Go Down

Topic: Programmer on Mini (Read 4480 times) previous topic - next topic

Hans K

Dear everyone,

I am a bit confused and worried regarding bootloader and programmer. I have a project (Nikon remote shutter control) which uses the Arduino Mini (04) with the ordinary bootloader that waits for about 10 seconds. If I replace the bootloader with my sketch, will my remote control start working instantely (like fractions of a second)?
If yes, do I need to change something in my sketch?

As you see, I am a beginner, will it be to difficult to use my other Arduino (Duemilanove) to function as a programmer using the MegaISP (http://arduino.cc/playground/Code/MegaISP), or should I instead spend some money and get an AVR-ISP for €30?
Will there likely be any problems using the ArduinoISP if I go via the Arduino 2009?
I don't want to brick by Mini (yet).

Advice are kindly appreciated!


Coding Badly

Quote
If I replace the bootloader with my sketch, will my remote control start working instantely (like fractions of a second)?


Yes.

Quote
If yes, do I need to change something in my sketch?


Like what?  Do you need a delay at startup?

Hans K

Quote
If yes, do I need to change something in my sketch?

A clarification: Will I need to add some header files etc to my sketch or just upload (via programmer) and the sketch will run automatically, ie start with setup() and then loop() ?

Quote
Like what?  Do you need a delay at startup?

I don't want nor need a delay, just want it to start immediately. Preferably press a button (closes the battery) and the "take a picture" signal is sent over IR immediately (and after every n seconds as long as the button is pressed = Arduino is on).

Coding Badly

Quote
A clarification: Will I need to add some header files etc to my sketch


I've never needed to do anything like that.  Just build the Sketch in the IDE and then upload.

Quote
or just upload (via programmer)


That's always worked for me.

Quote
and the sketch will run automatically, ie start with setup() and then loop() ?


And that's always worked as well.  The fuses on the processor may need to be changed.  But, if you have a programmer (any programmer), changing the fuses is fairly easy.

Quote
I don't want nor need a delay, just want it to start immediately


I think that's the way the AdaBoot bootloader works.  If you want to continue using a bootloader, you may want to search for a "no delay" bootloader.  But, if you have a programmer, there aren't many compelling reasons to use a bootloader.

retrolefty

If you load a sketch via a bootloader then there will be a delay when then after you first power up the board or hit the reset switch. some versions of bootloaders have shorter delays then others before jumping to a previously loaded sketch on the chip. This delay is to see if the Arduino IDE is trying to upload a new sketch. I use the adafruit bootloader at is seems to have the shortest time out period, I can hardly notice a delay on reset or power off.

However if you want zero delay and you have a hardware programmer, one can burn the sketch's hex file into a blank chip that has no bootloader installed and the sketch will start without any delay at all. There is no software changes needed to the sketch to use this option. However the fuse settings used for the chip will be different if there is no bootloader then if there are.

If you have one of the hardware programmers supported by the arduino IDE, then there is a way to burn sketches onto a chip without it having a bootloader by modifying the boards.txt file in the Arduino core files, but I can't seem to find the link in the Arduino playground at this time.




Hans K

Thanks for your replies!

I will definitely aim for "installing" my sketch directly without the default bootloader.

Hans K


...

However if you want zero delay and you have a hardware programmer, one can burn the sketch's hex file into a blank chip that has no bootloader installed and the sketch will start without any delay at all. There is no software changes needed to the sketch to use this option. However the fuse settings used for the chip will be different if there is no bootloader then if there are.

If you have one of the hardware programmers supported by the arduino IDE, then there is a way to burn sketches onto a chip without it having a bootloader by modifying the boards.txt file in the Arduino core files, but I can't seem to find the link in the Arduino playground at this time.


Since I have an Arduino Duemilanove I will turn it into a programmer using ArduinoISP (http://arduino.cc/en/Tutorial/ArduinoISP). There are no images on how to wire up the Mini, but I guess I just have to do it analogously.

Coding Badly

This might help...

http://arduino.cc/en/Hacking/MiniBootloader

Go Up