Go Down

Topic: Optiboot @ 8MHz (Read 2391 times) previous topic - next topic

Jack Christensen

Is there any reason not to use Optiboot on an ATmega328P running at 8MHz? Is there a maximum upload speed? I added the entry below to boards.txt and it seems to work. I set the upload speed to 57600 as I think that was the fastest I saw for systems at 8MHz in boards.txt. (I'm using WestfW's beta optiboot.)

Code: [Select]
uno8.name=Arduino "Uno" @ 8MHz


I think it works because the optiboot_atmega328 bootloader is pre-compiled for 115200 bps and a 16 MHz clock.  Since you are running it with an 8 MHz clock the bit rate drops to half: 57600 bps.  If you re-compile the bootloader for the 8MHz clock you should be able to get the bit rate back up to 115200.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Jack Christensen

Haha, well that was very serendipitous, every once in a while Mr. Murphy loses one! I don't need to set any land speed records for uploading, so maybe I'll just go with it like that. So the bootloader is compiled to operate at just one speed, or is it a maximum speed? It'd probably take me a bit to figure out how to re-compile it. I have WinAVR, barely know enough to be dangerous, can I use that to compile the bootloader (in case I get brave some day)?

Thanks for your reply!


So the bootloader is compiled to operate at just one speed

Yes.  115200bps at 8MHz is actually "not very accurate"; you might be better off staying where you are.
It won't affect anything other than the upload speed.

I have WinAVR, barely know enough to be dangerous, can I use that to compile the bootloader

Yes.  Also, the latest optiboot source has some makefile modifications and batch files to help users rebuild it using the tools that come with the Arduino IDE itself.  If update the contents of the optiboot directory (.../hardware/arduino/bootloaders/optiboot) with the files from https://github.com/WestfW/Arduino/tree/master/hardware/arduino/bootloaders/optiboot, you should be able to compile from a "cmd window" with a command like "omake pro8" or similar (see the Readme file.)

Jack Christensen

@WestfW, thanks, I'll put it on my "things to try" list!


I have Optiboot v4.4 running on some 8MHz Arduino Pro-Minis.  Compiled with the default upload speed of 115200 bps it wouldn't communicate with my PC, but it's fine at 57600.  The compiled binaries for 115200bps, 16MHz and 57600bps, 8MHz are not quite the same, because the led-flashing routine accounts for the CPU frequency.

Jack Christensen

Yes, I noticed the slower flashing!

Go Up