pico-sdk
pico-sdk copied to clipboard
Fixed an issue that caused incorrect settings when the SPI clock was …
…less than 244,141Hz.
Fixed an issue that caused incorrect settings when the SPI clock was less than 244,141Hz.
For example, if clk_peri is 125MHz and you specify 150kHz
Before correction prescale=2, postdiv=256, 125000000/(2*256)=244140.625Hz Therefore, it exceeds 150kHz.
After correction prescale=4, postdiv=209, 125000000/(4*209)=149521.5311004785Hz This is the correct frequency.