Yahoo Groups archive

Lpc2000

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

Thread

Problems with using SPI

Problems with using SPI

2004-10-12 by johnnorgaard2003

Hi 
I am using lpc2106 and SPI.
I can't get it to work, it should be simple but..

Here is what I do
//----------------------------------------------
PINSEL0 |= 0x5500;	// enable SPI pins
SPCR     = 0x20;	// set master mode
SPCCR    = 128;		// SCK =pclk/128


SPDR = c;		// start transfer
//-----------------------------------------------

but there is no activity on the  SCLK.

1) Should be SSEL be pull-up ? (it is always low)
How do activate/deactivate SSEL ?
(in the user manual on page 127 is say SSEL is not directly driven by
the master.It could be driven by a simple general purpose I/O under
software control.)
2) Should I still select SSEL as alternate function SSEL or general
purpose I/O ?


Please if any one have used SPI and SSEL, please comment

best regards

John

Re: [lpc2000] Problems with using SPI

2004-10-12 by Aminder Athwal

Hi John
Make sure you pull P0.7 (SSEL pin) to High (3.3V) I had alot of problems with this but It should resolve your problem.
 
Aminder

johnnorgaard2003 <john_2005@...> wrote:

Hi 
I am using lpc2106 and SPI.
I can't get it to work, it should be simple but..

Here is what I do
//----------------------------------------------
PINSEL0 |= 0x5500;      // enable SPI pins
SPCR     = 0x20;      // set master mode
SPCCR    = 128;            // SCK =pclk/128


SPDR = c;            // start transfer
//-----------------------------------------------

but there is no activity on the  SCLK.

1) Should be SSEL be pull-up ? (it is always low)
How do activate/deactivate SSEL ?
(in the user manual on page 127 is say SSEL is not directly driven by
the master.It could be driven by a simple general purpose I/O under
software control.)
2) Should I still select SSEL as alternate function SSEL or general
purpose I/O ?


Please if any one have used SPI and SSEL, please comment

best regards

John




Yahoo! Groups SponsorADVERTISEMENT


---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/lpc2000/
  
   To unsubscribe from this group, send an email to:
lpc2000-unsubscribe@yahoogroups.com
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



Regards,


Aminder Singh Athwal
		
---------------------------------
 ALL-NEW Yahoo! Messenger - all new features - even more fun!  

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

Re: Problems with using SPI

2004-10-12 by johnnorgaard2003

Hi Aminder

Ok I now have pull-up on SSEL pin. But how do I control it. Setting it
low when selecting the device ?
IOSET and IOCLR have no effect when any pin in configured as secondary
function(user manual p.82)

best regards


John

--- In lpc2000@yahoogroups.com, Aminder Athwal <aminderathwal@y...> wrote:
> 
> Hi John
> Make sure you pull P0.7 (SSEL pin) to High (3.3V) I had alot of
problems with this but It should resolve your problem.
Show quoted textHide quoted text
>  
> Aminder
> 
> johnnorgaard2003 <john_2005@c...> wrote:
> 
> Hi 
> I am using lpc2106 and SPI.
> I can't get it to work, it should be simple but..
> 
> Here is what I do
> //----------------------------------------------
> PINSEL0 |= 0x5500;      // enable SPI pins
> SPCR     = 0x20;      // set master mode
> SPCCR    = 128;            // SCK =pclk/128
> 
> 
> SPDR = c;            // start transfer
> //-----------------------------------------------
> 
> but there is no activity on the  SCLK.
> 
> 1) Should be SSEL be pull-up ? (it is always low)
> How do activate/deactivate SSEL ?
> (in the user manual on page 127 is say SSEL is not directly driven by
> the master.It could be driven by a simple general purpose I/O under
> software control.)
> 2) Should I still select SSEL as alternate function SSEL or general
> purpose I/O ?
> 
> 
> Please if any one have used SPI and SSEL, please comment
> 
> best regards
> 
> John
> 
> 
> 
> 
> Yahoo! Groups SponsorADVERTISEMENT
> 
> 
> ---------------------------------
> Yahoo! Groups Links
> 
>    To visit your group on the web, go to:
> http://groups.yahoo.com/group/lpc2000/
>   
>    To unsubscribe from this group, send an email to:
> lpc2000-unsubscribe@yahoogroups.com
>   
>    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
> 
> 
> 
> Regards,
> 
> 
> Aminder Singh Athwal
> 		
> ---------------------------------
>  ALL-NEW Yahoo! Messenger - all new features - even more fun!  
> 
> [Non-text portions of this message have been removed]

Re: [lpc2000] Re: Problems with using SPI

2004-10-12 by Robert Adsett

At 11:47 AM 10/12/04 +0000, you wrote:
>Ok I now have pull-up on SSEL pin. But how do I control it. Setting it
>low when selecting the device ?
>IOSET and IOCLR have no effect when any pin in configured as secondary
>function(user manual p.82)
You can't.  When using the SPI if SSEL goes low the microcontroller acts as 
a slave.  To select an external device you must use another pin.

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

Re: Problems with using SPI

2004-10-12 by johnnorgaard2003

Hi Robert

Ohh, I see. The SSEL in only a input to the LPC2106 to act as a slave
or master. Not to select an external slave device.
For selecting external device I have to use another I/O Pin.
Thanks Robert.

Best regards

John

--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...> wrote:
> At 11:47 AM 10/12/04 +0000, you wrote:
> >Ok I now have pull-up on SSEL pin. But how do I control it. Setting it
> >low when selecting the device ?
> >IOSET and IOCLR have no effect when any pin in configured as secondary
> >function(user manual p.82)
> You can't.  When using the SPI if SSEL goes low the microcontroller
acts as 
Show quoted textHide quoted text
> a slave.  To select an external device you must use another pin.
> 
> 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

Re: [lpc2000] Re: Problems with using SPI

2004-10-12 by Aminder Athwal

John
 
Thats right you shouldn't have any problems now. I've got some code which you might find useful to read and write to pins. If you're intrested let me kno.
 
 
Aminder

johnnorgaard2003 <john_2005@...> wrote:

Hi Robert

Ohh, I see. The SSEL in only a input to the LPC2106 to act as a slave
or master. Not to select an external slave device.
For selecting external device I have to use another I/O Pin.
Thanks Robert.

Best regards

John

--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...> wrote:
> At 11:47 AM 10/12/04 +0000, you wrote:
> >Ok I now have pull-up on SSEL pin. But how do I control it. Setting it
> >low when selecting the device ?
> >IOSET and IOCLR have no effect when any pin in configured as secondary
> >function(user manual p.82)
> You can't.  When using the SPI if SSEL goes low the microcontroller
acts as 
> a slave.  To select an external device you must use another pin.
> 
> 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




Yahoo! Groups SponsorADVERTISEMENT


---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/lpc2000/
  
   To unsubscribe from this group, send an email to:
lpc2000-unsubscribe@yahoogroups.com
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



Regards,


Aminder Singh Athwal
		
---------------------------------
 ALL-NEW Yahoo! Messenger - all new features - even more fun!  

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

Re: Problems with using SPI

2004-10-15 by misstero

Hi Aminder,

I'm going to interface LPC21xx with Serial DataFlash(tm) so that How 
can I obtain your worked SPI code for jump start. Can you post your 
code to this group?

Thanks,
Suriyan.

--- In lpc2000@yahoogroups.com, Aminder Athwal 
<aminderathwal@y...> wrote:
> John
>  
> Thats right you shouldn't have any problems now. I've got some code 
which you might find useful to read and write to pins. If you're intrested 
let me kno.
>  
>  
> Aminder
> 
> johnnorgaard2003 <john_2005@c...> wrote:
> 
> Hi Robert
> 
> Ohh, I see. The SSEL in only a input to the LPC2106 to act as a slave
> or master. Not to select an external slave device.
> For selecting external device I have to use another I/O Pin.
> Thanks Robert.
> 
> Best regards
> 
> John
> 
> --- In lpc2000@yahoogroups.com, Robert Adsett 
<subscriptions@a...> wrote:
> > At 11:47 AM 10/12/04 +0000, you wrote:
> > >Ok I now have pull-up on SSEL pin. But how do I control it. Setting 
it
> > >low when selecting the device ?
> > >IOSET and IOCLR have no effect when any pin in configured as 
secondary
> > >function(user manual p.82)
> > You can't.  When using the SPI if SSEL goes low the microcontroller
> acts as 
> > a slave.  To select an external device you must use another pin.
> > 
> > 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
> 
> 
> 
> 
> Yahoo! Groups SponsorADVERTISEMENT
> 
> 
> ---------------------------------
> Yahoo! Groups Links
> 
>    To visit your group on the web, go to:
> http://groups.yahoo.com/group/lpc2000/
>   
>    To unsubscribe from this group, send an email to:
> lpc2000-unsubscribe@yahoogroups.com
>   
>    Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service. 
Show quoted textHide quoted text
> 
> 
> 
> Regards,
> 
> 
> Aminder Singh Athwal
> 		
> ---------------------------------
>  ALL-NEW Yahoo! Messenger - all new features - even more fun!  
> 
> [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.