2010-12-10 05:59 AM
How to wire ADC inputs ?
2011-05-17 05:18 AM
I am not certain what help you are asking for.
STM32F10x parts have internal ADC multiplexing, so there is little need for documentation on how to connect an external analogue multiplexor. Put another way, the ADC pins on every STM32F device package are multipexed. So by looking at the datasheet for a device, for example http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00161566.pdf There is a table in every STM32F10x datasheet, in this case ''Table 5. Medium-density STM32F103xx pin definitions'' starting on page 27, which shows the pin numbers for every available ADC input, on every package. For example ADC12_IN10 is on pin 8 for LQFP64, and 15 for LQFP100. Software chooses how to configure the pin to be used as an ADC input, and which ADC to connect to it.2011-05-17 05:18 AM
Hi bulmer.g
I understand that the pins are multiplexed on the MCU, but how to you connect your 2 or 3 (depending on the pin) analog signals coming from the real world to a single MCU pin ? That's what I don't figure out. As you say, ADC12_IN10 must be connected to 2 real world signals. Let's call them fuel pressure and oil pressure. How do you do that ? You need an external component to connect fuel pressure and oil pressure to that specific MCU pin, don't you ? And you need to sync that component with the software to make sure you have the fuel pressure or oil pressure on that pin when the expected ADC channel is doing its conversion ?2011-05-17 05:18 AM
No you don't use an external multiplexer. The multiplexer is inside the MCU.You connect your inputs to separate pins on the MCU (depending on which MCU you are using) and the rest is just a matter of software ;) E.g your fuel pressure could connect to ACD12_IN1 and oil pressure could connect to ADC_IN2.
2011-05-17 05:18 AM
That's ok if you don't need all the ADC channels available on the MCU. If you need all the channels you have a problem because there are less ADC input pins that the number of ADC channels. Or is there something trivial that I am missing ?
2011-05-17 05:18 AM
Yes I think you or we are missing something. Pretty sure there are only 1, 2 or 3 (chip dependant) ADCs which have many more pins that can be used to connect to them.
Are you saying that you need more ADC inputs than the number of ADC pins available on the chip? If so then yes you would have to further multiplex externally with an analogue multiplexer. Just use a few IO pins to drive the multiplexer (pretty simple).2011-05-17 05:18 AM
We have those pins :
ADC123_IN0 to ADC123_IN3 : 4 pins ADC12_IN4 to ADC12_IN9 : 6 pins ADC3_IN4 to ADC3_IN8 : 5 pins ADC123_IN10 to ADC123_IN13 : 4 pins ADC12_IN14 to ADC12_IN15 : 2 pins ========= Total 21 pins There are 21 external pins for ADC, and that's it. The names are misleading if you don't go to the reference manual, because you expect to have 3 sets of 16 channels ADC1_IN0..15, ADC2_IN0..15 and ADC3_IN0..15, but this is not the case. For some reason some pins are connected to several ADCs, such as ADC1, ADC2 and/or ADC3, but the fact is that there are 21 pins. I beleive that I have to read _carefully_ the reference manual to understand how it works, and why there are more than one ADC taking care of some of the pins.2011-05-17 05:18 AM
Very useful summary. Thanks for posting.