There has been some interest (hello, The_Bongmaster) in using a bootloader to program a chip for use in a DIY TellyMate (e.g. for breadboarding).
To that end, Release 1.0.10
of the TellyMate source code
has pre-compiled .hex files for 4 different chips (with identical functionality):
Mega8, Mega88, Mega168 and Mega328p.
The Mega168 and Mega328p versions are suitable for programming using bootloaders as they take up a relatively small amount of their chips' flash (50% and 25% respectively). The Mega8 and Mega88 versions are not suitable for use with bootloaders
, as they take up nearly all the flash on their chip, meaning there's no room for a bootloader.
Caveats on using a bootloadered TellyMate:
a) There will be an extra delay (depending on your bootloader) before the TellyMate code starts.
b) Resetting the TellyMate using <ESC>Z may cause the bootloader to be entered (I'm not sure though)
c) If you've got a bootloadered TellyMate attached to an Arduino, be sure to disconnect it before uploading a sketch to the Arduino - otherwise it may attempt to upload to the TellyMate at the same time!
The following (hopefully fairly generic) instructions should help in getting a pre-compiled .hex file uploaded to a chip that's already programmed with an Arduino bootloader.
Note: There must be room for the code on the chip! You won't be able to upload an 8k firmware onto an 8k part that's got a 2k bootloader!
Note: The size of the .hex file is not the size of the firmware (the .hex file is padded, encoded, contains checksums etc.)
Note: I've got a windows box - your file locations will probably be very different to mine.
1. Put the chip you want to program, into your Arduino.
2. Don't forget to set correct chip/bootloader from the tools->board menu in the IDE.
3. Turn on the verbose output for uploading:
a. Find your preferences.txt file for the Arduino IDE. Mine was atC:\Documents and Settings\Nigel\Application Data\Arduino\preferences.txt
b. Change the line that reads upload.verbose=false
4. Upload any simple sketch to the Arduino. You'll find the output is now incredibly wordy.
5. Find the call to avrdude in the output... mine said:C:\arduino-0015-win\arduino-0015\hardware/tools/avr/bin/avrdude -CC:\arduino-0015-win\arduino-0015\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pm8 -cstk500v1 -P\\.\COM1 -b19200 -D -Uflash:w:C:\Documents and Settings\Nigel\My Documents\Arduino\TellyMateShield_Maze\applet\TellyMateShield_Maze.hex:i (yes, my Arduino is M8 based. Stop sniggering. It's not how big it is - it's what you do with it.)
6. Drop to a command-line (or create a batch file or whatever) and Copy the avrdude command found in step 5, replacing the *.hex path+filename with the .hex file you want to upload and then run the command
Just to re-emphasise... Don't copy my
avrdude call shown above! Find your own!
7. Remove the chip from the Arduino.
8. Straighten the pins (again). [or is that just me?]
9. Rejoice in your newly programmed chip.