Skip to content
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

Fix for ADC timing for NUCLEO-WL55JC (STM32WLxx) #1766

Merged
merged 1 commit into from
Jul 20, 2022
Merged

Fix for ADC timing for NUCLEO-WL55JC (STM32WLxx) #1766

merged 1 commit into from
Jul 20, 2022

Conversation

0x657373656C6C
Copy link
Contributor

This PR fixes/implements the following bugs/features

  • Bug

Motivation

When using the STM32Examples (internal channels) sketch to read the internal ADC values from the NUCLEO-WL55JC (STM32WLxx) the following is observed:

VRef(mv)= 3223 Temp(°C)= -92 Vbat(mv)= 598 A0(mv)= 0
VRef(mv)= 3274 Temp(°C)= -88 Vbat(mv)= 606 A0(mv)= 0
VRef(mv)= 3223 Temp(°C)= -91 Vbat(mv)= 597 A0(mv)= 0

Note that VRef is a little on the low side for USB power and that Temp provides an implausible and erroneous negative number. Vbat is also somewhat questionable.

With the small fix applied the following is observed:

VRef(mv)= 3308 Temp(°C)= 28 Vbat(mv)= 1109 A0(mv)= 0
VRef(mv)= 3310 Temp(°C)= 28 Vbat(mv)= 1110 A0(mv)= 0
VRef(mv)= 3313 Temp(°C)= 29 Vbat(mv)= 1110 A0(mv)= 0

Note that VRef reads more or less correct and that Temp presents a value more aligned with ambient room temperature. Vbat also appears more realistic.

Validation

  • Tested on NUCLEO-WL55JC

@fpistm fpistm added bug 🐛 Something isn't working fix 🩹 Bug fix labels Jul 20, 2022
@fpistm fpistm added this to the 2.3.1/2.4.0 milestone Jul 20, 2022
@fpistm fpistm self-requested a review July 20, 2022 08:01
@fpistm
Copy link
Member

fpistm commented Jul 20, 2022

Hi @yourapiexpert
Thanks for the fix. Good catch. 😉

@fpistm fpistm merged commit 251b502 into stm32duino:main Jul 20, 2022
fpistm added a commit that referenced this pull request Jul 21, 2022
Complete the PR #1766

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
cparata pushed a commit to cparata/Arduino_Core_STM32 that referenced this pull request Jan 31, 2023
Complete the PR stm32duino#1766

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working fix 🩹 Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants