- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using EPCS4SI8N through SPI interface to a microcontroller to write and read data. Right now I have done the connections accordingly but have problems with read and write to the serial EEPROM. I am not getting any response for any of the opcodes. The logic looks simple but dont know where I am going wrong. Thanks in advance!Link Copied
14 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
is the hold pin high (pin 7)? You may try to read identifier (command 20h). If you are not sure about the SPI protocol, you may have a look at the data sheet of another Flash e.g. M25P32. Regards- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Yeah the hold pin is high connected to 3.3V. I think my SPI protocol is correct since it worked fine with SD card. I have done the following steps: - pull CS low - send WREN(0x06) - pull CS high - delay(); - pull CS low -send WRITE(0x02) - send address 1st byte (MSB) - send address 2nd byte - send address 3rd byte (LSB) - send data - pull CS high - delay(); Even for read its done in a similar way but using read opcodes. Thanks!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
> - pull CS low
> - send WREN(0x06) > - pull CS high > - delay(); propose to insert the following lines, to check that the Flash "wants" to talk with you :-) - pull CS low - send RDSR (0x05) - read 1 byte --> shout be 0x02 (=Write Enable Latch is set) - pull CS high Regards, Heiko- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Yeah after I send the WREN, I have done what you have told. do{ pull CS low send 0x05 read from eeprom pull CS high while(!(read & 0x02)) So I send it many times until i receive 0x02. But I am receiving 0 from the eeprom. Thanks!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
so best is realy to start with the indentifier command (0x20). - CS low - write 0x20 - read 3 bytes - CS high I assume you'll get zeros again. If so, you need to check with a scope the right order of the bits, clock edges, etc. Best is to compare it with the drawings e.g. in the data sheet of M25P32. Regards, Heiko- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have done what you told but I get 255 from the eeprom. I have just sent 0x20 and am reading 3 bytes, nothing else. Is that right? Thanks!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
you have a problem with your interface as 255 is definitly wrong. You should get something like 0x01, 0x02. 0x12. You may download the data sheet of S25FL004A and compare with figure 9.3. Is your speed too high? Regards, Heiko- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I shall check with that datasheet. I have set my SPI clock to 5MHz. Initially it was 2MHz but I have changed it. Is that okay? Thanks!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
the slowest device should run with at least 25MHz, but check the data sheet I mentioned. Regards, Heiko- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
My MCU bus frequency is 20MHz. So I can assign 10MHz for SPI. Well is that okay? Thanks!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10MHz is less than 25MHz - hence it is OK :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
255 probably means High Impedance. you can check it by pulling it down. are you sure that the IC is properly powered?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
By pulling it down u mean...connect a resistor from that line to ground? Thanks!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Hi, By pulling it down u mean...connect a resistor from that line to ground? Thanks! --- Quote End --- yes, if it's a real 1 then you shoudn't have any problem. but if it's Z ( that is shown as 1 ) you will get 0. right?

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page