Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: SPI / SD on lpc2106

2005-10-11 by theothervmax

--- In lpc2000@yahoogroups.com, "armqamp" <wouter@w...> wrote:
>
> I defined the commands like this:
> 
> #define CMD0 0x40	// software reset
> #define CMD1 0x41	// brings card out of idle state
> #define CMD2 0x42	// not used in SPI mode
> #define CMD3 0x43	// not used in SPI mode
> #define CMD4 0x44	// not used in SPI mode
> #define CMD5 0x45	// Reserved
> #define CMD6 0x46	// Reserved
> #define CMD7 0x47	// not used in SPI mode
> 
> and so on...
> 
> 
> thanks,
> 
> Wouter
> 

Rest of the code looks good, except for that:
 if(i>10){
            SD_disable;
             print("SD activation failed\n");
       }
       else{
            print("SD activation successfully\n");
       }


If "SD_disable" is just setting CS high, you'd better do it every time after sending command (and getting response), not only if something failed.

Max

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.