Reply by thomas_augustinus April 27, 20072007-04-27
...
>
> I have yet to see any LPC2000 part accept SSEL programmed as a GPIO
> output pin and have the master mode working. I've tried this on
> LPC2106, LPC2138, and LPC2214, none of them will do this. The only
> thing that I've found to work is to program SSEL as a control input
for
> the SPI, then tie it high.
>

I am using SSEL line as GPIO (chip select for a SPI device) while using
the SPI in master mode on the LPC2103. It works fine.

Best regards

Thomas Augustinus
Amfitech ApS

An Engineer's Guide to the LPC2100 Series

Reply by Michael Anton April 25, 20072007-04-25
> -----Original Message-----
> From: l...
> [mailto:l...]On Behalf
> Of Tom Walsh
> Sent: Tuesday, April 24, 2007 5:39 PM
> To: l...
> Subject: Re: [lpc2000] Re: SPI SD card help
> Michael Anton wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: lpc2000@yahoogroups .com
> > > [mailto:lpc2000@yahoogroups .com
> > ]On Behalf
> > > Of philippcp
> > > Sent: Tuesday, April 24, 2007 12:49 AM
> > > To: lpc2000@yahoogroups .com
> > > Subject: [lpc2000] Re: SPI SD card help
> > >
> > >
> > > Hello,
> > >
> > > the sample code (raw sd-mmc access) is running with an
> workaround. I
> > > used another GPIO Pin for the CS. If someones got an
> idea how its
> > > working with the SSEL Pin, please let me know.
> >
> > The SSEL0 pin is not used in master mode, so for SD card access, you
> > must configure this as a GPIO, and toggle it in software (if this is
> > allowed on the LPC2294, as on some parts, this must be
> used, and held
> > high). Even if it could be used in master mode, the SSEL0 line must
> > be held low for the entire SD card access, so you cannot raise this
> > line in between bytes.
> > I have yet to see any LPC2000 part accept SSEL programmed as a GPIO
> output pin and have the master mode working. I've tried this on
> LPC2106, LPC2138, and LPC2214, none of them will do this. The only
> thing that I've found to work is to program SSEL as a control
> input for
> the SPI, then tie it high.
>

Well, LPC2148 works correctly with SSEL0 as a GPIO, but then it does
mention this specifically in the manual (if I remember correctly).
This is one of the things that was "fixed" in this part.

Mike
Reply by Tom Walsh April 24, 20072007-04-24
Michael Anton wrote:
>
> > -----Original Message-----
> > From: lpc2000@yahoogroups .com
> > [mailto:lpc2000@yahoogroups .com
> ]On Behalf
> > Of philippcp
> > Sent: Tuesday, April 24, 2007 12:49 AM
> > To: lpc2000@yahoogroups .com
> > Subject: [lpc2000] Re: SPI SD card help
> >
> >
> > Hello,
> >
> > the sample code (raw sd-mmc access) is running with an workaround. I
> > used another GPIO Pin for the CS. If someones got an idea how its
> > working with the SSEL Pin, please let me know.
>
> The SSEL0 pin is not used in master mode, so for SD card access, you
> must configure this as a GPIO, and toggle it in software (if this is
> allowed on the LPC2294, as on some parts, this must be used, and held
> high). Even if it could be used in master mode, the SSEL0 line must
> be held low for the entire SD card access, so you cannot raise this
> line in between bytes.
>

I have yet to see any LPC2000 part accept SSEL programmed as a GPIO
output pin and have the master mode working. I've tried this on
LPC2106, LPC2138, and LPC2214, none of them will do this. The only
thing that I've found to work is to program SSEL as a control input for
the SPI, then tie it high.

On the SPI0 for the LPC2214, CPHA and CPOL must be set to "zero" for me
to talk with the MMC (SD) card. I have SSEL0 tied to +3.3 volts (fixed
at Master Mode). Effectively, then set only bit 5 in SP0CR (0x20).

I've also set SP0SPCCR to '8'. These work for me:

=========== begin =============
#define SPI0_PINMASK 0x0000ff00
#define SPI0_PINSEL 0x00005500

static void setupSPI0 (void)
{// setup basic operation of the SPI0 controller.
volatile uchar byt;
// set pins for SPI0 operation.
PINSEL0 = (PINSEL0 & ~SPI0_PINMASK) | SPI0_PINSEL;
// set clock rate to approx 3.93MHz (58.98MHz / 15);
// 254 sets a 7.5us clockrate.
S0SPCCR = SPI0_XFER_CLOCK;
// turn off the SPI INT system.
S0SPCR = 0;
// ack any pending interrupt.
// reset SPI state.
S0SPINT = 1; byt = S0SPSR; byt = S0SPDR;
// just turn on master mode for now.
// clock is rising edge, pre-drive data bit before clock.
// Most significant bit shifted out first.
// resting state of the clock will be LOW.
// data is first driven out, then clock rising edge latches it.
S0SPCR = SPI_MASTER;
}
=========== snip ==============
TomW

--
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net http://cyberiansoftware.com http://openzipit.org
"Windows? No thanks, I have work to do..."
----------------
Reply by Michael Anton April 24, 20072007-04-24
> -----Original Message-----
> From: l...
> [mailto:l...]On Behalf
> Of philippcp
> Sent: Tuesday, April 24, 2007 12:49 AM
> To: l...
> Subject: [lpc2000] Re: SPI SD card help
> Hello,
>
> the sample code (raw sd-mmc access) is running with an workaround. I
> used another GPIO Pin for the CS. If someones got an idea how its
> working with the SSEL Pin, please let me know.

The SSEL0 pin is not used in master mode, so for SD card access, you
must configure this as a GPIO, and toggle it in software (if this is
allowed on the LPC2294, as on some parts, this must be used, and held
high). Even if it could be used in master mode, the SSEL0 line must
be held low for the entire SD card access, so you cannot raise this
line in between bytes.

Mike

>
> --- In l..., "philippcp" wrote:
> >
> > Hello,
> >
> > Ive got a problem with the SPI Port on Olimex L2294. I tried the
> > example code (raw sd-mmc access). When I start debugging, the CS
> > Signal is working, but the clock (SCK0) stays low. If I change
> > PINSEL0 to 0x5500 (SSEL0) the clock is working, but the CS Signal
> is
> > lost (stays low). I would appreciate any help.
> >
> > Philipp
> >
> > --- In l..., "tanermutlunun"
> > wrote:
> > >
> > > Thanks Carsten,
> > > Now I will port it to Olimex board. I will only change the CS
> pin
> > I
> > > guess which is P0_10 in Olimex.
> > >
> > > Bye..
> > >
> > > --- In l..., Carsten Gr wrote:
> > > >
> > > > Taner,
> > > >
> > > > I havce placed the file raw sd-mmc access.zip in the files
> > section.
> > > > Works for both SPI0 and SSP, compiles in Keil (RealView)
> > > >
> > > > Regards,
> > > > Carsten
> > > >
> > > > --- In l..., tanermutlu
> wrote:
> > > > >
> > > > > Hello
> > > > > I need raw(with no file system) SPI code for driving
> > > > > SD/MMC memory card for Keil or GNU compiler. I am
> > > > > using Olimex LPC2294 board. I would appreciate any
> > > > > help. I am in a kind of hurry..
> > > > >
> > > > > Thanks in advance...
> > > > >
> > > > > Taner Mutlu
> > > > > Elektronik M.
> > > > >
> > > > > __________________________________________________
> > > > >
> > > > >
> > > >
> > >
> > Yahoo! Groups Links
>
Reply by philippcp April 24, 20072007-04-24
Hello,

the sample code (raw sd-mmc access) is running with an workaround. I
used another GPIO Pin for the CS. If someones got an idea how its
working with the SSEL Pin, please let me know.

--- In l..., "philippcp" wrote:
>
> Hello,
>
> Ive got a problem with the SPI Port on Olimex L2294. I tried the
> example code (raw sd-mmc access). When I start debugging, the CS
> Signal is working, but the clock (SCK0) stays low. If I change
> PINSEL0 to 0x5500 (SSEL0) the clock is working, but the CS Signal
is
> lost (stays low). I would appreciate any help.
>
> Philipp
>
> --- In l..., "tanermutlunun"
> wrote:
> >
> > Thanks Carsten,
> > Now I will port it to Olimex board. I will only change the CS
pin
> I
> > guess which is P0_10 in Olimex.
> >
> > Bye..
> >
> > --- In l..., Carsten Gr wrote:
> > >
> > > Taner,
> > >
> > > I havce placed the file raw sd-mmc access.zip in the files
> section.
> > > Works for both SPI0 and SSP, compiles in Keil (RealView)
> > >
> > > Regards,
> > > Carsten
> > >
> > > --- In l..., tanermutlu
wrote:
> > > >
> > > > Hello
> > > > I need raw(with no file system) SPI code for driving
> > > > SD/MMC memory card for Keil or GNU compiler. I am
> > > > using Olimex LPC2294 board. I would appreciate any
> > > > help. I am in a kind of hurry..
> > > >
> > > > Thanks in advance...
> > > >
> > > > Taner Mutlu
> > > > Elektronik M.
> > > >
> > > > __________________________________________________
> > > >
> > > >
> > >
>
Reply by philippcp April 20, 20072007-04-20
Hello,

Ive got a problem with the SPI Port on Olimex L2294. I tried the
example code (raw sd-mmc access). When I start debugging, the CS
Signal is working, but the clock (SCK0) stays low. If I change
PINSEL0 to 0x5500 (SSEL0) the clock is working, but the CS Signal is
lost (stays low). I would appreciate any help.

Philipp

--- In l..., "tanermutlunun"
wrote:
>
> Thanks Carsten,
> Now I will port it to Olimex board. I will only change the CS pin
I
> guess which is P0_10 in Olimex.
>
> Bye..
>
> --- In l..., Carsten Gr wrote:
> >
> > Taner,
> >
> > I havce placed the file raw sd-mmc access.zip in the files
section.
> > Works for both SPI0 and SSP, compiles in Keil (RealView)
> >
> > Regards,
> > Carsten
> >
> > --- In l..., tanermutlu wrote:
> > >
> > > Hello
> > > I need raw(with no file system) SPI code for driving
> > > SD/MMC memory card for Keil or GNU compiler. I am
> > > using Olimex LPC2294 board. I would appreciate any
> > > help. I am in a kind of hurry..
> > >
> > > Thanks in advance...
> > >
> > > Taner Mutlu
> > > Elektronik M.
> > >
> > > __________________________________________________
> > >
> > >
>
Reply by tanermutlunun September 17, 20062006-09-17
Thanks Carsten,
Now I will port it to Olimex board. I will only change the CS pin I
guess which is P0_10 in Olimex.

Bye..

--- In l..., Carsten Gr wrote:
>
> Taner,
>
> I havce placed the file raw sd-mmc access.zip in the files section.
> Works for both SPI0 and SSP, compiles in Keil (RealView)
>
> Regards,
> Carsten
>
> --- In l..., tanermutlu wrote:
> >
> > Hello
> > I need raw(with no file system) SPI code for driving
> > SD/MMC memory card for Keil or GNU compiler. I am
> > using Olimex LPC2294 board. I would appreciate any
> > help. I am in a kind of hurry..
> >
> > Thanks in advance...
> >
> > Taner Mutlu
> > Elektronik M.
> >
> > __________________________________________________
> >
>



Reply by September 17, 20062006-09-17
Taner,

I havce placed the file raw sd-mmc access.zip in the files section.
Works for both SPI0 and SSP, compiles in Keil (RealView)

Regards,
Carsten

--- In l..., tanermutlu wrote:
>
> Hello
> I need raw(with no file system) SPI code for driving
> SD/MMC memory card for Keil or GNU compiler. I am
> using Olimex LPC2294 board. I would appreciate any
> help. I am in a kind of hurry..
>
> Thanks in advance...
>
> Taner Mutlu
> Elektronik M.
>
> __________________________________________________



Reply by tanermutlunun September 17, 20062006-09-17
Thanks Sutton,

Luckily, I found one in the files section called "raw sd-mmc
access.zip". I will try that one..

Bye...

--- In l..., "Sutton Mehaffey" wrote:
>
> I got the app note code to work on SPI0 and SPI1 (SSP) on LPC2148
> using Embedded Artists prototype board. I do think that there were a
> few errors in the code, if I remember correctly. I don't have the
> code at my disposal right this minute, but I will look when I have a
> chance.
>
> Sutton
>
Reply by Sutton Mehaffey September 17, 20062006-09-17
I got the app note code to work on SPI0 and SPI1 (SSP) on LPC2148
using Embedded Artists prototype board. I do think that there were a
few errors in the code, if I remember correctly. I don't have the
code at my disposal right this minute, but I will look when I have a
chance.

Sutton

--- In l..., "tanermutlunun" wrote:
>
> Thanks for the link..
> I have seen this file..In LPC2294 there is no SSP port, so I had to
> convert the code for SPI, I probably have done something wrong, and I
> cant pass over the "IDLE_STATE_TIMEOUT" mode. That is why I asked if
> somebody has code for directly "SPI" not SSP(Synchronous Serial Port).
> Or how should I change the initialization part of the code?
>
> Thanks in advance
>
> --- In l..., "Sutton Mehaffey" wrote:
> >
> > Try this:
> >
> > http://www.nxp.com/acrobat_download/applicationnotes/AN10406_2.pdf
> >
> >
> >
> >
> > --- In l..., tanermutlu wrote:
> > >
> > > Hello
> > > I need raw(with no file system) SPI code for driving
> > > SD/MMC memory card for Keil or GNU compiler. I am
> > > using Olimex LPC2294 board. I would appreciate any
> > > help. I am in a kind of hurry..
> > >
> > > Thanks in advance...
> > >
> > > Taner Mutlu
> > > Elektronik M.
> > >
> > > __________________________________________________
> > >
> > >
>