How to get the lpcopen example ssp to work with LPC_SSP1? I'm using the lpc11c24 chip.
I changed:
#define LPC_SSP LPC_SSP1
#define SSP_IRQ SSP1_IRQn
#define SSPIRQHANDLER SSP1_IRQHandlerChip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO2_2, (IOCON_FUNC1 | IOCON_MODE_INACT)); /* MISO1 */
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO2_3, (IOCON_FUNC1 | IOCON_MODE_INACT)); /* MOSI1 */
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO2_0, (IOCON_FUNC1 | IOCON_MODE_INACT)); /* SSEL1 */
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO2_1, (IOCON_FUNC1 | IOCON_MODE_INACT)); /* SCK1 */
I'm presume the problem lies in: Chip_IOCON_PinLocSel(LPC_IOCON, IOCON_SCKLOC_PIO2_11); which needs to be Chip_IOCON_PinLocSel(LPC_IOCON, IOCON_SCKLOC_PIO2_1); but this doesn't exist in the library. Which value do I need to put in. I'm a little confused by the library and the registers...
Thanks
Hi Luuk Grefte,
Your pin function configuration is not correct, please check the user manual. I have checked it, SPI function in PIO2_0, PIO2_1, PIO2_2, PIO2_3 is all function 2.
Take an example:
Chip_IOCON_PinLocSel can be found in iocon11xx.h, in the lpc_chip_11cxx.lib.
Please modify the pin function to 2, then try again.
If you still have question, please let me know!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Never mind. There is only 1 CLK1. Don't know the problem then....