-
Notifications
You must be signed in to change notification settings - Fork 1
VREF-olutionary: VREF support/instantiation for ADCs #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good! I just see a quick code removal in one of the samples.
EvanHughes-dev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good. There's just two comments (really the same comment) that needs clarification.
mjh9585
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small comments.
EvanHughes-dev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add configurable VREF voltage support to the ADC system for improved measurement accuracy.
The ADC bases its voltage calculations from the VREF pin on the STM32F302R8, but the ADC hardware doesn't implicitly know what the actual voltage at VREF is. Previously, the system assumed a hardcoded 3.3V reference, which could lead to inaccurate voltage readings when using different reference voltages.
This PR adds
setVref(float vref)andgetVref()methods to the ADC interface, enabling accurate measurements with various reference voltages (1.8V, 3.3V, 5.0V, etc.). The implementation replaces hardcoded VREF values with configurable runtime settings in both STM32F3xx and F4xx platforms.And do not fret, the default will always be 3.3V so old ADC code will not break