RT1052 to do LPSPI operations sent data faile

cancel
Showing results for 
Search instead for 
Did you mean: 

RT1052 to do LPSPI operations sent data faile

381 Views
wandongli
Contributor I

Hi  all

     I use RT1052 to do LPSPI operations, send data directly after initialization but I can't see spi data with logic analyzer. Here is my code.

lpspi_master_config_t masterConfig;
uint32_t srcClock_Hz;
lpspi_transfer_t masterXfer;
uint8_t fingertech_txData[8]={0xaa};

masterConfig.baudRate = (100000U);
masterConfig.bitsPerFrame = 8;
masterConfig.cpol = kLPSPI_ClockPolarityActiveHigh;
masterConfig.cpha = kLPSPI_ClockPhaseFirstEdge;
masterConfig.direction = kLPSPI_MsbFirst;

masterConfig.pcsToSckDelayInNanoSec = 1000000000 / masterConfig.baudRate;
masterConfig.lastSckToPcsDelayInNanoSec = 1000000000 / masterConfig.baudRate;
masterConfig.betweenTransferDelayInNanoSec = 1000000000 / masterConfig.baudRate;

masterConfig.whichPcs = kLPSPI_Pcs0; //ʹÓÃƬѡ0
masterConfig.pcsActiveHighOrLow = kLPSPI_PcsActiveLow;//0±íʾѡÖÐ

masterConfig.pinCfg = kLPSPI_SdiInSdoOut;
masterConfig.dataOutConfig = kLpspiDataOutRetained;

srcClock_Hz = LPSPI_MASTER_CLK_FREQ;
LPSPI_MasterInit(LPSPI1, &masterConfig, srcClock_Hz);
LPSPI_Enable(LPSPI1,true);
LPSPI_WriteData(LPSPI1,0x55);

0 Kudos
2 Replies

169 Views
wandongli
Contributor I

Thank you for your support, it is actually my hardware problem.

0 Kudos

169 Views
jimmychan
NXP TechSupport
NXP TechSupport

In the SDK, there is driver example for lpspi.

SDK_2.3.1_MIMXRT1052\boards\evkbimxrt1050\driver_examples\lpspi

You can try to run the example first.