Yahoo Groups archive

Lpc2000

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

Thread

SPI/MMC example - anyone got this to work?

SPI/MMC example - anyone got this to work?

2006-03-15 by ah_sandiego

This app note (2148) below shows how to use the SPI bus/mode to talk 
to an SDIO card. I have cut and paste the example and it compiles 
correctly, but when I run the program, it behaves the same, regardless 
whether or not there is an SD card in. 

The result is, it gets stuck waiting for a response that never comes, 
and goes into its infinite while(1). 

Has anyone got this to work? Can anyone post some code that works? 

Thanks, 
AH 

http://www.semiconductors.philips.com/acrobat/applicationnotes/AN10406_
2.pdf

Re: [lpc2000] SPI/MMC example - anyone got this to work?

2006-03-16 by Tom Walsh

ah_sandiego wrote:

>This app note (2148) below shows how to use the SPI bus/mode to talk 
>to an SDIO card. I have cut and paste the example and it compiles 
>correctly, but when I run the program, it behaves the same, regardless 
>whether or not there is an SD card in. 
>
>The result is, it gets stuck waiting for a response that never comes, 
>and goes into its infinite while(1). 
>
>Has anyone got this to work? Can anyone post some code that works? 
>
>  
>
I guess they never fixed their code.  They had the same problem 4..5 
months ago with that appnote.

I have a msdos FAT filesystem you can download which uses an SD/MMC 
drive via SPI.  It is at:

http://www.openhardware.net/?title=RDCF2%20DOS%20FAT%20Filesystem%20for%20LPC2138&dir=rdcf2&file=rdcf2lpc2138.html

Enjoy!

TomW


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Re: SPI/MMC example - anyone got this to work?

2006-03-16 by philips_apps

Tom,

    The source in SPI/MMC app-note has been fixed, retested, and 
updated long time ago, the following week after you pointed out the 
error.
    Thanks you very much for your suggestions and active 
participation to improve our products!

Philips app.


--- In lpc2000@yahoogroups.com, Tom Walsh <tom@...> wrote:
>
> ah_sandiego wrote:
> 
> >This app note (2148) below shows how to use the SPI bus/mode to 
talk 
> >to an SDIO card. I have cut and paste the example and it compiles 
> >correctly, but when I run the program, it behaves the same, 
regardless 
> >whether or not there is an SD card in. 
> >
> >The result is, it gets stuck waiting for a response that never 
comes, 
> >and goes into its infinite while(1). 
> >
> >Has anyone got this to work? Can anyone post some code that 
works? 
> >
> >  
> >
> I guess they never fixed their code.  They had the same problem 
4..5 
> months ago with that appnote.
> 
> I have a msdos FAT filesystem you can download which uses an 
SD/MMC 
> drive via SPI.  It is at:
> 
> http://www.openhardware.net/?title=RDCF2%20DOS%20FAT%20Filesystem%
20for%20LPC2138&dir=rdcf2&file=rdcf2lpc2138.html
Show quoted textHide quoted text
> 
> Enjoy!
> 
> TomW
> 
> 
> -- 
> Tom Walsh - WN3L - Embedded Systems Consultant
> http://openhardware.net, http://cyberiansoftware.com
> "Windows? No thanks, I have work to do..."
> ----------------------------------------------------
>

Re: [lpc2000] Re: SPI/MMC example - anyone got this to work?

2006-03-16 by Tom Walsh

philips_apps wrote:

>Tom,
>
>    The source in SPI/MMC app-note has been fixed, retested, and 
>updated long time ago, the following week after you pointed out the 
>error.
>    Thanks you very much for your suggestions and active 
>participation to improve our products!
>
>  
>
Hmm, wonder why his app won't work?


to: AH,

Try the SPI driver in my code: mmc_hardware.c has the SPI stuff.  That 
is for an LPC2138 processor and the SSP interface, not for SSI.  That 
code is a complete system, you do need newlib to link against.  See 
elsewhere on my website for the gnu tools + newlib build if you cannot 
get your compiler to build it (IAR, Keil, etc.).

TomW


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Re: [lpc2000] Re: SPI/MMC example - anyone got this to work?

2006-03-17 by Robert Adsett

At 06:44 PM 3/16/06 -0500, Tom Walsh wrote:
>philips_apps wrote:
> >    The source in SPI/MMC app-note has been fixed, retested, and
> >updated long time ago, the following week after you pointed out the
> >error.
> >    Thanks you very much for your suggestions and active
> >participation to improve our products!
> >
>Hmm, wonder why his app won't work?

Perhaps because he's using SDIO?  The SPI mode is optional even for MMC 
cards although I think most implement it, my impression was that SDIO 
didn't use it at all. (Non-IO SD cards are another matter)

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

Re: SPI/MMC example - anyone got this to work?

2006-03-17 by ah_sandiego

Thanks for all the responses.

So if I have read correctly, the code in the APP NOTE should work? I 
simply cut and pasted the code, it compiled, but didn't work. I know 
that is a very vague description, but I don't have much time to 
debug it, so I thought I would ask first if others have gotten it to 
work.

If you say it is working, I will post a more detailed description of 
the problem I am having.

Secondly, the card I am using is a 16Meg SD Card. It works since I 
can use it with my Pocket PC. I don't mind if the APP NOTE writes 
raw data to it (or whatever it is doing), but for the time being I 
want to access it in SPI (1 bit bus) mode, not the SDIO (4 bit bus). 
Can this be done?

Thanks,
AH

--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@...> 
wrote:
>
> At 06:44 PM 3/16/06 -0500, Tom Walsh wrote:
> >philips_apps wrote:
> > >    The source in SPI/MMC app-note has been fixed, retested, and
> > >updated long time ago, the following week after you pointed out 
the
> > >error.
> > >    Thanks you very much for your suggestions and active
> > >participation to improve our products!
> > >
> >Hmm, wonder why his app won't work?
> 
> Perhaps because he's using SDIO?  The SPI mode is optional even 
for MMC 
> cards although I think most implement it, my impression was that 
SDIO 
> didn't use it at all. (Non-IO SD cards are another matter)
> 
> Robert
> 
> " 'Freedom' has no meaning of itself.  There are always 
restrictions,   be 
> they legal, genetic, or physical.  If you don't believe me, try to 
chew a 
Show quoted textHide quoted text
> radio signal. "  -- Kelvin Throop, III
> http://www.aeolusdevelopment.com/
>

Re: [lpc2000] Re: SPI/MMC example - anyone got this to work?

2006-03-17 by Tom Walsh

ah_sandiego wrote:

>Thanks for all the responses.
>
>So if I have read correctly, the code in the APP NOTE should work? I 
>simply cut and pasted the code, it compiled, but didn't work. I know 
>that is a very vague description, but I don't have much time to 
>debug it, so I thought I would ask first if others have gotten it to 
>work.
>
>If you say it is working, I will post a more detailed description of 
>the problem I am having.
>
>Secondly, the card I am using is a 16Meg SD Card. It works since I 
>can use it with my Pocket PC. I don't mind if the APP NOTE writes 
>raw data to it (or whatever it is doing), but for the time being I 
>want to access it in SPI (1 bit bus) mode, not the SDIO (4 bit bus). 
>Can this be done?
>
>  
>
I'm using it SPI mode (SSP) to access the filesystem on an SD card (in 
MMC mode not 4 bits) fine on an LPC2138 processor.  The RDCF2 filesystem 
I mentioned is under a Public Domain, not a LGPL / GPL license.

TomW



-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

RE: [lpc2000] Re: SPI/MMC example - anyone got this to work?

2006-03-17 by Michael Anton

Hi,

I have had good luck using the EFSL library for interfacing to
SD cards.  It is open source, seems to be well supported, 
there is a port for the LPC2000 series, and the performance is decent.

It was not difficult to get up and running, and compiled fine with GCC.

You can find it here: http://sourceforge.net/projects/efsl/

I hope this helps,

Mike
Show quoted textHide quoted text
> -----Original Message-----
> From: lpc2000@yahoogroups.com 
> [mailto:lpc2000@yahoogroups.com]On Behalf
> Of ah_sandiego
> Sent: Friday, March 17, 2006 11:06 AM
> To: lpc2000@yahoogroups.com
> Subject: [lpc2000] Re: SPI/MMC example - anyone got this to work?
> 
> 
> Thanks for all the responses.
> 
> So if I have read correctly, the code in the APP NOTE should work? I 
> simply cut and pasted the code, it compiled, but didn't work. I know 
> that is a very vague description, but I don't have much time to 
> debug it, so I thought I would ask first if others have gotten it to 
> work.
> 
> If you say it is working, I will post a more detailed description of 
> the problem I am having.
> 
> Secondly, the card I am using is a 16Meg SD Card. It works since I 
> can use it with my Pocket PC. I don't mind if the APP NOTE writes 
> raw data to it (or whatever it is doing), but for the time being I 
> want to access it in SPI (1 bit bus) mode, not the SDIO (4 bit bus). 
> Can this be done?
> 
> Thanks,
> AH
> 
> --- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@...> 
> wrote:
> >
> > At 06:44 PM 3/16/06 -0500, Tom Walsh wrote:
> > >philips_apps wrote:
> > > >    The source in SPI/MMC app-note has been fixed, retested, and
> > > >updated long time ago, the following week after you pointed out 
> the
> > > >error.
> > > >    Thanks you very much for your suggestions and active
> > > >participation to improve our products!
> > > >
> > >Hmm, wonder why his app won't work?
> > 
> > Perhaps because he's using SDIO?  The SPI mode is optional even 
> for MMC 
> > cards although I think most implement it, my impression was that 
> SDIO 
> > didn't use it at all. (Non-IO SD cards are another matter)
> > 
> > Robert
> > 
> > " 'Freedom' has no meaning of itself.  There are always 
> restrictions,   be 
> > they legal, genetic, or physical.  If you don't believe me, try to 
> chew a 
> > radio signal. "  -- Kelvin Throop, III
> > http://www.aeolusdevelopment.com/
> >
> 
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
>

Re: SPI/MMC example - anyone got this to work?

2006-03-18 by Jan Szymanski

There are differences between MMC and SD card.
The init sequence for SD and MMC is different and some SD cards 
might not initialize correctly if you use the MMC init sequence.
Very briefly in SPI mode the initialization commands for MMC are :
CMD0, CMD1, CMD2, CMD3, while for SD use a sequence of: CMD0, CMD41, 
CMD55, CMD2, CMD3.
If your hardware is OK, you only need to change the init sequence 
and it should work.
Good luck.

Jan


--- In lpc2000@yahoogroups.com, "ah_sandiego" <ah_sandiego@...> 
wrote:
>
> Thanks for all the responses.
> 
> So if I have read correctly, the code in the APP NOTE should work? 
I 
> simply cut and pasted the code, it compiled, but didn't work. I 
know 
> that is a very vague description, but I don't have much time to 
> debug it, so I thought I would ask first if others have gotten it 
to 
> work.
> 
> If you say it is working, I will post a more detailed description 
of 
> the problem I am having.
> 
> Secondly, the card I am using is a 16Meg SD Card. It works since I 
> can use it with my Pocket PC. I don't mind if the APP NOTE writes 
> raw data to it (or whatever it is doing), but for the time being I 
> want to access it in SPI (1 bit bus) mode, not the SDIO (4 bit 
bus). 
> Can this be done?
> 
> Thanks,
> AH
> 
> --- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@> 
> wrote:
> >
> > At 06:44 PM 3/16/06 -0500, Tom Walsh wrote:
> > >philips_apps wrote:
> > > >    The source in SPI/MMC app-note has been fixed, retested, 
and
> > > >updated long time ago, the following week after you pointed 
out 
> the
> > > >error.
> > > >    Thanks you very much for your suggestions and active
> > > >participation to improve our products!
> > > >
> > >Hmm, wonder why his app won't work?
> > 
> > Perhaps because he's using SDIO?  The SPI mode is optional even 
> for MMC 
> > cards although I think most implement it, my impression was that 
> SDIO 
> > didn't use it at all. (Non-IO SD cards are another matter)
> > 
> > Robert
> > 
> > " 'Freedom' has no meaning of itself.  There are always 
> restrictions,   be 
> > they legal, genetic, or physical.  If you don't believe me, try 
to 
Show quoted textHide quoted text
> chew a 
> > radio signal. "  -- Kelvin Throop, III
> > http://www.aeolusdevelopment.com/
> >
>

Re: [lpc2000] Re: SPI/MMC example - anyone got this to work?

2006-03-18 by Mukund Deshmukh

> Hi,
> 
> I have had good luck using the EFSL library for interfacing to
> SD cards.  It is open source, seems to be well supported, 
> there is a port for the LPC2000 series, and the performance is decent.
> 

I am using it with MMC card.
It compiled (winarm) out of box and worked with Olimex 2148 board too.





Best Regards,

Mukund Deshmukh.
Beta Computronics Pvt Ltd
10/1, IT Park, Parsodi,
Nagpur-440022
Cell - 9422113746

Re: SPI/MMC example - anyone got this to work?

2006-03-18 by Vimal Amin

I have just started working on LPC2132 with keil.

I want to port this FAT16 code to KEIL. I am not familier with GCC.

Can somebody help me

Thanks and warm regards
Vimal Amin



[Non-text portions of this message have been removed]

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.