hello
I have a problem with the spi0 on a board lpcH2129, I work with µVISION,
the code seems to me correct, but does not work, I sees anything (noise) on the pines spi with the oscillo.
I you joint the code if somebody can help me
thank you
#include <LPC21xx.H> // LPC21xx definitions
static void Write(unsigned char val)
{
IOSET0 = 0x00000080; //
S0SPDR = val; // sent first byte
while(!(S0SPSR & 0x80)); // wait for end of transfer
IOCLR0 = 0x00000080; //
}
static void SPI_Init(void)
{
IODIR0 |= 0x00000080; // for SSEL
IOCLR0 = 0x00000080; //
PINSEL0 |= 0x00001500; // pin config, whithout SSEl
S0SPCCR = 12; // SCK = 1 MHz,
S0SPCR = 0x28; // master mode, MSB first, no interrupt
}
int main (void)
{
SPI_Init();
while(1)
{
Write(0x02);
}
}