lpc2106 - SPI - i need help
2003-12-11 by arturo_tramontini
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;
SPI_SPDR = 0x55;// i'm expect to see some activity
}
}
}