SPIM reading external memory incorrectly

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Basically, the SPIM will rotate bits as they are read into the PSoC3.... WARNING - not all chips present this problem! Some PSoC chips are NOT PRONE to this rotation! Other chips CONSISTANTLY show the problem!

   

Yes, a demo project is available on request! brian@genesysinst.com

   

Project: Create an SPIM with the normal IO (not bidirectional), mode 0. Disconnect the CS (SS) and connect to non-hardware pin. Chip used is a CY8C3866PVI-021ES2. I tried the DVK and it too gives this problem!

   

I'm using Ramtron FM25V05 as external memory, so grab a data sheet and notice that the word is similar (not identical!!!) to the Apps Note EP60810 - I.E. a multiple data word must be sent while the CS is low. I have pins 3 and 7 tied high, by the way. Well, the write needs two dips in the CS, but...

   

Speed - 3MHz, internal clock. Leave the buffers set at 4. I use the RESET pin to hold the SPIM non-functional and tri-state the IO as the Ramtron needs to be read by another processor. No interrupts.

   

Read/write various bit patterns as a BLOCK (one start address, many data). I need to block move data on occasion for my project.

   

I get bit rotations! Writing 16 (0x10) locations of "0x80" results in a READ of "0xC0" for the 0x10 locations! All the same!

   

Heres a list of some stuff I tried: 0x00 -> 0x00, 0xff -> 0xff, 0x55 -> 0x2a, 0xaa -> 0xd5, 0x80 -> 0xc0, 0x01 -> 0x00; 0x88 -> 0xc4, 0x11 -> 0x08.... Curiously, reading in, say, 0x15 locations does not reveal that the 0x11'th location contains incorrect data. You might expect this if the bit pattern is rotating to the next byte in the stream. So the stream is not polluted? Or can I say that?

   

Thoughts?

0 Likes
43 Replies
surec_285131
Level 1
Level 1

I am very new to PSOC. As a beginer I started to interface SPI EEPROM Memory SST 25V016B. I am performing this project on CY8CKIT-030. I used PSOC standard program available on net "Interfacing PSoC® 3 / PSoC 5 to an SPI EEPROM" In this memory is from Atmel , the same program i am trying with SST memory.  I found from SST data sheet that EWSR is to be wriiten "50H" before writing to status register (WRSR). I added this in the code. But the display shows "00FFFFFFFFFFFFFF". There after I tried to seperate out the CS from SPIM block. I assiged another port pin P0_7 for CS. I am switching this pin low, high while executing SPIM commands. Now the display reads " 000102030707FFFF". Kindly help.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Might make sense to post project for forum to look at -

   

 

   

    

   

          

   

“File”                                                             Creator

   

“Create Workspace Bundle”

   

Use Firefox or IE, not chrome to post.

   

 

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

hello,

   

I'm trying to  read/write  Adesto AT45DB321E  serial flash. i use the procedure as mention in the data sheet .

   

For write data in flash :-

   

first read the page then write buffer for 512 bytes followed by page write function .

   

For Read page from flash

   

first read the page followed by byte by byte read buffer.

   

 For first 256 bytes the data read is correct , but after 256 bytes the data repeated .

   

lets say if i write a string of 512 bytes to a page then after read the page , instead of 0 to 256 -257 to 512 sequence,. i got 0 to 256 - 0 to 256 bytes. (this data is repeated)

   

last 256 bytes got missed.

   

as i'm using 8 bit SPI master , i tried every thing , but i'm not getting the point how to correct it. i also increases the buffer size.

   

Please suggest me what should I do

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

When you have a new question, please start a new thread. Otherwise your question is just hidsing at the end of a very long (and old) thread.

   

Did you configure your flash memory to actually use 512 byte pages? By defaut its using 528 byte pages... Since this device has multiple ways to write and read data, which one are you using?

0 Likes