tiny26 just about to brownout but hangs

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone again.
Here I am with a little problem.
I'm using a tiny26 for a battery charger.
It's powered on 5V though a HT7550 reg., brown out enabled and watchdog running.

It has a LED which is connected directly to a port's pin (no current limiting resistor). I turn it on a few msecs every second, to show battery status.

Everything works fine, except that when it's being powered by the battery and voltage isn't high enough. It seems to be that when the LED is turned on, it draws so much current that VCC goes down to 4.1V. It stays there forever until I remove power or increase battery voltage.
No WDT reset, No brownout, since brownout level is set to 4.0V.

I know, maybe I shouldn't connect the LED directly to the AVR, but is there any way to reset the uP when this happens (even thou it will hang again presumably).
I don't want to add a current-limiting resistor because it would make the LED less shiny.

I thought adding a HT7044A and connect its output to the AVR reset pin through a 10K resistor to VCC. That way it would act as a brown out detector when VCC goes below 4.4V.

Oh just, by the way, to reduce power consumption I'm using the WDT as a timer, since all I have to do is check some analog data and show status on a led.. then wait 500ms and do it again. So now all I do is that and then go into powerdown mode, to get woken up by the WDT.
I don't think current could be reduced by using the other sleep modes, not mentioning that the only one I can use is the IDLE one, since the rest of them wouldn't let me wake up from a timer overflow or capture interrupt.

maybe external components, but that would increase price also.

thanks to all again,

---edit start ---
btw, when it hangs, the LED stays on, just as if it hanged a few instructions after executing the sbi one. Clearly the AVR's clock got halted when VCC got down when turning the LED on.
--- edit end ---

Carlos

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

just a thought-

If you want the brownout to actually happen, maybe some kind of diode between the 5v reg and tiny26 vcc to get the voltage down a bit so it will drop below the brownout when the led lights.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

curt,
that's a nice workaround, I'll give it a try to see how it behaves, but that would change my Vref too, and I need it to be quite precise in order to be able to compare voltages at the ADC's input.
Maybe getting a 4.4V regulator

It's still strange the way it hangs, since the watchdog should run.. probably the voltage drop screws up all on-chip oscillators. Oh, btw, I'm using the 1MHZ internal RC oscillator. Maybe an external osc. wouldn't be stopped by this condition.

thanks for the tip!

Carlos

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When turning on the [apparently] high-powered LED, with no current-limiting precautions, and insufficient power supply capacity, there is probably a dip in the supply voltage below the steady-state 4.1V.

I propose that your AVR actually >>is<< in brown-out reset, and that the brown-out hysteresis is preventing it from coming out of it.

Now, why the LED is still on...

Why stress your AVR like that? A glance at the Pin Driver Strength chart indicates that a .9V drop on a 5V output PIN indicates a 40mA ("Absolute maximum Rating") load. Who knows what the pin is drawing when >>Vcc<< drops .9V?!?

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lee,
I also thought it was in brown reset, but I checked it wasn't by using the corresponding bit in the MCUSR register.
About over-stressing the AVR, I used a 70ohm resistor in series with the LED to do some tests. It still hangs.

Results are LED current is 7mA.

I don't care if the AVR resets or hangs, but it shouldn't draw so much power.
However, now that i think of it, if it holds the reset line or waits in brown-out, current consumption will be an important issue right? (by looking at the datasheet).

thanks
Carlos

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I also thought it was in brown reset, but I checked it wasn't by using the corresponding bit in the MCUSR register.

That can be misleading in your case, right? You have to kill power to get it back and then it will show up as a power-on reset. (Think about it--whenever you kill power brown-out gets triggered first.)

If it actually >>was<< in brown-out reset then the pins would go to high-impedance (floating) inputs. Is there another part of your circuitry that would run away at that point?

It might be interesting to put an ammeter on the regulator output to see the current draw when the latchup happens. The HT7550 datasheet doesn't have a chart of output voltage vs. load, but it is a 100mA device that should have about a 0.1V droop at 70mA. Given your much larger droop it almost sounds like a virtual short-circuit somewhere.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can measure 9.8mA at the regulator's input and 8.3mA flowing through the LED. (the previous measurement was not precise, this one is).

I did some more test, and it's definitely not going into brown out reset.

I will do some more test tomorrow with the 4.4V voltage detector.

Thanks

carlos