EmbeddedRelated.com
Forums
Memfault Beyond the Launch

SSP (SPI mode) Baudrate limitation @ only 10Mbit/s - Bug ??????

Started by croquettegnu March 16, 2007
Thanks a lot Martin but I would need again a precision.
You said you run @15MHz but you haveprogrammed 0x20 in the SCR
So, for me the SSP baudrate is PCLK/(CPSDVSR*(SCR+1)), ie
60000000/(4*(14+1))`000000/54 = 1.25Mbit/s and not 15 Mbit/s
You only do PCLK/CPSDVSR

Sorry if I have missed something but to my understanding, SCR must be
taken into account for the baudrate

Thanks in advance

--- In l..., "Michael Anton" wrote:
>
> > -----Original Message-----
> > From: l...
> > [mailto:l...]On Behalf
> > Of croquettegnu
> > Sent: Tuesday, March 20, 2007 7:05 AM
> > To: l...
> > Subject: [lpc2000] Re: SSP (SPI mode) Baudrate limitation @ only
> > 10Mbit/s - Bug ??????
> >
> >
> > Mike,
> >
> > What was your SSP configuration for these baudrates please?
> > I'm in llopback mode, this is perhaps one of the reasons...
> >
> > Thanks in advance
> > This is what I use on an LPC2148 (more or less):
>
> // SSPCR0 Bit-Definitions
> #define CPOL 6
> // SSPCR1 Bit-Defintions
> #define SSE 1
> #define SCR 8
>
> #define SPI_SCK_PIN 17 /* Clock P0.17 out */
> #define SPI_MISO_PIN 18 /* from Card P0.18 in */
> #define SPI_MOSI_PIN 19 /* to Card P0.19 out */
>
> #define SPI_PINSEL PINSEL1
> #define SPI_SCK_FUNCBIT 2
> #define SPI_MISO_FUNCBIT 4
> #define SPI_MOSI_FUNCBIT 6
> #define SPI_SS_FUNCBIT 8
>
> // PCLK = 60MHz
> SPI_PINSEL |= ( (2< > (2< > SSPCR0 = ((8-1)<<0) | (0< > SSPCR1 = (1< > SSPCPSR = 4; // 15MHz clock
>
> Good luck,
>
> Mike
>

An Engineer's Guide to the LPC2100 Series

> -----Original Message-----
> From: l...
> [mailto:l...]On Behalf
> Of croquettegnu
> Sent: Wednesday, March 21, 2007 6:33 AM
> To: l...
> Subject: [lpc2000] Re: SSP (SPI mode) Baudrate limitation @ only
> 10Mbit/s - Bug ??????
> Thanks a lot Martin but I would need again a precision.
> You said you run @15MHz but you haveprogrammed 0x20 in the SCR
> So, for me the SSP baudrate is PCLK/(CPSDVSR*(SCR+1)), ie
> 60000000/(4*(14+1))`000000/54 = 1.25Mbit/s and not 15 Mbit/s
> You only do PCLK/CPSDVSR
>
> Sorry if I have missed something but to my understanding, SCR must be
> taken into account for the baudrate
>
> Thanks in advance
>
> --- In l..., "Michael Anton" wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: l...
> > > [mailto:l...]On Behalf
> > > Of croquettegnu
> > > Sent: Tuesday, March 20, 2007 7:05 AM
> > > To: l...
> > > Subject: [lpc2000] Re: SSP (SPI mode) Baudrate limitation @ only
> > > 10Mbit/s - Bug ??????
> > >
> > >
> > > Mike,
> > >
> > > What was your SSP configuration for these baudrates please?
> > > I'm in llopback mode, this is perhaps one of the reasons...
> > >
> > > Thanks in advance
> > >
> >
> > This is what I use on an LPC2148 (more or less):
> >
> > // SSPCR0 Bit-Definitions
> > #define CPOL 6
> > // SSPCR1 Bit-Defintions
> > #define SSE 1
> > #define SCR 8
> >
> > #define SPI_SCK_PIN 17 /* Clock P0.17 out */
> > #define SPI_MISO_PIN 18 /* from Card P0.18 in */
> > #define SPI_MOSI_PIN 19 /* to Card P0.19 out */
> >
> > #define SPI_PINSEL PINSEL1
> > #define SPI_SCK_FUNCBIT 2
> > #define SPI_MISO_FUNCBIT 4
> > #define SPI_MOSI_FUNCBIT 6
> > #define SPI_SS_FUNCBIT 8
> >
> > // PCLK = 60MHz
> >
> >
> > SPI_PINSEL |= ( (2< > > (2< > > SSPCR0 = ((8-1)<<0) | (0< > > SSPCR1 = (1< > > SSPCPSR = 4; // 15MHz clock
> >
> > Good luck,
> >
> > Mike
> >

You are correct, SCR should be zero, and then it will run
at 15MHz. This code is from the EFSL filesystem library,
and I forgot that the SD card gets initialized at a much lower
rate, and then the speed is increased later. I have verified
the clock rate with an oscilloscope, to it does work, as
documented.

Mike

Memfault Beyond the Launch