💬 Various bootloader files based on Optiboot 6.2
-
I am using RFM69. No fake as it's working perfectly at other frequency.
@GertSanders
I tried three different configurations:- 16 MHz with crystal
- 8 MHz internal
- 1 MHz internal (with some st=fail)
I measured power consumption in sleep mode and found that it's very close to 4uA with all configurations. So why using the 1 MHz ? Do you have better consumption when using 1 MHz ?
The best configuration for me will be the 8 MHz internal as it avoid to used the crystal.
David.
@carlierd
In sleep mode it does not matter which frequency is used. The watchdog timer runs off its own clock and that is the same for all three cases. The fact that you get around 4 uA is just because you still have a watchdogtimer running. With full deep sleep and complete shutdown of the radio we should see 1-2 uA if external pullup of more then 2MOhm is used.
The mcu frequency is important for the active time. Higher frequency means faster startup and faster completion of tasks.
8Mhz is a good compromise as the internal oscillator is less powerhungry then fullswing crystal.
And you need less parts. -
I am using RFM69. No fake as it's working perfectly at other frequency.
@GertSanders
I tried three different configurations:- 16 MHz with crystal
- 8 MHz internal
- 1 MHz internal (with some st=fail)
I measured power consumption in sleep mode and found that it's very close to 4uA with all configurations. So why using the 1 MHz ? Do you have better consumption when using 1 MHz ?
The best configuration for me will be the 8 MHz internal as it avoid to used the crystal.
David.
@carlierd, all that i can say is; do not rely on serial communication working. I'm running my custom made node on 8MHz internal, can use the serial monitor but i can not upload via serial. Only ISP uploads using programmer.
-
@carlierd, all that i can say is; do not rely on serial communication working. I'm running my custom made node on 8MHz internal, can use the serial monitor but i can not upload via serial. Only ISP uploads using programmer.
@Samuel235
I have no issues with ftdi uploads at 8Mhz internal and 38k upload speed on my nodes. Even for 25k byte sketches. -
@Samuel235
I have no issues with ftdi uploads at 8Mhz internal and 38k upload speed on my nodes. Even for 25k byte sketches.@GertSanders said:
@Samuel235
I have no issues with ftdi uploads at 8Mhz internal and 38k upload speed on my nodes. Even for 25k byte sketches.I've been told that it should work but atmel do not advise it or support it apparently. There are chances that it wont work and mine doesn't. I had the discussion regarding it in my nodes topic but the conversation just dropped off and went stale.
-
@GertSanders said:
@Samuel235
I have no issues with ftdi uploads at 8Mhz internal and 38k upload speed on my nodes. Even for 25k byte sketches.I've been told that it should work but atmel do not advise it or support it apparently. There are chances that it wont work and mine doesn't. I had the discussion regarding it in my nodes topic but the conversation just dropped off and went stale.
@Samuel235
That depends on the upload speed. At higher speeds the error on the frequency of the internal oscillator gets more important. It can be off by several percent (from 8mhz) and then avrdude can fail. I have experimented with 9600 baud and there the deviation of the internal 8mhz has to be severe before the serial uploads starts to feel the effect.
So try using a 8Mhz boot loader prepared for an 9600 baud upload. -
@Samuel235
That depends on the upload speed. At higher speeds the error on the frequency of the internal oscillator gets more important. It can be off by several percent (from 8mhz) and then avrdude can fail. I have experimented with 9600 baud and there the deviation of the internal 8mhz has to be severe before the serial uploads starts to feel the effect.
So try using a 8Mhz boot loader prepared for an 9600 baud upload.@GertSanders, i did do, that's the latest solution i tried. No joy.
-
@carlierd
In sleep mode it does not matter which frequency is used. The watchdog timer runs off its own clock and that is the same for all three cases. The fact that you get around 4 uA is just because you still have a watchdogtimer running. With full deep sleep and complete shutdown of the radio we should see 1-2 uA if external pullup of more then 2MOhm is used.
The mcu frequency is important for the active time. Higher frequency means faster startup and faster completion of tasks.
8Mhz is a good compromise as the internal oscillator is less powerhungry then fullswing crystal.
And you need less parts.@GertSanders Thanks for explanation. It confirms what I imagine !
I am using a 10MOhm resistor but not the full deep sleep as I want to periodically send the battery.
I will try it because 1-2 uA is very low ;) -
@carlierd, all that i can say is; do not rely on serial communication working. I'm running my custom made node on 8MHz internal, can use the serial monitor but i can not upload via serial. Only ISP uploads using programmer.
@Samuel235 No issue to with the FTDI.
I just found a small problem due to the Arduino IDE. As I often change board (from UNO to different bootloader) I discover that the menu is sometime not coherent with the real setting. So I found that selecting two or three times board parameters (including port) is the solution to avoid communication issue. -
@GertSanders, i did do, that's the latest solution i tried. No joy.
@Samuel235
Would you want to try a bootloader with an upload speed of 4800 ? I can make that for 8Mhz if you want (just to test)? -
@Samuel235
Would you want to try a bootloader with an upload speed of 4800 ? I can make that for 8Mhz if you want (just to test)?@GertSanders, that would be fantastic if you wouldn't mind. Its for my in wall light switch custom made node that you're following. Thanks you, much appreciated.
-
@GertSanders, that would be fantastic if you wouldn't mind. Its for my in wall light switch custom made node that you're following. Thanks you, much appreciated.
here is the boot loader in 2 versions: one will flash port PB0 and the other does not.
You need to use the following fuse settings in the board file:
bootloader.low_fuses=0xE2
bootloader.high_fuses=0xDE
bootloader.extended_fuses=0x061_1458903521561_optiboot_atmega328_08M_004800_NOLED.hex
0_1458903521561_optiboot_atmega328_08M_004800_B0.hex
I saw that you use high fuse 0xDA
I'm assuming you use a boot loader larger then 512 bytes. Optiboot fits inside 512 bytes, so we need to define a space of 256 words (1 word = 2 bytes in AVR 8bit).
-
@GertSanders, that would be fantastic if you wouldn't mind. Its for my in wall light switch custom made node that you're following. Thanks you, much appreciated.
For my boot loaders based on Optiboot 6.2, I normally use high fuse set to 0xDE
Extract from my boards.txt file:
menu.mhz=CPU Speed
menu.bod=Brown Out Detection28PinBoard.name=atmega328p based - 28 pin DIL
28PinBoard.upload.tool=arduino:avrdude
28PinBoard.upload.protocol=arduino
28PinBoard.upload.maximum_size=32256
28PinBoard.upload.maximum_data_size=204828PinBoard.bootloader.tool=arduino:avrdude
28PinBoard.bootloader.unlock_bits=0x3F
28PinBoard.bootloader.lock_bits=0x0F28PinBoard.build.core=arduino:arduino
28PinBoard.build.mcu=atmega328p28PinBoard.build.board=AVR_GERTSANDERS28PinBoard
28PinBoard.build.variant=28PinBoard28PinBoard.menu.bod.4v3=4V3
28PinBoard.menu.bod.4v3.bootloader.extended_fuses=0x04
28PinBoard.menu.bod.2v7=2V7
28PinBoard.menu.bod.2v7.bootloader.extended_fuses=0x05
28PinBoard.menu.bod.1v8=1V8
28PinBoard.menu.bod.1v8.bootloader.extended_fuses=0x06
28PinBoard.menu.bod.off=Disabled
28PinBoard.menu.bod.off.bootloader.extended_fuses=0x0728PinBoard.menu.mhz.8Mi-38K4-D8= 8Mhz - internal - 38K4 - D8
28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.low_fuses=0xE2
28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.high_fuses=0xDE
28PinBoard.menu.mhz.8Mi-38K4-D8.build.f_cpu=8000000L
28PinBoard.menu.mhz.8Mi-38K4-D8.upload.speed=38400
28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.file=myoptiboot/optiboot_atmega328_08M_038400_B0.hex -
For my boot loaders based on Optiboot 6.2, I normally use high fuse set to 0xDE
Extract from my boards.txt file:
menu.mhz=CPU Speed
menu.bod=Brown Out Detection28PinBoard.name=atmega328p based - 28 pin DIL
28PinBoard.upload.tool=arduino:avrdude
28PinBoard.upload.protocol=arduino
28PinBoard.upload.maximum_size=32256
28PinBoard.upload.maximum_data_size=204828PinBoard.bootloader.tool=arduino:avrdude
28PinBoard.bootloader.unlock_bits=0x3F
28PinBoard.bootloader.lock_bits=0x0F28PinBoard.build.core=arduino:arduino
28PinBoard.build.mcu=atmega328p28PinBoard.build.board=AVR_GERTSANDERS28PinBoard
28PinBoard.build.variant=28PinBoard28PinBoard.menu.bod.4v3=4V3
28PinBoard.menu.bod.4v3.bootloader.extended_fuses=0x04
28PinBoard.menu.bod.2v7=2V7
28PinBoard.menu.bod.2v7.bootloader.extended_fuses=0x05
28PinBoard.menu.bod.1v8=1V8
28PinBoard.menu.bod.1v8.bootloader.extended_fuses=0x06
28PinBoard.menu.bod.off=Disabled
28PinBoard.menu.bod.off.bootloader.extended_fuses=0x0728PinBoard.menu.mhz.8Mi-38K4-D8= 8Mhz - internal - 38K4 - D8
28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.low_fuses=0xE2
28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.high_fuses=0xDE
28PinBoard.menu.mhz.8Mi-38K4-D8.build.f_cpu=8000000L
28PinBoard.menu.mhz.8Mi-38K4-D8.upload.speed=38400
28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.file=myoptiboot/optiboot_atmega328_08M_038400_B0.hex@GertSanders I used that DA high fuse simply to make sure the default bootloader fitted, however if its too big will it cause issues on serial ipload even if its a very small upload? Could that be the reason?
I will try your bootloader without the LED as my module doesn't contain the LED. This is very hard to read from a mobile device so i will attempt this when i get home tonight. Thank you once again for your files and time.
-
@carlierd
In sleep mode it does not matter which frequency is used. The watchdog timer runs off its own clock and that is the same for all three cases. The fact that you get around 4 uA is just because you still have a watchdogtimer running. With full deep sleep and complete shutdown of the radio we should see 1-2 uA if external pullup of more then 2MOhm is used.
The mcu frequency is important for the active time. Higher frequency means faster startup and faster completion of tasks.
8Mhz is a good compromise as the internal oscillator is less powerhungry then fullswing crystal.
And you need less parts.@GertSanders Hello. I tried the full deep sleep and it's really amazing !
I used your 8MHz with internal crystal and B0 led, BOD disabled. RFM69 for radio and just a switch via a 10MOhm resistor.
With the switch open: 280nA
With the switch close: 580nAMeasures done with a uCurrent Gold.
So I am sure now that I found the good bootloader for my application. It's simple to install and I can change easily the BOD !
Thanks ! -
@GertSanders Hello. I tried the full deep sleep and it's really amazing !
I used your 8MHz with internal crystal and B0 led, BOD disabled. RFM69 for radio and just a switch via a 10MOhm resistor.
With the switch open: 280nA
With the switch close: 580nAMeasures done with a uCurrent Gold.
So I am sure now that I found the good bootloader for my application. It's simple to install and I can change easily the BOD !
Thanks !@carlierd
Great to hear those low consumption numbers. -
@carlierd
Great to hear those low consumption numbers.@GertSanders
Yes, very impressive ! But finally not a lot of difference with the same node using interruption and sleep.
The auto-discharge of AA batteries is really important compare to node consumption.David.
-
For my boot loaders based on Optiboot 6.2, I normally use high fuse set to 0xDE
Extract from my boards.txt file:
menu.mhz=CPU Speed
menu.bod=Brown Out Detection28PinBoard.name=atmega328p based - 28 pin DIL
28PinBoard.upload.tool=arduino:avrdude
28PinBoard.upload.protocol=arduino
28PinBoard.upload.maximum_size=32256
28PinBoard.upload.maximum_data_size=204828PinBoard.bootloader.tool=arduino:avrdude
28PinBoard.bootloader.unlock_bits=0x3F
28PinBoard.bootloader.lock_bits=0x0F28PinBoard.build.core=arduino:arduino
28PinBoard.build.mcu=atmega328p28PinBoard.build.board=AVR_GERTSANDERS28PinBoard
28PinBoard.build.variant=28PinBoard28PinBoard.menu.bod.4v3=4V3
28PinBoard.menu.bod.4v3.bootloader.extended_fuses=0x04
28PinBoard.menu.bod.2v7=2V7
28PinBoard.menu.bod.2v7.bootloader.extended_fuses=0x05
28PinBoard.menu.bod.1v8=1V8
28PinBoard.menu.bod.1v8.bootloader.extended_fuses=0x06
28PinBoard.menu.bod.off=Disabled
28PinBoard.menu.bod.off.bootloader.extended_fuses=0x0728PinBoard.menu.mhz.8Mi-38K4-D8= 8Mhz - internal - 38K4 - D8
28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.low_fuses=0xE2
28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.high_fuses=0xDE
28PinBoard.menu.mhz.8Mi-38K4-D8.build.f_cpu=8000000L
28PinBoard.menu.mhz.8Mi-38K4-D8.upload.speed=38400
28PinBoard.menu.mhz.8Mi-38K4-D8.bootloader.file=myoptiboot/optiboot_atmega328_08M_038400_B0.hex@GertSanders, I have just managed to make time to remake a node and troubleshoot its upload issues with your suggested solution. So i went a head, got everything made up the minimal version, MCU, caps, and programming headers. I made sure all connections were working fine, they were. I then read the fuses, all fine and dandy. I then burnt your suggested fuses of;
bootloader.low_fuses=0xE2 bootloader.high_fuses=0xDE bootloader.extended_fuses=0x06Then the problem came. I lost all contact to the node, tried slowing the clock rate down on AVRDUDE to read it, nothing. I've hooked up my crystal just in case it burnt it incorrectly and thought it had an external crystal, nothing there either.
I'll be honest, i'm a little confused.
-
@GertSanders, I have just managed to make time to remake a node and troubleshoot its upload issues with your suggested solution. So i went a head, got everything made up the minimal version, MCU, caps, and programming headers. I made sure all connections were working fine, they were. I then read the fuses, all fine and dandy. I then burnt your suggested fuses of;
bootloader.low_fuses=0xE2 bootloader.high_fuses=0xDE bootloader.extended_fuses=0x06Then the problem came. I lost all contact to the node, tried slowing the clock rate down on AVRDUDE to read it, nothing. I've hooked up my crystal just in case it burnt it incorrectly and thought it had an external crystal, nothing there either.
I'll be honest, i'm a little confused.
@Samuel235
I'm out of ideas myself. I have been using several boot loader versions with the LED on different pins and different upload speeds or clockspeeds, and so far all my boot loaders work on my nodes.
Maybe you should write down step by step what you do, without assuming we know which steps you take, so we can see if the procedure is correct. Other then that it could be a board issue, but then if you already have a working board which allows uploading ??? -
Here is the process i have gone through so far:
- Soldered the MCU in place.
- Soldered the ISP and FTDI header in place.
- Soldered the Capacitors and resistor in place.
- Connected the board to PC through ISP.
- Checked for continuity through-out the board on all ISP header Pins and corresponding MCU pins.
- Check for correct voltage on all of the VCC and GND points.
- Ran a fuse check on AVRDUDE and got back all the default fuses.
- Checked that your fuses were going to be okay with my board using the fuse calculator.
- Entered your suggested fuse settings into AVRDUDE and burned.
- Went to read the fuses (like i always do after burning them to double check they have been applied). Got no answer for the device.
- Disconnected and connected the board back and read fuses over and over again with no hope with all of the speed options available within AVRDUDESS.
- Connected a 8MHz external crystal and checked for fuse readings yet again, nothing.
- Came here to see if you have any idea what has happened.
I didn't even get to the point of choosing one of your bootloaders that you gave me to try, so i'm more than sure it is either a fuse problem or a board problem (which i'm doubtful of since it was working before i burned the new fuse settings).
I haven't soldered the Radio, the radio's capacitor, battery holder, or the screw terminal block. Other than that, everything else has been assembled. The only other hardware thing that it could be, but not sure why it would work until i burnt the fuse settings, is there may be a 4.7uF as one of the capacitors where it should be a 0.1uF. I have replaced the one on the reset line so i can guarantee it is not that one. The only other caps on the board are decoupling/filtering caps.
I do already have one board with the fuses that you saw me use before (which you questioned why i used the size of the boot sector that i did) and that is working perfectly fine. But as you know that is just running a sketch that was uploaded through "Upload using programmer".
-
Here is the process i have gone through so far:
- Soldered the MCU in place.
- Soldered the ISP and FTDI header in place.
- Soldered the Capacitors and resistor in place.
- Connected the board to PC through ISP.
- Checked for continuity through-out the board on all ISP header Pins and corresponding MCU pins.
- Check for correct voltage on all of the VCC and GND points.
- Ran a fuse check on AVRDUDE and got back all the default fuses.
- Checked that your fuses were going to be okay with my board using the fuse calculator.
- Entered your suggested fuse settings into AVRDUDE and burned.
- Went to read the fuses (like i always do after burning them to double check they have been applied). Got no answer for the device.
- Disconnected and connected the board back and read fuses over and over again with no hope with all of the speed options available within AVRDUDESS.
- Connected a 8MHz external crystal and checked for fuse readings yet again, nothing.
- Came here to see if you have any idea what has happened.
I didn't even get to the point of choosing one of your bootloaders that you gave me to try, so i'm more than sure it is either a fuse problem or a board problem (which i'm doubtful of since it was working before i burned the new fuse settings).
I haven't soldered the Radio, the radio's capacitor, battery holder, or the screw terminal block. Other than that, everything else has been assembled. The only other hardware thing that it could be, but not sure why it would work until i burnt the fuse settings, is there may be a 4.7uF as one of the capacitors where it should be a 0.1uF. I have replaced the one on the reset line so i can guarantee it is not that one. The only other caps on the board are decoupling/filtering caps.
I do already have one board with the fuses that you saw me use before (which you questioned why i used the size of the boot sector that i did) and that is working perfectly fine. But as you know that is just running a sketch that was uploaded through "Upload using programmer".
@Samuel235
One possible reason: the BOD setting is now 0x06, which is the value if you use the Arduino IDE to burn the bootloader and set the fuses.
Since you use AVRDUDE ditectly, the extended fuse needs a different value (the one you get from the AVR fuse calculator at ATMEL).
I'm using my phone for this reply, so can not check the actual site right now