iam interfacing rt1170 with ksz8851snli which is spi to ethernet and vice versa.the spi slave device it can support up to 40mhz but as now iam generating sclk freq 1mhz width and 500khz freq only but i need increase 1mhz to more than 10mhz
iam using mcuzpresso ide
present configuration:
NOTE:srcClock_Hz=24MHZ
#define LPSPI_MASTER_CLK_FREQ (CLOCK_GetFreqFromObs(CCM_OBS_LPSPI4_CLK_ROOT))
PRINTF("\r\nSPI INTERFACE CALLED");
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;
PRINTF("\n\rsrcClock_Hz ==%d\n\r",srcClock_Hz);
LPSPI_MasterInit(LPSPI4, &masterConfig, srcClock_Hz);
HOW CAN I INCREASE SCLK FREQUENCY?
how to calculate baudrate? as of now i selected the default one
Solved! Go to Solution.
Hi @sandeepc
You can increase the frequency by using a larger clock source for you module, instead of using the 24MHz.
Best Regards, Miguel.
Hi @sandeepc
You can increase the frequency by using a larger clock source for you module, instead of using the 24MHz.
Best Regards, Miguel.