Linux programmer for the Atmel ATmega8
For various projects, I have used the Atmel AT90S1200 and AT90S4433
microcontrollers. Recently, the ATmega8 has been introduced as an
enhanced version of the 4433, so I am using the ATmega8 for some
robot experiments.
I use Linux for my normal working environment. Hardware is developed
using the Eagle PCB layout package. For software development I
use the Tavrasm assembler, available from
www.tavrasm.org. To download
programs to the target processor, I use a homebuilt board connected
to the PC printer port, with the SP12 programming software. SP12 is
available from Steven Bolt at
www.xs4all.nl/~sbolt/e-spider_prog.html
Now for the fun. None of these tools support the ATmega8. For Eagle,
I built my own device libarary by modifying the existing 4433 model.
For tavrasm, it's a couple of lines changed to support a new .device
instruction.
SP12 supports some mega chips, but not the ATmega8. After a day of
hacking, I was able to download a program to it, and reprogram the
flags.
For burning, there are two main differences between the ATmega8 and
other Atmel chips:
-
There are a lot of extra flags. In particular, there are flags
to switch between an internal RC oscillator, external crystal, or
an external resonator as the clock source. The chip comes from the
factory programmed to use the internal RC oscillator, so I definitely
needed to reprogram those flags.
-
The program memory is written in pages of 32 instructions; other mega
devices appear to use a page of 128 instructions.
Source code for my modified version is posted as
sp12mega8.tgz (depending on
your browser, you may have to right-click or shift-click this
link to download the file). NOTE: this is a quickly hacked version,
with several restrictions, including
- It has been tested on linux only.
- It has been tested with the ATmega8 only. The hacks may have broken
it for other chips.
- The new -X option sets flags in the low flag byte only.
- The SP12 flag options (-V0, etc) probably don't work.
- Options to set the memory protection fuse bits or the upper
byte of flag bits have not been fully implemented.
home
,Contact Info
© 2003 Joseph Rothweiler
Last modified $Date: 2003/01/03 14:50:37 $