Arduino-FOC icon indicating copy to clipboard operation
Arduino-FOC copied to clipboard

[FEATURE] STM32 Generic ADC input

Open Moddingear opened this issue 10 months ago • 2 comments
trafficstars

Is your feature request related to a problem? Please describe. Right now, using any sort of current sense on STM32 hogs the corresponding ADCs. Thus, there is no way to add other sensors such as temperature, battery voltage or a simple potentiometer.

Describe the solution you'd like An API to add other sensors to be included in the DMA

Additional context I'm using the STM32 BG431-ESC1 as a test platform, with Arduino on platformio. analogRead (or any other ADC-related function) won't work.

Moddingear avatar Jan 19 '25 20:01 Moddingear

For those in the same case as me : There's a workaround builtin.

Follow this https://community.simplefoc.com/t/temperature-monitoring-on-b-g431b-esc1/2955/15, except that you should _readADCVoltageLowSide instead of _readADCVoltageInline (as inline uses analogRead). It works for all of the board's inputs

Moddingear avatar Jan 31 '25 13:01 Moddingear

We're working on a new STM32 current sense driver, and this functionality will be part of it. For the moment, the workaround you suggested will work on some boards, I think.

We can leave this issue open until we finish the new current sense driver, but it may take a while, please don't hold your breath.

runger1101001 avatar Feb 18 '25 21:02 runger1101001