[McHUG] Arduino Programming
n3sb at qis.net
n3sb at qis.net
Mon Mar 17 19:36:53 EST 2008
Folks;
Rich N3III has been asking me to figure out how to download a hex file to an
Arduino without using the Arduino IDE. Well, it's easy.
The Arduino is based on an ATMEL ATMEGA168 chip, which has been pre-programmed
with a bootloader to make it emulate an ATMEL STK-500 programmer.
Since there are several ways to generate code for an ATMEL ATMEGA168, having a
simple way to program the chip would be very convenient. The Arduino IDE has
some nice features, but its kinda big, and does some non-standard things in
order to make programming by beginning code developer a little easier. Those
non-standard things can get in the way if the developer has worked with C
before, or if other programs are being adapted to the Arduino. Also, it's
possible to generate ATMEGA168 code from BASIC using the very nice MCS BASCOM
AVR Compiler, which has a demo mode to generate small programs < 2K in size.
Anyway, below is the command line for downloading code into the Arduino. It
looks like a bear to type over and over again, but when it's put into a batch
file, script, or makefile, it only has to be entered once.
avrdude -F -p atmega168 -P COMx -c stk500 -b 19200 -U flash:w:PROGRAM.hex
Replace the x with the COM port number being used, and the PROGRAM with the name
of the hex file being downloaded into the chip.
So there!
73; Steve, N3SB
More information about the McHUG
mailing list