8mhz optiboot -- tearing my hair out!

Hi.

Hopefully this is a straightforward question. I've got an 8Mhz application that needs to run on batteries/solar for years so it utilizes sleep. This is all designed and working like a charm but susceptible to having code stuck due to a component brown-out. I'd prefer to set up the watchdog to reset the arduino if something browned out and it's stuck in code.

So watchdog reset (WDE) is broken on the normal bootloader, so then i need to use the optiboot. I saw on the optiboot site there's a "optiboot_atmega328_pro_8MHz.hex"

few questions on that bootloader:

  1. will sleep functionality still work? I'm using a watch dog time based interrupt to wake it up from sleep. Currently my microcontroller + radio + regulation sleeps at 26uA (with brown out enabled)

  2. anyone know what speed it uploads the code at? is it 57600 or 115200? remember 8mhz crystal

  3. will the arduino still work down to 2.7ish volts? I'm pretty sure this is a yes since to my knowlege only the crystal and brown out settings determine that

Very sorry that i haven't just tried it myself before asking. I've been reading atmel datasheet for so long then looked at other's example code to do a watchdog full system reset... tearing my hair out because the bootloader just goes into an endless reset, then found out about optiboot and found that 8mhz version. My application isn't easy to get to at the moment and i don't have an 8mhz arduino handy at the moment

Why do you NEED the boatloader? If you use the chip as standalone you may program it via a programmer, possibly another Arduino with ArduinoISP sketch.

thefatmoop:

  1. will sleep functionality still work? I'm using a watch dog time based interrupt to wake it up from sleep. Currently my microcontroller + radio + regulation sleeps at 26uA (with brown out enabled)

I've been using it no problem at all with sleep mode.

  1. anyone know what speed it uploads the code at? is it 57600 or 115200? remember 8mhz crystal

Think it is still the 115200 speed.

  1. will the arduino still work down to 2.7ish volts? I'm pretty sure this is a yes since to my knowlege only the crystal and brown out settings determine that

Brown out setting plays a part, and also the frequency, at 2.7 Volt though you can go up to 10Mhz.

You also need to set the fuses, just uploading the opti bootloader will not set the right fuses usually depending on what crystal/oscillator you are using, these may want changing.

Regards

Phil

Smajdalf:
Why do you NEED the boatloader? If you use the chip as standalone you may program it via a programmer, possibly another Arduino with ArduinoISP sketch.

Yeah I'm thinking about that

Thanks for the info Phil.

Would it work to have my watchdog ISR that gets executed before restarting the micro controller disable the watchdog? Would the micro still reset?

The easiest way to put optiboot onto an 8MHz chip is to use the standard 16MHz .hex file, and adjust the boards.txt file to have the reduced clock (8MHz), baud (57600), and fuse values.