Content originally posted in LPCWare by EI24 on Sun Jul 19 07:09:28 MST 2015
I've found two errors. It seems you need to enable the AHB clock to the IOCONFIG block, before you can set the pin functions. I thought that was that was activated by default. You also need to set the SSP1CPSR register to 2, so that the SPI1 clock i prescaled for the SPI to work properly. Also i changed the frame size to 8-bit instead of 16-bit to make the program more simple. Though it still does not work. I have also checked the definition multiple times and they are correct. I think the problem may lay in the functions, or something more with the SPI setup.