I decided to look a little deeper into FALA, particularly at high sample rates as I was debugging some SPI high clock rates (> 10MHz). First, a small bug which allows FALA setting to exceed the limits of capture frequency - half of the cpu clock rate -
Then I noticed that the PIO div is set as a float. This introduces some jitter at low div values. For example if you sample at 50MHz on BP5 you get a div of 1.25 (125/(2*50)) The clock frequency changes every 4 cycle, alternating between 125MHz and 125Mhz/2 (see picture). This is a lot of jitter.
I propose that we use whole values when the div is between 1 and 10
for values of div greater than 10, float is ok, in my opinion, since the jitter won’t exceed 10%. This will result in non integer oversampling for high sampling rates. if @ian is ok with this, I can submit a PR
3 Likes
Good find and debug! Thank you so much. Please make a pull request.
1 Like
We have a prototype with 8MB PSRAM on the horizon. Bringing it up today it seems like it might be a bit slow. Would you like to have one?
1 Like
Sure! Thank you for thinking of me
2 Likes
By the way, I tested the latest SDK / tool chain. It works fine for me.
set(sdkVersion 2.1.1)
set(toolchainVersion 14_2_Rel1)
set(picotoolVersion 2.1.1)
2 Likes
Thank you for the info. I will set about updating everything to the latest SDK.
1 Like