Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. [Tutorial] How to burn 1Mhz & 8Mhz bootloader using Arduino IDE 1.6.5-r5

[Tutorial] How to burn 1Mhz & 8Mhz bootloader using Arduino IDE 1.6.5-r5

Scheduled Pinned Locked Moved Development
86 Posts 20 Posters 102.6k Views 28 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MasMatM Offline
    MasMatM Offline
    MasMat
    wrote on last edited by MasMat
    #72

    I have now. I always have that nagging feeling...
    But after MANY iterations, finally success. At least partly. :v:

    BlinkWithoutDelay works AND mysensors sketch as well (will do more testing...).
    What made it work, if anyone else struggles with this:

    -connect uno (to computer-linux), board:uno, upload ArduinoISP, disconnect
    -add shield to uno and atmega328p-pu to shield, connect to computer, board: "8mhz on breadboard", "programmer: "Arduino as ISP", burn bootloader, disconnect
    -board: Uno, connect as above, "upload sketch using programmer", disconnect EDIT this last part appears to work but internal clock is all messed up. Bootloader works fine like this.

    The magic happened after I changed the board back to Uno after burning bootloader. Why is beyond me, but maybe some arduino-ninja can figure it out.

    1 Reply Last reply
    1
    • bjacobseB Offline
      bjacobseB Offline
      bjacobse
      wrote on last edited by
      #73

      As I recall depending of frequency you need to adjust sketch upload baudrate, Maybe "uno" board have the "correct" baudrate defined for your frequency
      https://forum.arduino.cc/index.php?topic=92663.0

      1 Reply Last reply
      0
      • MasMatM Offline
        MasMatM Offline
        MasMat
        wrote on last edited by MasMat
        #74

        Can someone help me with these questions?
        I want the Slim Node to function "like a 3.3/8mhz pro mini" for MySensors home autom applications. So I can upload sketches thru ftdi-pins. Since I also use Pro Minis, I would not want change the mysensors library (serial baud).

        1. if I load the bootloader with a 8mhz crystal on the breadboard, does my barebones Slim node need a crystal too?
        2. If I set serial.begin in the sketch, does it override the MySensors default? So I could have that for slim node sketches.
        3. What kind of nodes would be problematic without crystal use? Repeater?
        4. Is it possible to Uno+breadboard just bootload all atmega328p's and then just solder onto SlimNode and use ftdi for uploading sketches (as I would normally to a Pro Mini)? In other words do I have to rethink the whole thing.

        EDIT, to help others

        1. if the bootloader is not set for crystal, it's not needed.
        2. yes
        3. ? Repeaters work fine.
        4. yes.
          My biggest problem was a capacitor missing between RST and GND when uploading bootloaders. After adding that to my shield, everything works.
          Now I bootload 1Mhz (battery nodes) and 8Mhz (non-bat) once I get them and then program them with the FTDI when I build the nodes.
        mfalkviddM 1 Reply Last reply
        0
        • MasMatM MasMat

          Can someone help me with these questions?
          I want the Slim Node to function "like a 3.3/8mhz pro mini" for MySensors home autom applications. So I can upload sketches thru ftdi-pins. Since I also use Pro Minis, I would not want change the mysensors library (serial baud).

          1. if I load the bootloader with a 8mhz crystal on the breadboard, does my barebones Slim node need a crystal too?
          2. If I set serial.begin in the sketch, does it override the MySensors default? So I could have that for slim node sketches.
          3. What kind of nodes would be problematic without crystal use? Repeater?
          4. Is it possible to Uno+breadboard just bootload all atmega328p's and then just solder onto SlimNode and use ftdi for uploading sketches (as I would normally to a Pro Mini)? In other words do I have to rethink the whole thing.

          EDIT, to help others

          1. if the bootloader is not set for crystal, it's not needed.
          2. yes
          3. ? Repeaters work fine.
          4. yes.
            My biggest problem was a capacitor missing between RST and GND when uploading bootloaders. After adding that to my shield, everything works.
            Now I bootload 1Mhz (battery nodes) and 8Mhz (non-bat) once I get them and then program them with the FTDI when I build the nodes.
          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #75

          @masmat I don't know about the other questions, but for the baud rate you can use

          #define MY_BAUD_RATE 9600
          

          (or some other speed that you want to use)
          Documentation: https://www.mysensors.org/apidocs/group__SerialDebugGrpPub.html#ga36a01c35b670e1f0797fd63d2ad76ed2

          1 Reply Last reply
          0
          • pihomeP Offline
            pihomeP Offline
            pihome
            wrote on last edited by
            #76

            First of all thanks to all who worked on this tutorial and bootloaders. i got fascinated about 8mhz and 1mhz with internal clock after reading this tutorial.

            Some might say 1mhz 8 times slower then 8mhz hence need longer awake time to do perform task before it can go back to sleep and consumes more power but what i found: point is not it takes 8 times longer to perform task but it can run it on battery longer and on lower voltage when battery ist at its peak youth.

            Anyway i wanted to share my experience and errors i had and the fix i found after googling around and spending hours trying to figure out what is going on.

            if you follow instructions as it is then you will end up with second boards.txt file located at C:\Program Files (x86)\Arduino\hardware\breadboard\avr\boards.txt, this file contact info about ATmegaBOOT_168_atmega328_pro_8MHz.hex only. So far so good and it works but for some reason when i try to add 1mhz bootloader to C:\Program Files (x86)\Arduino\hardware\arduino\avr\boards.txt it just wouldn't work, the 1mhz bootloader wouldn't show in in board selection option but if i add info about 1mhz bootloader to "C:\Program Files (x86)\Arduino\hardware\breadboard\avr\boards.txt" then i could see option for "APM Optiboot internal 1MHz noBOD 9600baud" but when i try to burn this bootloader i get all sorts of error on burning bootloader, one of the error: Could not find tool avrdude (sorry didn't copy all error messages)

            Then some forums suggest to start clean i.e uninstall Arduino ID and reinstall but simply uninstalling and reinstalling ID doesn't work you need to delete Arduino15 folder from following location(s) and reinstall Arduino ID:
            C:\Users(username)\AppData\Local\Arduino15 or C:\Users<username>\AppData\Roaming\Arduino15 or C:\Users<username>\AppData\Local\Arduino15

            What i think is best to keep your boards.txt file in one location and modify it and add bootloaders in it and this worked for me. Simply copy your bootloaders to C:\Program Files (x86)\Arduino\hardware\arduino\avr\bootloaders and modify C:\Program Files (x86)\Arduino\hardware\arduino\avr\boards.txt for additional bootloaders.
            here is my boards.txt

            ##############################################################
            # Add the new board to boards.txt (normally located at "C:\Program Files\Arduino\hardware\arduino\avr"
            # The *.bootloader.* etries only matters if you want to program bootloader (and fuses) from Arduino IDE. 
            # See http://www.engbedded.com/fusecalc (select Atmega328p) for interpretation of fuse values and how 
            # extended fuses are written in different applications (07h in Arduino IDE = FFh in Atmel studio).
            ##############################################################
            
            apm96.name=APM Optiboot internal 1MHz noBOD 9600baud
            
            apm96.upload.tool=avrdude
            apm96.upload.protocol=arduino
            apm96.upload.maximum_size=32256
            apm96.upload.speed=9600
            apm96.bootloader.tool=avrdude
            apm96.bootloader.low_fuses=0x62
            apm96.bootloader.high_fuses=0xde
            # all the possible values:
            #bootloader.extended_fuses=0x04 -> BOD at 4.3V
            #bootloader.extended_fuses=0x05 -> BOD at 2.7V
            #bootloader.extended_fuses=0x06 -> BOD at 1.8V
            #bootloader.extended_fuses=0x07 -> BOD disabled
            apm96.bootloader.extended_fuses=0x07
            apm96.bootloader.path=optiboot_v50
            apm96.bootloader.file=atmega328_1a.hex
            apm96.bootloader.unlock_bits=0x3F
            apm96.bootloader.lock_bits=0x2F
            apm96.build.mcu=atmega328p
            apm96.build.f_cpu=1000000L
            apm96.build.core=arduino
            apm96.build.variant=standard
            
            ##############################################################
            
            ##############################################################
            
            atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)
            
            atmega328bb.upload.protocol=arduino
            atmega328bb.upload.maximum_size=30720
            atmega328bb.upload.speed=57600
            
            atmega328bb.bootloader.low_fuses=0xE2
            atmega328bb.bootloader.high_fuses=0xDA
            atmega328bb.bootloader.extended_fuses=0x05
            
            atmega328bb.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
            atmega328bb.bootloader.unlock_bits=0x3F
            atmega328bb.bootloader.lock_bits=0x0F
            
            atmega328bb.build.mcu=atmega328p
            atmega328bb.build.f_cpu=8000000L
            atmega328bb.build.core=arduino:arduino
            atmega328bb.build.variant=arduino:standard
            
            
            atmega328bb.bootloader.tool=arduino:avrdude
            atmega328bb.upload.tool=arduino:avrdude```

            PiHome - Smart Heating Control

            1 Reply Last reply
            1
            • F Offline
              F Offline
              FIRE FOX
              wrote on last edited by
              #77

              Dear Sir,
              I'm trying to use the 8MHz bootloader, but I kindly ask you in detail where I've to copy the files extracted from the zip file breadboard-1-6-x.zip.

              Actually I'm using an Arduino IDE 1.8.10, the sentence that I need some explanation/confirmation is the following one:

              "Open your Arduino folder path and move the breadboard folder from the zip archive to the "hardware" folder of your Arduino sketchbook."

              is the Arduino sketchbook folder located at the path listed from:

              File=>Preferences=>Settings

              at the text field with label "Sketchbook location"?

              At this path I've no other "hardware" directory, just only a libraries folder, so if this is the right path I've just to simply copy and paste the "breadboard" folder into this one, I'm correct?

              Thanks!
              Fire

              MasMatM E 2 Replies Last reply
              0
              • F FIRE FOX

                Dear Sir,
                I'm trying to use the 8MHz bootloader, but I kindly ask you in detail where I've to copy the files extracted from the zip file breadboard-1-6-x.zip.

                Actually I'm using an Arduino IDE 1.8.10, the sentence that I need some explanation/confirmation is the following one:

                "Open your Arduino folder path and move the breadboard folder from the zip archive to the "hardware" folder of your Arduino sketchbook."

                is the Arduino sketchbook folder located at the path listed from:

                File=>Preferences=>Settings

                at the text field with label "Sketchbook location"?

                At this path I've no other "hardware" directory, just only a libraries folder, so if this is the right path I've just to simply copy and paste the "breadboard" folder into this one, I'm correct?

                Thanks!
                Fire

                MasMatM Offline
                MasMatM Offline
                MasMat
                wrote on last edited by
                #78

                @FIRE-FOX The answer depends a little on what OS you're using.
                In linux I have an Arduino-folder where the program files (not necessarily the sketches) are AND a hardware folder. Also on OSX I have an Arduino-folder (where I have my sketch-directories and libraries and hardware.
                Locate the hardware-folder (use whatever search-option your OS has) and you can pretty easily figure out where the breadboard-directory goes.

                I wish you luck with the bootloader programming. I went crazy a couple of times but once I got the routine down, it's worth the trouble.

                1 Reply Last reply
                0
                • F FIRE FOX

                  Dear Sir,
                  I'm trying to use the 8MHz bootloader, but I kindly ask you in detail where I've to copy the files extracted from the zip file breadboard-1-6-x.zip.

                  Actually I'm using an Arduino IDE 1.8.10, the sentence that I need some explanation/confirmation is the following one:

                  "Open your Arduino folder path and move the breadboard folder from the zip archive to the "hardware" folder of your Arduino sketchbook."

                  is the Arduino sketchbook folder located at the path listed from:

                  File=>Preferences=>Settings

                  at the text field with label "Sketchbook location"?

                  At this path I've no other "hardware" directory, just only a libraries folder, so if this is the right path I've just to simply copy and paste the "breadboard" folder into this one, I'm correct?

                  Thanks!
                  Fire

                  E Offline
                  E Offline
                  evb
                  wrote on last edited by evb
                  #79

                  @FIRE-FOX Today I should not go that way, see https://forum.mysensors.org/topic/2067/my-slim-2aa-battery-node. In the first topic you will see Update1 and to use the github project MiniCore. Much easier to use!
                  In the readme of the MiniCore github you will find how to install and how to use.

                  1 Reply Last reply
                  0
                  • E Offline
                    E Offline
                    emre299
                    wrote on last edited by
                    #80

                    hi,
                    i am using pro mini, i installed the blink code, pro mini does not work at 2.3v. I burned minicore bootloader(1Mhz-1,98).
                    my purpose: running pro mini up to 1.8v and saving power.
                    The blink code continues to run. no longer working pro mini 2.3V. but I can't upload new code.
                    What can I do to use it again?

                    the error he gave:

                    avrdude: stk500_recv(): programmer is not responding
                    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03
                    avrdude: stk500_recv(): programmer is not responding
                    avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03
                    avrdude: stk500_recv(): programmer is not responding
                    avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x03
                    avrdude: stk500_recv(): programmer is not responding
                    avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x03
                    Karta yüklenirken sorun oluştu. Tavsiyeler için http://www.arduino.cc/en/Guide/Troubleshooting#upload adresine göz atabilirsiniz.
                    avrdude: stk500_recv(): programmer is not responding
                    avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x03
                    avrdude: stk500_recv(): programmer is not responding
                    avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x03
                    avrdude: stk500_recv(): programmer is not responding
                    avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x03
                    avrdude: stk500_recv(): programmer is not responding
                    avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x03
                    avrdude: stk500_recv(): programmer is not responding
                    avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x03
                    avrdude: stk500_recv(): programmer is not responding
                    avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x03
                    
                    
                    electrikE 1 Reply Last reply
                    0
                    • E emre299

                      hi,
                      i am using pro mini, i installed the blink code, pro mini does not work at 2.3v. I burned minicore bootloader(1Mhz-1,98).
                      my purpose: running pro mini up to 1.8v and saving power.
                      The blink code continues to run. no longer working pro mini 2.3V. but I can't upload new code.
                      What can I do to use it again?

                      the error he gave:

                      avrdude: stk500_recv(): programmer is not responding
                      avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03
                      avrdude: stk500_recv(): programmer is not responding
                      avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03
                      avrdude: stk500_recv(): programmer is not responding
                      avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x03
                      avrdude: stk500_recv(): programmer is not responding
                      avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x03
                      Karta yüklenirken sorun oluştu. Tavsiyeler için http://www.arduino.cc/en/Guide/Troubleshooting#upload adresine göz atabilirsiniz.
                      avrdude: stk500_recv(): programmer is not responding
                      avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x03
                      avrdude: stk500_recv(): programmer is not responding
                      avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x03
                      avrdude: stk500_recv(): programmer is not responding
                      avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x03
                      avrdude: stk500_recv(): programmer is not responding
                      avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x03
                      avrdude: stk500_recv(): programmer is not responding
                      avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x03
                      avrdude: stk500_recv(): programmer is not responding
                      avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x03
                      
                      
                      electrikE Offline
                      electrikE Offline
                      electrik
                      wrote on last edited by
                      #81

                      @emre299 Did you changed the upload speed in boards.txt?
                      See in the first message of this topic
                      https://forum.mysensors.org/uploads/files/1454449114161-9.png

                      1 Reply Last reply
                      0
                      • E Offline
                        E Offline
                        evb
                        wrote on last edited by evb
                        #82

                        @electrik said in [Tutorial] How to burn 1Mhz & 8Mhz bootloader using Arduino IDE 1.6.5-r5:

                        @emre299 Did you changed the upload speed in boards.txt?
                        See in the first message of this topic
                        https://forum.mysensors.org/uploads/files/1454449114161-9.png

                        @emre299 did use the Minicore project, so that is different. See my comment just above his.

                        @emre299 can you describe the steps you did? step by step
                        Which version of Arduino IDE did you use?
                        Without more information, it will be difficult to respond to your question.

                        E 1 Reply Last reply
                        0
                        • E evb

                          @electrik said in [Tutorial] How to burn 1Mhz & 8Mhz bootloader using Arduino IDE 1.6.5-r5:

                          @emre299 Did you changed the upload speed in boards.txt?
                          See in the first message of this topic
                          https://forum.mysensors.org/uploads/files/1454449114161-9.png

                          @emre299 did use the Minicore project, so that is different. See my comment just above his.

                          @emre299 can you describe the steps you did? step by step
                          Which version of Arduino IDE did you use?
                          Without more information, it will be difficult to respond to your question.

                          E Offline
                          E Offline
                          emre299
                          wrote on last edited by
                          #83

                          Hi @evb and @electrik ,

                          First of all, for checking purposes, i installed the blink code to pro mini 3,3V with the ISP method(arduino nano). My goal is not to use the stupid booster circuit and using arduino up to 1.8v
                          I added arduino ide(1.8.13) minicore.

                          Then i chosed;
                          Board: minicore->ATmega328
                          Clock: internal 1MHZ
                          BOD: 1.8V
                          Arduino as ISP and Ctrl + shift + U
                          Then Blink works at 3.3v (but a little slow) but didn't work with 2.3v to the arduino.

                          Then;
                          Board: minicore->ATmega328
                          Clock: internal 1MHZ
                          BOD: 1.8V
                          Arduino as ISP and burn bootloader.

                          blink works well at 3.3v and 2,3v but now it gives an error when uploading new code to the arduino.I haven't made any other settings.

                          what is missing Is the minicore method wrong?

                          Thank you for your help.

                          E 1 Reply Last reply
                          0
                          • E emre299

                            Hi @evb and @electrik ,

                            First of all, for checking purposes, i installed the blink code to pro mini 3,3V with the ISP method(arduino nano). My goal is not to use the stupid booster circuit and using arduino up to 1.8v
                            I added arduino ide(1.8.13) minicore.

                            Then i chosed;
                            Board: minicore->ATmega328
                            Clock: internal 1MHZ
                            BOD: 1.8V
                            Arduino as ISP and Ctrl + shift + U
                            Then Blink works at 3.3v (but a little slow) but didn't work with 2.3v to the arduino.

                            Then;
                            Board: minicore->ATmega328
                            Clock: internal 1MHZ
                            BOD: 1.8V
                            Arduino as ISP and burn bootloader.

                            blink works well at 3.3v and 2,3v but now it gives an error when uploading new code to the arduino.I haven't made any other settings.

                            what is missing Is the minicore method wrong?

                            Thank you for your help.

                            E Offline
                            E Offline
                            evb
                            wrote on last edited by
                            #84

                            Ok, you programmed the blink sketch the first time via the ISP way of uploading

                            • the pro mini at 3.3V : works
                            • the pro mini at 2.3V : didn't do anything ==> this is already strange, it should also work

                            Then you did the same using the default way by uploading the sketch via the bootloader

                            • the pro mini at 3.3V : works
                            • the pro mini at 2.3V : works

                            And now you can't upload anymore new sketches to the pro mini.
                            Of course you upload your sketch with the pro mini again at 3.3V?

                            Further I should:

                            • double check your wirings
                            • is your programmer connected with fixed pinheaders or by folding the programmer a little in the holes of the pro mini? Verify if you have strong connections.
                            • Reprogram the bootloader. If this works, you should be able to upload a sketch.

                            Post some photo's that we can see something.

                            E 1 Reply Last reply
                            0
                            • E evb

                              Ok, you programmed the blink sketch the first time via the ISP way of uploading

                              • the pro mini at 3.3V : works
                              • the pro mini at 2.3V : didn't do anything ==> this is already strange, it should also work

                              Then you did the same using the default way by uploading the sketch via the bootloader

                              • the pro mini at 3.3V : works
                              • the pro mini at 2.3V : works

                              And now you can't upload anymore new sketches to the pro mini.
                              Of course you upload your sketch with the pro mini again at 3.3V?

                              Further I should:

                              • double check your wirings
                              • is your programmer connected with fixed pinheaders or by folding the programmer a little in the holes of the pro mini? Verify if you have strong connections.
                              • Reprogram the bootloader. If this works, you should be able to upload a sketch.

                              Post some photo's that we can see something.

                              E Offline
                              E Offline
                              emre299
                              wrote on last edited by
                              #85

                              @evb
                              hello, yes, it gives an error while loading code right now (Pro mini 3.3v 1 mhz minicore bootloader).

                              i checked my cables 2 times. I already have a board for ISP code.!
                              20210207_150948.jpg

                              Adsız.png

                              Is there any detail picture you want? do you think the boot loader might be broken while writing

                              E 1 Reply Last reply
                              0
                              • E emre299

                                @evb
                                hello, yes, it gives an error while loading code right now (Pro mini 3.3v 1 mhz minicore bootloader).

                                i checked my cables 2 times. I already have a board for ISP code.!
                                20210207_150948.jpg

                                Adsız.png

                                Is there any detail picture you want? do you think the boot loader might be broken while writing

                                E Offline
                                E Offline
                                evb
                                wrote on last edited by
                                #86

                                @emre299 when you click on Burn Bootloader, you get these errors

                                avrdude: stk500_recv(): programmer is not responding
                                avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03
                                avrdude: stk500_recv(): programmer is not responding
                                avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03
                                

                                So you verified the connections. Did you verify also with a multimeter? A wire can be broken internally

                                Do you have another pro mini to verify the connections?
                                I would try different settings like the normal settings 3.3V and 8Mzh externally, etc

                                If this does not work, I have no ideas anymore...

                                1 Reply Last reply
                                1
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                14

                                Online

                                11.7k

                                Users

                                11.2k

                                Topics

                                113.0k

                                Posts


                                Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • MySensors
                                • OpenHardware.io
                                • Categories
                                • Recent
                                • Tags
                                • Popular