??? 03/27/07 20:39 Read: times |
#135980 - AT89C51ED2 SD/MMC interface |
Hi,
I am trying to interface and SD card with 89C51ED2 using the SPI interface. I have set the microcontroller in master mode. According to SPI spec, first I need to send 0xff for 74 clock cycles. However, the SPIF bit (in SPSTA register) does not seem to get cleared. I have the following code to send/rcv a byte: char SPI_byte(char c) { char rcv; SPDAT = c; while(!SPIF_SET()); rcv = SPDAT; return rcv; } The code loops forever in the while. I have the following setting: Master, mode 0, Fosc clock/128 Any suggestions ? thanks, -siddharth |
Topic | Author | Date |
AT89C51ED2 SD/MMC interface | 01/01/70 00:00 | |
I do not know about Atmel | 01/01/70 00:00 | |
Maybe... | 01/01/70 00:00 | |
Re: Maybe... | 01/01/70 00:00 | |
I do, | 01/01/70 00:00 | |
How about this? | 01/01/70 00:00 | |
Re: I do, | 01/01/70 00:00 | |
SILabs chipa ARE 8051 derivatives | 01/01/70 00:00 | |
Atmel SPI | 01/01/70 00:00 | |
Reference software - MMC![]() | 01/01/70 00:00 |