Anik96 1 Posted February 18, 2018 Share Posted February 18, 2018 When using analog read function, ADC never gives 0 value even when it is directly connected to the ground. But when I connect it to 3.3V it gives constant 4095 value. What is the problem? Quote Link to post Share on other sites
Rei Vilo 695 Posted February 18, 2018 Share Posted February 18, 2018 Please have a look at What Information to Provide When Asking for Help so others can help you. Quote Link to post Share on other sites
Anik96 1 Posted February 18, 2018 Author Share Posted February 18, 2018 I am using TM4C123GXL launchpad ....MCU TM4C123GH6PM.... when I am trying to read ADC value using analogRead() it is fluctuating very much....even if I directly connect it to the GND pin it is giving random value between 0 to 50( 50*0.8mV = 40mV). Quote Link to post Share on other sites
dubnet 238 Posted February 19, 2018 Share Posted February 19, 2018 Sounds like noise. How is the ADC input physically connected to ground? If it is a long jumper wire you may want to shorten it as much as possible. A long jumper wire will act as an antenna, picking up noise from the digital clocks on your board. Another thing you can try is placing a small capacitor right at the ADC pin to ground. Quote Link to post Share on other sites
Anik96 1 Posted February 19, 2018 Author Share Posted February 19, 2018 9 hours ago, dubnet said: Sounds like noise. How is the ADC input physically connected to ground? If it is a long jumper wire you may want to shorten it as much as possible. A long jumper wire will act as an antenna, picking up noise from the digital clocks on your board. Another thing you can try is placing a small capacitor right at the ADC pin to ground. May be it is noise but not external.... cuz if i use internal Pulldown resistor , I am getting the same result. But If I connect it to 3.3V ....I am getting almost constant 4095 value. I have also tried using hardware avg and dither enable. When using hardware avg it is taking avg over the noise and thus giving a value between 10 to 15. But I need 0 output when connected to GND. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.