Society of Robots - Robot Forum

Software => Software => Topic started by: Joker94 on January 22, 2010, 09:16:47 PM

Title: How long does the Arduino bootloader take to load
Post by: Joker94 on January 22, 2010, 09:16:47 PM
Hi every one

How long does the arduino or in this case a romeo take to load.

Thanks every one

Joker94
Title: Re: How long does the Arduino bootloader take to load
Post by: SmAsH on January 23, 2010, 05:43:08 AM
To load onto the micro? Depends on the program size!
Its not too slow, my arduino normally takes a few seconds (5-10) to load a small program. ie, the $50 code.
Title: Re: How long does the Arduino bootloader take to load
Post by: Joker94 on January 23, 2010, 05:56:40 AM
I'll have a go with that but and report back

cheers smash
Title: Re: How long does the Arduino bootloader take to load
Post by: Joker94 on January 23, 2010, 06:07:42 AM
I cant use the 50 buck code as it isnt arduino code. and when i try to load the test LED blinking code it says uploading but dosnt complete just keeps going.
Title: Re: How long does the Arduino bootloader take to load
Post by: Joker94 on January 23, 2010, 06:20:58 AM
Could it be to do with my boot loader not being there or something wrong with it as the code still isnt loading.

cheers Joker94
Title: Re: How long does the Arduino bootloader take to load
Post by: hopslink on January 23, 2010, 07:12:45 AM
Just in case...

You do have the correct arduino board and COM port selected under the tools menu don't you?
Title: Re: How long does the Arduino bootloader take to load
Post by: Joker94 on January 23, 2010, 07:18:35 AM
yep done that. have Duemilanove/nona selected as it says and the correct comport.(com9)

anything else or is it time to try and re load the boot loader.

Thanks joker94
Title: Re: How long does the Arduino bootloader take to load
Post by: hopslink on January 23, 2010, 07:38:37 AM
Check your COM port shows no driver errors. Try disconnecting everything and restarting (you probably have already).

Check the code compiles ok (but you should be fine with the example code). Reset the board and hit download. Transfer times for a short sketch are <10 seconds.

EDIT - Arduino Troubleshooting Page (http://arduino.cc/en/Guide/Troubleshooting)
Title: Re: How long does the Arduino bootloader take to load
Post by: Joker94 on January 24, 2010, 05:01:36 AM
well i read through the arduino trouble shooting page and i guess the only thing left for me to do is to re laod the bootloader and see what happens.

wheni i do it do i do it through the arduino software or avr studio or pong prong?

thanks again

Joker94
Title: Re: How long does the Arduino bootloader take to load
Post by: Ro-Bot-X on January 24, 2010, 07:30:57 AM
I have a ARV ISP programmer and for some reason I can't upload the bootloader from Arduino software. I have to use AVR Studio to do that. Someone showed me how to do it and it is the only thing I know how to do in AVR Studio. Loading the bootloader is like loading any other hex file, but you also need to check the fuses. If you need help I can walk you through the process.
Title: Re: How long does the Arduino bootloader take to load
Post by: Joker94 on January 24, 2010, 06:10:47 PM
The walk through would be fantstic

thanks robotX
Title: Re: How long does the Arduino bootloader take to load
Post by: Joker94 on January 25, 2010, 03:48:34 AM
Hey Ro-bot-X

i guess the best way would be just to tell me what fuses i need to check. and do i need to do anything else, eg. lock bits, advanced (ocilator calibration) etc.

i really appreciated.

Joker94
Title: Re: How long does the Arduino bootloader take to load
Post by: Ro-Bot-X on January 26, 2010, 08:21:42 AM
Sorry it took me so long to reply but I wasn't able to replicate the process so I don't tell you things from memory.

So, to burn the Arduino bootloader on a blank ATmega (or any other Atmel micro) using AVR Studio 4, you need to have a few things handy:
- a hardware programmer (AVR ISP, AVR ISP mkII, etc.)
- the microcontroller installed on a board or on a breadboard (make sure you have a crystal and caps, reset pull up resistor, 5V regulated power and of course, the ISP 6 pin header)
- AVR Studio 4 installed on your computer
- Arduino-0017 (or latest) installed on your computer..

First, you need to connect the programmer to the board, then to the USB port on your computer. Start your AVR Studio, click on Cancel when it asks you to open or create a new project, then click on the CON button (or navigate to Tools -> Program AVR -> Connect) and the "Select AVR" window will open. Select your programmer from the "Platform" list on the left  (AVRISP or AVRISP mkII) and the COM port on the right, then click Connect button.

A new window will open and you can see at the bottom the status for your programmer. If all is OK, you may proceed further, if not, there is something wrong with your programmer. I never had a problem with my programmer, so you need to find info on how to troubleshoot it elsewhere. If the programmer is fine, you need to select the Main tab and select your microcontroler from the list and click on Read Signature button. (Make sure you have the board powered before you do this, or you will get an Error message.) If the connection is OK and your microcontroller is fine, you will see the signature right below it:  0x1E, 0x95, 0x0F for ATmega328P.

If your micro is new, you need to set up the fuse bits to match the crystal frequency. Go to Fuses tab and uncheck the CKDIV8 button, and see that you have checked only the BOOTRST button. Do not touch the SPIEN and BODLEVEL and the BOOTSZ should be 512 words. Click on the SUT_CKSEL list and select the last option at the bottom of the list. Once you have that, click on the Program button.

Now it's time to burn the bootloader. Go to the Program tab and in the Flash section, browse for the  Arduino-0017\hardware\bootloaders\atmega\ folder and choose the hex file that matches your microcontroller, ex. ATmegaBOOT_168_atmega328.hex for the ATmega328P micro. Then click on the Program button in the Flash section. Your bootloader should be now burned.

If you want to protect your bootloader from an accidental erase, go to the Lock bits tab and select the last one top down (BLB1) to be LPM and SPM prohibited in Boot section, then click on the Program button. Don't worry, if you make a mistake, you can restore the lock bits to the default state with a Chip Erase from the Main tab.

That's it, now you should have a perfectly functional Arduino microcontroller.
Title: Re: How long does the Arduino bootloader take to load
Post by: Joker94 on January 27, 2010, 01:23:34 AM
Awsome, it works.

Thank you so very much Ro-bot-X. how can i ever repay you. it works well, finishes uploading in less than 5-10 seconds.

Thanks very much

Joker94
Title: Re: How long does the Arduino bootloader take to load
Post by: Joker94 on February 06, 2010, 04:47:05 AM
well i have run into another problem,  i load the bootloader and after 1 upload via the boot loader it stops working. so i reload the boot loader and try again and only get 1 upload through it.

i think it is because of the lockbit settings are not correct. i have the "LPM and SPM prohibited in boot section" lock bit setting set but the other 2 i leave off.

any suggestions on what i need to do. initially i had it working but now...who knows.

thanks Joker94