cancel
Showing results for 
Search instead for 
Did you mean: 

Where can I find doc on STM32f103 ADC channel numbers ?

Frederic Cloth
Associate III

Hi,

I am writing code for the STM32f103 involving ADC conversion.

I understand you have to select a list of "channels" you want to be converted and put them either in a regular or injected list. These lists are contained in the ADC_SQRx (or ADC_JSQR for injected) registers.

I am using for this the reference manual RM0008 rev 20.

I presume each "channel" is connected to a given pin (say PA0, PA1,... provided they are configured as analogue input of course) or some internal signal (Vcc,Temperature).

The problem I have is that I find nowhere the list of channel numbers and what they are connected to, which render impossible the task of reading any analogue input.

Can somebody help on this and point me to the right direction ?

Where can I find documentation on channel numbers for STM32f103 ?

1 ACCEPTED SOLUTION

Accepted Solutions

The Data Sheet for your specific part. There will be a pin enumeration like ADC12_CH5, which is CH5 pin ADC1 and ADC2

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

4 REPLIES 4

The Data Sheet for your specific part. There will be a pin enumeration like ADC12_CH5, which is CH5 pin ADC1 and ADC2

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Frederic Cloth
Associate III

Thank you very much. That indeed was where the information was hidden :-))

for the sake of future readers, here is what comes out:

For STM32F103RB (and all chips STM32F103x8 or STM32F103xB)

00000 channel 00 of ADC1 and ADC2 ---> PA0

00001 channel 01 of ADC1 and ADC2 ---> PA1

00010 channel 02 of ADC1 and ADC2 ---> PA2

00011 channel 03 of ADC1 and ADC2 ---> PA3

00100 channel 04 of ADC1 and ADC2 ---> PA4

00101 channel 05 of ADC1 and ADC2 ---> PA5

00110 channel 06 of ADC1 and ADC2 ---> PA6

00111 channel 07 of ADC1 and ADC2 ---> PA7

01000 channel 08 of ADC1 and ADC2 ---> PB0

01001 channel 09 of ADC1 and ADC2 ---> PB1

01010 channel 10 of ADC1 and ADC2 ---> PC0

01011 channel 11 of ADC1 and ADC2 ---> PC1

01100 channel 12 of ADC1 and ADC2 ---> PC2

01101 channel 13 of ADC1 and ADC2 ---> PC3

01110 channel 14 of ADC1 and ADC2 ---> PC4

01111 channel 15 of ADC1 and ADC2 ---> PC5

10000 channel 16 of ADC1          ---> temperature sensor

10000 channel 16 of         ADC2 ---> Vss

10001 channel 17 of ADC1          ---> temperature sensor

10001 channel 17 of         ADC2 ---> Vss

There is no ADC3.

Frederic Cloth
Associate III

An for those who uses the evaluation board with the Arduino connector,

here is the cheat :)

00000 channel 00 of ADC1 and ADC2 ---> PA0 ---> Arduino A0

00001 channel 01 of ADC1 and ADC2 ---> PA1 ---> Arduino A1

00010 channel 02 of ADC1 and ADC2 ---> PA2 ---> Arduino D1

00011 channel 03 of ADC1 and ADC2 ---> PA3 ---> Arduino D0

00100 channel 04 of ADC1 and ADC2 ---> PA4 ---> Arduino A2

00101 channel 05 of ADC1 and ADC2 ---> PA5 ---> Arduino D13

00110 channel 06 of ADC1 and ADC2 ---> PA6 ---> Arduino D12

00111 channel 07 of ADC1 and ADC2 ---> PA7 ---> Arduino D11

01000 channel 08 of ADC1 and ADC2 ---> PB0 ---> Arduino A3

01001 channel 09 of ADC1 and ADC2 ---> PB1

01010 channel 10 of ADC1 and ADC2 ---> PC0 ---> Arduino A5

01011 channel 11 of ADC1 and ADC2 ---> PC1 ---> Arduino A4

01100 channel 12 of ADC1 and ADC2 ---> PC2

01101 channel 13 of ADC1 and ADC2 ---> PC3

01110 channel 14 of ADC1 and ADC2 ---> PC4

01111 channel 15 of ADC1 and ADC2 ---> PC5

10000 channel 16 of ADC1          ---> temperature sensor

10000 channel 16 of         ADC2 ---> Vss

10001 channel 17 of ADC1          ---> temperature sensor

10001 channel 17 of         ADC2 ---> Vss

Snorelax
Associate

Thank you @Frederic Cloth​