I get a bad server request error 400 everytime I try to post in the AVR forum. So I am posting my question in here. Moderators, please move this to the AVR forum.
< Done; Plons >
I am measuring a voltage on an ADC pin on my M328P AVR at 8MHz.
I have attached my code, I think the browser kept rejecting my post because of something in the code.
This is the relevant part of the code. I am measuring a diode drop for certain pins of an IC. Each timer pulse is 500 ms. When I increment PORTC, I am selecting the particular MUX line that will complete the path to GND for the ADC input (basically switch GND). I have a pull up on the ADC input pin to 5V to set the current.
I set a flag in my timer interrupt and display the value through an RS232 connection to my PC.
I am also waiting 100 ms before every ADC conversion.
My problem is some pins read voltages that are very close to GND. (about 50 - 100 mV above GND) and the ADC is reading them as 0V.
I would like the ADC to measure this low voltage and report it back to my PC.
How can I achieve this? Is this because I may be sampling the ADC input at the wrong time? I do the MUX GND switching before the ADC read but maybe this timing is critical?