Joseph Rothweiler
January 3, 2003
http://www.myown1.com
email:joe.nospam.1@myown1.com

This directory contains a hacked version of the
SP12 programmer for Atmel chips. The original version
was released under the GPL (see licence.txt), and
is available from 
http://www.xs4all.nl/~sbolt/e-spider_prog.html

This is a preliminary
version, which has been tested for Linux and the ATmega8
only. Changes that were needed include:

- The ATmega8 has an extended set of fuse bits to
  control read and write access to the program memory,
  with separate boot and application program sections.
- There are many additional flag bits, which control the
  processor clock source and other operating modes of
  the chip. There are now 2 bytes of flags that need
  to be programmed.
- The memory page is 32 instructions. Other mega chips
  seem to use a 128-instruction page. The hacks I made
  for the Atmega8 probably broke the program for other
  megas.
- The ATmega8 requires that instructions be written low byte
  first, then high byte. Routine loadCodePage() in SP12
  originally did it in reverse order for the mega103/603
  (not sure if they require reverse order or if they don't
  care).

In this version, the '-Xflags,mask' option is used to set
the flags in the lower flag byte. Any bit that is set to 1
in 'mask' means that the corresponding flag is to be
modified. 'flags' contains the flag bits to be programmed.
Either value may be decimal, octal(with a leading 0), or
hex (with a leading 0x).  For example, to set the
device to use an external 8 MHz crystal, use:
sp12 -X0xf,0xf
or to switch back to the internal RC oscillator, use
sp12 -X1,0xf
To see all of the flag, fuse, and calibration byte settings,
sp12 -rF 
(Options to set the high flag byte and fuse values are not
complete yet.)

The L, S, R, D, V, K, A, U, M options have not been tested,
and probably don't work.
