Pro Mini 3.3V vs. Optiboot

I have a number of Arduino Pro Minis with Atmega328 in two flavours: 3.3V @8MHz and 5V @16MHz.

Upgrading the 5V Pro Minis to Optiboot via AVR ISP MkII has worked nice, maybe with the small flaw that the Optiboot board options want them to be selected as Duemilanoves. Nothing serious, as the specifications are basically the same and things seem to work alright.

However, when a 3.3V Pro Mini is upgraded with Optiboot, it won't accept any sketches through the Arduino IDE anymore. Some blinkage of the TX LED on the FTDI board, then timeout. If I go back to the non-Optiboot loader, it programs fine again. I have reproduced this multiple times, back and forth, with two 3.3V Pro Minis. (I only have one FTDI board, though.)

Any suggestions on this? Have I hit a bug in Optiboot?

-martin

The bootloader you're using is designed to run at 16 MHz. On an 8 MHz processor, it runs at "half speed". Basically, this means the baud rate is cut in half.

You can either: find an Optiboot built for 8 MHz; build an Optiboot for 8 MHz; create an entry in boards.txt with the baud rate cut in half.

Thanks! Out of these, editing boards.txt sounds like the most obvious solution. I have replaced 115200 with 57600 in this section of boards.txt from Optiboot:

pro328o.name=[Optiboot] Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328
pro328o.upload.protocol=stk500
pro328o.upload.maximum_size=30720
pro328o.upload.speed=57600
pro328o.bootloader.low_fuses=0xff
pro328o.bootloader.high_fuses=0xdc
pro328o.bootloader.extended_fuses=0x05
pro328o.bootloader.path=optiboot
pro328o.bootloader.file=optiboot_atmega328_pro_8MHz.hex
pro328o.bootloader.unlock_bits=0x3F
pro328o.bootloader.lock_bits=0x0F
pro328o.build.mcu=atmega328p
pro328o.build.f_cpu=8000000L
pro328o.build.core=arduino

Unfortunately, this didn't help a bit. Behaviour is still the same.

This section somewhat implies that Optiboot does in fact come with an 8MHz version, doesn't it?

[quote author=M. Schmitt link=topic=52508.msg374804#msg374804 date=1297899972]I have replaced 115200 with 57600 in this section of boards.txt from Optiboot:

pro328o.name=[Optiboot] Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328
pro328o.upload.speed=57600
pro328o.bootloader.file=optiboot_atmega328_pro_8MHz.hex
pro328o.build.f_cpu=8000000L

This section somewhat implies that Optiboot does in fact come with an 8MHz version, doesn't it?[/quote]

Yup. So that isn't the problem. You should put the baud rate back the way you found it.

Try a manual reset (look under "Update")... http://bleaklow.com/2011/01/21/optiboot_on_arduino_pro_mini.html

This guy's post seems to say "I did modify the bootlader and reduced the baud rate and still have to press RESET to properly tickle the Arduino on upload".

I'm not sure whether putting Optiboot onto a very limited number of 8MHz units is worth diving into bootloader compilation for me. It's not like I have an industrial-scale 8MHz operation going. :P

What's the deal with those super-fast upload speeds anyway? It seems to be a tradeoff between compatibility and a 2 second gain on each upload. :~

I'm not clear myself which configurations affect the compilation of the bootloader and which affect the Arduino software's upload baud rate. Ideally it should be possible to recompile a version of Optiboot that assumes 8MHz. This is an area I'd like the Arduino software to handle better (being able to generate a custum bootloader for given settings from a menu)

The other problem you will have is that the fuses for 3V3 8MHz may be different from 5V 16MHz for two reasons:

a) The default brown-out detect voltage needs to be lower for 3V3 operation. IIRC you want this set lower than 2V7 for reliable operation. b) The crystal drive parameters are potentially different for 8MHz (though I think it does work with the highest settings).

Hi there,

Im having a very similar problem with an Arduino Mini Ultra. Ive been trying to load an 8mhz 3.3V version of Optiboot onto the board as the default boot loader has issues with the watchdog timer. So far I managed to upload the OptiBoot328Mini successfully however it has changed the power consumption of the board, it seems to run slower and I cant upload sketched from OSX, only Windows. So its back to the drawing board...

Did you get any further with this???

Cheers, Sam

I (as the one who started this) have basically given up on the 3.3V units, mostly out of laziness.

I was just playing with this over the last couple days. The Makefile needs to be changed to compile Optiboot for a 57600bps upload speed. The consensus on 115200bps it that there is too much error when generated from an 8MHz clock. I rebuilt it for 57600 and it seems to work for me, I’m attaching it if you’d like to try it. Put it in the \hardware\arduino\bootloaders\optiboot directory and also change the boards.txt entry as follows.

pro328.name=Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328

pro328.upload.protocol=stk500
pro328.upload.maximum_size=32256
pro328.upload.speed=57600

pro328.bootloader.low_fuses=0xFF
pro328.bootloader.high_fuses=0xDE
pro328.bootloader.extended_fuses=0x05
pro328.bootloader.path=optiboot
pro328.bootloader.file=optiboot_atmega328_pro_8MHz.hex
pro328.bootloader.unlock_bits=0x3F
pro328.bootloader.lock_bits=0x0F

pro328.build.mcu=atmega328p
pro328.build.f_cpu=8000000L
pro328.build.core=arduino

optiboot_atmega328_pro_8MHz.hex (1.43 KB)

Hi Jack,

Thanks for for that. Your a legend! I made the changes and its all working... so far.

The only thing I have notices is the sleep power consumption is now slightly higher. Im using an Arduino Mini Ultra http://www.rocketscream.com/blog/2011/07/06/mini-ultra-8-mhz-available-now/ which can achieve 1.7uA using a low power library made by Rocket Scream. Using the standard boot loader I can achieve this however now the board is consuming around 3.3uA while sleeping.

Honestly, I can deal with a few uA but for my own understanding do you know what might cause this? The guy I have been speaking with at RocketScream said it would be the fuse settings...?

I noticed in your changes to 'boards.txt' you alter the high_fuses from 0xDA to 0xDE, could I change this back perhaps?

Thanks again Sam

I noticed in your changes to 'boards.txt' you alter the high_fuses from 0xDA to 0xDE, could I change this back perhaps?

No. That bit changes the space reserved for the bootloader. It has absolutely nothing to do with power consumption.

fireman_sam6986: Thanks for for that. Your a legend!

Well that definitely depends on who you talk to ;)

I made the changes and its all working... so far.

Good deal!

The only thing I have notices is the sleep power consumption is now slightly higher. Im using an Arduino Mini Ultra http://www.rocketscream.com/blog/2011/07/06/mini-ultra-8-mhz-available-now/ which can achieve 1.7uA using a low power library made by Rocket Scream. Using the standard boot loader I can achieve this however now the board is consuming around 3.3uA while sleeping.

Honestly, I can deal with a few uA but for my own understanding do you know what might cause this? The guy I have been speaking with at RocketScream said it would be the fuse settings...?

All other things being equal, I can't imagine why this would be so. All other things are equal, yes? I'm not aware of a fuse setting that would affect this, but I might ask the RocketScream guy for specifics just for fun.