2018-01-03 01:27 PM
Hello,
I have a simple application where I need to sample a single ADC line periodically. I can use polling rather than DMA and interrupts since the timing requirements are very slow.
Anyway, I've taken an ADC sample and started to run it but I'm not getting what I would expect for the 12 bit single ended ADC reading. When the analog input line is floating, I get a value around 1700. If I tie the analog input to ground I get a value around 1700. If I tie the analog input to 3.3V I get a value of around 1700. If I tie the analog input to 5V I get a value of 4095, the top rail.
Is there some external reference wiring needed on the Nucleo board to make the ADC work?
Thanks,
Dave
#adc-pollSolved! Go to Solution.
2018-01-03 04:05 PM
Thank you all. It was my mistake. It's time to focus on something else for a while... The jumpers were on the wrong ADC pins. No wonder I wasn't getting what was expected! All is working as expected now.
2018-01-03 01:42 PM
Have you checked that your ADC is really connected to a pin. My board, not 303, CPU pins are not always connected to where I want. There is a resistor field on the board, which connects pins and CPU legs.
2018-01-03 02:32 PM
One suggestion is to review the information on pages 90 to 93 of the Datasheet. With this information you may be able to determine if the applied voltages, external resistance and ADC reference voltage are correct for your application.
A single resistor that is either in series with the signal source or in shunt to the signal source and ADC input should suffice for initial purposes. This signal path should share a common ground.
2018-01-03 04:05 PM
Thank you all. It was my mistake. It's time to focus on something else for a while... The jumpers were on the wrong ADC pins. No wonder I wasn't getting what was expected! All is working as expected now.