Optiboot on pro-mini 3.3v 8mHz

Hello forum,

I've taken a new path, away from megas and unos and trying out the smaller boards. 3.3V 8MHz pro-mini to start off with. The main reason being my increased usage of LoRa, 3.3v logic levels are essential. And using logic level converters seem to be a clumsy solution.

The issue I'm facing is the WDT not working on the board as it is sold. I tried @nickgammon 's board programmer, but he does not offer optiboot for this specific board.

Also tried minicore, selecting all possible combinations of options related to the board I have, but I've not managed to even get it to burn the bootloader.

Has anyone gotten the WDT to work on this board?

You do need to burn the bootloader. Use the Arduino as ISP sketch on another Arduino that you use as a programmer, and then burn the bootloader. Or use Nick's board programmer and select Uno.
Burn the Uno bootloader on it. It runs at 115200 baud on a 16MHz Arduino, but since your Pro Mini is running at 8MHz the bootloader will run at 57600 just like a stock Pro Mini.

I have used Minicore with 3.3V Pro Minis in the past and been very happy with it.
Can you describe what you mean by the WDT 'not working'? That's a bit vague. Do you mean that if the board hangs the WDT isn't resetting it?

BJHenry:
I have used Minicore with 3.3V Pro Minis in the past and been very happy with it.
Can you describe what you mean by the WDT 'not working'? That's a bit vague. Do you mean that if the board hangs the WDT isn't resetting it?

Exactly. When WDT is enabled (I use 8sec) and I test it with "while(1)" it doesn't reset like its meant to.

dmjlambert:
You do need to burn the bootloader. Use the Arduino as ISP sketch on another Arduino that you use as a programmer, and then burn the bootloader. Or use Nick's board programmer and select Uno.
Burn the Uno bootloader on it. It runs at 115200 baud on a 16MHz Arduino, but since your Pro Mini is running at 8MHz the bootloader will run at 57600 just like a stock Pro Mini.

Nick's board programmer uses optiboot for some of the boards but not the 3.3V 8MHz. Tried his version and WDT does not work on it.

From https://github.com/nickgammon/arduino_sketches:

"Supported target chips are:

Atmega8 (1024 bytes)
Atmega168 Optiboot (512 bytes)
Atmega328 Optiboot (for Uno etc. at 16 MHz) (512 bytes)
Atmega328 (8 MHz) for Lilypad etc. (2048 bytes)
Atmega32U4 for Leonardo (4096 bytes)
Atmega1280 Optiboot (1024 bytes)
Atmega1284 Optiboot (1024 bytes)
Atmega2560 with fixes for watchdog timer problem (8192 bytes)
Atmega16U2 - the bootloader on the USB interface chip of the Uno"

Looks like your best bet is going to be to use an external programmer and Minicore to burn Optiboot then, if the Gammon programmer won't do it.

I’ve spent a lot of time with Minicore, but cannot even upload a basic sketch with it, never mind burn bootloader.

See screenshots.

PS: Using FTD1232 board to load sketches

Screenshot 2019-06-20 at 11.21.05.png

Are you using an external programmer? You can't upload the bootloader over serial.

Yes, I use an UNO as programmer.

Nick Gammon's programmer sketch works fine, but when I use "Arduino as ISP", and select the board, clock, etc. and tap "Burn Bootoader", I get the following error messages.

I'm new to this side of Arduino, so any help would be appreciated.

Arduino: 1.8.9 (Mac OS X), Board: "ATmega328, No bootloader, 328P / 328PA, BOD 2.7V, LTO enabled, 8 MHz external"

/Users/heinmyburgh/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/bin/avrdude -C/Users/heinmyburgh/Library/Arduino15/packages/MiniCore/hardware/avr/2.0.3/avrdude.conf -v -patmega328p -carduino -P/dev/cu.wchusbserial1420 -b19200 -e -Ulock:w:0x3f:m -Uefuse:w:0b11111101:m -Uhfuse:w:0xd7:m -Ulfuse:w:0b11110111:m

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/Users/heinmyburgh/Library/Arduino15/packages/MiniCore/hardware/avr/2.0.3/avrdude.conf"
User configuration file is "/Users/heinmyburgh/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/cu.wchusbserial1420
Using Programmer : arduino
Overriding Baud Rate : 19200
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : Arduino
Description : Arduino

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
Hardware Version: 425479
Firmware Version: 33555972.-1441849512
Topcard : STK502
Vtarget : 1.8 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10

avrdude done. Thank you.

Error while burning bootloader.

I see when programming the bare chip they say to insert a 10uF capacitor between the RESET and GND pins.

Is this also necessary when programming a pro-mini using FTD1232?

heinburgh:
Nick's board programmer uses optiboot for some of the boards but not the 3.3V 8MHz. Tried his version and WDT does not work on it.

What does this mean? You can't get Nick's board programmer to work to burn the bootloader? After you successfully burn the bootloader watchdog still does not work? It should.

heinburgh:
From https://github.com/nickgammon/arduino_sketches:

"Supported target chips are:
.......
Atmega328 Optiboot (for Uno etc. at 16 MHz) (512 bytes)
.......

There's the one you need, optiboot for 16MHz. Put that one on your 8MHz Pro Mini. Because the Pro Mini is running at half speed, it will be adjusted for the right baud rate for Pro Mini, and just work.

dmjlambert:
What does this mean? You can't get Nick's board programmer to work to burn the bootloader? After you successfully burn the bootloader watchdog still does not work? It should.

I used Nick's programmer and burned the 8Mhz bootloader - Lilypad. It burns fine, and I can upload sketches to it but WDT does not reset.

dmjlambert:
There's the one you need, optiboot for 16MHz. Put that one on your 8MHz Pro Mini. Because the Pro Mini is running at half speed, it will be adjusted for the right baud rate for Pro Mini, and just work.

So I just burned the 16MHz bootloader and it burns fine, but I cannot load sketches onto the board after that.

When selecting Pro-mini from boards list before uploading sketch, the error is "avrdude: stk500_recv(): programmer is not responding"

This error means you should insert a 10uF capacitor between the RESET and GND pins on the Arduino used as a programmer.
Try it with MiniCore again.

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
         Hardware Version: 425479
         Firmware Version: 33555972.-1441849512
         Topcard         : STK502
         Vtarget         : 1.8 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10

avrdude done.  Thank you.

10uF capacitor made no difference.

Do you have another Pro Mini that you have not put a different bootloader on? If so, use it to check that you can upload something to it with your FTDI adapter (or whatever type of serial adapter you are using). That will check that upload can work and your FTDI adapter can work. Then unplug from the known good Pro Mini and plug in to the recently bootloaded Pro Mini. If you have the type of adapter that requires individual wires to be plugged in, you must be careful to get the right wires plugged in the right places. If you have the type of adapter that just plugs in like this, it is hard to have a problem.


I use the same FTDI adapter as in your photos, and its working fine. I can load sketches without any issues, its only after flashing the pro-mini with the 16mhz bootloader (nick's programmer) that I cannot load sketches. Once I burn the 8mhz bootloader back onto the same pro-mini I can load sketches again.

When burning these different bootloaders you can see differences in the values for fuses etc, so I suspect the 16mhz bootloader won't work since these values are different.

I've tried to edit the boards.txt file so I can use the optiboot bootloader when selecting pro-mini from the boards options, but after adding boards or editing existing boards in boards.txt the changes do not take effect in the IDE (even after restarting etc.) I use macos, and the location of the boards.txt file I'm editing is in app contents / java / hardware / arduino / avr / boards.txt. Any idea what I'm missing here?

heinburgh:
I use macos, and the location of the boards.txt file I'm editing is in app contents / java / hardware / arduino / avr / boards.txt. Any idea what I'm missing here?

When you update to a new version of the Arduino IDE via Boards Manager, it's installed to a different location and the copy of Arduino AVR Boards in app contents / java / hardware / arduino / avr is no longer used. So it's possible you are editing the wrong file.

The easiest way to find the active hardware package location is as follows:

  • Select a board from the hardware package you want to find from the Tools > Board menu
  • File > Examples > SPI > BarometricPressureSensor (or any other SPI example sketch)
  • Sketch > Show Sketch Folder
  • Move up folder levels until you reach the one that contains boards.txt

You do need to restart the Arduino IDE after you make changes to boards.txt.

I suggest the following:

Use Nick's board programmer sketch to put the Uno 16MHz bootloader on the Pro Mini. Connect the Pro Mini to the FTDI adapter. Press the reset button on the Pro Mini. Observe the 3 flashes that follow the reset button press. Compare that to your Uno, press reset on your Uno and see the 3 flashes. Do they happen at the same rate on both boards? Or are those 3 flashes slower on the Pro Mini?

Same speed means you have a 16MHz Pro Mini and should upload to it as if it is an Uno. Slower flashes mean you have an 8MHz Pro Mini and I would be at a loss to explain why you can't upload to it. Also I have no idea why you can't bootload it via the Arduino as ISP sketch.

Ok, got a bit more time, trying to get this issue sorted again.

Just burnt my pro-mini with the 16MHz bootloader and the three flashes are slower than the UNO, looks like half the speed of the UNO. Not too surprised since I ordered these boards as the 3.3V 8MHz version.

To recap:

  1. I can load the 16MHz bootloader using Nick's sketch, but then I cannot load any sketches onto the pro-mini

  2. I can also burn the 8MHz bootloader on the pro-mini using Nick's sketch, but this does nothing to fix the WDT issue, which is my ultimate goal here.

  3. I have not been able to burn the bootloader onto the pro-mini using the Arduino as ISP sketch, using an UNO as ISP.

I see the fuses and other values are different on the 16 and 8 MHz bootloaders when using Nick's sketch, so I'm not surprised that the board won't accept any sketches after burning the 16MHz bootloader.

The only thing I can think of is to use Nick's sketch to burn optiboot instead of the default bootloader that his sketch burns when selecting the 8MHz option (Lilypad etc.)

Does anyone have an idea how to do this?