2023-01-03 07:05 PM
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
Solved! Go to Solution.
2023-01-04 12:42 AM
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
2023-01-04 12:42 AM
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
2023-01-04 06:43 PM
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