Pages: [1]   Go Down
Author Topic: Arduino Bootloader ATmega* for single sided serial  (Read 1408 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

i made single sided serial board. And the autorestar feature works just perfect, but with it i find the 8 or 10 sec delay until the progam is runned as very, very long. I looked to the source of bootloader (in hardware/bootloder/Atmega8 folder) but i found a lot of code commented
and i think, that the waiting condition to run porgram is commented to:

Code:
//    } else {
//                  time_count++;
//                  if (time_count>=MAX_TIME_COUNT) {
//                        app_start();
//                  }
//            }

so i have two questions:

-is this source for the bootloader, which was compiled?
-should i just uncomment this part of code and change MAX_TIME_COUNT to 2000000?

Thank you in advance.

Jan
Logged

London, England
Offline Offline
Edison Member
*
Karma: 4
Posts: 1026
Go! Go! Arduinoooo !!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Go the the Ladyada website. I think she has a bootloader without a delay you can download.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, i have seen it. http://www.ladyada.net/library/arduino/bootloader.html . But this is for atmega328 and i unluckily need atmega8. :-( It will be fain to just have the source code for atmega8 which was really used and compiled as hex, which is in arduino 16. I am little afraid to just test it...
Logged

London, England
Offline Offline
Edison Member
*
Karma: 4
Posts: 1026
Go! Go! Arduinoooo !!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am 99.9% certain this is out there for the Atmega8. You will need to look around a bit.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, i have to change make file. Nice. thank you...
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

i'm also trying to do this, using an AVRISPmkII to update bootloader on an Arduino NG with atmega8 to eliminate startup delay.  can you detail exactly what changes you made to makefile, and what command line instruction you used?  (i assume you used avrdude.)

i would like to use this improved ADABOOT
http://www.1strecon.org/TheShoppe/freeduino/ADABOOT.shtml

rather than the original
http://www.ladyada.net/library/arduino/bootloader.html

but it looks like it will be more work making the newer one work with atmega8...
Logged

LIMA-PERU
Offline Offline
Newbie
*
Karma: 0
Posts: 12
AVE, Arduino
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello
I do not know if this help you... read in this site

http://spiffie.org/know/arduino_1k_bootloader/start.shtml

it is a 1K bootloader, they mention it is for the 8-168-328 Megas. I am using it with 168 (and will try 328). Burned the .hex downloaded directly with a "normal programmer" via AVRStudio 4.16 SP1. Since then I used it with Arduino-0016 normally. Read all and follow their instructions. The initial delay is totally good (small) for me. Note it is a 1K NOT 2K bootloader, so 1K more to your program.
Today changed to Arduino-0017 and worked too
Good luck smiley-wink
Hector
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks.  how different is that from lady ada's bootloader?  they all seemed to be working on things together, hard to straighten out differences.  

but those files don't include an ATmega8 hex file, nor do they include code in the Makefile to compile one, nor do they include a corrected boards file for the atmega8.  i was hoping not to have to figure all of that out myself, sigh...

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

why there is nothing about this new bootloader? seems to be nice, but no one wants to share... :-) I was missing a little space in Atmega8, it seems i coud use the cheper processor.
Logged

LIMA-PERU
Offline Offline
Newbie
*
Karma: 0
Posts: 12
AVE, Arduino
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@eforman
read smiley

http://spiffie.org/electronics/archives/microcontrollers/Have%20a%20KB%20on%20me!.html

http://spiffie.org/know/arduino_1k_bootloader/acknowledgments.shtml

maybe you can ask there too.
I am lazy and I am working with 168 so I do not need to try the mega8. They solved my problem and I say thank you and I am using it smiley-wink
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

i read over the 1k bootloader docs, it's cool but it won't work on the atmega8 without some modifications and work.  i ended up doing a simple change to the built-in bootloader.  here's what i did in case it helps anyone else:

make backups of ATmegaBOOT.c and ATmegaBOOT.hex in apps/arduino-001x/hardware/bootloaders/atmega8/

change startup delay by a factor of 2 or 3: in ATmegaBOOT.c change line 52 to

#define MAX_TIME_COUNT (F_CPU>>3)

that gives about a 2.5 second delay after reset before program starts.  use F_CPU>>2 for a 5 second delay, and F_CPU>>4 for a 1.25 second (approx) delay.  

open Makefile in the same folder and change the DIRAVR path (line 13) to your avr compiler path.  if you have CrossPack installed use

DIRAVR = /usr/local/CrossPack-AVR

if you don't, you could try the one included with Arduino IDE

DIRAVR = ../../tools/avr

but when i tried it i got some errors, maybe somebody else can figure that out, i'll paste it at the end of this.  

in Terminal, cd to that directory (hint - drag the enclosing folder to the Terminal window to avoid typing the path), and type make, e.g.

eric:/Applications/arduino-0016/hardware/bootloaders/atmega8
make


connect your ISP and Arduino or other board with Atmega8 and select Tools/Board/Arduino NG or older w/ Atmega8, then Tools/Burn Bootloader.

Done!

You can erase all the files generated by the compile except for the .c, .hex, and makefile, of course.  the Makefile has a clean command but it doesn't seem to work for me.

If you want to remind yourself the bootloader has been altered, you can change the name in arduino-001x/hardware/boards.txt, e.g.

atmega8.name=Arduino NG or older w/ ATmega8 - short delay

i'm not sure how to make duplicate entries as atmega8.name variable is overwritten.

note that a delay of <=2.5 seconds can be very hard to work with if you have to press the reset button manually when programming.  i recommend the NG auto-reset capacitor hack described here http://www.arduino.cc/en/Hacking/NGAutoReset, but note there is a mistake on that page and the cap should go on the TOP two pads, not the bottom.  

e

---------------------
NOTE: maybe someone can clarify this so people don't need to have CrossPack installed -  error when trying included compiler DIRAVR = ../../tools/avr:
Code:
/Applications/arduino-0016/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld: address 0x2060 of ATmegaBOOT.elf section .text is not within region text
make: *** [ATmegaBOOT.elf] Error 1
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

i read over the 1k bootloader docs, it's cool but it won't work on the atmega8 without some modifications and work.  i ended up doing a simple change to the built-in bootloader.  here's what i did in case it helps anyone else:

make backups of ATmegaBOOT.c and ATmegaBOOT.hex in apps/arduino-001x/hardware/bootloaders/atmega8/

change startup delay by a factor of 2 or 3: in ATmegaBOOT.c change line 52 to

#define MAX_TIME_COUNT (F_CPU>>3)

that gives about a 2.5 second delay after reset before program starts.  use F_CPU>>2 for a 5 second delay, and F_CPU>>4 for a 1.25 second (approx) delay.  

open Makefile in the same folder and change the DIRAVR path (line 13) to your avr compiler path.  if you have CrossPack installed use

DIRAVR = /usr/local/CrossPack-AVR

if you don't, you could try the one included with Arduino IDE

DIRAVR = ../../tools/avr

but when i tried it i got some errors, maybe somebody else can figure that out, i'll paste it at the end of this.  

in Terminal, cd to that directory (hint - drag the enclosing folder to the Terminal window to avoid typing the path), and type make, e.g.

eric:/Applications/arduino-0016/hardware/bootloaders/atmega8
make


connect your ISP and Arduino or other board with Atmega8 and select Tools/Board/Arduino NG or older w/ Atmega8, then Tools/Burn Bootloader.

Done!

You can erase all the files generated by the compile except for the .c, .hex, and makefile, of course.  the Makefile has a clean command but it doesn't seem to work for me.

If you want to remind yourself the bootloader has been altered, you can change the name in arduino-001x/hardware/boards.txt, e.g.

atmega8.name=Arduino NG or older w/ ATmega8 - short delay

i'm not sure how to make duplicate entries as atmega8.name variable is overwritten.

note that a delay of <=2.5 seconds can be very hard to work with if you have to press the reset button manually when programming.  i recommend the NG auto-reset capacitor hack described here http://www.arduino.cc/en/Hacking/NGAutoReset, but note there is a mistake on that page and the cap should go on the TOP two pads, not the bottom.  

e

---------------------
NOTE: maybe someone can clarify this so people don't need to have CrossPack installed -  error when trying included compiler DIRAVR = ../../tools/avr:
Code:
/Applications/arduino-0016/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld: address 0x2060 of ATmegaBOOT.elf section .text is not within region text
make: *** [ATmegaBOOT.elf] Error 1
Logged

Pages: [1]   Go Up
Jump to: