cancel
Showing results for 
Search instead for 
Did you mean: 

What registers on the STM32G4 correspond to CR1 and CR2 on the STM32F1 ADC?

SCook.1
Associate III

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

3 REPLIES 3

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.

SCook.1
Associate III

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.

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