Sunday, April 17, 2011

Random Data Over SPI

I'm trying to interface a PSoC 3 FTK with a MX25L6406E 64Mb(datasheet) serial flash module.It talks over SPI.
Heres a pic of my setup:

Thats the memory module on the right.A close up here:
I appoached this by writing basic SPI functions,of Sending,and Receiving a Byte.Make a neat .h file of those,and we can move onto the actual read/write operations on the chip.

To start off,I'm sending it 0x9F(Read ID or RDID Command),and i should get back
C2,20,17 in MID,DID1,DID2 ( Page 22 of the datasheet),MI is the manufacturing ID,and DID stands for Device Id.

But for some unknown reason(to me),I'm not able to get the Rx/Tx part properly working.I keep getting inconsistent data.Below are a set of shots showing the received values from each run of the code.

Most puzzling.Ive posted this issue to the PSoCDeveloper forums(here).

Will this post updated with my progress.

19-04-11 : Ive just realised,based on the input from abitkin of the PSoC Developer forums,and the syntax I kept using with the SPI Explorer,that the issue is with the Chip Select Line not being low for the entire time.Will test this out soon. Exams :(

21-04-11 : Managed to get over the nagging tension of exams,and tried out the code..Turns out,abitkin was right! \m/ Flawless SPI Communication at 10MBits/sec :)

No comments:

Post a Comment