Arduino Bootloader Update or Install – Upgrade a Clone From Old Bootloader to New Optiboot!
Well, look at how to install the new optiboot bootloader to bring these clones up to current arduino standards. This method also works to reinstall or upgrade boot loaders on almost any type of arduino using the atmega chipset, whether they are genuine or clones. The only requirement is at least one working device to be set up as a programmer. In our case, these came in a set of three so well use one as the programmer to upgrade the other two and then switch them around to program. The first so well set these up on a breadboard to make it a little easier. Well, use this one here as the programmer and well take our first to be programmed set it up on the other side and make the connections now put the wiring diagram up on the screen im just using jumper cables. To make this easier, and since i do this a lot, i use these same jumper cables and i just labeled what pins they go to with the other side heading to the in circuit programmer pins on the device itself to be programmed. So why would you want to upgrade the bootloader? There are some known issues with the old bootloader, one of them being the watchdog. Timer may reset the device. Unexpectedly, the new bootloader takes up a lot less space than the old leaving more room for your sketches, and the new bootloader is also twice as fast to upload a sketch.
The old bootloader uses only 56k speeds, while the new one is 115k baud. So it takes just a few minutes here to upload the new. So why not so we have our one that will be used as the programmer. We have the one to receive the new bootloader set up here, using the isp pins, and once we get this one flash well change it out for this one, and once these two are upgraded well take one of them put it in this position here, set it To be a programmer and move this guy on this side, so we can upgrade it and well have all three at the newest firmware version, so well get this plugged into the computer and take a look at the arduino ide side. So, with our nano plugged in well open up the arduino ide and go to file examples, arduino, isp and open the arduino isp sketch. This will allow us to set the first arduino as an in circuit programmer, make sure we have our board selected. We are still using the old bootloader com port and the usual programmer setup then well upload this sketch and now well be able to use this arduino as a programmer to upload the bootloaders to the next arduinos. Well, go to tools change our programmer to arduino as isp from here. It could be a little tricky if you were to go to tools and choose burn bootloader, it will burn the bootloader to the next nano that we have connected.
However, it will still burn the old bootloader if we change the processor to the atmega328, which is the new opti bootloader that we want. It will fail and thats, because the arduino ide is still communicating with the programmer nano and it will think the programmer has the new bootloader. So it will try to communicate with it at 115k baud rate, which will end up failing, because our programmer is indeed still on the old bootloader, who will only transmit at 56k, so well need to edit the boards text file for the arduino ide. In order to tell it to use the new bootloader, whenever we select the burn bootloader option for an arduino nano, whether its a genuine or a clone, it doesnt matter in windows, you can find it at this path under linux. The file is located here so well. Open our boards text file and just search for nano top boot loader itll, be around there somewhere scrolling down. We see the arduino nano with 18 mega 328p, and here is where it points to the bootloader file. While underneath we have the arduino nano, 328p old boot motor and again, the same bootloader path is pointing to the old bootloader. So what we want to do is just change this section of the old bootloader to use the file of the new opti boot. So well just replace this whole piece with the october. If youre worried about overwriting things for the future, you can use a double pound and a space to comment out.
The line then copy this setting back underneath and then make your change this way. If anything goes wrong to make things easier, you can just delete this new line that we added uncomment, the old and youll, be back to where you were so now. Save this and well go back to the arduino ide ide has to be restarted so well close and reopen. This will force our changes into effect. So back in tools, we still have nano and the old boot loader selected our programmers set as arduino isp and its important. You want arduino as isp, not arduino isp. Now we can go back to tools and choose burn bootloader, and we can see that the file being used is the opti boot new firmware that we wanted, even though we had the old selected so now back on our bench, well, remove the isp pins turn this Around and well and well test that this worked well load the blink script. Now we will choose the 18 atmega328p as our processor, using the new bootloader, compile and upload, and we can see the upload worked notice. The baud rate for uploading, the sketch is now at eleven five, two hundred double the speed of the old bootloader. If we now switch back to the board were using as a programmer and upload the same blink sketch with the same settings, youll see it fails and thats again, because this board is using the old bootloader which wants to transmit at 56k speeds.
So if we change our processor back to old bootloader upload now youll see it works fine. If we look at the speed baud rate 57600, so you can see how easy this is to do im going to load the isp programming sketch back, remove the board that we just upgraded connect. The next board in place turn the boot loader and then swap the boards around. So we now have two arduino clones that have the new bootloader in place. This one that weve been using as the programmer still has the old bootloader so well remove it, connect the isp, headers and insert one of our upgraded boards in its place, making sure we align the pins correctly and once again back in the arduino ide well have To reload this arduino sketch to the new board we just swapped in but well want to change our processor to 18 mega 328 since were no longer using the old bootloader upload, the arduino isp sketch and burn bootloader. Now all three of our boards are using the optiboot bootloader and essentially these clones are no different than a genuine arduino nano other than the ch340 chip used for usb communication. This also works to program any type of arduino or clone that uses the 18 mega chips or the 18 mega chips directly for the more advanced users out there. Loading, the arduino isp sketch to a board also allows you to use avr directly with that arduino connected to another 18 mega chip.
So you dont have to rely on the arduino ide and once youre done since the board you used as a programmer was simply uploading. A programming sketch you can overwrite it, and the board goes back to being a normal arduino that you can use in your projects, just as, as always, i hope you found this helpful.