Connect with us

atmega16 adc question

Discussion in 'Electronic Design' started by Mark X, Nov 9, 2005.

Scroll to continue with content
  1. Mark X

    Mark X Guest

    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.

  2. PeteS

    PeteS Guest

    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


  3. Mark X

    Mark X Guest

    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).

  4. Bob Monsen

    Bob Monsen Guest

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

    Bob Monsen

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

    PeteS Guest

    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

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


  6. Mark X

    Mark X Guest

    Thanks, Pete - I appreciate the input!

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day