Reply by Michael Anton March 21, 20072007-03-21
> -----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

An Engineer's Guide to the LPC2100 Series

Reply by croquettegnu March 21, 20072007-03-21
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
>
Reply by Michael Anton March 20, 20072007-03-20
> -----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
Reply by croquettegnu March 20, 20072007-03-20
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

--- In l..., "Michael Anton" wrote:
>
> > -----Original Message-----
> > From: l...
> > [mailto:l...]On Behalf
> > Of croquettegnu
> > Sent: Monday, March 19, 2007 9:30 AM
> > To: l...
> > Subject: [lpc2000] Re: SSP (SPI mode) Baudrate limitation @ only
> > 10Mbit/s - Bug ??????
> >
> >
> > It seems that when programming a value less or equal to 6 for the
> > CPSDVSR, I can't succeed in transmitting and receiving correctly...
> >
> > Please help!
> >
> > --- In l..., "croquettegnu"
> > wrote:
> > >
> > > Hi,
> > >
> > > I can't succeed in using my SSP in SPI mode at speed more
> > than 10MBit/s
> > > I use the loopback mode but I assume this is the same in standard
> > mode...
> > > If I program a CPSDVSR value in the SSPCPSR register lower
> > than 8, it
> > > does not work and sometimes I observe a reset !!!
> > >
> > > Does anybody succeed in running the SSP in master mode at
> > speed higher
> > > than 10 MBit/s?
> > >
> > > Thanks a lot
> > >
> >
> >
> > I'd say you still have a bug somewhere, as I have run at
> 15Mbit/s and 24Mbit/s without any problems.
>
> Mike
>
Reply by croquettegnu March 20, 20072007-03-20
The errate sheet mentionned:
"The deviation of the initial data bits/clocks will decrease as the
SSP frequency decreases."
For me this is not clear as we do not know if under 20Mbit/s, the same
issue could occur...

--- In l..., "lpc2100_fan" wrote:
>
> --- In l..., wrote:
> >
> > >> I'd say you still have a bug somewhere, as I have run at
> > >> 15Mbit/s and 24Mbit/s without any problems.
> >
> > Really. Doesn't the doc say that the SPI ports can't do more than
about
> > 4-5MHz? Also, as I recall they only seem to support 8,16, 32 bit
> words. Is
> > it possible to do 24 bit words? You sound like the SPI expert so I'm
> > curious :))
> >
> > Chris.
> >
> Hi Chris,
>
> the original SPI implemented in the LPC2104/5/6 was limited to CPU/8
> best case in master mode. The SSP in SPI mode can run CPU/2 but as
> mentioned check Errata Sheet for LPC2148, short first pulse.
>
> Bob
>
Reply by Thiago Lima March 20, 20072007-03-20
Hello all,

>From the LPC2103 errata datasheet, sounds that SSP with high frequencies of
work, doesnt work so fine:
http://www.standardics.nxp.com/support/documents/microcontrollers/pdf/errata.lpc2103.pdf

At high SSP frequencies, it is found that the first four pulses are shorter
than the subsequent pulses.
- At 30MHz, the first pulse can be expected to be approximately 10ns
shorter and the second pulse around 5ns shorter. The remaining two pulses
are around 2ns shorter than subsequent pulses.
- At 25MHz, the length of the first pulse would be around 7ns shorter. The
subsequent three pulses are around 2ns shorter.
- At 20MHz only the first pulse is affected and it is around 2ns shorter.
All subsequent pulses are fine.

Thiago

Electrical Engineer

On 20/03/07, lpc2100_fan wrote:
>
> --- In l... ,
> wrote:
> >
> > >> I'd say you still have a bug somewhere, as I have run at
> > >> 15Mbit/s and 24Mbit/s without any problems.
> >
> > Really. Doesn't the doc say that the SPI ports can't do more than about
> > 4-5MHz? Also, as I recall they only seem to support 8,16, 32 bit
> words. Is
> > it possible to do 24 bit words? You sound like the SPI expert so I'm
> > curious :))
> >
> > Chris.
> >
> Hi Chris,
>
> the original SPI implemented in the LPC2104/5/6 was limited to CPU/8
> best case in master mode. The SSP in SPI mode can run CPU/2 but as
> mentioned check Errata Sheet for LPC2148, short first pulse.
>
> Bob
>
Reply by lpc2100_fan March 20, 20072007-03-20
--- In l..., wrote:
>
> >> I'd say you still have a bug somewhere, as I have run at
> >> 15Mbit/s and 24Mbit/s without any problems.
>
> Really. Doesn't the doc say that the SPI ports can't do more than about
> 4-5MHz? Also, as I recall they only seem to support 8,16, 32 bit
words. Is
> it possible to do 24 bit words? You sound like the SPI expert so I'm
> curious :))
>
> Chris.
>
Hi Chris,

the original SPI implemented in the LPC2104/5/6 was limited to CPU/8
best case in master mode. The SSP in SPI mode can run CPU/2 but as
mentioned check Errata Sheet for LPC2148, short first pulse.

Bob
Reply by Michael Anton March 20, 20072007-03-20
> -----Original Message-----
> From: l...
> [mailto:l...]On Behalf
> Of s...@hotmail.com
> Sent: Monday, March 19, 2007 8:27 PM
> To: l...
> Subject: Re: [lpc2000] Re: SSP (SPI mode) Baudrate limitation @ only
> 10Mbit/s - Bug ??????
> >> I'd say you still have a bug somewhere, as I have run at
> >> 15Mbit/s and 24Mbit/s without any problems.
>
> Really. Doesn't the doc say that the SPI ports can't do more
> than about
> 4-5MHz? Also, as I recall they only seem to support 8,16, 32
> bit words. Is
> it possible to do 24 bit words? You sound like the SPI expert so I'm
> curious :))
>
> Chris.

Well, the LPC214x series can run up to 30MHz (in master mode), bearing
in mind the errata for that rate, which shortens the first couple
of clocks. The SPI0 can have 8 to 16 bits per transfer, and if you control
the CS line, it can be 8bits to whatever you want. The SSP allows
4 to 16 bits per transfer, and like the SPI0, if you control the CS
line, you have more control.

I'm not the expert, as I've only used these parts in master mode, but
I'm pretty good at digesting data sheets... :-)

Mike
Reply by sig5...@hotmail.com March 19, 20072007-03-19
>> I'd say you still have a bug somewhere, as I have run at
>> 15Mbit/s and 24Mbit/s without any problems.

Really. Doesn't the doc say that the SPI ports can't do more than about
4-5MHz? Also, as I recall they only seem to support 8,16, 32 bit words. Is
it possible to do 24 bit words? You sound like the SPI expert so I'm
curious :))

Chris.
Reply by Michael Anton March 19, 20072007-03-19
> -----Original Message-----
> From: l...
> [mailto:l...]On Behalf
> Of croquettegnu
> Sent: Monday, March 19, 2007 9:30 AM
> To: l...
> Subject: [lpc2000] Re: SSP (SPI mode) Baudrate limitation @ only
> 10Mbit/s - Bug ??????
> It seems that when programming a value less or equal to 6 for the
> CPSDVSR, I can't succeed in transmitting and receiving correctly...
>
> Please help!
>
> --- In l..., "croquettegnu"
> wrote:
> >
> > Hi,
> >
> > I can't succeed in using my SSP in SPI mode at speed more
> than 10MBit/s
> > I use the loopback mode but I assume this is the same in standard
> mode...
> > If I program a CPSDVSR value in the SSPCPSR register lower
> than 8, it
> > does not work and sometimes I observe a reset !!!
> >
> > Does anybody succeed in running the SSP in master mode at
> speed higher
> > than 10 MBit/s?
> >
> > Thanks a lot
>
I'd say you still have a bug somewhere, as I have run at
15Mbit/s and 24Mbit/s without any problems.

Mike