You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update, it looks like this behavior happens when the ADC prescaler is 6 or 8. For 2 and 4, it behaves normally
Edit:
Some more observations:
Sample time seems to affect things as well, T_1, T_7, and T_239 works, the others do not.
In addition to being ordered incorrectly, the readings are also of lower quality when the bug occurs. Especially the first reading which is completely incorrect
After reverting the changes to rcc and adc and watching the problem persist, I am now suspecting that a bug introduced in the PAC crate between 0.7.0 and 0.8.0 is causing the issues
At some ADC clock values, the ADC reads values out of order, or to the wrong channels.
Using the above modified
examples/adc.rs
, with 3.3V connected to to PA0, 0Vconnected to PA1, and 2V connected to PA2, the readings returned are
not 4096, 0, 2510 as expected.
This can be fixed by setting the adcclk to 2 MHz in the clock initialisation.
I'm going to work on a patch to fix this, but i'm reporting it now so noone
else has to debug the issue :)
The text was updated successfully, but these errors were encountered: