spi clock comfiguration

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

spi clock comfiguration

301 次查看
sandeep_c
Contributor I

hi eveyone i configured the LPSPI4 in rt1170 as below the baudarate which i had taken from example but

1) iam not getting how to calculate the baudrate 

2)as i configured below iam getting clock frequency 500khz but i need to increase spi clock frequency to 10mhz how can i do it

 

#define LPSPI_MASTER_CLK_FREQ (CLOCK_GetFreqFromObs(CCM_OBS_LPSPI4_CLK_ROOT))
PRINTF("\r\nSPI INTERFACE CALLED");
#if 1
uint32_t srcClock_Hz;
lpspi_master_config_t masterConfig;
masterConfig.baudRate =500000;
masterConfig.bitsPerFrame=8;
masterConfig.cpol=kLPSPI_ClockPolarityActiveHigh;
masterConfig.cpha = kLPSPI_ClockPhaseFirstEdge;
masterConfig.direction = kLPSPI_MsbFirst;
masterConfig.pcsToSckDelayInNanoSec=1000;
masterConfig.lastSckToPcsDelayInNanoSec=1000;
masterConfig.betweenTransferDelayInNanoSec=1000;
masterConfig.whichPcs = kLPSPI_Pcs1;
masterConfig.pinCfg = kLPSPI_SdiInSdoOut;
masterConfig.dataOutConfig=kLpspiDataOutRetained;
masterConfig.pcsActiveHighOrLow=kLPSPI_SdiInSdoOut;
srcClock_Hz = LPSPI_MASTER_CLK_FREQ;
LPSPI_MasterInit(LPSPI4, &masterConfig, srcClock_Hz);

i_MXRT1170Processor_0-1681454111692.png

 

0 项奖励
2 回复数

269 次查看
nxpuser98
Contributor I

Did solve this? I currently have the same problem with 500 kHz SPI clock frequency although I configured 1 MHz.

0 项奖励

261 次查看
sandeep_c
Contributor I
yes its solved
0 项奖励