cancel
Showing results for 
Search instead for 
Did you mean: 

How to do multiple ADC conversions if pins belonging to different ports

migmel
Senior

Hello guys,

This is a silly question, but still cannot get it right.

I want to read different values coming from sensors connected to different ports.

I know using 16 available channels for external input is very intuitive when all the inputs come from pins in the same port. But lets say I have inputs and GPIOA, pin1 and GPIOC pin1, and etc... How to set them in a multiple channel configuration? How to select the right channel for every input? It's a bit confusing for me

1 ACCEPTED SOLUTION

Accepted Solutions
KnarfB
Principal III

Pins configured as ADC channel are connected to ADC independently of GPIO (digital IO) port and pin numbers. Check the data sheet/ref. manual of your chip (which one?)

hth

KnarfB

View solution in original post

2 REPLIES 2
KnarfB
Principal III

Pins configured as ADC channel are connected to ADC independently of GPIO (digital IO) port and pin numbers. Check the data sheet/ref. manual of your chip (which one?)

hth

KnarfB

Thank you for your response.

Yes, I checked the datasheet and turns out not all ports/pins can be used as ADC input.

They are predefined for each specific MCU.

I was thinking if I use the port A, I could use all 16 pins as ADC input, but the true is I can only use PA0 to PA7 range of pins (STM32F103VCT6) which are channel 0 to 7. Then, the rest of available ADC inputs, are distributed between different ports using different channels(between 8 and 15) to sum up 16 ADC inputs