Close

Boot time and BOD

A project log for MI/O

Tiny microcontroller dev board, wristwatch and timer "It's not a smart watch, it's a watch for smart people"

m-bindhammerM. Bindhammer 04/24/2020 at 15:010 Comments

The ATmega328P running on 8MHz needs a few seconds to boot after power is applied when using a bootloader. This is bad. The watch should show the time immediately after power-on. What to do? Using no bootloader at all on the watch's microcontroller! Programming the watch via ISP. Downside: need an Arduino Pro Mini or similar as a programmer and code upload is slow.

Here is my experiment setup. Without bootloader time/date is nearly shown without delay after power-up:

Seems also, according to the datasheet, the operating voltage for the ATmega328P is now only 2.7 to 5.5V, not starting at 1.8V anymore. The extended fuse can only be set to disable the BOD (0xFF), 2.7V (0xFD) or 4.3V (0xFC).

Note, the extended fuse only uses the lower 3 bits. Unused fuse bits read back as 1.

0xFE (110), before the setting for 1.8V, is now reserved. Let's see, if I disable the BOD. The 128 x 32 OLED  (I removed the voltage regulator on its breakout board) would still run at 2V. On the other hand, a watch should be a reliable device. Using BOD, the watch will execute brown-out resets when the battery voltage dips below the brownout threshold, typically 2.7V (min. 2.5V, max. 2.9V). This restarts the code, which restarts the display, causing another brown-out…repeating until the battery is dead. Without BOD the ATmega328P will start to behave erratically at some point, and may spontaneously jump to any random memory location. Also not good. Could be that the code become corrupted, means, we would need to re-flash the watch. Not good at all.

I need to do some more testing. Finally, I also could use rechargeable LIR-2032 instead of CR2032. They have a rated voltage of 3.6V, lower capacity though (approx. 45mAh).

Discussions