Atmega328P problems vcc voltage drop

Hello

Working on a project with a standalone Atmega328P running at 8mhz (external resonator 0.5%) at 2.8V. I have disabled the internal BOD and use an external voltage supervisor instead that pulls the reset pin low when vcc goes below 2.6V.

I have a rather large cap on the input so the vcc falls slow (0.5V/s) but I have checked the reset pin and it is a clean low when triggered so it doesn't jump up and down.

The problem is that the microcontroller don't seems to "shutdown" properly in this setup. It seems to mess with millis() and other things like random eeprom writes...

If I use the same voltage supervisor but with a 2.7V threshold or use the internal 2.7V BOD the problem goes away but I cannot have the threshold set to 2.7V as it is to close of a tolerance to 2.8V.

I have also tried removing the voltage supervisor with the BOD still disabled and noticed that around the 2.6V I get the same problems.

From what I understand the Atmega328P will run at 8mhz down to approx 2.5V so cutting of at 2.6V shouldn't be a problem with that.

Any thoughts on this would be highly appriciated.

Best regards

Got me stumped. The stuff you did seems correct per the datasheet.
If no better suggestions come up, try contacting Atmel tech support.
http://www.atmel.com/design-support/
Select "Open a support case"

8 MHz requires a minimum of 2.4V according to the datasheet. What are you exact fuse settings?

What is your code doing before the shutdown? I don't know what "mess with millis" means.

Use a detection circuit consisting of a comparator with hysterisis, that is, output goes LOW (reset triggered) for V <a (…whatever you want), and comes HIGH at a+100mV (for example). This way ignore “glitch” reset conditions that dont allow processor to completely “reset”

demkat1:
Use a detection circuit consisting of a comparator with hysterisis, that is, output goes LOW (reset triggered) for V <a (…whatever you want), and comes HIGH at a+100mV (for example). This way ignore “glitch” reset conditions that dont allow processor to completely “reset”

I would hope the external voltage supervisor would already have hysteresis. It wouldn’t be very good if it didn’t.

CrossRoads:
Got me stumped. The stuff you did seems correct per the datasheet.
If no better suggestions come up, try contacting Atmel tech support.
http://www.atmel.com/design-support/
Select “Open a support case”

Yeah me too but I am a rookie so sure I have messed something up :slight_smile:

Jiggy-Ninja:
8 MHz requires a minimum of 2.4V according to the datasheet. What are you exact fuse settings?

What is your code doing before the shutdown? I don’t know what “mess with millis” means.

fuses: -U lfuse:w:0xff:m -U hfuse:w:0xde:m -U efuse:w:0xff:m

I haven´t had the time to debug this properly yet but it could be a software problem maybe or some other hardware issue. The code that got me noticing it is I have a function that compares to millis (feeding the watchdog) and if it is to far inbetween feeds it serial prints an error and it does just that when vcc goes around 2.6V and what is wierd is that it is no problem at all if I use the supervisor with 2.7V threshold. Also I have had some random eeprom write occasionally but they could also be not related.

Otherwise plenty of SRAM left etc.

demkat1:
Use a detection circuit consisting of a comparator with hysterisis, that is, output goes LOW (reset triggered) for V <a (…whatever you want), and comes HIGH at a+100mV (for example). This way ignore “glitch” reset conditions that dont allow processor to completely “reset”

Jiggy-Ninja:
I would hope the external voltage supervisor would already have hysteresis. It wouldn’t be very good if it didn’t.

Yepp the supervisor has hysteresis and double checked the rst pin and it is a clean low with no jumping.

When I have time I will try and debug more properly and let you know.

Thanks

I ran a loop with a counter over 500mS

One of my 8MHz chips counted 29140 loops and a standard 16MHz counted 58881. Just to be sure I put a logic analyser over the loop and checked the time interval was 500mS on each - which it was.

How big a grumpy face can you put on an emoji?