low-battery detection, ADC, and ICP of mega16
2004-05-20 by jay marante
here's what i wanted to do:
first, i wanted to determine if the battery back-up supply is low on voltage output.
i had the circuit this way:
main ---------------- >| ------------
\__________________ dc-dc converter
/
battery -------------- >| ------------ * >| - diode
max battery voltage : 12V
the max639 dc-dc converter has a low-battery output(LBO) pin that goes low when the battery input(LBI) is less than the reference voltage of about 1.23V. the LBI pin is connected to the main power supply. im planning to connect the LBO pin to ICP of mega16 and the battery output to ADC input 7 of the chip. to have the battery voltage lowered to 5V before it goes in the ADC pin, i have this circuit:
battery
|
<
> 1.3 Mega ohm
<
|
|------------------- ADC7 ~ 5V as simulated in multisim
|
<
> 10ohm
<
|
GND
now, when circuit switches to the back-up battery, the LBI goes low; which in turn, switches the LBO low.
my question is:
1. will the ICP work even if timer1 is off? i won't enable the timer, only the ICP interrupt bit. i cannot use the external interrupts since i have these pins connected to other devices. i'll use this interrupt to start an ADC conversion.
2. i don't know much of the ADC of mega16. i understand the datasheet says that it can be configured to use the AVCC as the reference voltage. does this mean that the AVCC pin can be connected to VCC?
3. the datasheet also says that the there should be an external capacitor at the aref pin. what should be the capacitor value?
thanks for the help.
-jay
---------------------------------
Do you Yahoo!?
Yahoo! Domains - Claim yours for only $14.70/year