AnsweredAssumed Answered

SPI Master example for LPC54618

Question asked by S S on Oct 3, 2018
Latest reply on Oct 23, 2018 by Kerry Zhou

I am using OM13094 kit with MCUXpresso IDE and SDK version 2.3.1.

I am trying to use SPI Master example and  J11 connector of the Kit.

 I have used lpcxpresso54618_driver_examples_spi_spi_interrupt example and changed the SPI-SSEL pin in pin_mux.c file as:

 

const uint32_t port4_pin6_config = (/* Pin is configured as FC9_CTS_SDA_SSEL0 */
IOCON_PIO_FUNC2 |
/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT3 PIN30 (coords: K13) is configured as FC9_CTS_SDA_SSEL0 */
IOCON_PinMuxSet(IOCON, 4U, 6U, port4_pin6_config);

 

My Slave Controller (not NXP MCU) is configured as :

 

SPI_Params_init(&spiParams);
spiParams.frameFormat = SPI_POL1_PHA1;
spiParams.mode = SPI_SLAVE;
spiParams.transferCallbackFxn = transferCompleteFxn;
spiParams.transferMode = SPI_MODE_CALLBACK;
slaveSpi = SPI_open(Board_SPI_SLAVE, &spiParams);

 

So modified the SPI example for master controller (OM13094) as;

SPI_MasterGetDefaultConfig(&masterConfig);
sourceClock = EXAMPLE_SPI_MASTER_CLK_FREQ;
masterConfig.polarity = kSPI_ClockPolarityActiveLow;
masterConfig.phase = kSPI_ClockPhaseSecondEdge;
masterConfig.baudRate_Bps = 1000000U;
masterConfig.sselNum = (spi_ssel_t)EXAMPLE_SPI_SSEL;
masterConfig.sselPol = (spi_spol_t)EXAMPLE_SPI_SPOL;
SPI_MasterInit(EXAMPLE_SPI_MASTER, &masterConfig, sourceClock);

 

I am getting response as;

Kindly help.

If you have other example code kindly share.

Regards,

SS

Outcomes