[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] measuring uC supply voltage
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] measuring uC supply voltage |
Date: |
Mon, 25 Oct 2004 09:52:18 +0200 (MET DST) |
JAMIE MORKEN <address@hidden> wrote:
> I am trying to figure out the best way to measure the 5V supply
> voltage for an atmega128. I am using the 5V supply as the ADC
> reference voltage.
Why don't you just reverse the logic? Keep Vcc as the reference
voltage, and use ADMUX == 0x1e to measure the 1.22 V bandgap
reference. As your actual reference (Vcc) voltage varies, you'll get
a different ADC readout for the internal bandgap ref. That way, you
could calculate that one back to the actual Vcc level.
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/