cancel
Showing results for 
Search instead for 
Did you mean: 

Low-layer driver terminology for ADC

Robert Ritchey
Associate III

Hi, I am trying to use the ADC on an STM32G030 for the first time using the low-layer drivers.  The terminology of the driver documentation has me baffled as it has nothing in common with the '030 Reference Manual (I have to say the Description of STM32G0 HAL and low-layer drivers manual is really horrible documentation, no function index, no way to find a function).  Anyway, I want to do something really simple, I have 4 channels I want to convert after a trigger, either software or hardware.  I used CubeMx to generate some code but it still doesn't make sense.  What are "Ranks"?  This term is neither defined or has any reference in the '030 Reference manual.  I have looked for some kind of example using the low-layer drivers and so far have come up empty.  Can someone point me to some documentation then is understandable to describe what these low-layer driver calls are referring to? Thanks. 

3 REPLIES 3

Well, it is what it is. If you find it baffling, well, just don't use it. Is the Reference Manual clearer? No wonder. Just stick to it.

JW

PS. "Ranks" is used throughout Cubes to denote "order of conversion within scan/sequence". In 'G0, see ADC_CHSELR; ADCs differ quite significantly between STM32 families so in other family it's a different register or set of registers, and in 'G0 "rank" has meaning only when ADC_CFGR1.CHSELRMOD=1). I have no idea whether this is formally documented anywhere, as you may've guessed I don't use the Cubes.

AScha.3
Chief II

>STM32G030 for the first time using the low-layer drivers

Why ? Using HAL you tried , with success ?

 

+

>What are "Ranks"?

Read the rm. 

ADC working on a sequence, which is started and then the adc doing its job , depending on the settings .

Yes, is not easy to understand at first, if you expect a simple "now do a conversion ADC" as in old 8bit cpus .

Here you have to read and understand first, how this thing works. And on G0 its just about 40 pages to read...come on, look at a H7 adc , about 80 pages . 🙂

+

>point me to some documentation

see on STM , for this series or in general, a lot of ANxxx etc.

https://www.st.com/en/microcontrollers-microprocessors/stm32g030j6.html#documentation

ie

https://www.st.com/resource/en/application_note/an2834-how-to-optimize-the-adc-accuracy-in-the-stm32-mcus-stmicroelectronics.pdf

+

and look at some nice examples, how to use such a cpu , see here:

https://github.com/parezj/EMBO

 

If you feel a post has answered your question, please click "Accept as Solution".

Well, yes, I do plan to write my own routines at this point.  I have used the LL for about 6-7 years now with no issues until I came across the ADC.  No, "rank" is not documented anywhere I could find, I searched for "rank" in the RM and the HAL/LL document, and it is not explained anywhere.  Thanks.