cancel
Showing results for 
Search instead for 
Did you mean: 

Analog input ADC, STM32F103, newbie question

tescaflown
Associate II
Posted on June 11, 2015 at 02:00

hello,

I'm discovering how the analog works input in STM32F103. There is something I still didn't find in the datasheet.

I understood all the mode and register configuration, but where is the information to know with wich port is linked to wich ADCx?

For exemple, I need to fullfil the ADCx->SQRx with each number channel I want convert. But where can I find the information that ADCx_INx is Portx?

Is ADC1 is ¨PORTA and ADC2 is PORTB?

Thanks,

4 REPLIES 4
Posted on June 11, 2015 at 02:36

In the datasheet you look for things like ADC123_IN8 or ADC3_IN9, I made those up, the ADC digits would refer to which units they work on, INx is the channel#

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
tescaflown
Associate II
Posted on June 11, 2015 at 03:25

hello,

I'm sorry but I do not understand you.

I have the STM32F103 LQFP64 pins. So I have ADC1 and ADC2 and physically, I have pins PAx, PBx (x=0-15)

You said ''the ADC digits would refer to which units they work on, INx is the channel#''

I'm ok about that, but for example IN3 is which physically pin (and which ADC)?

or with another words, when I configure :

GPIOA->CRL to have PA0 as analog input, how I know which ADCx and which INx channel is?

I miss something easy and surely trivial but that's what I don't understand.

Can you help me to make clear my mind?

Thanks

tescaflown
Associate II
Posted on June 11, 2015 at 06:46

I finnaly got it. It's in device datasheet, there is alternative name on some pin where we can find the ADCxINx pin.

I knew that it was silly question, sorry.

Chris1
Senior III
Posted on June 11, 2015 at 15:07

Incidentally, ''ADC123_INx'' means that a pin can be connected to any of the the three ADCs, ADC12_INx means that the pin can connect to ADC1 and / or ADC2, but not ADC3.  Similarly, ADC3_INx connects only to ADC3.