We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am using IMXRT1050-EVKB board. I have loaded CMSIS SPI example code from the Pack Installer
/* Select USB1 PLL PFD0 (720 MHz) as lpspi clock source */ #define EXAMPLE_LPSPI_CLOCK_SOURCE_SELECT (1U)
/* Clock divider for master lpspi clock source */ #define EXAMPLE_LPSPI_CLOCK_SOURCE_DIVIDER (7U)
#define EXAMPLE_LPSPI_CLOCK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllPfd0Clk) / (EXAMPLE_LPSPI_CLOCK_SOURCE_DIVIDER + 1U))
#define TRANSFER_BAUDRATE 500000U /* Transfer baudrate - 500k */
The SPI frequency for these parameters gives me around 0.5MHz at times and around 16.3MHz some time. I get the same frequency every time I change the value of either TRANSFER_BAUDRATE(increasing from 500k to 1000k/2000k) or EXAMPLE_LPSPI_CLOCK_SOURCE_DIVIDER or even both. When I disconnect my board from the power source for a couple of minutes, then I can see the change in frequency. But again, this change doesn't happen every time I power off the board. Also I am not sure how the frequency is been calculated with the above mentioned parameters. I am using oscilloscope to observe the SCK frequency. Any help regarding the frequency calculation would be much appreciated.
Regards, Snehal