Lpc11u37 spi slave select pin

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

Lpc11u37 spi slave select pin

503 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by siangming on Wed Mar 04 17:03:32 MST 2015
hi all,

I am trying to use the spi on this mcu, lpc11u37, as a master spi and connect the mcu to another single slave spi device only.

After reading the reference manual, I still do not understand if the slave select pin is driven automatically to the active state whenever there is a data waiting to send out in the FIFO buffer ....

or do I have to manually drive it to the active state before the data get sent out through the MOSI. If so, do I also have to manually drive it back to inactive state after the data transmission is done?

Thank you.
Labels (1)
0 Kudos
3 Replies

432 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Mar 05 00:26:45 MST 2015
If a pin is switched to SSEL pin function, SSP peripheral is controllong this pin and switching it automatically...
0 Kudos

432 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by siangming on Wed Mar 04 20:15:35 MST 2015

Quote: R2D2
As shown in LPCOpen sample:

#if (defined(BOARD_NXP_XPRESSO_11U14) || defined(BOARD_NGX_BLUEBOARD_11U24) || defined(BOARD_NXP_XPRESSO_11U37H))
/* Only SSP0 is supported */
[color=#f00]Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 2, (IOCON_FUNC1 | IOCON_MODE_PULLUP));/* SSEL0 */[/color]
Chip_IOCON_PinMuxSet(LPC_IOCON, 1, 29, (IOCON_FUNC1 | IOCON_MODE_PULLUP));/* SCK0 */
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 8, (IOCON_FUNC1 | IOCON_MODE_PULLUP));/* MISO0 */
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 9, (IOCON_FUNC1 | IOCON_MODE_PULLUP));/* MOSI0 */


slave select can be activated via pin function 1 

You can also use this pin (or another) as GPIO and switch slave select yourself in your code...



I understand that i can either configure PIO0_2 as a general GPIO or configure it as SSEL0.

if i configure it as SSEL0, do i have to manually set the SSEL0 to active state everytime before i want to send something to the slave spi device? or will the MCU automatically set the SSEL0 to the correct state (active or non-active) when the SPI communication is triggered or finished?

(My guess is that it is automatically toggled if the pin is configured as SSEL0. But if the pin is configured as GPIO, i have to manually toggle the output to select the slave when i want to communicate with the slave.)

Thank you.
0 Kudos

432 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Mar 04 17:35:12 MST 2015
As shown in LPCOpen sample:

#if (defined(BOARD_NXP_XPRESSO_11U14) || defined(BOARD_NGX_BLUEBOARD_11U24) || defined(BOARD_NXP_XPRESSO_11U37H))
/* Only SSP0 is supported */
[color=#f00]Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 2, (IOCON_FUNC1 | IOCON_MODE_PULLUP));/* SSEL0 */[/color]
Chip_IOCON_PinMuxSet(LPC_IOCON, 1, 29, (IOCON_FUNC1 | IOCON_MODE_PULLUP));/* SCK0 */
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 8, (IOCON_FUNC1 | IOCON_MODE_PULLUP));/* MISO0 */
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 9, (IOCON_FUNC1 | IOCON_MODE_PULLUP));/* MOSI0 */


slave select can be activated via pin function 1 

You can also use this pin (or another) as GPIO and switch slave select yourself in your code...
0 Kudos