AnsweredAssumed Answered

RT1052 to do LPSPI operations sent data faile

Question asked by wandong li on Jun 5, 2018
Latest reply on Jun 6, 2018 by wandong li

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);

Outcomes