SSP

LPC2368 SSP init as SPI

void sspInit(void) { // SSP1 (SPI) init sequense PCONP |= (1<<10); // PCSSP1 - power on PINSEL0 |= (2<<(7*2)) | (2<<(8*2)) | (2<<(9*2)) | (2<<(6*2)); // configure SPI1 pinouts // Serial Clock Rate: PCLK/CPSDVSR SSP1CR1 = 0x0 ; // disable SSP, must be off during changes SSP1CR0 = (8-1); // | (1<<6) /* CPOL */ | (1<<7) /* CPHA */; // | SSP_CR0_CPOL | SSP_CR0_CPHA; // DataSizeSelect=8, CPOL=1,CPHA=1 SSP1CPSR = 8; // SPICLK = PCLK/8 = 18MHz/8 = 2.