What can I expect from my ATmega328 when the batteries run down?

I have an ATmega328 with DS1307 clock and 4x7-segment display on a project board. It's powered by 3xAA batteries. I'm going to run it until the power is drained and wondered what behavior I might expect when power gets low?

Will the '328 simply shutdown, or maybe bad data, scrambled display, or something else? I'm assuming no harm will come to the device.

Thanks, Jake

Assuming the brown-out fuse is set, when VCC sags below the brown-out threshold the ATmega will hold itself in RESET.

How the display or the RTC will act isn't probably as well defined.

Thanks James. I burned the "Duemilanove w/ ATmega328" bootloader onto a blank 328p myself, so if the brown-out fuse is on by default I should be OK. The RTC has the battery backup, so I'm probably OK there too. I don't really care if the display gets weird, that can be my indicator the batteries need replacing XD

I would think you need to verify the voltage at when the rtc switches to its battery and not just assume it’ll work.

Thanks. The RTC is a DS1307 and I found this in the datasheet:

UPDATE: The batteries ran down below a level that was acceptable. They lasted about 10 hours. Incorrect time digits were being intermittently displayed. So now I know.

I put in some fresh batteries and all was well. But for now I've hooked up a 5V wall-wart and am running fine. I don't think batteries are going to be a viable power option, unless it's for a quick demo when I don't have access to AC power.

I wanted to add that BOD is not as simple as "on" or "off" and has multiple levels that it can be set for. In order to determine whether you're going to get rogue instruction execution you need to make sure your clock speed matches your BOD setting. For example, you can set a BOD of 1.8V if you're running 2Mhz or less. You'll want a BOD of 2.7V for 8Mhz and 4.3V for 16Mhz+. Double-check those exact numbers with the datasheet.

If you choose a BOD setting too low for your given clock speed you'll indeed get incorrect/rogue execution of instructions at some point. Is it possible you are using the default BOD of 2.7V and 16Mhz? That would explain the instability. If you can slow the clock down you can run reliably at lower voltages. The best option considering the needs of your RTC seems to be BOD of 2.7V and 8Mhz. Try that.

More or less on topic question -

I have two Arduino's running from batteries, one uses a crystal and the other a resonator - I assume that the clock of the cyrstal Arduino will not slow down with a falling battery voltage, how about the resonator ?

Duane B