spi clock comfiguration

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

spi clock comfiguration

1,043件の閲覧回数
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 返答(返信)

1,011件の閲覧回数
nxpuser98
Contributor I

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

0 件の賞賛
返信

1,003件の閲覧回数
sandeep_c
Contributor I
yes its solved
0 件の賞賛
返信