Trying to find reason for reset on T25

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

I'm working on a project with a Tiny25 and having some trouble trying to determine if the most recent reset was from the BOD or POR. Testing the MCUSR register bits and turning on an led has not been working. ie. the led stays dark so bit is not set as expected.
Perhaps I'm not reading and resetting this register soon enough in my code, as I'm reading it after doing normal peripheral inits, like the timers and adc.

Has anyone done this, are there any tricks I'm missing?
How soon after reset do I need to check the MCUSR register for it to be valid?
I also found one has to write zeros to the bits to clear this register, unlike most register where one writes ones to clear it.

The project involves powering a t25 using a solar cell, what i'm finding is, during low light conditions the t25 resets soon after turning on a LED, as the cell does not yet have enough light on it to power the LED and the voltage sags, causing a reset. I'm trying to determine the level of the sag, is it just a BOD reset, or a deep sag POR reset.
Thanks
JC

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

JC,
I read through the data sheet parts about the POR and BOD and the only thing I can think of is the LED draws a lot more power than you expect. Maybe a stupid suggestion, but have you tried increasing the current limiting resistor on the LED so that it barely lights up? I wonder if it goes into BOD reset first, then regains power and tries to restart, reads the BODF, tries to light the LED, then everything goes out leading to a POR before you can see it? I have several suggestions that may not be worth the server space, but ...

Did you try powering just the LED with the solar cell under different lighting?

Maybe a large cap from GND to Vcc to keep the power a little more stable?

I hope nobody minds the plug here, but I have a Xprotolab and I really use it a lot. I would much prefer a full scope, but I think something like it would help you a lot. Instead of trying to light an LED you could just read the pin. And keep an eye on your Vcc level of course.

IIUC (for me that's If I Understand Correctly) the data sheet lays out how to adjust the hysteresis of the BOD levels. Maybe setting the Vbot- trigger low as possible, then the Vbot+ high as possible so that the cap is charged up and has better chance of lighting the LED without the chance of the full POR condition.

edit: just trying to reformat the outline, post looks much different than the text box.