LPCOPEN example SSP(SPI) with LPC_SSP1 instead of LPC_SSP0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPCOPEN example SSP(SPI) with LPC_SSP1 instead of LPC_SSP0

2,308 Views
luukgr
Contributor I

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

Labels (4)
Tags (4)
0 Kudos
Reply
2 Replies

1,512 Views
kerryzhou
NXP TechSupport
NXP TechSupport

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:

pastedImage_1.png

Chip_IOCON_PinLocSel can be found in iocon11xx.h, in the lpc_chip_11cxx.lib.

pastedImage_2.png

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,512 Views
luukgr
Contributor I

Never mind. There is only 1 CLK1. Don't know the problem then....

0 Kudos
Reply