hi iam using rt1170 with mcuxpresso sdk my slave device can support up to 40mhz but as of i can able to generate 1mhz only.
which register i want use to change the sclk of rt1170 from 1mhz to 10mhz
Solved! Go to Solution.
Hi @sandeepc
The maximum frequency for the LPSPI4 module is 135MHz. You can increase the source frequency for this module with the clock configuration tool. In this example, I simply double clicked the clock root section, selected LPSPI4 clock root, and changed the source to OSC_RC_400M and divider to /4 in order to increase the default clock frequency from 24MHz all the way to 100MHz. This clock source will allow you to have a higher range for your SCL frequency.
With respect to the community post you reference, it only applies to S32K, not RT.
BR,
Edwin.
Hi @sandeep_c,
Please loot into Section "70.3.1.3 Timing parameters" of the RM for more information about the timing configurations for the SPI modules. There you will find the description of the SCKDIV register, which you will have to adjust in order to change the divider of the modules frequency and that way determine a desired SCL frequency. In other words, the SCL frequency depends on both the SPI source clock as well as it's divider. The function "LPSPI_MasterSetBaudRate()" from the fsl_lpspi.c driver found in our SDK examples shows an optimal way of calculating and asserting a desired baud rate on a chosen LPSPI module, so you can refer to that routine for a proper implementation of baud rate change in your code.
BR,
Edwin.
If you are looking for higher baud rates, try using a larger clock source for your module in order to increase the frequency cap of the LPSPI. Use another clock root with a higher frequency, instead of the 24 MHz clock root, and then use that as your srcClock parameter to let the previously mentioned routine adjust to the desired baudrate.
@EdwinHz thank you what is the maximum source frequency of of lpspi module
Thanks for mentioning this case link but Please check the below link
I have doubt like what is the maximum lpspi src clock and what is the maximum sclk clock? What he mentioned it's for sclk freq or src freq?
How can I calculate the desired baudrate?
What is maximum src frequency clock for lpspi ?
What is maximum sclk frequency i can generate?
What is 28mhz mentioned in above link?
Hi @sandeepc
The maximum frequency for the LPSPI4 module is 135MHz. You can increase the source frequency for this module with the clock configuration tool. In this example, I simply double clicked the clock root section, selected LPSPI4 clock root, and changed the source to OSC_RC_400M and divider to /4 in order to increase the default clock frequency from 24MHz all the way to 100MHz. This clock source will allow you to have a higher range for your SCL frequency.
With respect to the community post you reference, it only applies to S32K, not RT.
BR,
Edwin.