Yahoo Groups archive

Lpc2000

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

Message

Re: lpc2106 - SPI - i need help

2003-12-11 by arturo_tramontini

--- In lpc2100@yahoogroups.com, "arturo_tramontini" <a.t@t...> wrote:
> first - sorry for english mistake.
> 
> i'm try to use SPI in master mode.
> i dont see any activity on relative pin.
> here my code ( i'm use KEIL uvison3)
> 
> 
> have someone some suggestion?
> 
> thanks
> 
> ----------------------------------------------------------
> #include <LPC210x.H>                    
> 
> unsigned long j,g; 
> 
> int main (void)  {
> 
> unsigned char pin;
> unsigned long i;                         
> 
> 	PCONP = 0x3FE;		
> 
> 	IODIR = 0xff;     	// P0.0..7 defined as Outputs 
> 
> 	SPI_SPCCR = 8; 		// rate spi
> 
> 	PINSEL0 = 0x5500;	// enable spi i/o 
> 
> 	SPI_SPCR = 0x20; 	// master mode
> 
>   pin  = 0;
> 
>   while (1) {                             
> 
> 	for(i=0;i<8;i++){
> 
> 		if (pin) IOSET = 0x20; else IOCLR = 0x20; 
> 		pin ^= 1;
>    
                // here i have put code for about 1 msec. delay
                // to allow the flow for spi

> 
> 		SPI_SPDR = 0x55;// i'm expect to see some activity 
> 
> 	}
>   }
> }

Attachments

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.