Firstly, the ADC uses 3 ADC clock cycles to perform it's sample and hold. You can calculate the sample and hold time by multiplying your ADC clock period by 3. Secondly, the ADC must be fed from a low impedance source - have a look at the input with your scope when your feeding it from a high impedance source, I had my voltage dropping 200mV on a 3V signal by feeding it from a too high impedance source. (Keep the loop impdance low!!) Generally when I want to measure the supply voltage in a AVR, I connect the high side of the voltage divider to a output pin, connect the center to the ADC and connect the low side to ground. That means you can control very easily without any external parts when the bulk of the current flows through your "low" impedance voltage divider, I usually use 2 * 10k resistors for the divider, but you should be able to up these values into the 100s of k without any problems. I personally wouldnt use MOHM resistors as they cause lots of problems with temperature and humidity. You change the value of a 3M3 resistor by blowing on it! <- caused a problem in one of my projects. This is an interesting topic, but in the end you need to decide what is the easiest method, generally for measuring the supply voltage you probably dont need to be VERY accurate anyway! You are usually just trying to find out whether the battery is good or low. Cheers Hein B Auckland, New Zealand. --- In AVR-Chat@yahoogroups.com, "Jim Wagner" <jim_d_wagner@...> wrote: > > On Tue, 19 Jun 2007 19:35:43 -0000 > "Dave VanHorn" <microbrix@...> wrote: > > > > > I'm still curious enough to experiment with this idea > > compared to my > > > typical OpAmp solution. > > > > It may "work" on one unit, but if you can't handle the > > leakage allowed > > in the spec without significant error, then you're in > > trouble. > > > > Remember, you have to add this error to all the other > > sources of error > > in the ADC measurement. > > > > > > > And Op-Amps have their own input "leakage". > > Jim > > --------------------------------------------------------------- > The Think Different Store > http://www.thinkdifferentstore.com/ > For All Your Mac Gear > --------------------------------------------------------------- >
Message
Re: Using the ADC to measure the battery supply?
2007-06-19 by kernels_nz
Attachments
- No local attachments were found for this message.