2022-05-31 08:03 AM
I'm trying to convert 'baremetal' code from the STM32F103 to the STM32G431. I've managed to sort out the GPIO and EXTI stuff, but the ADC is confusing! To start off, what registers on the G4 correspond to CR1 and CR2 on the F1 ADC?
Solved! Go to Solution.
2022-05-31 12:26 PM
ADC is the peripheral which varies the most between STM32 families. Given 'F1xx and 'G4xx are on the opposing ends of some 12 years of development, with a dozen of steps in between, I am afraid there's no straighforward mapping between the registers.
In other words, you are probably at or close to the starting point with the 'G4 ADC.
JW
PS. There's a 'G4-ADC-specific appnote out there AN5346 but it deals with the hardware aspects, not software/registers.
2022-05-31 12:26 PM
ADC is the peripheral which varies the most between STM32 families. Given 'F1xx and 'G4xx are on the opposing ends of some 12 years of development, with a dozen of steps in between, I am afraid there's no straighforward mapping between the registers.
In other words, you are probably at or close to the starting point with the 'G4 ADC.
JW
PS. There's a 'G4-ADC-specific appnote out there AN5346 but it deals with the hardware aspects, not software/registers.
2022-06-01 02:34 AM
Thank you for your answer, even if it wasn't what I was hoping to hear :) I've decided to try using CubeMX to generate the ADC initialisation code and see if I can work it out from there.
2022-06-03 02:40 AM
I personally prefer reading the RM first, hacking through the cubisms as last resort. ADC used to be described quite concisely in the RMs, even if they are incredibly complex and certainly have their quirks.
JW