Skip to content

Regular channel read for stm32 (while injected ADC conversion runnig)#506

Merged
askuric merged 3 commits intofeat_stm32_multiple_motorsfrom
feat_stm32_read_regular_while_injected_running
Feb 7, 2026
Merged

Regular channel read for stm32 (while injected ADC conversion runnig)#506
askuric merged 3 commits intofeat_stm32_multiple_motorsfrom
feat_stm32_read_regular_while_injected_running

Conversation

@askuric
Copy link
Member

@askuric askuric commented Jan 7, 2026

Description

This PR is an initial proposition of the reagular ADC channel reads on stm32 that

  • Is more efficient than analogRead
  • Allows reading regular ADC channels even if the Injected channles are read (ex. low-side current sesnig)

NOTE
It still uses the polling strategy, no DMA so it is still blocking and is not intended to be called to often.
On f405 boards the ADC read time is around 20us and on g4 is similar.
For reference analogRead takes about 60us+

Tested setups
Tested on f4 and g4 boards with different setups.
Did not test on other boards though, but none of the original API calls shouldn't be affected by this.

@askuric
Copy link
Member Author

askuric commented Jan 19, 2026

tested on f1 too.
It works.
The time is around 40us.
The analogRead is around 80us for f1.

@runger1101001 runger1101001 added this to the 2.4.0_Release milestone Feb 3, 2026
@askuric askuric linked an issue Feb 7, 2026 that may be closed by this pull request
@askuric
Copy link
Member Author

askuric commented Feb 7, 2026

Works on H7 as well - Nucleo h723zg
_readRegularADCVoltage takes about 3us

@askuric askuric merged commit aaf0b28 into feat_stm32_multiple_motors Feb 7, 2026
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] STM32 Generic ADC input

2 participants