Content originally posted in LPCWare by hzrnbgy on Sun Sep 18 01:20:37 MST 2011
//heres what I have for SSP1 slave on pins P0.6,P0.7, P0.8, P0.9 on a 96MHz 1768. You'll probably have to change the clock if you are using a LPC1769
void ssp1_init(void)
{
LPC_SC->PCONP |= (1<<10); //power up SSP1
LPC_SC->PCLKSEL0 |= (2<<20); //run SSP1 at 48MHz (prescale 2)
//configure PIN functions
LPC_PINCON->PINSEL0 |= (2<<18) | (2<<16) | (2<<14) | (2<<12); //MOSI1, MISO1, SCK1, SSEL1
LPC_PINCON->PINMODE0 |= (2<<18) | (2<<16) | (2<<14); //no pull-up or down on MOSI1, MISO1, SCK1
LPC_PINCON->PINMODE0 |= (3<<12); pull-up on SSEL1
//frame format, 8bits SPI format, CPOL0, CPHA0
LPC_SSP1->CR0 &= ~(0xFF<<8 | 1<<7 | 1<<6 | 3<<4);
LPC_SSP1->CR0 |= (7<<0);
//slave mode
LPC_SSP1->CR1 &= ~(1<<3 | 1<<0);
LPC_SSP1->CR1 |= (1<<2);
//clock counter/prescaler setup
LPC_SSP1->CPSR = 6; //run SSP1 clock at 8MHz
//enable SSP controller
LPC_SSP1->CR1 |= (1<<1);
}
you might want to turn on received interrupt so you don't have to poll the status register to determine pending transfer
makes me wonder, why are you using the Arduino as the master while the LCP1769 is clearly the more powerful card?