LPC55S36 SPI Pin Activity on LPCXpresso55S36 board

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

LPC55S36 SPI Pin Activity on LPCXpresso55S36 board

265 Views
TRCooper
Contributor II

Hello,

I have an LPC55S36 on an Xpresso evaluation board. I have a new requirement: add SPI driver to the software.  An SPI driver is therefore being added to an existing project under MCUXpresso IDE v11.9.0 [Build 2144] [2024-01-05].

I've chosen flexcom2 spi, and specified the following pins for the SPI Port.  These will be jumpered off-board to another evaluation board once they work.  Pins:

SCL     P1-23      J122-8

MOSI   P0-26    J92-9

MISO   P1-25     J122-12

SSEL0  P1-26      J122-6

 

Clock into flexcomm2 is 32 MHz.   The port is initialized in the peripheral init function.  A small test program sends a single string to the port at a 1Hz rate.  The test function is here:

done = 0;

 

SPI_MasterTransferCreateHandle (SPI_ADS1X2S14_ADC_PERIPHERAL, &spiHandle, &spiDone, NULL);

 

xfer.txData = txDataBuffer;

xfer.rxData = rxDataBuffer;

xfer.dataSize = n;

 

status = SPI_MasterTransferNonBlocking (SPI_ADS1X2S14_ADC_PERIPHERAL, &spiHandle, &xfer);

 

while (!done)

{

PRINTF ("Waiting...\r\n");

usleep (10000);

}

 

Where done is a volatile. In loopback mode, the test works. The n-byte test string is deposited in the rx buffer and "done" is set to a nonzero value in the callback function "spiDone".  

However, when loopback is turned off and MISO is connected to MOSI,  status is 0 (indicating success), done is set (indication completion), the Rx buffer has n values of 0xff (which is not correct), and a scope shows no activity on the SSEL, CLK, and MOSI pins. In this initial test the pins are floating, having no load other than an oscope probe. 

My read of the eval board schematic suggests that there are no conflicts for these pins, and no on-board devices that would be interfering with this test (though I may have overlooked something).

Flexcom setup:

TRCooper_0-1734810955624.png

 

Pin routing:

TRCooper_1-1734811028579.png

 

I must have omitted something, though I cannot identify what. Below should be the contents of the Analog/Digital I/O control port for PIO1_23, 25, and 26 which show digital mode, function 1 (is this correct?)

0x400010DC 00000101 00000000 ........
0x400010E4 00000101 00000101 ........

 

What else can I examine?  

Best Regards,

TC

 

 

 

Labels (2)
0 Kudos
Reply
0 Replies