LPC11u68 SPI CS as GIPO pin

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

LPC11u68 SPI CS as GIPO pin

764 Views
lukaskühnbach
Contributor I

hey everybody,

i would like to connect 2 sensors to my lpc11u68. i connected one of them via IOCON SSP1_SEL but i want to connect the other one via a GPIO. Does anyone know how to do that ?  

0 Kudos
5 Replies

635 Views
lukaskühnbach
Contributor I
 Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 22, (IOCON_FUNC3 | IOCON_MODE_INACT | IOCON_DIGMODE_EN)); // MISO
 Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 21, (IOCON_FUNC2 | IOCON_MODE_INACT)); // MOSI
 Chip_IOCON_PinMuxSet(LPC_IOCON, 1, 20, (IOCON_FUNC2 | IOCON_MODE_INACT)); // SCK
 Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 12, (IOCON_FUNC1 | IOCON_MODE_INACT | IOCON_DIGMODE_EN)); // SSEL

 Chip_SSP_Init(LPC_SSP);

 ssp_format.frameFormat = SSP_FRAMEFORMAT_SPI;//SSP_FRAMEFORMAT_SPI
 ssp_format.bits = SSP_BITS_8;
 ssp_format.clockMode = SSP_CLOCK_MODE3;
 Chip_SSP_SetFormat(LPC_SSP1, ssp_format.bits, ssp_format.frameFormat, ssp_format.clockMode);
 Chip_SSP_Set_Mode(LPC_SSP1, SSP_MODE_MASTER);

 Chip_SSP_SetBitRate(LPC_SSP1, SENSOR_SPI_BITRATE);

 Chip_SSP_Enable(LPC_SSP1);
0 Kudos

635 Views
soledad
NXP Employee
NXP Employee

Please don't forget to set up the direction of the pin to be output pin and set it high as default.

Chip_GPIO_SetPinDIROutput()
Chip_GPIO_SetPinState()

I hope this helps, 

Regards 

Sol

0 Kudos

635 Views
lukaskühnbach
Contributor I

Hi,

i tried to used the solution in the posted thread, but it didn't seem to work.

The Problem i try to solve is to use PIO_12 as SSP1_SSEL. as you can see PIO_23 column 5 is used normally for the CS.

I also tried to to set PIO_12 to LOW manually in the Code, but that doesn't seem to work neither.

Do you have any hint for my, how I could solve that Problem ?

Screenshot_3_handbuch.png

0 Kudos

635 Views
soledad
NXP Employee
NXP Employee

Could you please share the configuration for PIO0_12 you are using?

Regards 

Sol 

0 Kudos

635 Views
soledad
NXP Employee
NXP Employee

Hi,

Please check the following thread and let me know if this helps.

Howto: 20-bit SPI transfer using SSP? 

Have a nice day!

Regards

Sol 

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos