Maker Pro
Maker Pro

atmega16 adc question

M

Mark X

Jan 1, 1970
0
I'm working on a project using an Atmega16 mcu. It's adc is being used to
measure the battery voltage via a divider. A potential problem is that when
the board is switched on there is a short time that the voltage is applied
to the adc pin before the switching power supply brings the mcu up. My
question is whether this is a problem, and if so how to solve it. Thanks for
your assistance.

Mark
 
P

PeteS

Jan 1, 1970
0
The data sheet is clear that inputs should not exceed Vcc + 0.5V.

There are two things

1. As you are feeding the input from a divider, you are simply current
limiting the input drain through the input protection diode, which
should be ok for small currents (what are the divider values/battery
voltage?), which leads to:

2. You are draining the battery through the measurement circuitry while
the equipment is off. The drain is, quite simply Vbatt - 0.5V/ (R div)
where 0.5V is a typical forward bias voltage at low currents for the
input protection diode and Rdiv is the value of the resistor from the
battery to the ADC input.

So is it a problem? Electrically to the controller, probably not, but
if the battery is always connected it will discharge faster than you
expect.

Cheers

PeteS
 
M

Mark X

Jan 1, 1970
0
PeteS said:
The data sheet is clear that inputs should not exceed Vcc + 0.5V.

There are two things

1. As you are feeding the input from a divider, you are simply current
limiting the input drain through the input protection diode, which
should be ok for small currents (what are the divider values/battery
voltage?), which leads to:

2. You are draining the battery through the measurement circuitry while
the equipment is off. The drain is, quite simply Vbatt - 0.5V/ (R div)
where 0.5V is a typical forward bias voltage at low currents for the
input protection diode and Rdiv is the value of the resistor from the
battery to the ADC input.

So is it a problem? Electrically to the controller, probably not, but
if the battery is always connected it will discharge faster than you
expect.

Cheers

PeteS
Sorry, but I really didn't describe the circuit fully - there is a pmos
switch between the battery and the switcher. Pressing a pushbutton switch
turns the pmos switch on, and as soon as the mcu comes up, it latches it on
via a diode. The battery voltage is read from a point after the pmos switch,
so it isn't draining the battery. The divider is a 15K and a 4.99K - the
input voltage is 10-18 vdc (sometimes battery, sometimes wall wart).

Mark
 
B

Bob Monsen

Jan 1, 1970
0
I'm working on a project using an Atmega16 mcu. It's adc is being used to
measure the battery voltage via a divider. A potential problem is that when ^^^^^^^^^ nyuck...
the board is switched on there is a short time that the voltage is applied
to the adc pin before the switching power supply brings the mcu up. My
question is whether this is a problem, and if so how to solve it. Thanks for
your assistance.

How about a schottky diode from the ADC input to the VCC pin.

---
Regards,
Bob Monsen

Nature does not at once disclose all Her mysteries.
- Lucius Seneca (Roman philosopher)
 
P

PeteS

Jan 1, 1970
0
Assuming you are feeding the battery to the ADC channel via the 15k, (
I assume the battery is effectively paralleled on the main supply for
this) then 18V/15k ~ 1.2mA into the pin while still powered down, which
is for the order of tens of milliseconds, one would think. All that
current is flowing through the input protection diode(s) when powered
down.

I wouldn't personally think that should give you any trouble on the
MCU.

Cheers

PeteS
 
M

Mark X

Jan 1, 1970
0
PeteS said:
Assuming you are feeding the battery to the ADC channel via the 15k, (
I assume the battery is effectively paralleled on the main supply for
this) then 18V/15k ~ 1.2mA into the pin while still powered down, which
is for the order of tens of milliseconds, one would think. All that
current is flowing through the input protection diode(s) when powered
down.

I wouldn't personally think that should give you any trouble on the
MCU.

Cheers

PeteS
Thanks, Pete - I appreciate the input!

Mark
 
Top