Pages: [1]   Go Down
Author Topic: Optiboot @ 8MHz  (Read 1502 times)
0 Members and 1 Guest are viewing this topic.
Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4092
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
uno8.name=Arduino "Uno" @ 8MHz
uno8.upload.protocol=stk500
uno8.upload.maximum_size=32256
uno8.upload.speed=57600
uno8.bootloader.low_fuses=0xff
uno8.bootloader.high_fuses=0xde
uno8.bootloader.extended_fuses=0x05
uno8.bootloader.path=optiboot
uno8.bootloader.file=optiboot_atmega328.hex
uno8.bootloader.unlock_bits=0x3F
uno8.bootloader.lock_bits=0x0F
uno8.build.mcu=atmega328p
uno8.build.f_cpu=8000000L
uno8.build.core=arduino
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8967
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4092
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6788
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

Quote
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.)
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4092
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4092
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I noticed the slower flashing!
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Pages: [1]   Go Up
Jump to: