Can the at89s52 support to SPI protocol? If not, how can do it? As I need to use a EEPROM-AT25256 storing the data but I stuck in read part.
I have seen several related program or equivalent info and its also include a initialization(for what?). Why we need it for SPI? I have encountered
this issue for days.
Can the at89s52 support to SPI protocol? If not, how can do it? As I need to use a EEPROM-AT25256 storing the data but I stuck in read part.
I have seen several related program or equivalent info and its also include a initialization(for what?). Why we need it for SPI? I have encountered
this issue for days.Regards,Andy
The AT89S52 does not have dedicated SPI interface, but it can be implemented by using standard pins .. see attached picture ..
Example (incl. asm code):
**broken link removed**
:wink:
IanP
I have not provided the dummy write but I get the wrong data(e.g. 27 is real data then I get 25). Also, I do not know how to provide the dummy write to the slave. Is it like the following steps? CS=0;-->for loop to send 1 byte-->CS=1;
Please help, I have tested many times but it's not work.
In this picture, the real data is showed on the bottom while the read data is showed on the top. I only write 5bytes(words) to AT25256A.
okay, would you illustrate the write steps? In my write function, it starts checkbusy[CB()]-->CS=0-->send WREN code-->CS=1-->short delay or not-->
CB()-->CS=0-->send Write code and then send the higher byte address and lower byte address is followed-->send 8bit data-->CS=1-->
CB()-->CS=0-->send WRDI code-->CS=1