Pages: [1]   Go Down
Author Topic: SPI to eternal F-RAM  (Read 2051 times)
0 Members and 1 Guest are viewing this topic.
Western Australia
Offline Offline
Newbie
*
Karma: 1
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino Due connected to CMOS4050 (level translation 3.6v) to Ramtron FM25H20 (2M SPI FRAM)
Please see attached code (SPI_02.ino) and logic anyliser image (SPI_write and SPI_read)
I am not sure if my write is wrong or read is, as I do not get the same data back???
The FRAM uses 3 bytes for address (18 bits) MSB first (standard SPI settings)
Have tried all sorts of variations, LSB, clock and data polarity, cutting down divde clock etc, but no luck
Noted that MISO is tri stated, does it need to be biased high? Did try that but still no luck....
Have tried another Due and FRAM, but again same result
So I assume I have a fault in the code....?
Please advice if possible.
Thanks


* SPI_write.png (82.11 KB, 1253x372 - viewed 34 times.)

* SPI_read.png (85.07 KB, 1258x382 - viewed 17 times.)
* SPI_02.ino (4.26 KB - downloaded 10 times.)
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you got the W pin high?

Also there's this from the data sheet

Quote
The FM25H20 will power up with writes disabled. The WREN command must be issued prior to any write operation.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Western Australia
Offline Offline
Newbie
*
Karma: 1
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

/W and /HOLD are tied high
See code, WREN is sent first then WRITE, ADDRESS, DATA
Then small delay
READ, ADDRESS, then clock SPI_transfer(oxff)
Thanks
Also Merry Christmas......
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes I see the WREN now.

_____
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Western Australia
Offline Offline
Newbie
*
Karma: 1
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, have just changed circuit to suite SRAM 23k256 and adjusted code, (2 byte address, no WREN, and set reg to "sequence write and read" and it all works ok...!
So I assume the problem is my protocol to the FRAM or some weird circuit setup...
Any one got any constructive ideas for me?
All I can think is the Register is not correctly setup, but I should at least get 1 byte into memory....
But can not even read the reg, or I am getting incorrect data back....?
Frustrating smiley-mad
Logged

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2066
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using the FM25H20 with pic24HJ/dspic33 with no issues (@3.3V, none level translation). Show us your schematics pls.
« Last Edit: December 28, 2012, 11:47:37 am by pito » Logged

Western Australia
Offline Offline
Newbie
*
Karma: 1
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Pito
I do not have a "schematic prog" so as to give you a diagram.
But can list as below,
 
Arduino pin   (CMOS 4050 pin   CMOS 4050 pin)   FRAM pin  description
10 --------------- 14      buffer       15 ------------ 1          Chip Select (SS)
11 --------------- 11      buffer       12 ------------ 5          Serial Data in (MOSI) (D)
12 ---------------  2       buffer        3 ------------ 2          Serial Data out (MISO) (Q)
13 ---------------  9       buffer       10 ----------- 6           Serial Clock (SLK) (C)
3.3v ------------- 1                                          8           VDD
Gnd  ------------- 8                                          4           GND

Thanks

Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I do not have a "schematic prog" so as to give you a diagram.

If you have a way to take a digital picture - then you have a way to post a schematic, provided you own a pencil/pen and some paper.
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2066
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

..cmos4050 @3.3V may have ~100ns prop delays - be aware..
Logged

Western Australia
Offline Offline
Newbie
*
Karma: 1
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, but it works with the SRAM. Same circuit.
As I can not get a "valid" reading from the register in the FRAM (RDSR) I must assume my "read process" is incorrect....
Tried the 1Meg Fram (FM25V10_ds) which has a manufacture ID (9 bytes), but could not read that correctly.... So "reading" seems more the problem, I suspect.
I would not think that the logic anyliser would cause corruption on the FRAM output, tried without it connected and sent "read" values by serial, same result....
What next? (I bet it is a stupid simple thing, just slightly out of my vision...!)
Logged

Western Australia
Offline Offline
Newbie
*
Karma: 1
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, change the FRAM, AGAIN and it all works.........
I do not know why but 3 chips later and ever thing is ok :-)
I noticed on the power supply requirements that the power supplied must have a fast power up or the internal chip does not reset correctly?
May be this was the cause, but why does the 4th chip work?
Many thanks for your help and advice...(I will investigate more later)
Have a Great New Year.
Logged

Pages: [1]   Go Up
Jump to: