Luuk Grefte

LPCOPEN example SSP(SPI) with LPC_SSP1 instead of LPC_SSP0

Discussion created by Luuk Grefte on Mar 3, 2017
Latest reply on Mar 6, 2017 by Kerry Zhou

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_IRQHandler

 

Chip_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

Outcomes