Hi there,
I’m thinking about designing a motor driver for a 63100 BLDC motor
- 63mm diameter
- 103mm long excl. shaft
- 60V max
- 100A max
- 0.031Ohm winding resistance
- 100 Kv
I’m looking at the STM32G431 together with a TI DRV8323RH (3-ch 60V half-bridge gate driver with 3 integrated current shunt amplifiers) driving some pretty beefy MOSFETs.
Because of the high currents involved, I’d like to have a thermistor near the power FETs and one on the motor casing to monitor to ensure it doesn’t burn up. Same goes for monitoring supply voltage.
Reading the docs and the discussions on the forum, using analogRead() re-initializes the ADC on every call and thus takes 60µs, which would mess up the current control loop if the pin your’re trying to read is on the same ADC.
Is there a way to work effectively with ADCs with STM32duino? Or a way to force the current sense channels to ADC1 and the misc stuff to ADC2? Or am I missing the point completely?
kind regards,

I don't know about DRV8323 but if you using stm32 mcu, I recommend use stm32cudeide. If you can handle DMA with adc, you can use these data without cpu usage. its only have 32bit mcu as i know. You can read this article on the internet. cheers !
– flashgift80How does that work with simpleFOC? I am under the impression that simpleFOC is an Arduino library (for the Arduino IDE / environment). Does it also work as a library for STM32CubeIDE?
– WaffolI didn't use simpleFOC now. I make my own driver this time.. Just use SimpleFOC first time and check the problem is best way to fast one. And then implement detail code at low side code by your hand.
– flashgift80I guess you're right. I can always try my own code if simpleFOC doens't work out for me. Let's hope it does work out, because I'm not great at writing code >.<"
– WaffolYou can write your own ADC setup for SimpleFOC if you want. Just override the hardware-specific functions _configureADCLowSide and _readADCVoltageLowSide. Add
– dekutree64__attribute__((weak))before the originals so they'll have lower priority in linking. I have a custom I2C setup using DMA as well. I hate the HAL library, but STM did a great job with the #defines and structs for direct register access. They're in packages\STMicroelectronics\hardware\stm32\2.3.0\system\Drivers\CMSIS\Device\ST\STM32G4xx\Include\stm32g431xx.h