1# $Id: avrdude.conf.in 1371 2016-02-15 20:15:07Z joerg_wunsch $ -*- text -*-
2#
3# AVRDUDE Configuration File
4#
5# This file contains configuration data used by AVRDUDE which describes
6# the programming hardware pinouts and also provides part definitions.
7# AVRDUDE's "-C" command line option specifies the location of the
8# configuration file.  The "-c" option names the programmer configuration
9# which must match one of the entry's "id" parameter.  The "-p" option
10# identifies which part AVRDUDE is going to be programming and must match
11# one of the parts' "id" parameter.
12#
13# DO NOT MODIFY THIS FILE.  Modifications will be overwritten the next
14# time a "make install" is run.  For user-specific additions, use the
15# "-C +filename" commandline option.
16#
17# Possible entry formats are:
18#
19#   programmer
20#       parent <id>                                 # optional parent
21#       id       = <id1> [, <id2> [, <id3>] ...] ;  # <idN> are quoted strings
22#       desc     = <description> ;                  # quoted string
23#       type     = <type>;                          # programmer type, quoted string
24#                          # supported programmer types can be listed by "-c ?type"
25#       connection_type = parallel | serial | usb
26#       baudrate = <num> ;                          # baudrate for avr910-programmer
27#       vcc      = <num1> [, <num2> ... ] ;         # pin number(s)
28#       buff     = <num1> [, <num2> ... ] ;         # pin number(s)
29#       reset    = <num> ;                          # pin number
30#       sck      = <num> ;                          # pin number
31#       mosi     = <num> ;                          # pin number
32#       miso     = <num> ;                          # pin number
33#       errled   = <num> ;                          # pin number
34#       rdyled   = <num> ;                          # pin number
35#       pgmled   = <num> ;                          # pin number
36#       vfyled   = <num> ;                          # pin number
37#       usbvid   = <hexnum>;                        # USB VID (Vendor ID)
38#       usbpid   = <hexnum> [, <hexnum> ...]        # USB PID (Product ID) (1)
39#       usbdev   = <interface>;                     # USB interface or other device info
40#       usbvendor = <vendorname>;                   # USB Vendor Name
41#       usbproduct = <productname>;                 # USB Product Name
42#       usbsn    = <serialno>;                      # USB Serial Number
43#
44#        To invert a bit, use = ~ <num>, the spaces are important.
45#        For a pin list all pins must be inverted.
46#        A single pin can be specified as usual = ~ <num>, for lists
47#        specify it as follows = ~ ( <num> [, <num2> ... ] ) .
48#
49#        (1) Not all programmer types can process a list of PIDs.
50#     ;
51#
52#   part
53#       id               = <id> ;                 # quoted string
54#       desc             = <description> ;        # quoted string
55#       has_jtag         = <yes/no> ;             # part has JTAG i/f
56#       has_debugwire    = <yes/no> ;             # part has debugWire i/f
57#       has_pdi          = <yes/no> ;             # part has PDI i/f
58#       has_tpi          = <yes/no> ;             # part has TPI i/f
59#       devicecode       = <num> ;            # deprecated, use stk500_devcode
60#       stk500_devcode   = <num> ;                # numeric
61#       avr910_devcode   = <num> ;                # numeric
62#       signature        = <num> <num> <num> ;    # signature bytes
63#       usbpid           = <num> ;                # DFU USB PID
64#       chip_erase_delay = <num> ;                # micro-seconds
65#       reset            = dedicated | io;
66#       retry_pulse      = reset | sck;
67#       pgm_enable       = <instruction format> ;
68#       chip_erase       = <instruction format> ;
69#       chip_erase_delay = <num> ;                # chip erase delay (us)
70#       # STK500 parameters (parallel programming IO lines)
71#       pagel            = <num> ;                # pin name in hex, i.e., 0xD7
72#       bs2              = <num> ;                # pin name in hex, i.e., 0xA0
73#       serial           = <yes/no> ;             # can use serial downloading
74#       parallel         = <yes/no/pseudo>;       # can use par. programming
75#       # STK500v2 parameters, to be taken from Atmel's XML files
76#       timeout          = <num> ;
77#       stabdelay        = <num> ;
78#       cmdexedelay      = <num> ;
79#       synchloops       = <num> ;
80#       bytedelay        = <num> ;
81#       pollvalue        = <num> ;
82#       pollindex        = <num> ;
83#       predelay         = <num> ;
84#       postdelay        = <num> ;
85#       pollmethod       = <num> ;
86#       mode             = <num> ;
87#       delay            = <num> ;
88#       blocksize        = <num> ;
89#       readsize         = <num> ;
90#       hvspcmdexedelay  = <num> ;
91#       # STK500v2 HV programming parameters, from XML
92#       pp_controlstack  = <num>, <num>, ...;   # PP only
93#       hvsp_controlstack = <num>, <num>, ...;  # HVSP only
94#       hventerstabdelay = <num>;
95#       progmodedelay    = <num>;               # PP only
96#       latchcycles      = <num>;
97#       togglevtg        = <num>;
98#       poweroffdelay    = <num>;
99#       resetdelayms     = <num>;
100#       resetdelayus     = <num>;
101#       hvleavestabdelay = <num>;
102#       resetdelay       = <num>;
103#       synchcycles      = <num>;               # HVSP only
104#       chiperasepulsewidth = <num>;            # PP only
105#       chiperasepolltimeout = <num>;
106#       chiperasetime    = <num>;               # HVSP only
107#       programfusepulsewidth = <num>;          # PP only
108#       programfusepolltimeout = <num>;
109#       programlockpulsewidth = <num>;          # PP only
110#       programlockpolltimeout = <num>;
111#       # JTAG ICE mkII parameters, also from XML files
112#       allowfullpagebitstream = <yes/no> ;
113#       enablepageprogramming = <yes/no> ;
114#       idr              = <num> ;                # IO addr of IDR (OCD) reg.
115#       rampz            = <num> ;                # IO addr of RAMPZ reg.
116#       spmcr            = <num> ;                # mem addr of SPMC[S]R reg.
117#       eecr             = <num> ;                # mem addr of EECR reg.
118#                                                 # (only when != 0x3c)
119#       is_at90s1200     = <yes/no> ;             # AT90S1200 part
120#       is_avr32         = <yes/no> ;             # AVR32 part
121#
122#       memory <memtype>
123#           paged           = <yes/no> ;          # yes / no
124#           size            = <num> ;             # bytes
125#           page_size       = <num> ;             # bytes
126#           num_pages       = <num> ;             # numeric
127#           min_write_delay = <num> ;             # micro-seconds
128#           max_write_delay = <num> ;             # micro-seconds
129#           readback_p1     = <num> ;             # byte value
130#           readback_p2     = <num> ;             # byte value
131#           pwroff_after_write = <yes/no> ;       # yes / no
132#           read            = <instruction format> ;
133#           write           = <instruction format> ;
134#           read_lo         = <instruction format> ;
135#           read_hi         = <instruction format> ;
136#           write_lo        = <instruction format> ;
137#           write_hi        = <instruction format> ;
138#           loadpage_lo     = <instruction format> ;
139#           loadpage_hi     = <instruction format> ;
140#           writepage       = <instruction format> ;
141#         ;
142#     ;
143#
144# If any of the above parameters are not specified, the default value
145# of 0 is used for numerics or the empty string ("") for string
146# values.  If a required parameter is left empty, AVRDUDE will
147# complain.
148#
149# Parts can also inherit parameters from previously defined parts
150# using the following syntax. In this case specified integer and
151# string values override parameter values from the parent part. New
152# memory definitions are added to the definitions inherited from the
153# parent.
154#
155#   part parent <id>                              # quoted string
156#       id               = <id> ;                 # quoted string
157#       <any set of other parameters from the list above>
158#     ;
159#
160# NOTES:
161#   * 'devicecode' is the device code used by the STK500 (see codes
162#       listed below)
163#   * Not all memory types will implement all instructions.
164#   * AVR Fuse bits and Lock bits are implemented as a type of memory.
165#   * Example memory types are:
166#       "flash", "eeprom", "fuse", "lfuse" (low fuse), "hfuse" (high
167#       fuse), "signature", "calibration", "lock"
168#   * The memory type specified on the avrdude command line must match
169#     one of the memory types defined for the specified chip.
170#   * The pwroff_after_write flag causes avrdude to attempt to
171#     power the device off and back on after an unsuccessful write to
172#     the affected memory area if VCC programmer pins are defined.  If
173#     VCC pins are not defined for the programmer, a message
174#     indicating that the device needs a power-cycle is printed out.
175#     This flag was added to work around a problem with the
176#     at90s4433/2333's; see the at90s4433 errata at:
177#
178#         http://www.atmel.com/dyn/resources/prod_documents/doc1280.pdf
179#
180# INSTRUCTION FORMATS
181#
182#    Instruction formats are specified as a comma seperated list of
183#    string values containing information (bit specifiers) about each
184#    of the 32 bits of the instruction.  Bit specifiers may be one of
185#    the following formats:
186#
187#       '1'  = the bit is always set on input as well as output
188#
189#       '0'  = the bit is always clear on input as well as output
190#
191#       'x'  = the bit is ignored on input and output
192#
193#       'a'  = the bit is an address bit, the bit-number matches this bit
194#              specifier's position within the current instruction byte
195#
196#       'aN' = the bit is the Nth address bit, bit-number = N, i.e., a12
197#              is address bit 12 on input, a0 is address bit 0.
198#
199#       'i'  = the bit is an input data bit
200#
201#       'o'  = the bit is an output data bit
202#
203#    Each instruction must be composed of 32 bit specifiers.  The
204#    instruction specification closely follows the instruction data
205#    provided in Atmel's data sheets for their parts.
206#
207# See below for some examples.
208#
209#
210# The following are STK500 part device codes to use for the
211# "devicecode" field of the part.  These came from Atmel's software
212# section avr061.zip which accompanies the application note
213# AVR061 available from:
214#
215#      http://www.atmel.com/dyn/resources/prod_documents/doc2525.pdf
216#
217
218#define ATTINY10    0x10  /* the _old_ one that never existed! */
219#define ATTINY11    0x11
220#define ATTINY12    0x12
221#define ATTINY15    0x13
222#define ATTINY13    0x14
223
224#define ATTINY22    0x20
225#define ATTINY26    0x21
226#define ATTINY28    0x22
227#define ATTINY2313  0x23
228
229#define AT90S1200   0x33
230
231#define AT90S2313   0x40
232#define AT90S2323   0x41
233#define AT90S2333   0x42
234#define AT90S2343   0x43
235
236#define AT90S4414   0x50
237#define AT90S4433   0x51
238#define AT90S4434   0x52
239#define ATMEGA48    0x59
240
241#define AT90S8515   0x60
242#define AT90S8535   0x61
243#define AT90C8534   0x62
244#define ATMEGA8515  0x63
245#define ATMEGA8535  0x64
246
247#define ATMEGA8     0x70
248#define ATMEGA88    0x73
249#define ATMEGA168   0x86
250
251#define ATMEGA161   0x80
252#define ATMEGA163   0x81
253#define ATMEGA16    0x82
254#define ATMEGA162   0x83
255#define ATMEGA169   0x84
256
257#define ATMEGA323   0x90
258#define ATMEGA32    0x91
259
260#define ATMEGA64    0xA0
261
262#define ATMEGA103   0xB1
263#define ATMEGA128   0xB2
264#define AT90CAN128  0xB3
265#define AT90CAN64   0xB3
266#define AT90CAN32   0xB3
267
268#define AT86RF401   0xD0
269
270#define AT89START   0xE0
271#define AT89S51	    0xE0
272#define AT89S52	    0xE1
273
274# The following table lists the devices in the original AVR910
275# appnote:
276# |Device |Signature | Code |
277# +-------+----------+------+
278# |tiny12 | 1E 90 05 | 0x55 |
279# |tiny15 | 1E 90 06 | 0x56 |
280# |       |          |      |
281# | S1200 | 1E 90 01 | 0x13 |
282# |       |          |      |
283# | S2313 | 1E 91 01 | 0x20 |
284# | S2323 | 1E 91 02 | 0x48 |
285# | S2333 | 1E 91 05 | 0x34 |
286# | S2343 | 1E 91 03 | 0x4C |
287# |       |          |      |
288# | S4414 | 1E 92 01 | 0x28 |
289# | S4433 | 1E 92 03 | 0x30 |
290# | S4434 | 1E 92 02 | 0x6C |
291# |       |          |      |
292# | S8515 | 1E 93 01 | 0x38 |
293# | S8535 | 1E 93 03 | 0x68 |
294# |       |          |      |
295# |mega32 | 1E 95 01 | 0x72 |
296# |mega83 | 1E 93 05 | 0x65 |
297# |mega103| 1E 97 01 | 0x41 |
298# |mega161| 1E 94 01 | 0x60 |
299# |mega163| 1E 94 02 | 0x64 |
300
301# Appnote AVR109 also has a table of AVR910 device codes, which
302# lists:
303# dev         avr910   signature
304# ATmega8     0x77     0x1E 0x93 0x07
305# ATmega8515  0x3B     0x1E 0x93 0x06
306# ATmega8535  0x6A     0x1E 0x93 0x08
307# ATmega16    0x75     0x1E 0x94 0x03
308# ATmega162   0x63     0x1E 0x94 0x04
309# ATmega163   0x66     0x1E 0x94 0x02
310# ATmega169   0x79     0x1E 0x94 0x05
311# ATmega32    0x7F     0x1E 0x95 0x02
312# ATmega323   0x73     0x1E 0x95 0x01
313# ATmega64    0x46     0x1E 0x96 0x02
314# ATmega128   0x44     0x1E 0x97 0x02
315#
316# These codes refer to "BOOT" device codes which are apparently
317# different than standard device codes, for whatever reasons
318# (often one above the standard code).
319
320# There are several extended versions of AVR910 implementations around
321# in the Internet.  These add the following codes (only devices that
322# actually exist are listed):
323
324# ATmega8515	0x3A
325# ATmega128	0x43
326# ATmega64	0x45
327# ATtiny26	0x5E
328# ATmega8535	0x69
329# ATmega32	0x72
330# ATmega16	0x74
331# ATmega8	0x76
332# ATmega169	0x78
333
334#
335# Overall avrdude defaults; suitable for ~/.avrduderc
336#
337default_parallel   = "@DEFAULT_PAR_PORT@";
338default_serial     = "@DEFAULT_SER_PORT@";
339# default_bitclock = 2.5;
340
341# Turn off safemode by default
342#default_safemode  = no;
343
344
345#
346# PROGRAMMER DEFINITIONS
347#
348
349# http://wiring.org.co/
350# Basically STK500v2 protocol, with some glue to trigger the
351# bootloader.
352programmer
353  id    = "wiring";
354  desc  = "Wiring";
355  type  = "wiring";
356  connection_type = serial;
357;
358
359programmer
360  id    = "arduino";
361  desc  = "Arduino";
362  type  = "arduino";
363  connection_type = serial;
364;
365# this will interface with the chips on these programmers:
366#
367# http://real.kiev.ua/old/avreal/en/adapters
368# http://www.amontec.com/jtagkey.shtml, jtagkey-tiny.shtml
369# http://www.olimex.com/dev/arm-usb-ocd.html, arm-usb-tiny.html
370# http://www.ethernut.de/en/hardware/turtelizer/index.html
371# http://elk.informatik.fh-augsburg.de/hhweb/doc/openocd/usbjtag/usbjtag.html
372# http://dangerousprototypes.com/docs/FT2232_breakout_board
373# http://www.ftdichip.com/Products/Modules/DLPModules.htm,DLP-2232*,DLP-USB1232H
374# http://flashrom.org/FT2232SPI_Programmer
375#
376# The drivers will look for a specific device and use the first one found.
377# If you have mulitple devices, then look for unique information (like SN)
378# And fill that in here.
379#
380# Note that the pin numbers for the main ISP signals (reset, sck,
381# mosi, miso) are fixed and cannot be changed, since they must match
382# the way the Multi-Protocol Synchronous Serial Engine (MPSSE) of
383# these FTDI ICs has been designed.
384
385programmer
386  id         = "avrftdi";
387  desc       = "FT2232D based generic programmer";
388  type       = "avrftdi";
389  connection_type = usb;
390  usbvid     = 0x0403;
391  usbpid     = 0x6010;
392  usbvendor  = "";
393  usbproduct = "";
394  usbdev     = "A";
395  usbsn      = "";
396#ISP-signals - lower ADBUS-Nibble (default)
397  reset  = 3;
398  sck    = 0;
399  mosi   = 1;
400  miso   = 2;
401#LED SIGNALs - higher ADBUS-Nibble
402#  errled = 4;
403#  rdyled = 5;
404#  pgmled = 6;
405#  vfyled = 7;
406#Buffer Signal - ACBUS - Nibble
407#  buff   = 8;
408;
409# This is an implementation of the above with a buffer IC (74AC244) and
410# 4 LEDs directly attached, all active low.
411programmer
412  id         = "2232HIO";
413  desc       = "FT2232H based generic programmer";
414  type       = "avrftdi";
415  connection_type = usb;
416  usbvid     = 0x0403;
417# Note: This PID is reserved for generic H devices and
418# should be programmed into the EEPROM
419#  usbpid     = 0x8A48;
420  usbpid     = 0x6010;
421  usbdev     = "A";
422  usbvendor  = "";
423  usbproduct = "";
424  usbsn      = "";
425#ISP-signals
426  reset  = 3;
427  sck    = 0;
428  mosi   = 1;
429  miso   = 2;
430  buff   = ~4;
431#LED SIGNALs
432  errled = ~ 11;
433  rdyled = ~ 14;
434  pgmled = ~ 13;
435  vfyled = ~ 12;
436;
437
438#The FT4232H can be treated as FT2232H, but it has a different USB
439#device ID of 0x6011.
440programmer parent "avrftdi"
441  id         = "4232h";
442  desc       = "FT4232H based generic programmer";
443  usbpid     = 0x6011;
444;
445
446programmer
447  id         = "jtagkey";
448  desc       = "Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2";
449  type       = "avrftdi";
450  connection_type = usb;
451  usbvid     = 0x0403;
452# Note: This PID is used in all JTAGKey variants
453  usbpid     = 0xCFF8;
454  usbdev     = "A";
455  usbvendor  = "";
456  usbproduct = "";
457  usbsn      = "";
458#ISP-signals => 20 - Pin connector on JTAGKey
459  reset  = 3; # TMS 7 violet
460  sck    = 0; # TCK 9 white
461  mosi   = 1; # TDI 5 green
462  miso   = 2; # TDO 13 orange
463  buff   = ~4;
464# VTG           VREF 1 brown with red tip
465# GND           GND 20 black
466# The colors are on the 20 pin breakout cable
467# from Amontec
468;
469
470# UM232H module from FTDI and Glyn.com.au.
471# See helix.air.net.au for detailed usage information.
472# J1: Connect pin 2 and 3 for USB power.
473# J2: Connect pin 2 and 3 for USB power.
474# J2: Pin 7 is SCK
475#   : Pin 8 is MOSI
476#   : Pin 9 is MISO
477#   : Pin 11 is RST
478#   : Pin 6 is ground
479# Use the -b flag to set the SPI clock rate eg -b 3750000 is the fastest I could get
480# a 16MHz Atmega1280 to program reliably.  The 232H is conveniently 5V tolerant.
481programmer
482  id         = "UM232H";
483  desc       = "FT232H based module from FTDI and Glyn.com.au";
484  type       = "avrftdi";
485  usbvid     = 0x0403;
486# Note: This PID is reserved for generic 232H devices and
487# should be programmed into the EEPROM
488  usbpid     = 0x6014;
489  usbdev     = "A";
490  usbvendor  = "";
491  usbproduct = "";
492  usbsn      = "";
493#ISP-signals
494  sck    = 0;
495  mosi   = 1;
496  miso   = 2;
497  reset  = 3;
498;
499
500# C232HM module from FTDI and Glyn.com.au.
501# : Orange is SCK
502# : Yellow is MOSI
503# : Green is MISO
504# : Brown is RST
505# : Black is ground
506# Use the -b flag to set the SPI clock rate eg -b 3750000 is the fastest I could get
507# a 16MHz Atmega1280 to program reliably.  The 232H is conveniently 5V tolerant.
508programmer
509  id         = "C232HM";
510  desc       = "FT232H based module from FTDI and Glyn.com.au";
511  type       = "avrftdi";
512  usbvid     = 0x0403;
513# Note: This PID is reserved for generic 232H devices and
514# should be programmed into the EEPROM
515  usbpid     = 0x6014;
516  usbdev     = "A";
517  usbvendor  = "";
518  usbproduct = "";
519  usbsn      = "";
520#ISP-signals
521  sck    = 0;
522  mosi   = 1;
523  miso   = 2;
524  reset  = 3;
525;
526
527
528# On the adapter you can read "O-Link". On the PCB is printed "OpenJTAG v3.1"
529# You can find it as "OpenJTAG ARM JTAG USB" in the internet.
530# (But there are also several projects called Open JTAG, eg.
531# http://www.openjtag.org, which are completely different.)
532#   http://www.100ask.net/shop/english.html (website seems to be outdated)
533#   http://item.taobao.com/item.htm?id=1559277013
534#   http://www.micro4you.com/store/openjtag-arm-jtag-usb.html (schematics!)
535# some other sources which call it O-Link
536#   http://www.andahammer.com/olink/
537#   http://www.developmentboard.net/31-o-link-debugger.html
538#   http://armwerks.com/catalog/o-link-debugger-copy/
539# or just have a look at ebay ...
540# It is basically the same entry as jtagkey with different usb ids.
541programmer parent "jtagkey"
542  id         = "o-link";
543  desc       = "O-Link, OpenJTAG from www.100ask.net";
544  usbvid     = 0x1457;
545  usbpid     = 0x5118;
546  usbvendor  = "www.100ask.net";
547  usbproduct = "USB<=>JTAG&RS232";
548;
549
550# http://wiki.openmoko.org/wiki/Debug_Board_v3
551programmer
552  id    = "openmoko";
553  desc  = "Openmoko debug board (v3)";
554  type  = "avrftdi";
555  usbvid     = 0x1457;
556  usbpid    = 0x5118;
557  usbdev = "A";
558  usbvendor  = "";
559  usbproduct = "";
560  usbsn      = "";
561  reset  = 3; # TMS 7
562  sck    = 0; # TCK 9
563  mosi   = 1; # TDI 5
564  miso   = 2; # TDO 13
565;
566
567# Only Rev. A boards.
568# Schematic and user manual: http://www.cs.put.poznan.pl/wswitala/download/pdf/811EVBK.pdf
569programmer
570  id         = "lm3s811";
571  desc       = "Luminary Micro LM3S811 Eval Board (Rev. A)";
572  type       = "avrftdi";
573  connection_type = usb;
574  usbvid     = 0x0403;
575  usbpid     = 0xbcd9;
576  usbvendor  = "LMI";
577  usbproduct = "LM3S811 Evaluation Board";
578  usbdev     = "A";
579  usbsn      = "";
580#ISP-signals - lower ACBUS-Nibble (default)
581  reset  = 3;
582  sck    = 0;
583  mosi   = 1;
584  miso   = 2;
585# Enable correct buffers
586  buff   = 7;
587;
588
589# submitted as bug #46020
590programmer
591  id     = "tumpa";
592  desc   = "TIAO USB Multi-Protocol Adapter";
593  type   = "avrftdi";
594  connection_type = usb;
595  usbvid = 0x0403;
596  usbpid = 0x8A98;
597  usbdev = "A";
598  usbvendor = "TIAO";
599  usbproduct = "";
600  usbsn  = "";
601  sck    = 0; # TCK 9
602  mosi   = 1; # TDI 5
603  miso   = 2; # TDO 13
604  reset  = 3; # TMS 7
605;
606
607programmer
608  id    = "avrisp";
609  desc  = "Atmel AVR ISP";
610  type  = "stk500";
611  connection_type = serial;
612;
613
614programmer
615  id    = "avrispv2";
616  desc  = "Atmel AVR ISP V2";
617  type  =  "stk500v2";
618  connection_type = serial;
619;
620
621programmer
622  id    = "avrispmkII";
623  desc  = "Atmel AVR ISP mkII";
624  type  =  "stk500v2";
625  connection_type = usb;
626;
627
628programmer parent "avrispmkII"
629  id    = "avrisp2";
630;
631
632programmer
633  id    = "buspirate";
634  desc  = "The Bus Pirate";
635  type  = "buspirate";
636  connection_type = serial;
637;
638
639programmer
640  id    = "buspirate_bb";
641  desc  = "The Bus Pirate (bitbang interface, supports TPI)";
642  type  = "buspirate_bb";
643  connection_type = serial;
644  # pins are bits in bitbang byte (numbers are 87654321)
645  # 1|POWER|PULLUP|AUX|MOSI|CLK|MISO|CS
646  reset  = 1;
647  sck    = 3;
648  mosi   = 4;
649  miso   = 2;
650  #vcc    = 7; This is internally set independent of this setting.
651;
652
653# This is supposed to be the "default" STK500 entry.
654# Attempts to select the correct firmware version
655# by probing for it.  Better use one of the entries
656# below instead.
657programmer
658  id    = "stk500";
659  desc  = "Atmel STK500";
660  type  = "stk500generic";
661  connection_type = serial;
662;
663
664programmer
665  id    = "stk500v1";
666  desc  = "Atmel STK500 Version 1.x firmware";
667  type  = "stk500";
668  connection_type = serial;
669;
670
671programmer
672  id    = "mib510";
673  desc  = "Crossbow MIB510 programming board";
674  type  = "stk500";
675  connection_type = serial;
676;
677
678programmer
679  id    = "stk500v2";
680  desc  = "Atmel STK500 Version 2.x firmware";
681  type  = "stk500v2";
682  connection_type = serial;
683;
684
685programmer
686  id    = "stk500pp";
687  desc  = "Atmel STK500 V2 in parallel programming mode";
688  type  = "stk500pp";
689  connection_type = serial;
690;
691
692programmer
693  id    = "stk500hvsp";
694  desc  = "Atmel STK500 V2 in high-voltage serial programming mode";
695  type  = "stk500hvsp";
696  connection_type = serial;
697;
698
699programmer
700  id    = "stk600";
701  desc  = "Atmel STK600";
702  type  = "stk600";
703  connection_type = usb;
704;
705
706programmer
707  id    = "stk600pp";
708  desc  = "Atmel STK600 in parallel programming mode";
709  type  = "stk600pp";
710  connection_type = usb;
711;
712
713programmer
714  id    = "stk600hvsp";
715  desc  = "Atmel STK600 in high-voltage serial programming mode";
716  type  = "stk600hvsp";
717  connection_type = usb;
718;
719
720programmer
721  id    = "avr910";
722  desc  = "Atmel Low Cost Serial Programmer";
723  type  = "avr910";
724  connection_type = serial;
725;
726
727programmer
728  id    = "ft245r";
729  desc  = "FT245R Synchronous BitBang";
730  type  = "ftdi_syncbb";
731  connection_type = usb;
732  miso  = 1; # D1
733  sck   = 0; # D0
734  mosi  = 2; # D2
735  reset = 4; # D4
736;
737
738programmer
739  id    = "ft232r";
740  desc  = "FT232R Synchronous BitBang";
741  type  = "ftdi_syncbb";
742  connection_type = usb;
743  miso  = 1;  # RxD
744  sck   = 0;  # TxD
745  mosi  = 2;  # RTS
746  reset = 4;  # DTR
747;
748
749# see http://www.bitwizard.nl/wiki/index.php/FTDI_ATmega
750programmer
751  id    = "bwmega";
752  desc  = "BitWizard ftdi_atmega builtin programmer";
753  type  = "ftdi_syncbb";
754  connection_type = usb;
755  miso  = 5;  # DSR
756  sck   = 6;  # DCD
757  mosi  = 3;  # CTS
758  reset = 7;  # RI
759;
760
761# see http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
762# Note: pins are numbered from 1!
763programmer
764  id    = "arduino-ft232r";
765  desc  = "Arduino: FT232R connected to ISP";
766  type  = "ftdi_syncbb";
767  connection_type = usb;
768  miso  = 3;  # CTS X3(1)
769  sck   = 5;  # DSR X3(2)
770  mosi  = 6;  # DCD X3(3)
771  reset = 7;  # RI  X3(4)
772;
773
774# website mentioned above uses this id
775programmer parent "arduino-ft232r"
776  id    = "diecimila";
777  desc  = "alias for arduino-ft232r";
778;
779
780# There is a ATmega328P kit PCB called "uncompatino".
781# This board allows ISP via its on-board FT232R.
782# This is designed like Arduino Duemilanove but has no standard ICPS header.
783# Its 4 pairs of pins are shorted to enable ftdi_syncbb.
784# http://akizukidenshi.com/catalog/g/gP-07487/
785# http://akizukidenshi.com/download/ds/akizuki/k6096_manual_20130816.pdf
786programmer
787  id    = "uncompatino";
788  desc  = "uncompatino with all pairs of pins shorted";
789  type  = "ftdi_syncbb";
790  connection_type = usb;
791  miso  = 3; # cts
792  sck   = 5; # dsr
793  mosi  = 6; # dcd
794  reset = 7; # ri
795;
796
797# FTDI USB to serial cable TTL-232R-5V with a custom adapter for ICSP
798# http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm
799# http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232R_CABLES.pdf
800# For ICSP pinout see for example http://www.atmel.com/images/doc2562.pdf
801# (Figure 1. ISP6PIN header pinout and Table 1. Connections required for ISP ...)
802# TTL-232R GND 1 Black  -> ICPS GND   (pin 6)
803# TTL-232R CTS 2 Brown  -> ICPS MOSI  (pin 4)
804# TTL-232R VCC 3 Red    -> ICPS VCC   (pin 2)
805# TTL-232R TXD 4 Orange -> ICPS RESET (pin 5)
806# TTL-232R RXD 5 Yellow -> ICPS SCK   (pin 3)
807# TTL-232R RTS 6 Green  -> ICPS MISO  (pin 1)
808# Except for VCC and GND, you can connect arbitual pairs as long as
809# the following table is adjusted.
810programmer
811  id    = "ttl232r";
812  desc  = "FTDI TTL232R-5V with ICSP adapter";
813  type  = "ftdi_syncbb";
814  connection_type = usb;
815  miso  = 2; # rts
816  sck   = 1; # rxd
817  mosi  = 3; # cts
818  reset = 0; # txd
819;
820
821programmer
822  id    = "usbasp";
823  desc  = "USBasp, http://www.fischl.de/usbasp/";
824  type  = "usbasp";
825  connection_type = usb;
826  usbvid     = 0x16C0; # VOTI
827  usbpid     = 0x05DC; # Obdev's free shared PID
828  usbvendor  = "www.fischl.de";
829  usbproduct = "USBasp";
830
831  # following variants are autodetected for id "usbasp"
832
833  # original usbasp from fischl.de
834  # see above "usbasp"
835
836  # old usbasp from fischl.de
837  #usbvid     = 0x03EB; # ATMEL
838  #usbpid     = 0xC7B4; # (unoffical) USBasp
839  #usbvendor  = "www.fischl.de";
840  #usbproduct = "USBasp";
841
842  # NIBObee (only if -P nibobee is given on command line)
843  # see below "nibobee"
844;
845
846programmer
847  id    = "nibobee";
848  desc  = "NIBObee";
849  type  = "usbasp";
850  connection_type = usb;
851  usbvid     = 0x16C0; # VOTI
852  usbpid     = 0x092F; # NIBObee PID
853  usbvendor  = "www.nicai-systems.com";
854  usbproduct = "NIBObee";
855;
856
857programmer
858  id    = "usbasp-clone";
859  desc  = "Any usbasp clone with correct VID/PID";
860  type  = "usbasp";
861  connection_type = usb;
862  usbvid    = 0x16C0; # VOTI
863  usbpid    = 0x05DC; # Obdev's free shared PID
864  #usbvendor  = "";
865  #usbproduct = "";
866;
867
868programmer
869  id    = "usbtiny";
870  desc  = "USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/";
871  type  = "usbtiny";
872  connection_type = usb;
873  usbvid     = 0x1781;
874  usbpid     = 0x0c9f;
875;
876
877 programmer
878  id    = "arduinoisp";
879  desc  = "Arduino ISP Programmer";
880  type  = "usbtiny";
881  connection_type = usb;
882  usbvid     = 0x2341;
883  usbpid     = 0x0049;
884;
885
886 programmer
887  id    = "arduinoisporg";
888  desc  = "Arduino ISP Programmer";
889  type  = "usbtiny";
890  connection_type = usb;
891  usbvid     = 0x2A03;
892  usbpid     = 0x0049;
893;
894
895programmer
896  id    = "butterfly";
897  desc  = "Atmel Butterfly Development Board";
898  type  = "butterfly";
899  connection_type = serial;
900;
901
902programmer
903  id    = "avr109";
904  desc  = "Atmel AppNote AVR109 Boot Loader";
905  type  = "butterfly";
906  connection_type = serial;
907;
908
909programmer
910  id    = "avr911";
911  desc  = "Atmel AppNote AVR911 AVROSP";
912  type  = "butterfly";
913  connection_type = serial;
914;
915
916# suggested in http://forum.mikrokopter.de/topic-post48317.html
917programmer
918  id    = "mkbutterfly";
919  desc  = "Mikrokopter.de Butterfly";
920  type  = "butterfly_mk";
921  connection_type = serial;
922;
923
924programmer parent "mkbutterfly"
925  id    = "butterfly_mk";
926;
927
928programmer
929  id    = "jtagmkI";
930  desc  = "Atmel JTAG ICE (mkI)";
931  baudrate = 115200;    # default is 115200
932  type  = "jtagmki";
933  connection_type = serial;
934;
935
936# easier to type
937programmer parent "jtagmkI"
938  id    = "jtag1";
939;
940
941# easier to type
942programmer parent "jtag1"
943  id    = "jtag1slow";
944  baudrate = 19200;
945;
946
947# The JTAG ICE mkII has both, serial and USB connectivity.  As it is
948# mostly used through USB these days (AVR Studio 5 only supporting it
949# that way), we make connection_type = usb the default.  Users are
950# still free to use a serial port with the -P option.
951
952programmer
953  id    = "jtagmkII";
954  desc  = "Atmel JTAG ICE mkII";
955  baudrate = 19200;    # default is 19200
956  type  = "jtagmkii";
957  connection_type = usb;
958;
959
960# easier to type
961programmer parent "jtagmkII"
962  id    = "jtag2slow";
963;
964
965# JTAG ICE mkII @ 115200 Bd
966programmer parent "jtag2slow"
967  id    = "jtag2fast";
968  baudrate = 115200;
969;
970
971# make the fast one the default, people will love that
972programmer parent "jtag2fast"
973  id    = "jtag2";
974;
975
976# JTAG ICE mkII in ISP mode
977programmer
978  id    = "jtag2isp";
979  desc  = "Atmel JTAG ICE mkII in ISP mode";
980  baudrate = 115200;
981  type  = "jtagmkii_isp";
982  connection_type = usb;
983;
984
985# JTAG ICE mkII in debugWire mode
986programmer
987  id    = "jtag2dw";
988  desc  = "Atmel JTAG ICE mkII in debugWire mode";
989  baudrate = 115200;
990  type  = "jtagmkii_dw";
991  connection_type = usb;
992;
993
994# JTAG ICE mkII in AVR32 mode
995programmer
996  id    = "jtagmkII_avr32";
997  desc  = "Atmel JTAG ICE mkII im AVR32 mode";
998  baudrate = 115200;
999  type  = "jtagmkii_avr32";
1000  connection_type = usb;
1001;
1002
1003# JTAG ICE mkII in AVR32 mode
1004programmer
1005  id    = "jtag2avr32";
1006  desc  = "Atmel JTAG ICE mkII im AVR32 mode";
1007  baudrate = 115200;
1008  type  = "jtagmkii_avr32";
1009  connection_type = usb;
1010;
1011
1012# JTAG ICE mkII in PDI mode
1013programmer
1014  id    = "jtag2pdi";
1015  desc  = "Atmel JTAG ICE mkII PDI mode";
1016  baudrate = 115200;
1017  type  = "jtagmkii_pdi";
1018  connection_type = usb;
1019;
1020
1021# AVR Dragon in JTAG mode
1022programmer
1023  id    = "dragon_jtag";
1024  desc  = "Atmel AVR Dragon in JTAG mode";
1025  baudrate = 115200;
1026  type  = "dragon_jtag";
1027  connection_type = usb;
1028;
1029
1030# AVR Dragon in ISP mode
1031programmer
1032  id    = "dragon_isp";
1033  desc  = "Atmel AVR Dragon in ISP mode";
1034  baudrate = 115200;
1035  type  = "dragon_isp";
1036  connection_type = usb;
1037;
1038
1039# AVR Dragon in PP mode
1040programmer
1041  id    = "dragon_pp";
1042  desc  = "Atmel AVR Dragon in PP mode";
1043  baudrate = 115200;
1044  type  = "dragon_pp";
1045  connection_type = usb;
1046;
1047
1048# AVR Dragon in HVSP mode
1049programmer
1050  id    = "dragon_hvsp";
1051  desc  = "Atmel AVR Dragon in HVSP mode";
1052  baudrate = 115200;
1053  type  = "dragon_hvsp";
1054  connection_type = usb;
1055;
1056
1057# AVR Dragon in debugWire mode
1058programmer
1059  id    = "dragon_dw";
1060  desc  = "Atmel AVR Dragon in debugWire mode";
1061  baudrate = 115200;
1062  type  = "dragon_dw";
1063  connection_type = usb;
1064;
1065
1066# AVR Dragon in PDI mode
1067programmer
1068  id    = "dragon_pdi";
1069  desc  = "Atmel AVR Dragon in PDI mode";
1070  baudrate = 115200;
1071  type  = "dragon_pdi";
1072  connection_type = usb;
1073;
1074
1075programmer
1076  id    = "jtag3";
1077  desc  = "Atmel AVR JTAGICE3 in JTAG mode";
1078  type  = "jtagice3";
1079  connection_type = usb;
1080  usbpid = 0x2110, 0x2140;
1081;
1082
1083programmer
1084  id    = "jtag3pdi";
1085  desc  = "Atmel AVR JTAGICE3 in PDI mode";
1086  type  = "jtagice3_pdi";
1087  connection_type = usb;
1088  usbpid = 0x2110, 0x2140;
1089;
1090
1091programmer
1092  id    = "jtag3dw";
1093  desc  = "Atmel AVR JTAGICE3 in debugWIRE mode";
1094  type  = "jtagice3_dw";
1095  connection_type = usb;
1096  usbpid = 0x2110, 0x2140;
1097;
1098
1099programmer
1100  id    = "jtag3isp";
1101  desc  = "Atmel AVR JTAGICE3 in ISP mode";
1102  type  = "jtagice3_isp";
1103  connection_type = usb;
1104  usbpid = 0x2110, 0x2140;
1105;
1106
1107programmer
1108  id    = "xplainedpro";
1109  desc  = "Atmel AVR XplainedPro in JTAG mode";
1110  type  = "jtagice3";
1111  connection_type = usb;
1112  usbpid = 0x2111;
1113;
1114
1115programmer
1116  id    = "xplainedmini";
1117  desc  = "Atmel AVR XplainedMini in ISP mode";
1118  type  = "jtagice3_isp";
1119  connection_type = usb;
1120  usbpid = 0x2145;
1121;
1122
1123programmer
1124  id    = "xplainedmini_dw";
1125  desc  = "Atmel AVR XplainedMini in debugWIRE mode";
1126  type  = "jtagice3_dw";
1127  connection_type = usb;
1128  usbpid = 0x2145;
1129;
1130
1131programmer
1132  id    = "atmelice";
1133  desc  = "Atmel-ICE (ARM/AVR) in JTAG mode";
1134  type  = "jtagice3";
1135  connection_type = usb;
1136  usbpid = 0x2141;
1137;
1138
1139programmer
1140  id    = "atmelice_pdi";
1141  desc  = "Atmel-ICE (ARM/AVR) in PDI mode";
1142  type  = "jtagice3_pdi";
1143  connection_type = usb;
1144  usbpid = 0x2141;
1145;
1146
1147programmer
1148  id    = "atmelice_dw";
1149  desc  = "Atmel-ICE (ARM/AVR) in debugWIRE mode";
1150  type  = "jtagice3_dw";
1151  connection_type = usb;
1152  usbpid = 0x2141;
1153;
1154
1155programmer
1156  id    = "atmelice_isp";
1157  desc  = "Atmel-ICE (ARM/AVR) in ISP mode";
1158  type  = "jtagice3_isp";
1159  connection_type = usb;
1160  usbpid = 0x2141;
1161;
1162
1163
1164programmer
1165  id    = "pavr";
1166  desc  = "Jason Kyle's pAVR Serial Programmer";
1167  type  = "avr910";
1168  connection_type = serial;
1169;
1170
1171programmer
1172  id    = "pickit2";
1173  desc  = "MicroChip's PICkit2 Programmer";
1174  type  = "pickit2";
1175  connection_type = usb;
1176;
1177
1178programmer
1179  id    = "flip1";
1180  desc  = "FLIP USB DFU protocol version 1 (doc7618)";
1181  type  = "flip1";
1182  connection_type = usb;
1183;
1184
1185programmer
1186  id    = "flip2";
1187  desc  = "FLIP USB DFU protocol version 2 (AVR4023)";
1188  type  = "flip2";
1189  connection_type = usb;
1190;
1191
1192@HAVE_PARPORT_BEGIN@  Inclusion of the following depends on --enable-parport
1193# Parallel port programmers.
1194
1195programmer
1196  id    = "bsd";
1197  desc  = "Brian Dean's Programmer, http://www.bsdhome.com/avrdude/";
1198  type  = "par";
1199  connection_type = parallel;
1200  vcc   = 2, 3, 4, 5;
1201  reset = 7;
1202  sck   = 8;
1203  mosi  = 9;
1204  miso  = 10;
1205;
1206
1207programmer
1208  id    = "stk200";
1209  desc  = "STK200";
1210  type  = "par";
1211  connection_type = parallel;
1212  buff  = 4, 5;
1213  sck   = 6;
1214  mosi  = 7;
1215  reset = 9;
1216  miso  = 10;
1217;
1218
1219# The programming dongle used by the popular Ponyprog
1220# utility.  It is almost similar to the STK200 one,
1221# except that there is a LED indicating that the
1222# programming is currently in progress.
1223
1224programmer parent "stk200"
1225  id    = "pony-stk200";
1226  desc  = "Pony Prog STK200";
1227  pgmled = 8;
1228;
1229
1230programmer
1231  id    = "dt006";
1232  desc  = "Dontronics DT006";
1233  type  = "par";
1234  connection_type = parallel;
1235  reset = 4;
1236  sck   = 5;
1237  mosi  = 2;
1238  miso  = 11;
1239;
1240
1241programmer parent "dt006"
1242  id    = "bascom";
1243  desc  = "Bascom SAMPLE programming cable";
1244;
1245
1246programmer
1247  id     = "alf";
1248  desc   = "Nightshade ALF-PgmAVR, http://nightshade.homeip.net/";
1249  type   = "par";
1250  connection_type = parallel;
1251  vcc    = 2, 3, 4, 5;
1252  buff   = 6;
1253  reset  = 7;
1254  sck    = 8;
1255  mosi   = 9;
1256  miso   = 10;
1257  errled = 1;
1258  rdyled = 14;
1259  pgmled = 16;
1260  vfyled = 17;
1261;
1262
1263programmer
1264  id    = "sp12";
1265  desc  = "Steve Bolt's Programmer";
1266  type  = "par";
1267  connection_type = parallel;
1268  vcc   = 4,5,6,7,8;
1269  reset = 3;
1270  sck   = 2;
1271  mosi  = 9;
1272  miso  = 11;
1273;
1274
1275programmer
1276  id     = "picoweb";
1277  desc   = "Picoweb Programming Cable, http://www.picoweb.net/";
1278  type   = "par";
1279  connection_type = parallel;
1280  reset  = 2;
1281  sck    = 3;
1282  mosi   = 4;
1283  miso   = 13;
1284;
1285
1286programmer
1287  id    = "abcmini";
1288  desc  = "ABCmini Board, aka Dick Smith HOTCHIP";
1289  type  = "par";
1290  connection_type = parallel;
1291  reset = 4;
1292  sck   = 3;
1293  mosi  = 2;
1294  miso  = 10;
1295;
1296
1297programmer
1298  id    = "futurlec";
1299  desc  = "Futurlec.com programming cable.";
1300  type  = "par";
1301  connection_type = parallel;
1302  reset = 3;
1303  sck   = 2;
1304  mosi  = 1;
1305  miso  = 10;
1306;
1307
1308
1309# From the contributor of the "xil" jtag cable:
1310# The "vcc" definition isn't really vcc (the cable gets its power from
1311# the programming circuit) but is necessary to switch one of the
1312# buffer lines (trying to add it to the "buff" lines doesn't work in
1313# avrdude versions before 5.5j).
1314# With this, TMS connects to RESET, TDI to MOSI, TDO to MISO and TCK
1315# to SCK (plus vcc/gnd of course)
1316programmer
1317  id    = "xil";
1318  desc  = "Xilinx JTAG cable";
1319  type  = "par";
1320  connection_type = parallel;
1321  mosi  = 2;
1322  sck   = 3;
1323  reset = 4;
1324  buff  = 5;
1325  miso  = 13;
1326  vcc   = 6;
1327;
1328
1329
1330programmer
1331  id = "dapa";
1332  desc = "Direct AVR Parallel Access cable";
1333  type = "par";
1334  connection_type = parallel;
1335  vcc   = 3;
1336  reset = 16;
1337  sck = 1;
1338  mosi = 2;
1339  miso = 11;
1340;
1341
1342programmer
1343  id    = "atisp";
1344  desc  = "AT-ISP V1.1 programming cable for AVR-SDK1 from <http://micro-research.co.th/> micro-research.co.th";
1345  type  = "par";
1346  connection_type = parallel;
1347  reset = ~6;
1348  sck   = ~8;
1349  mosi  = ~7;
1350  miso  = ~10;
1351;
1352
1353programmer
1354  id    = "ere-isp-avr";
1355  desc  = "ERE ISP-AVR <http://www.ere.co.th/download/sch050713.pdf>";
1356  type  = "par";
1357  connection_type = parallel;
1358  reset = ~4;
1359  sck   = 3;
1360  mosi  = 2;
1361  miso  = 10;
1362;
1363
1364programmer
1365  id    = "blaster";
1366  desc  = "Altera ByteBlaster";
1367  type  = "par";
1368  connection_type = parallel;
1369  sck   = 2;
1370  miso  = 11;
1371  reset = 3;
1372  mosi  = 8;
1373  buff  = 14;
1374;
1375
1376# It is almost same as pony-stk200, except vcc on pin 5 to auto
1377# disconnect port (download on http://electropol.free.fr/spip/spip.php?article27)
1378programmer parent "pony-stk200"
1379  id    = "frank-stk200";
1380  desc  = "Frank STK200";
1381  buff  = ; # delete buff pin assignment
1382  vcc   = 5;
1383;
1384
1385# The AT98ISP Cable is a simple parallel dongle for AT89 family.
1386# http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2877
1387programmer
1388  id = "89isp";
1389  desc = "Atmel at89isp cable";
1390  type = "par";
1391  connection_type = parallel;
1392  reset = 17;
1393  sck = 1;
1394  mosi = 2;
1395  miso = 10;
1396;
1397
1398@HAVE_PARPORT_END@
1399
1400#This programmer bitbangs GPIO lines using the Linux sysfs GPIO interface
1401#
1402#To enable it set the configuration below to match the GPIO lines connected to the
1403#relevant ISP header pins and uncomment the entry definition. In case you don't
1404#have the required permissions to edit this system wide config file put the
1405#entry in a separate <your name>.conf file and use it with -C+<your name>.conf
1406#on the command line.
1407#
1408#To check if your avrdude build has support for the linuxgpio programmer compiled in,
1409#use -c?type on the command line and look for linuxgpio in the list. If it's not available
1410#you need pass the --enable-linuxgpio=yes option to configure and recompile avrdude.
1411#
1412#programmer
1413#  id    = "linuxgpio";
1414#  desc  = "Use the Linux sysfs interface to bitbang GPIO lines";
1415#  type  = "linuxgpio";
1416#  reset = ?;
1417#  sck   = ?;
1418#  mosi  = ?;
1419#  miso  = ?;
1420#;
1421
1422# some ultra cheap programmers use bitbanging on the
1423# serialport.
1424#
1425# PC - DB9 - Pins for RS232:
1426#
1427# GND   5   -- |O
1428#              |   O| <-   9   RI
1429# DTR   4   <- |O   |
1430#              |   O| <-   8   CTS
1431# TXD   3   <- |O   |
1432#              |   O| ->   7   RTS
1433# RXD   2   -> |O   |
1434#              |   O| <-   6   DSR
1435# DCD   1   -> |O
1436#
1437# Using RXD is currently not supported.
1438# Using RI is not supported under Win32 but is supported under Posix.
1439
1440# serial ponyprog design (dasa2 in uisp)
1441# reset=!txd sck=rts mosi=dtr miso=cts
1442
1443programmer
1444  id    = "ponyser";
1445  desc  = "design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts";
1446  type  = "serbb";
1447  connection_type = serial;
1448  reset = ~3;
1449  sck   = 7;
1450  mosi  = 4;
1451  miso  = 8;
1452;
1453
1454# Same as above, different name
1455# reset=!txd sck=rts mosi=dtr miso=cts
1456
1457programmer parent "ponyser"
1458  id    = "siprog";
1459  desc  = "Lancos SI-Prog <http://www.lancos.com/siprogsch.html>";
1460;
1461
1462# unknown (dasa in uisp)
1463# reset=rts sck=dtr mosi=txd miso=cts
1464
1465programmer
1466  id    = "dasa";
1467  desc  = "serial port banging, reset=rts sck=dtr mosi=txd miso=cts";
1468  type  = "serbb";
1469  connection_type = serial;
1470  reset = 7;
1471  sck   = 4;
1472  mosi  = 3;
1473  miso  = 8;
1474;
1475
1476# unknown (dasa3 in uisp)
1477# reset=!dtr sck=rts mosi=txd miso=cts
1478
1479programmer
1480  id    = "dasa3";
1481  desc  = "serial port banging, reset=!dtr sck=rts mosi=txd miso=cts";
1482  type  = "serbb";
1483  connection_type = serial;
1484  reset = ~4;
1485  sck   = 7;
1486  mosi  = 3;
1487  miso  = 8;
1488;
1489
1490# C2N232i (jumper configuration "auto")
1491# reset=dtr sck=!rts mosi=!txd miso=!cts
1492
1493programmer
1494  id    = "c2n232i";
1495  desc  = "serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts";
1496  type  = "serbb";
1497  connection_type = serial;
1498  reset = 4;
1499  sck   = ~7;
1500  mosi  = ~3;
1501  miso  = ~8;
1502;
1503
1504#
1505# PART DEFINITIONS
1506#
1507
1508#------------------------------------------------------------
1509# ATtiny11
1510#------------------------------------------------------------
1511
1512# This is an HVSP-only device.
1513
1514part
1515    id                  = "t11";
1516    desc                = "ATtiny11";
1517    stk500_devcode      = 0x11;
1518    signature           = 0x1e 0x90 0x04;
1519    chip_erase_delay    = 20000;
1520
1521    timeout		= 200;
1522    hvsp_controlstack     =
1523        0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00,
1524        0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
1525        0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
1526        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
1527    hventerstabdelay    = 100;
1528    progmodedelay       = 0;
1529    hvspcmdexedelay     = 0;
1530    synchcycles         = 6;
1531    latchcycles         = 1;
1532    togglevtg           = 1;
1533    poweroffdelay       = 25;
1534    resetdelayms        = 0;
1535    resetdelayus        = 50;
1536    hvleavestabdelay    = 100;
1537    resetdelay          = 25;
1538    chiperasepolltimeout = 40;
1539    chiperasetime       = 0;
1540    programfusepolltimeout = 25;
1541    programlockpolltimeout = 25;
1542
1543    memory "eeprom"
1544        size            = 64;
1545	blocksize	= 64;
1546	readsize	= 256;
1547	delay		= 5;
1548    ;
1549
1550    memory "flash"
1551        size            = 1024;
1552	blocksize	= 128;
1553	readsize	= 256;
1554	delay		= 3;
1555    ;
1556
1557    memory "signature"
1558        size            = 3;
1559    ;
1560
1561    memory "lock"
1562        size            = 1;
1563    ;
1564
1565    memory "calibration"
1566        size            = 1;
1567    ;
1568
1569    memory "fuse"
1570        size            = 1;
1571    ;
1572;
1573
1574#------------------------------------------------------------
1575# ATtiny12
1576#------------------------------------------------------------
1577
1578part
1579    id                  = "t12";
1580    desc                = "ATtiny12";
1581    stk500_devcode      = 0x12;
1582    avr910_devcode      = 0x55;
1583    signature           = 0x1e 0x90 0x05;
1584    chip_erase_delay    = 20000;
1585    pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
1586                          "x x x x  x x x x   x x x x  x x x x";
1587
1588    chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
1589                          "x x x x  x x x x   x x x x  x x x x";
1590
1591    timeout		= 200;
1592    stabdelay		= 100;
1593    cmdexedelay		= 25;
1594    synchloops		= 32;
1595    bytedelay		= 0;
1596    pollindex		= 3;
1597    pollvalue		= 0x53;
1598    predelay		= 1;
1599    postdelay		= 1;
1600    pollmethod		= 0;
1601
1602    hvsp_controlstack   =
1603        0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00,
1604        0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
1605        0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
1606        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
1607    hventerstabdelay    = 100;
1608    hvspcmdexedelay     = 0;
1609    synchcycles         = 6;
1610    latchcycles         = 1;
1611    togglevtg           = 1;
1612    poweroffdelay       = 25;
1613    resetdelayms        = 0;
1614    resetdelayus        = 50;
1615    hvleavestabdelay    = 100;
1616    resetdelay          = 25;
1617    chiperasepolltimeout = 40;
1618    chiperasetime       = 0;
1619    programfusepolltimeout = 25;
1620    programlockpolltimeout = 25;
1621
1622    memory "eeprom"
1623        size            = 64;
1624        min_write_delay = 9000;
1625        max_write_delay = 20000;
1626        readback_p1     = 0xff;
1627        readback_p2     = 0xff;
1628        read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
1629                          "x  x a5 a4  a3 a2 a1 a0    o o o o  o o o o";
1630
1631        write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
1632                          "x  x a5 a4  a3 a2 a1 a0    i i i i  i i i i";
1633
1634	mode		= 0x04;
1635	delay		= 8;
1636	blocksize	= 64;
1637	readsize	= 256;
1638    ;
1639
1640    memory "flash"
1641        size            = 1024;
1642        min_write_delay = 4500;
1643        max_write_delay = 20000;
1644        readback_p1     = 0xff;
1645        readback_p2     = 0xff;
1646        read_lo         = "  0  0  1  0   0  0  0  0",
1647                          "  x  x  x  x   x  x  x a8",
1648                          " a7 a6 a5 a4  a3 a2 a1 a0",
1649                          "  o  o  o  o   o  o  o  o";
1650
1651        read_hi         = "  0  0  1  0   1  0  0  0",
1652                          "  x  x  x  x   x  x  x a8",
1653                          " a7 a6 a5 a4  a3 a2 a1 a0",
1654                          "  o  o  o  o   o  o  o  o";
1655
1656        write_lo        = "  0  1  0  0   0  0  0  0",
1657                          "  x  x  x  x   x  x  x a8",
1658                          " a7 a6 a5 a4  a3 a2 a1 a0",
1659                          "  i  i  i  i   i  i  i  i";
1660
1661        write_hi        = "  0  1  0  0   1  0  0  0",
1662                          "  x  x  x  x   x  x  x a8",
1663                          " a7 a6 a5 a4  a3 a2 a1 a0",
1664                          "  i  i  i  i   i  i  i  i";
1665
1666	mode		= 0x04;
1667	delay		= 5;
1668	blocksize	= 128;
1669	readsize	= 256;
1670    ;
1671
1672    memory "signature"
1673        size            = 3;
1674        read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
1675                          "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
1676    ;
1677
1678    memory "lock"
1679        size            = 1;
1680        read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
1681                          "x  x  x  x   x  x  x  x    x x x x  x o o x";
1682
1683        write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 i i 1",
1684                          "x  x  x  x   x  x  x  x    x x x x  x x x x";
1685        min_write_delay = 9000;
1686        max_write_delay = 9000;
1687    ;
1688
1689    memory "calibration"
1690        size            = 1;
1691        read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
1692                          "0  0  0  0   0  0  0  0    o o o o  o o o o";
1693    ;
1694
1695    memory "fuse"
1696        size            = 1;
1697        read            = "0  1  0  1   0  0  0  0    x x x x  x x x x",
1698                          "x  x  x  x   x  x  x  x    o o o o  o o o o";
1699
1700        write           = "1  0  1  0   1  1  0  0    1 0 1 x  x x x x",
1701                          "x  x  x  x   x  x  x  x    i i i i  i i i i";
1702        min_write_delay = 9000;
1703        max_write_delay = 9000;
1704    ;
1705;
1706
1707#------------------------------------------------------------
1708# ATtiny13
1709#------------------------------------------------------------
1710
1711part
1712    id                  = "t13";
1713    desc                = "ATtiny13";
1714     has_debugwire = yes;
1715     flash_instr   = 0xB4, 0x0E, 0x1E;
1716     eeprom_instr  = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
1717	             0xBC, 0x0E, 0xB4, 0x0E, 0xBA, 0x0D, 0xBB, 0xBC,
1718	             0x99, 0xE1, 0xBB, 0xAC;
1719    stk500_devcode      = 0x14;
1720    signature           = 0x1e 0x90 0x07;
1721    chip_erase_delay    = 4000;
1722    pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
1723                          "x x x x  x x x x   x x x x  x x x x";
1724
1725    chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
1726                          "x x x x  x x x x   x x x x  x x x x";
1727
1728    timeout		= 200;
1729    stabdelay		= 100;
1730    cmdexedelay		= 25;
1731    synchloops		= 32;
1732    bytedelay		= 0;
1733    pollindex		= 3;
1734    pollvalue		= 0x53;
1735    predelay		= 1;
1736    postdelay		= 1;
1737    pollmethod		= 1;
1738
1739    hvsp_controlstack     =
1740	0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
1741        0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
1742        0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
1743        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
1744    hventerstabdelay    = 100;
1745    progmodedelay       = 0;
1746    hvspcmdexedelay     = 0;
1747    synchcycles         = 6;
1748    latchcycles         = 1;
1749    togglevtg           = 1;
1750    poweroffdelay       = 25;
1751    resetdelayms        = 0;
1752    resetdelayus        = 90;
1753    hvleavestabdelay    = 100;
1754    resetdelay          = 25;
1755    chiperasepolltimeout = 40;
1756    chiperasetime       = 0;
1757    programfusepolltimeout = 25;
1758    programlockpolltimeout = 25;
1759
1760    ocdrev              = 0;
1761
1762    memory "eeprom"
1763        size            = 64;
1764        page_size       = 4;
1765        min_write_delay = 4000;
1766        max_write_delay = 4000;
1767        readback_p1     = 0xff;
1768        readback_p2     = 0xff;
1769        read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x x",
1770                          "x  x a5 a4  a3 a2 a1 a0    o o o o  o o o o";
1771
1772        write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
1773                          "x  x a5 a4  a3 a2 a1 a0    i i i i  i i i i";
1774
1775	loadpage_lo	= "  1   1   0   0      0   0   0   1",
1776			  "  0   0   0   0      0   0   0   0",
1777			  "  0   0   0   0      0   0  a1  a0",
1778			  "  i   i   i   i      i   i   i   i";
1779
1780	writepage	= "  1   1   0   0      0   0   1   0",
1781			  "  0   0   x   x      x   x   x   x",
1782			  "  x   x  a5  a4     a3  a2   0   0",
1783			  "  x   x   x   x      x   x   x   x";
1784
1785	mode		= 0x41;
1786	delay		= 5;
1787	blocksize	= 4;
1788	readsize	= 256;
1789    ;
1790
1791    memory "flash"
1792        paged           = yes;
1793        size            = 1024;
1794        page_size       = 32;
1795        num_pages       = 32;
1796        min_write_delay = 4500;
1797        max_write_delay = 4500;
1798        readback_p1     = 0xff;
1799        readback_p2     = 0xff;
1800        read_lo         = "  0  0  1  0   0  0  0  0",
1801                          "  0  0  0  0   0  0  0 a8",
1802                          " a7 a6 a5 a4  a3 a2 a1 a0",
1803                          "  o  o  o  o   o  o  o  o";
1804
1805        read_hi         = "  0  0  1  0   1  0  0  0",
1806                          "  0  0  0  0   0  0  0 a8",
1807                          " a7 a6 a5 a4  a3 a2 a1 a0",
1808                          "  o  o  o  o   o  o  o  o";
1809
1810        loadpage_lo     = "  0  1  0  0   0  0  0  0",
1811                          "  0  0  0  x   x  x  x  x",
1812                          "  x  x  x  x  a3 a2 a1 a0",
1813                          "  i  i  i  i   i  i  i  i";
1814
1815        loadpage_hi     = "  0  1  0  0   1  0  0  0",
1816                          "  0  0  0  x   x  x  x  x",
1817                          "  x  x  x  x  a3 a2 a1 a0",
1818                          "  i  i  i  i   i  i  i  i";
1819
1820        writepage       = "  0  1  0  0   1  1  0  0",
1821                          "  0  0  0  0   0  0  0 a8",
1822                          " a7 a6 a5 a4   x  x  x  x",
1823                          "  x  x  x  x   x  x  x  x";
1824
1825	mode		= 0x41;
1826	delay		= 6;
1827	blocksize	= 32;
1828	readsize	= 256;
1829    ;
1830
1831    memory "signature"
1832        size            = 3;
1833        read            = "0  0  1  1   0  0  0  0    0 0 0 x  x x x x",
1834                          "x  x  x  x   x  x a1 a0    o o o o  o o o o";
1835    ;
1836
1837    memory "lock"
1838        size            = 1;
1839        min_write_delay = 4500;
1840        max_write_delay = 4500;
1841
1842	read            = "0  1  0  1   1  0  0  0    0 0 0 0  0 0 0 0",
1843                          "x  x  x  x   x  x  x  x    x x o o  o o o o";
1844
1845        write           = "1  0  1  0   1  1  0  0    1 1 1 x  x x x x",
1846                          "x  x  x  x   x  x  x  x    1 1 i i  i i i i";
1847    ;
1848
1849    memory "calibration"
1850        size            = 2;
1851        read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
1852                          "0  0  0  0   0  0  0 a0    o o o o  o o o o";
1853    ;
1854
1855    memory "lfuse"
1856        size            = 1;
1857        min_write_delay = 4500;
1858        max_write_delay = 4500;
1859
1860        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
1861                          "x x x x  x x x x  i i i i  i i i i";
1862
1863        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
1864                          "x x x x  x x x x  o o o o  o o o o";
1865      ;
1866
1867    memory "hfuse"
1868        size            = 1;
1869        min_write_delay = 4500;
1870        max_write_delay = 4500;
1871
1872        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
1873                          "x x x x  x x x x  i i i i  i i i i";
1874
1875        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
1876                          "x x x x  x x x x  o o o o  o o o o";
1877      ;
1878
1879;
1880
1881
1882#------------------------------------------------------------
1883# ATtiny15
1884#------------------------------------------------------------
1885
1886part
1887    id                  = "t15";
1888    desc                = "ATtiny15";
1889    stk500_devcode      = 0x13;
1890    avr910_devcode      = 0x56;
1891    signature           = 0x1e 0x90 0x06;
1892    chip_erase_delay    = 8200;
1893    pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
1894                          "x x x x  x x x x   x x x x  x x x x";
1895
1896    chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
1897                          "x x x x  x x x x   x x x x  x x x x";
1898
1899    timeout		= 200;
1900    stabdelay		= 100;
1901    cmdexedelay		= 25;
1902    synchloops		= 32;
1903    bytedelay		= 0;
1904    pollindex		= 3;
1905    pollvalue		= 0x53;
1906    predelay		= 1;
1907    postdelay		= 1;
1908    pollmethod		= 0;
1909
1910    hvsp_controlstack   =
1911        0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00,
1912        0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
1913        0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
1914        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
1915    hventerstabdelay    = 100;
1916    hvspcmdexedelay     = 5;
1917    synchcycles         = 6;
1918    latchcycles         = 16;
1919    togglevtg           = 1;
1920    poweroffdelay       = 25;
1921    resetdelayms        = 0;
1922    resetdelayus        = 50;
1923    hvleavestabdelay    = 100;
1924    resetdelay          = 25;
1925    chiperasepolltimeout = 40;
1926    chiperasetime       = 0;
1927    programfusepolltimeout = 25;
1928    programlockpolltimeout = 25;
1929
1930    memory "eeprom"
1931        size            = 64;
1932        min_write_delay = 8200;
1933        max_write_delay = 8200;
1934        readback_p1     = 0xff;
1935        readback_p2     = 0xff;
1936        read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
1937                          "x  x a5 a4  a3 a2 a1 a0    o o o o  o o o o";
1938
1939        write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
1940                          "x  x a5 a4  a3 a2 a1 a0    i i i i  i i i i";
1941
1942	mode		= 0x04;
1943	delay		= 10;
1944	blocksize	= 64;
1945	readsize	= 256;
1946    ;
1947
1948    memory "flash"
1949        size            = 1024;
1950        min_write_delay = 4100;
1951        max_write_delay = 4100;
1952        readback_p1     = 0xff;
1953        readback_p2     = 0xff;
1954        read_lo         = "  0  0  1  0   0  0  0  0",
1955                          "  x  x  x  x   x  x  x a8",
1956                          " a7 a6 a5 a4  a3 a2 a1 a0",
1957                          "  o  o  o  o   o  o  o  o";
1958
1959        read_hi         = "  0  0  1  0   1  0  0  0",
1960                          "  x  x  x  x   x  x  x a8",
1961                          " a7 a6 a5 a4  a3 a2 a1 a0",
1962                          "  o  o  o  o   o  o  o  o";
1963
1964        write_lo        = "  0  1  0  0   0  0  0  0",
1965                          "  x  x  x  x   x  x  x a8",
1966                          " a7 a6 a5 a4  a3 a2 a1 a0",
1967                          "  i  i  i  i   i  i  i  i";
1968
1969        write_hi        = "  0  1  0  0   1  0  0  0",
1970                          "  x  x  x  x   x  x  x a8",
1971                          " a7 a6 a5 a4  a3 a2 a1 a0",
1972                          "  i  i  i  i   i  i  i  i";
1973
1974	mode		= 0x04;
1975	delay		= 5;
1976	blocksize	= 128;
1977	readsize	= 256;
1978    ;
1979
1980    memory "signature"
1981        size            = 3;
1982        read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
1983                          "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
1984    ;
1985
1986    memory "lock"
1987        size            = 1;
1988        read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
1989                          "x  x  x  x   x  x  x  x    x x x x  x o o x";
1990
1991        write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 i i 1",
1992                          "x  x  x  x   x  x  x  x    x x x x  x x x x";
1993        min_write_delay = 9000;
1994        max_write_delay = 9000;
1995    ;
1996
1997    memory "calibration"
1998        size            = 1;
1999        read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
2000                          "0  0  0  0   0  0  0  0    o o o o  o o o o";
2001    ;
2002
2003    memory "fuse"
2004        size            = 1;
2005        read            = "0  1  0  1   0  0  0  0    x x x x  x x x x",
2006                          "x  x  x  x   x  x  x  x    o o o o  x x o o";
2007
2008        write           = "1  0  1  0   1  1  0  0    1 0 1 x  x x x x",
2009                          "x  x  x  x   x  x  x  x    i i i i  1 1 i i";
2010        min_write_delay = 9000;
2011        max_write_delay = 9000;
2012    ;
2013;
2014
2015#------------------------------------------------------------
2016# AT90s1200
2017#------------------------------------------------------------
2018
2019part
2020    id               = "1200";
2021    desc             = "AT90S1200";
2022    is_at90s1200     = yes;
2023    stk500_devcode   = 0x33;
2024    avr910_devcode   = 0x13;
2025    signature        = 0x1e 0x90 0x01;
2026    pagel            = 0xd7;
2027    bs2              = 0xa0;
2028    chip_erase_delay = 20000;
2029    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2030                       "x x x x  x x x x    x x x x  x x x x";
2031
2032    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2033                       "x x x x  x x x x    x x x x  x x x x";
2034
2035    timeout		= 200;
2036    stabdelay		= 100;
2037    cmdexedelay		= 25;
2038    synchloops		= 1;
2039    bytedelay		= 0;
2040    pollindex		= 0;
2041    pollvalue		= 0xFF;
2042    predelay		= 1;
2043    postdelay		= 1;
2044    pollmethod		= 0;
2045
2046    pp_controlstack     =
2047        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2048        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2049        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2050        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2051    hventerstabdelay    = 100;
2052    progmodedelay       = 0;
2053    latchcycles         = 0;
2054    togglevtg           = 0;
2055    poweroffdelay       = 0;
2056    resetdelayms        = 0;
2057    resetdelayus        = 0;
2058    hvleavestabdelay    = 15;
2059    chiperasepulsewidth = 15;
2060    chiperasepolltimeout = 0;
2061    programfusepulsewidth = 2;
2062    programfusepolltimeout = 0;
2063    programlockpulsewidth = 0;
2064    programlockpolltimeout = 1;
2065
2066    memory "eeprom"
2067        size            = 64;
2068        min_write_delay = 4000;
2069        max_write_delay = 9000;
2070        readback_p1     = 0x00;
2071        readback_p2     = 0xff;
2072        read            = "1 0  1  0   0  0  0  0   x x x x  x x x x",
2073                          "x x a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2074
2075        write           = "1 1  0  0   0  0  0  0   x x x x  x x x x",
2076                          "x x a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2077
2078	mode		= 0x04;
2079	delay		= 20;
2080	blocksize	= 32;
2081	readsize	= 256;
2082      ;
2083    memory "flash"
2084        size            = 1024;
2085        min_write_delay = 4000;
2086        max_write_delay = 9000;
2087        readback_p1     = 0xff;
2088        readback_p2     = 0xff;
2089        read_lo         = "  0   0   1   0    0   0   0   0",
2090                          "  x   x   x   x    x   x   x  a8",
2091                          " a7  a6  a5  a4   a3  a2  a1  a0",
2092                          "  o   o   o   o    o   o   o   o";
2093
2094        read_hi         = "  0   0   1   0    1   0   0   0",
2095                          "  x   x   x   x    x   x   x  a8",
2096                          " a7  a6  a5  a4   a3  a2  a1  a0",
2097                          "  o   o   o   o    o   o   o   o";
2098
2099        write_lo        = "  0   1   0   0    0   0   0   0",
2100                          "  x   x   x   x    x   x   x  a8",
2101                          " a7  a6  a5  a4   a3  a2  a1  a0",
2102                          "  i   i   i   i    i   i   i   i";
2103
2104        write_hi        = "  0   1   0   0    1   0   0   0",
2105                          "  x   x   x   x    x   x   x  a8",
2106                          " a7  a6  a5  a4   a3  a2  a1  a0",
2107                          "  i   i   i   i    i   i   i   i";
2108
2109	mode		= 0x02;
2110	delay		= 15;
2111	blocksize	= 128;
2112	readsize	= 256;
2113      ;
2114    memory "signature"
2115        size            = 3;
2116        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2117                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2118      ;
2119    memory "fuse"
2120        size            = 1;
2121      ;
2122    memory "lock"
2123        size            = 1;
2124        min_write_delay = 9000;
2125        max_write_delay = 20000;
2126        write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2127                          "x x x x  x x x x   x x x x  x x x x";
2128      ;
2129  ;
2130
2131#------------------------------------------------------------
2132# AT90s4414
2133#------------------------------------------------------------
2134
2135part
2136    id               = "4414";
2137    desc             = "AT90S4414";
2138    stk500_devcode   = 0x50;
2139    avr910_devcode   = 0x28;
2140    signature        = 0x1e 0x92 0x01;
2141    chip_erase_delay = 20000;
2142    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2143                       "x x x x  x x x x    x x x x  x x x x";
2144
2145    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2146                       "x x x x  x x x x    x x x x  x x x x";
2147
2148    timeout		= 200;
2149    stabdelay		= 100;
2150    cmdexedelay		= 25;
2151    synchloops		= 32;
2152    bytedelay		= 0;
2153    pollindex		= 3;
2154    pollvalue		= 0x53;
2155    predelay		= 1;
2156    postdelay		= 1;
2157    pollmethod		= 0;
2158
2159    pp_controlstack     =
2160        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2161        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2162        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2163        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
2164    hventerstabdelay    = 100;
2165    progmodedelay       = 0;
2166    latchcycles         = 0;
2167    togglevtg           = 0;
2168    poweroffdelay       = 0;
2169    resetdelayms        = 0;
2170    resetdelayus        = 0;
2171    hvleavestabdelay    = 15;
2172    chiperasepulsewidth = 15;
2173    chiperasepolltimeout = 0;
2174    programfusepulsewidth = 2;
2175    programfusepolltimeout = 0;
2176    programlockpulsewidth = 0;
2177    programlockpolltimeout = 1;
2178
2179    memory "eeprom"
2180        size            = 256;
2181        min_write_delay = 9000;
2182        max_write_delay = 20000;
2183        readback_p1     = 0x80;
2184        readback_p2     = 0x7f;
2185        read            = " 1  0  1  0   0  0  0  0  x x x x  x x x a8",
2186                          "a7 a6 a5 a4 a3 a2 a1 a0   o o o o  o o o o";
2187
2188        write           = " 1  1  0  0   0  0  0  0   x x x x  x x x a8",
2189                          "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2190
2191	mode		= 0x04;
2192	delay		= 12;
2193	blocksize	= 64;
2194	readsize	= 256;
2195      ;
2196    memory "flash"
2197        size            = 4096;
2198        min_write_delay = 9000;
2199        max_write_delay = 20000;
2200        readback_p1     = 0x7f;
2201        readback_p2     = 0x7f;
2202        read_lo         = "  0   0   1   0    0   0   0   0",
2203                          "  x   x   x   x  a11 a10  a9  a8",
2204                          " a7  a6  a5  a4   a3  a2  a1  a0",
2205                          "  o   o   o   o    o   o   o   o";
2206
2207        read_hi         = "  0   0   1   0    1   0   0   0",
2208                          "  x   x   x   x  a11 a10  a9  a8",
2209                          " a7  a6  a5  a4   a3  a2  a1  a0",
2210                          "  o   o   o   o    o   o   o   o";
2211
2212        write_lo        = "  0   1   0   0    0   0   0   0",
2213                          "  x   x   x   x  a11 a10  a9  a8",
2214                          " a7  a6  a5  a4   a3  a2  a1  a0",
2215                          "  i   i   i   i    i   i   i   i";
2216
2217        write_hi        = "  0   1   0   0    1   0   0   0",
2218                          "  x   x   x   x  a11 a10  a9  a8",
2219                          " a7  a6  a5  a4   a3  a2  a1  a0",
2220                          "  i   i   i   i    i   i   i   i";
2221
2222	mode		= 0x04;
2223	delay		= 12;
2224	blocksize	= 64;
2225	readsize	= 256;
2226      ;
2227    memory "signature"
2228        size            = 3;
2229        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2230                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2231      ;
2232    memory "fuse"
2233	size		= 1;
2234      ;
2235    memory "lock"
2236	size		= 1;
2237	write		= "1  0  1  0   1  1  0  0   1  1  1  1   1  i  i  1",
2238			  "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  x";
2239        min_write_delay = 9000;
2240        max_write_delay = 9000;
2241      ;
2242  ;
2243
2244#------------------------------------------------------------
2245# AT90s2313
2246#------------------------------------------------------------
2247
2248part
2249    id               = "2313";
2250    desc             = "AT90S2313";
2251    stk500_devcode   = 0x40;
2252    avr910_devcode   = 0x20;
2253    signature        = 0x1e 0x91 0x01;
2254    chip_erase_delay = 20000;
2255    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2256                       "x x x x  x x x x    x x x x  x x x x";
2257
2258    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2259                       "x x x x  x x x x    x x x x  x x x x";
2260
2261    timeout		= 200;
2262    stabdelay		= 100;
2263    cmdexedelay		= 25;
2264    synchloops		= 32;
2265    bytedelay		= 0;
2266    pollindex		= 3;
2267    pollvalue		= 0x53;
2268    predelay		= 1;
2269    postdelay		= 1;
2270    pollmethod		= 0;
2271
2272    pp_controlstack     =
2273        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2274        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2275        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2276        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2277    hventerstabdelay    = 100;
2278    progmodedelay       = 0;
2279    latchcycles         = 0;
2280    togglevtg           = 0;
2281    poweroffdelay       = 0;
2282    resetdelayms        = 0;
2283    resetdelayus        = 0;
2284    hvleavestabdelay    = 15;
2285    chiperasepulsewidth = 15;
2286    chiperasepolltimeout = 0;
2287    programfusepulsewidth = 2;
2288    programfusepolltimeout = 0;
2289    programlockpulsewidth = 0;
2290    programlockpolltimeout = 1;
2291
2292    memory "eeprom"
2293        size            = 128;
2294        min_write_delay = 4000;
2295        max_write_delay = 9000;
2296        readback_p1     = 0x80;
2297        readback_p2     = 0x7f;
2298        read            = "1  0  1  0   0  0  0  0   x x x x  x x x x",
2299                          "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2300
2301        write           = "1  1  0  0   0  0  0  0   x x x x  x x x x",
2302                          "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2303
2304	mode		= 0x04;
2305	delay		= 12;
2306	blocksize	= 64;
2307	readsize	= 256;
2308      ;
2309    memory "flash"
2310        size            = 2048;
2311        min_write_delay = 4000;
2312        max_write_delay = 9000;
2313        readback_p1     = 0x7f;
2314        readback_p2     = 0x7f;
2315        read_lo         = "  0   0   1   0    0   0   0   0",
2316                          "  x   x   x   x    x   x  a9  a8",
2317                          " a7  a6  a5  a4   a3  a2  a1  a0",
2318                          "  o   o   o   o    o   o   o   o";
2319
2320        read_hi         = "  0   0   1   0    1   0   0   0",
2321                          "  x   x   x   x    x   x  a9  a8",
2322                          " a7  a6  a5  a4   a3  a2  a1  a0",
2323                          "  o   o   o   o    o   o   o   o";
2324
2325        write_lo        = "  0   1   0   0    0   0   0   0",
2326                          "  x   x   x   x    x   x  a9  a8",
2327                          " a7  a6  a5  a4   a3  a2  a1  a0",
2328                          "  i   i   i   i    i   i   i   i";
2329
2330        write_hi        = "  0   1   0   0    1   0   0   0",
2331                          "  x   x   x   x    x   x  a9  a8",
2332                          " a7  a6  a5  a4   a3  a2  a1  a0",
2333                          "  i   i   i   i    i   i   i   i";
2334
2335	mode		= 0x04;
2336	delay		= 12;
2337	blocksize	= 128;
2338	readsize	= 256;
2339      ;
2340    memory "signature"
2341        size            = 3;
2342        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2343                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2344      ;
2345    memory "fuse"
2346        size            = 1;
2347      ;
2348    memory "lock"
2349        size            = 1;
2350        write           = "1 0 1 0  1 1 0 0  1 1 1 x  x i i x",
2351                          "x x x x  x x x x  x x x x  x x x x";
2352        min_write_delay = 9000;
2353        max_write_delay = 9000;
2354      ;
2355  ;
2356
2357#------------------------------------------------------------
2358# AT90s2333
2359#------------------------------------------------------------
2360
2361part
2362    id               = "2333";
2363##### WARNING: No XML file for device 'AT90S2333'! #####
2364    desc             = "AT90S2333";
2365    stk500_devcode   = 0x42;
2366    avr910_devcode   = 0x34;
2367    signature        = 0x1e 0x91 0x05;
2368    chip_erase_delay = 20000;
2369    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2370                       "x x x x  x x x x    x x x x  x x x x";
2371
2372    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2373                       "x x x x  x x x x    x x x x  x x x x";
2374
2375    timeout		= 200;
2376    stabdelay		= 100;
2377    cmdexedelay		= 25;
2378    synchloops		= 32;
2379    bytedelay		= 0;
2380    pollindex		= 3;
2381    pollvalue		= 0x53;
2382    predelay		= 1;
2383    postdelay		= 1;
2384    pollmethod		= 0;
2385
2386    pp_controlstack     =
2387        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2388        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2389        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2390        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2391    hventerstabdelay    = 100;
2392    progmodedelay       = 0;
2393    latchcycles         = 0;
2394    togglevtg           = 0;
2395    poweroffdelay       = 0;
2396    resetdelayms        = 0;
2397    resetdelayus        = 0;
2398    hvleavestabdelay    = 15;
2399    chiperasepulsewidth = 15;
2400    chiperasepolltimeout = 0;
2401    programfusepulsewidth = 2;
2402    programfusepolltimeout = 0;
2403    programlockpulsewidth = 0;
2404    programlockpolltimeout = 1;
2405
2406    memory "eeprom"
2407        size            = 128;
2408        min_write_delay = 9000;
2409        max_write_delay = 20000;
2410        readback_p1     = 0x00;
2411        readback_p2     = 0xff;
2412        read            = "1  0  1  0   0  0  0  0   x x x x  x x x x",
2413                          "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2414
2415        write           = "1  1  0  0   0  0  0  0   x x x x  x x x x",
2416                          "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2417
2418	mode		= 0x04;
2419	delay		= 12;
2420	blocksize	= 128;
2421	readsize	= 256;
2422      ;
2423
2424    memory "flash"
2425        size            = 2048;
2426        min_write_delay = 9000;
2427        max_write_delay = 20000;
2428        readback_p1     = 0xff;
2429        readback_p2     = 0xff;
2430        read_lo         = "  0   0   1   0    0   0   0   0",
2431                          "  x   x   x   x    x   x  a9  a8",
2432                          " a7  a6  a5  a4   a3  a2  a1  a0",
2433                          "  o   o   o   o    o   o   o   o";
2434
2435        read_hi         = "  0   0   1   0    1   0   0   0",
2436                          "  x   x   x   x    x   x  a9  a8",
2437                          " a7  a6  a5  a4   a3  a2  a1  a0",
2438                          "  o   o   o   o    o   o   o   o";
2439
2440        write_lo        = "  0   1   0   0    0   0   0   0",
2441                          "  x   x   x   x    x   x  a9  a8",
2442                          " a7  a6  a5  a4   a3  a2  a1  a0",
2443                          "  i   i   i   i    i   i   i   i";
2444
2445        write_hi        = "  0   1   0   0    1   0   0   0",
2446                          "  x   x   x   x    x   x  a9  a8",
2447                          " a7  a6  a5  a4   a3  a2  a1  a0",
2448                          "  i   i   i   i    i   i   i   i";
2449
2450	mode		= 0x04;
2451	delay		= 12;
2452	blocksize	= 128;
2453	readsize	= 256;
2454      ;
2455
2456    memory "signature"
2457        size            = 3;
2458        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2459                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2460      ;
2461    memory "fuse"
2462        size            = 1;
2463        min_write_delay = 9000;
2464        max_write_delay = 20000;
2465        pwroff_after_write = yes;
2466        read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
2467                          "x x x x  x x x x   x x o o  o o o o";
2468
2469        write           = "1 0 1 0  1 1 0 0   1 0 1 i  i i i i",
2470                          "x x x x  x x x x   x x x x  x x x x";
2471      ;
2472    memory "lock"
2473        size            = 1;
2474        min_write_delay = 9000;
2475        max_write_delay = 20000;
2476        read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2477                          "x x x x  x x x x   x x x x  x o o x";
2478
2479        write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2480                          "x x x x  x x x x   x x x x  x x x x";
2481      ;
2482  ;
2483
2484
2485#------------------------------------------------------------
2486# AT90s2343 (also AT90s2323 and ATtiny22)
2487#------------------------------------------------------------
2488
2489part
2490    id               = "2343";
2491    desc             = "AT90S2343";
2492    stk500_devcode   = 0x43;
2493    avr910_devcode   = 0x4c;
2494    signature        = 0x1e 0x91 0x03;
2495    chip_erase_delay = 18000;
2496    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2497                       "x x x x  x x x x    x x x x  x x x x";
2498
2499    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
2500                       "x x x x  x x x x    x x x x  x x x x";
2501
2502    timeout		= 200;
2503    stabdelay		= 100;
2504    cmdexedelay		= 25;
2505    synchloops		= 32;
2506    bytedelay		= 0;
2507    pollindex		= 3;
2508    pollvalue		= 0x53;
2509    predelay		= 1;
2510    postdelay		= 1;
2511    pollmethod		= 0;
2512
2513    hvsp_controlstack   =
2514        0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00,
2515        0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
2516        0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
2517        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
2518    hventerstabdelay    = 100;
2519    hvspcmdexedelay     = 0;
2520    synchcycles         = 6;
2521    latchcycles         = 1;
2522    togglevtg           = 0;
2523    poweroffdelay       = 25;
2524    resetdelayms        = 0;
2525    resetdelayus        = 50;
2526    hvleavestabdelay    = 100;
2527    resetdelay          = 25;
2528    chiperasepolltimeout = 40;
2529    chiperasetime       = 0;
2530    programfusepolltimeout = 25;
2531    programlockpolltimeout = 25;
2532
2533    memory "eeprom"
2534        size            = 128;
2535        min_write_delay = 9000;
2536        max_write_delay = 20000;
2537        readback_p1     = 0x00;
2538        readback_p2     = 0xff;
2539        read            = "1  0  1  0   0  0  0  0   0 0 0 0  0 0 0 0",
2540                          "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2541
2542        write           = "1  1  0  0   0  0  0  0   0 0 0 0  0 0 0 0",
2543                          "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2544
2545	mode		= 0x04;
2546	delay		= 12;
2547	blocksize	= 64;
2548	readsize	= 256;
2549      ;
2550    memory "flash"
2551        size            = 2048;
2552        min_write_delay = 9000;
2553        max_write_delay = 20000;
2554        readback_p1     = 0xff;
2555        readback_p2     = 0xff;
2556        read_lo         = "  0   0   1   0    0   0   0   0",
2557                          "  x   x   x   x    x   x  a9  a8",
2558                          " a7  a6  a5  a4   a3  a2  a1  a0",
2559                          "  o   o   o   o    o   o   o   o";
2560
2561        read_hi         = "  0   0   1   0    1   0   0   0",
2562                          "  x   x   x   x    x   x  a9  a8",
2563                          " a7  a6  a5  a4   a3  a2  a1  a0",
2564                          "  o   o   o   o    o   o   o   o";
2565
2566        write_lo        = "  0   1   0   0    0   0   0   0",
2567                          "  x   x   x   x    x   x  a9  a8",
2568                          " a7  a6  a5  a4   a3  a2  a1  a0",
2569                          "  i   i   i   i    i   i   i   i";
2570
2571        write_hi        = "  0   1   0   0    1   0   0   0",
2572                          "  x   x   x   x    x   x  a9  a8",
2573                          " a7  a6  a5  a4   a3  a2  a1  a0",
2574                          "  i   i   i   i    i   i   i   i";
2575
2576	mode		= 0x04;
2577	delay		= 12;
2578	blocksize	= 128;
2579	readsize	= 128;
2580      ;
2581    memory "signature"
2582        size            = 3;
2583        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2584                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2585      ;
2586    memory "fuse"
2587        size            = 1;
2588        min_write_delay = 9000;
2589        max_write_delay = 20000;
2590        read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2591                          "x x x x  x x x x   o o o x  x x x o";
2592
2593        write           = "1 0 1 0  1 1 0 0   1 0 1 1  1 1 1 i",
2594                          "x x x x  x x x x   x x x x  x x x x";
2595      ;
2596    memory "lock"
2597        size            = 1;
2598        min_write_delay = 9000;
2599        max_write_delay = 20000;
2600        read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2601                          "x x x x  x x x x   o o o x  x x x o";
2602
2603        write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2604                          "x x x x  x x x x   x x x x  x x x x";
2605      ;
2606  ;
2607
2608
2609#------------------------------------------------------------
2610# AT90s4433
2611#------------------------------------------------------------
2612
2613part
2614    id               = "4433";
2615    desc             = "AT90S4433";
2616    stk500_devcode   = 0x51;
2617    avr910_devcode   = 0x30;
2618    signature        = 0x1e 0x92 0x03;
2619    chip_erase_delay = 20000;
2620    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2621                       "x x x x  x x x x    x x x x  x x x x";
2622
2623    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2624                       "x x x x  x x x x    x x x x  x x x x";
2625
2626    timeout		= 200;
2627    stabdelay		= 100;
2628    cmdexedelay		= 25;
2629    synchloops		= 32;
2630    bytedelay		= 0;
2631    pollindex		= 3;
2632    pollvalue		= 0x53;
2633    predelay		= 1;
2634    postdelay		= 1;
2635    pollmethod		= 0;
2636
2637    pp_controlstack     =
2638        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2639        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2640        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2641        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2642    hventerstabdelay    = 100;
2643    progmodedelay       = 0;
2644    latchcycles         = 0;
2645    togglevtg           = 0;
2646    poweroffdelay       = 0;
2647    resetdelayms        = 0;
2648    resetdelayus        = 0;
2649    hvleavestabdelay    = 15;
2650    chiperasepulsewidth = 15;
2651    chiperasepolltimeout = 0;
2652    programfusepulsewidth = 2;
2653    programfusepolltimeout = 0;
2654    programlockpulsewidth = 0;
2655    programlockpolltimeout = 1;
2656
2657    memory "eeprom"
2658        size            = 256;
2659        min_write_delay = 9000;
2660        max_write_delay = 20000;
2661        readback_p1     = 0x00;
2662        readback_p2     = 0xff;
2663        read            = " 1  0  1  0   0  0  0  0   x x x x  x x x x",
2664                          "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2665
2666        write           = " 1  1  0  0   0  0  0  0   x x x x  x x x x",
2667                          "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2668
2669	mode		= 0x04;
2670	delay		= 12;
2671	blocksize	= 128;
2672	readsize	= 256;
2673      ;
2674    memory "flash"
2675        size            = 4096;
2676        min_write_delay = 9000;
2677        max_write_delay = 20000;
2678        readback_p1     = 0xff;
2679        readback_p2     = 0xff;
2680        read_lo         = "  0   0   1   0    0   0   0   0",
2681                          "  x   x   x   x    x a10  a9  a8",
2682                          " a7  a6  a5  a4   a3  a2  a1  a0",
2683                          "  o   o   o   o    o   o   o   o";
2684
2685        read_hi         = "  0   0   1   0    1   0   0   0",
2686                          "  x   x   x   x    x a10  a9  a8",
2687                          " a7  a6  a5  a4   a3  a2  a1  a0",
2688                          "  o   o   o   o    o   o   o   o";
2689
2690        write_lo        = "  0   1   0   0    0   0   0   0",
2691                          "  x   x   x   x    x a10  a9  a8",
2692                          " a7  a6  a5  a4   a3  a2  a1  a0",
2693                          "  i   i   i   i    i   i   i   i";
2694
2695        write_hi        = "  0   1   0   0    1   0   0   0",
2696                          "  x   x   x   x    x a10  a9  a8",
2697                          " a7  a6  a5  a4   a3  a2  a1  a0",
2698                          "  i   i   i   i    i   i   i   i";
2699
2700	mode		= 0x04;
2701	delay		= 12;
2702	blocksize	= 128;
2703	readsize	= 256;
2704      ;
2705    memory "signature"
2706        size            = 3;
2707        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2708                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2709      ;
2710    memory "fuse"
2711        size            = 1;
2712        min_write_delay = 9000;
2713        max_write_delay = 20000;
2714        pwroff_after_write = yes;
2715        read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
2716                          "x x x x  x x x x   x x o o  o o o o";
2717
2718        write           = "1 0 1 0  1 1 0 0   1 0 1 i  i i i i",
2719                          "x x x x  x x x x   x x x x  x x x x";
2720      ;
2721    memory "lock"
2722        size            = 1;
2723        min_write_delay = 9000;
2724        max_write_delay = 20000;
2725        read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2726                          "x x x x  x x x x   x x x x  x o o x";
2727
2728        write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2729                          "x x x x  x x x x   x x x x  x x x x";
2730      ;
2731  ;
2732
2733#------------------------------------------------------------
2734# AT90s4434
2735#------------------------------------------------------------
2736
2737part
2738    id               = "4434";
2739##### WARNING: No XML file for device 'AT90S4434'! #####
2740    desc             = "AT90S4434";
2741    stk500_devcode   = 0x52;
2742    avr910_devcode   = 0x6c;
2743    signature        = 0x1e 0x92 0x02;
2744    chip_erase_delay = 20000;
2745    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2746                       "x x x x  x x x x    x x x x  x x x x";
2747
2748    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2749                       "x x x x  x x x x    x x x x  x x x x";
2750
2751    memory "eeprom"
2752        size            = 256;
2753        min_write_delay = 9000;
2754        max_write_delay = 20000;
2755        readback_p1     = 0x00;
2756        readback_p2     = 0xff;
2757        read            = " 1  0  1  0   0  0  0  0   x x x x  x x x x",
2758                          "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2759
2760        write           = " 1  1  0  0   0  0  0  0   x x x x  x x x x",
2761                          "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2762      ;
2763    memory "flash"
2764        size            = 4096;
2765        min_write_delay = 9000;
2766        max_write_delay = 20000;
2767        readback_p1     = 0xff;
2768        readback_p2     = 0xff;
2769        read_lo         = "  0   0   1   0    0   0   0   0",
2770                          "  x   x   x   x    x a10  a9  a8",
2771                          " a7  a6  a5  a4   a3  a2  a1  a0",
2772                          "  o   o   o   o    o   o   o   o";
2773
2774        read_hi         = "  0   0   1   0    1   0   0   0",
2775                          "  x   x   x   x    x a10  a9  a8",
2776                          " a7  a6  a5  a4   a3  a2  a1  a0",
2777                          "  o   o   o   o    o   o   o   o";
2778
2779        write_lo        = "  0   1   0   0    0   0   0   0",
2780                          "  x   x   x   x    x a10  a9  a8",
2781                          " a7  a6  a5  a4   a3  a2  a1  a0",
2782                          "  i   i   i   i    i   i   i   i";
2783
2784        write_hi        = "  0   1   0   0    1   0   0   0",
2785                          "  x   x   x   x    x a10  a9  a8",
2786                          " a7  a6  a5  a4   a3  a2  a1  a0",
2787                          "  i   i   i   i    i   i   i   i";
2788      ;
2789    memory "signature"
2790        size            = 3;
2791        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2792                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2793      ;
2794    memory "fuse"
2795        size            = 1;
2796        min_write_delay = 9000;
2797        max_write_delay = 20000;
2798        read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
2799                          "x x x x  x x x x   x x o o  o o o o";
2800
2801        write           = "1 0 1 0  1 1 0 0   1 0 1 i  i i i i",
2802                          "x x x x  x x x x   x x x x  x x x x";
2803      ;
2804    memory "lock"
2805        size            = 1;
2806        min_write_delay = 9000;
2807        max_write_delay = 20000;
2808        read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2809                          "x x x x  x x x x   x x x x  x o o x";
2810
2811        write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2812                          "x x x x  x x x x   x x x x  x x x x";
2813      ;
2814  ;
2815
2816#------------------------------------------------------------
2817# AT90s8515
2818#------------------------------------------------------------
2819
2820part
2821    id               = "8515";
2822    desc             = "AT90S8515";
2823    stk500_devcode   = 0x60;
2824    avr910_devcode   = 0x38;
2825    signature        = 0x1e 0x93 0x01;
2826    chip_erase_delay = 20000;
2827    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2828                       "x x x x  x x x x    x x x x  x x x x";
2829
2830    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
2831                       "x x x x  x x x x    x x x x  x x x x";
2832
2833    timeout		= 200;
2834    stabdelay		= 100;
2835    cmdexedelay		= 25;
2836    synchloops		= 32;
2837    bytedelay		= 0;
2838    pollindex		= 3;
2839    pollvalue		= 0x53;
2840    predelay		= 1;
2841    postdelay		= 1;
2842    pollmethod		= 0;
2843
2844    pp_controlstack     =
2845	0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2846	0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2847	0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2848	0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2849    hventerstabdelay    = 100;
2850    progmodedelay       = 0;
2851    latchcycles         = 0;
2852    togglevtg           = 0;
2853    poweroffdelay       = 0;
2854    resetdelayms        = 0;
2855    resetdelayus        = 0;
2856    hvleavestabdelay    = 15;
2857    resetdelay          = 15;
2858    chiperasepulsewidth = 15;
2859    chiperasepolltimeout = 0;
2860    programfusepulsewidth = 2;
2861    programfusepolltimeout = 0;
2862    programlockpulsewidth = 0;
2863    programlockpolltimeout = 1;
2864
2865    memory "eeprom"
2866        size            = 512;
2867        min_write_delay = 4000;
2868        max_write_delay = 9000;
2869        readback_p1     = 0x80;
2870        readback_p2     = 0x7f;
2871        read            = " 1  0  1  0   0  0  0  0  x x x x  x x x a8",
2872                          "a7 a6 a5 a4 a3 a2 a1 a0   o o o o  o o o o";
2873
2874        write           = " 1  1  0  0   0  0  0  0   x x x x  x x x a8",
2875                          "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2876
2877	mode		= 0x04;
2878	delay		= 12;
2879	blocksize	= 128;
2880	readsize	= 256;
2881      ;
2882    memory "flash"
2883        size            = 8192;
2884        min_write_delay = 4000;
2885        max_write_delay = 9000;
2886        readback_p1     = 0x7f;
2887        readback_p2     = 0x7f;
2888        read_lo         = "  0   0   1   0    0   0   0   0",
2889                          "  x   x   x   x  a11 a10  a9  a8",
2890                          " a7  a6  a5  a4   a3  a2  a1  a0",
2891                          "  o   o   o   o    o   o   o   o";
2892
2893        read_hi         = "  0   0   1   0    1   0   0   0",
2894                          "  x   x   x   x  a11 a10  a9  a8",
2895                          " a7  a6  a5  a4   a3  a2  a1  a0",
2896                          "  o   o   o   o    o   o   o   o";
2897
2898        write_lo        = "  0   1   0   0    0   0   0   0",
2899                          "  x   x   x   x  a11 a10  a9  a8",
2900                          " a7  a6  a5  a4   a3  a2  a1  a0",
2901                          "  i   i   i   i    i   i   i   i";
2902
2903        write_hi        = "  0   1   0   0    1   0   0   0",
2904                          "  x   x   x   x  a11 a10  a9  a8",
2905                          " a7  a6  a5  a4   a3  a2  a1  a0",
2906                          "  i   i   i   i    i   i   i   i";
2907
2908	mode		= 0x04;
2909	delay		= 12;
2910	blocksize	= 128;
2911	readsize	= 256;
2912      ;
2913    memory "signature"
2914        size            = 3;
2915        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2916                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2917      ;
2918    memory "fuse"
2919	size		= 1;
2920      ;
2921    memory "lock"
2922	size		= 1;
2923	write		= "1  0  1  0   1  1  0  0   1  1  1  1   1  i  i  1",
2924			  "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  x";
2925        min_write_delay = 9000;
2926        max_write_delay = 9000;
2927      ;
2928  ;
2929
2930#------------------------------------------------------------
2931# AT90s8535
2932#------------------------------------------------------------
2933
2934part
2935    id               = "8535";
2936    desc             = "AT90S8535";
2937    stk500_devcode   = 0x61;
2938    avr910_devcode   = 0x68;
2939    signature        = 0x1e 0x93 0x03;
2940    chip_erase_delay = 20000;
2941    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2942                       "x x x x  x x x x    x x x x  x x x x";
2943
2944    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2945                       "x x x x  x x x x    x x x x  x x x x";
2946
2947    timeout		= 200;
2948    stabdelay		= 100;
2949    cmdexedelay		= 25;
2950    synchloops		= 32;
2951    bytedelay		= 0;
2952    pollindex		= 3;
2953    pollvalue		= 0x53;
2954    predelay		= 1;
2955    postdelay		= 1;
2956    pollmethod		= 0;
2957
2958    pp_controlstack     =
2959        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2960        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2961        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2962        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2963    hventerstabdelay    = 100;
2964    progmodedelay       = 0;
2965    latchcycles         = 0;
2966    togglevtg           = 0;
2967    poweroffdelay       = 0;
2968    resetdelayms        = 0;
2969    resetdelayus        = 0;
2970    hvleavestabdelay    = 15;
2971    chiperasepulsewidth = 15;
2972    chiperasepolltimeout = 0;
2973    programfusepulsewidth = 2;
2974    programfusepolltimeout = 0;
2975    programlockpulsewidth = 0;
2976    programlockpolltimeout = 1;
2977
2978    memory "eeprom"
2979        size            = 512;
2980        min_write_delay = 9000;
2981        max_write_delay = 20000;
2982        readback_p1     = 0x00;
2983        readback_p2     = 0xff;
2984        read            = " 1  0  1  0   0  0  0  0   x x x x  x x x a8",
2985                          "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2986
2987        write           = " 1  1  0  0   0  0  0  0   x x x x  x x x a8",
2988                          "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2989
2990	mode		= 0x04;
2991	delay		= 12;
2992	blocksize	= 128;
2993	readsize	= 256;
2994      ;
2995    memory "flash"
2996        size            = 8192;
2997        min_write_delay = 9000;
2998        max_write_delay = 20000;
2999        readback_p1     = 0xff;
3000        readback_p2     = 0xff;
3001        read_lo         = "  0   0   1   0    0   0   0   0",
3002                          "  x   x   x   x  a11 a10  a9  a8",
3003                          " a7  a6  a5  a4   a3  a2  a1  a0",
3004                          "  o   o   o   o    o   o   o   o";
3005
3006        read_hi         = "  0   0   1   0    1   0   0   0",
3007                          "  x   x   x   x  a11 a10  a9  a8",
3008                          " a7  a6  a5  a4   a3  a2  a1  a0",
3009                          "  o   o   o   o    o   o   o   o";
3010
3011        write_lo        = "  0   1   0   0    0   0   0   0",
3012                          "  x   x   x   x  a11 a10  a9  a8",
3013                          " a7  a6  a5  a4   a3  a2  a1  a0",
3014                          "  i   i   i   i    i   i   i   i";
3015
3016        write_hi        = "  0   1   0   0    1   0   0   0",
3017                          "  x   x   x   x  a11 a10  a9  a8",
3018                          " a7  a6  a5  a4   a3  a2  a1  a0",
3019                          "  i   i   i   i    i   i   i   i";
3020
3021	mode		= 0x04;
3022	delay		= 12;
3023	blocksize	= 128;
3024	readsize	= 256;
3025      ;
3026    memory "signature"
3027        size            = 3;
3028        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3029                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3030      ;
3031    memory "fuse"
3032	size		= 1;
3033	read		= "0  1  0  1   1  0  0  0   x  x  x  x   x  x  x  x",
3034			  "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  o";
3035	write		= "1  0  1  0   1  1  0  0   1  0  1  1   1  1  1  i",
3036			  "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  x";
3037        min_write_delay = 9000;
3038        max_write_delay = 9000;
3039      ;
3040    memory "lock"
3041	size		= 1;
3042	read		= "0  1  0  1   1  0  0  0   x  x  x  x   x  x  x  x",
3043			  "x  x  x  x   x  x  x  x   o  o  x  x   x  x  x  x";
3044	write		= "1  0  1  0   1  1  0  0   1  1  1  1   1  i  i  1",
3045			  "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  x";
3046        min_write_delay = 9000;
3047        max_write_delay = 9000;
3048      ;
3049  ;
3050
3051#------------------------------------------------------------
3052# ATmega103
3053#------------------------------------------------------------
3054
3055part
3056    id               = "m103";
3057    desc             = "ATmega103";
3058    stk500_devcode   = 0xB1;
3059    avr910_devcode   = 0x41;
3060    signature        = 0x1e 0x97 0x01;
3061    chip_erase_delay = 112000;
3062    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3063                       "x x x x  x x x x    x x x x  x x x x";
3064
3065    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
3066                       "x x x x  x x x x    x x x x  x x x x";
3067
3068    timeout		= 200;
3069    stabdelay		= 100;
3070    cmdexedelay		= 25;
3071    synchloops		= 32;
3072    bytedelay		= 0;
3073    pollindex		= 3;
3074    pollvalue		= 0x53;
3075    predelay		= 1;
3076    postdelay		= 1;
3077    pollmethod		= 0;
3078
3079    pp_controlstack     =
3080        0x0E, 0x1E, 0x8E, 0x9E, 0x2E, 0x3E, 0xAE, 0xBE,
3081        0x4E, 0x5E, 0xCE, 0xDE, 0x6E, 0x7E, 0xEE, 0xDE,
3082        0x66, 0x76, 0xE6, 0xF6, 0x6A, 0x7A, 0xEA, 0x7A,
3083        0x7F, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
3084    hventerstabdelay    = 100;
3085    progmodedelay       = 0;
3086    latchcycles         = 0;
3087    togglevtg           = 0;
3088    poweroffdelay       = 0;
3089    resetdelayms        = 0;
3090    resetdelayus        = 0;
3091    hvleavestabdelay    = 15;
3092    chiperasepulsewidth = 15;
3093    chiperasepolltimeout = 0;
3094    programfusepulsewidth = 2;
3095    programfusepolltimeout = 0;
3096    programlockpulsewidth = 0;
3097    programlockpolltimeout = 10;
3098
3099    memory "eeprom"
3100        size            = 4096;
3101        min_write_delay = 4000;
3102        max_write_delay = 9000;
3103        readback_p1     = 0x80;
3104        readback_p2     = 0x7f;
3105	read            = "  1   0   1   0      0   0   0   0",
3106                          "  x   x   x   x    a11 a10  a9  a8",
3107                          " a7  a6  a5  a4     a3  a2  a1  a0",
3108                          "  o   o   o   o      o   o   o   o";
3109
3110	write           = "  1   1   0   0      0   0   0   0",
3111                          "  x   x   x   x    a11 a10  a9  a8",
3112                          " a7  a6  a5  a4     a3  a2  a1  a0",
3113                          "  i   i   i   i      i   i   i   i";
3114
3115	mode		= 0x04;
3116	delay		= 12;
3117	blocksize	= 64;
3118	readsize	= 256;
3119      ;
3120
3121    memory "flash"
3122        paged           = yes;
3123        size            = 131072;
3124        page_size       = 256;
3125        num_pages       = 512;
3126        min_write_delay = 22000;
3127        max_write_delay = 56000;
3128        readback_p1     = 0xff;
3129        readback_p2     = 0xff;
3130        read_lo         = "  0   0   1   0      0   0   0   0",
3131                          "a15 a14 a13 a12    a11 a10  a9  a8",
3132                          " a7  a6  a5  a4     a3  a2  a1  a0",
3133                          "  o   o   o   o      o   o   o   o";
3134
3135        read_hi         = "  0   0   1   0      1   0   0   0",
3136                          "a15 a14 a13 a12    a11 a10  a9  a8",
3137                          " a7  a6  a5  a4     a3  a2  a1  a0",
3138                          "  o   o   o   o      o   o   o   o";
3139
3140        loadpage_lo     = "  0   1   0   0      0   0   0   0",
3141                          "  x   x   x   x      x   x   x   x",
3142                          "  x  a6  a5  a4     a3  a2  a1  a0",
3143                          "  i   i   i   i      i   i   i   i";
3144
3145        loadpage_hi     = "  0   1   0   0      1   0   0   0",
3146                          "  x   x   x   x      x   x   x   x",
3147                          "  x  a6  a5  a4     a3  a2  a1  a0",
3148                          "  i   i   i   i      i   i   i   i";
3149
3150        writepage       = "  0   1   0   0      1   1   0   0",
3151                          "a15 a14 a13 a12    a11 a10  a9  a8",
3152                          " a7   x   x   x      x   x   x   x",
3153                          "  x   x   x   x      x   x   x   x";
3154
3155	mode		= 0x11;
3156	delay		= 70;
3157	blocksize	= 256;
3158	readsize	= 256;
3159      ;
3160
3161    memory "fuse"
3162        size            = 1;
3163        read            = "0 1 0 1  0 0 0 0  x x x x  x x x x",
3164                          "x x x x  x x x x  x x o x  o 1 o o";
3165
3166        write           = "1 0 1 0  1 1 0 0  1 0 1 1  i 1 i i",
3167                          "x x x x  x x x x  x x x x  x x x x";
3168        min_write_delay = 9000;
3169        max_write_delay = 9000;
3170      ;
3171
3172    memory "lock"
3173        size            = 1;
3174        read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
3175                          "x x x x  x x x x   x x x x  x o o x";
3176
3177        write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
3178                          "x x x x  x x x x   x x x x  x x x x";
3179        min_write_delay = 9000;
3180        max_write_delay = 9000;
3181      ;
3182
3183    memory "signature"
3184        size            = 3;
3185        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3186                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3187      ;
3188  ;
3189
3190
3191#------------------------------------------------------------
3192# ATmega64
3193#------------------------------------------------------------
3194
3195part
3196    id               = "m64";
3197    desc             = "ATmega64";
3198    has_jtag         = yes;
3199    stk500_devcode   = 0xA0;
3200    avr910_devcode   = 0x45;
3201    signature        = 0x1e 0x96 0x02;
3202    chip_erase_delay = 9000;
3203    pagel            = 0xD7;
3204    bs2              = 0xA0;
3205    reset            = dedicated;
3206    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3207                       "x x x x  x x x x    x x x x  x x x x";
3208
3209    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
3210                       "x x x x  x x x x    x x x x  x x x x";
3211
3212    timeout		= 200;
3213    stabdelay		= 100;
3214    cmdexedelay		= 25;
3215    synchloops		= 32;
3216    bytedelay		= 0;
3217    pollindex		= 3;
3218    pollvalue		= 0x53;
3219    predelay		= 1;
3220    postdelay		= 1;
3221    pollmethod		= 0;
3222
3223    pp_controlstack     =
3224        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3225        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3226        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3227        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
3228    hventerstabdelay    = 100;
3229    progmodedelay       = 0;
3230    latchcycles         = 6;
3231    togglevtg           = 0;
3232    poweroffdelay       = 0;
3233    resetdelayms        = 0;
3234    resetdelayus        = 0;
3235    hvleavestabdelay    = 15;
3236    chiperasepulsewidth = 0;
3237    chiperasepolltimeout = 10;
3238    programfusepulsewidth = 0;
3239    programfusepolltimeout = 5;
3240    programlockpulsewidth = 0;
3241    programlockpolltimeout = 5;
3242
3243    idr                 = 0x22;
3244    spmcr               = 0x68;
3245    allowfullpagebitstream = yes;
3246
3247    ocdrev              = 2;
3248
3249    memory "eeprom"
3250        paged           = no; /* leave this "no" */
3251        page_size       = 8;  /* for parallel programming */
3252        size            = 2048;
3253        min_write_delay = 9000;
3254        max_write_delay = 9000;
3255        readback_p1     = 0xff;
3256        readback_p2     = 0xff;
3257        read            = "  1   0   1   0      0   0   0   0",
3258                          "  x   x   x   x    a11 a10  a9  a8",
3259                          " a7  a6  a5  a4     a3  a2  a1  a0",
3260                          "  o   o   o   o      o   o   o   o";
3261
3262        write           = "  1   1   0   0      0   0   0   0",
3263                          "  x   x   x   x    a11 a10  a9  a8",
3264                          " a7  a6  a5  a4     a3  a2  a1  a0",
3265                          "  i   i   i   i      i   i   i   i";
3266
3267	mode		= 0x04;
3268	delay		= 20;
3269	blocksize	= 64;
3270	readsize	= 256;
3271      ;
3272
3273    memory "flash"
3274        paged           = yes;
3275        size            = 65536;
3276        page_size       = 256;
3277        num_pages       = 256;
3278        min_write_delay = 4500;
3279        max_write_delay = 4500;
3280        readback_p1     = 0xff;
3281        readback_p2     = 0xff;
3282        read_lo         = "  0   0   1   0      0   0   0   0",
3283                          "  x a14 a13 a12    a11 a10  a9  a8",
3284                          " a7  a6  a5  a4     a3  a2  a1  a0",
3285                          "  o   o   o   o      o   o   o   o";
3286
3287        read_hi         = "  0   0   1   0      1   0   0   0",
3288                          "  x a14 a13 a12    a11 a10  a9  a8",
3289                          " a7  a6  a5  a4     a3  a2  a1  a0",
3290                          "  o   o   o   o      o   o   o   o";
3291
3292
3293        loadpage_lo     = "  0   1   0   0      0   0   0   0",
3294                          "  x   x   x   x      x   x   x   x",
3295                          "  x  a6  a5  a4     a3  a2  a1  a0",
3296                          "  i   i   i   i      i   i   i   i";
3297
3298        loadpage_hi     = "  0   1   0   0      1   0   0   0",
3299                          "  x   x   x   x      x   x   x   x",
3300                          "  x  a6  a5  a4     a3  a2  a1  a0",
3301                          "  i   i   i   i      i   i   i   i";
3302
3303        writepage       = "  0   1   0   0      1   1   0   0",
3304                          "  x a14 a13 a12    a11 a10  a9  a8",
3305                          " a7   x   x   x      x   x   x   x",
3306                          "  x   x   x   x      x   x   x   x";
3307
3308	mode		= 0x21;
3309	delay		= 6;
3310	blocksize	= 128;
3311	readsize	= 256;
3312      ;
3313
3314    memory "lfuse"
3315        size            = 1;
3316        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
3317                          "x x x x  x x x x  i i i i  i i i i";
3318
3319        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
3320                          "x x x x  x x x x  o o o o  o o o o";
3321        min_write_delay = 9000;
3322        max_write_delay = 9000;
3323      ;
3324
3325    memory "hfuse"
3326        size            = 1;
3327        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
3328                          "x x x x  x x x x  i i i i  i i i i";
3329
3330        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
3331                          "x x x x  x x x x  o o o o  o o o o";
3332        min_write_delay = 9000;
3333        max_write_delay = 9000;
3334      ;
3335
3336    memory "efuse"
3337        size            = 1;
3338        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3339                          "x x x x  x x x x  x x x x  x x i i";
3340
3341        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3342                          "x x x x  x x x x  o o o o  o o o o";
3343        min_write_delay = 9000;
3344        max_write_delay = 9000;
3345      ;
3346
3347    memory "lock"
3348        size            = 1;
3349        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3350                          "x x x x  x x x x   x x o o  o o o o";
3351
3352        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3353                          "x x x x  x x x x   1 1 i i  i i i i";
3354        min_write_delay = 9000;
3355        max_write_delay = 9000;
3356      ;
3357
3358    memory "calibration"
3359        size            = 4;
3360        read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
3361                          "0 0 0 0  0 0 a1 a0  o o o o  o o o o";
3362      ;
3363
3364    memory "signature"
3365        size            = 3;
3366        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3367                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3368      ;
3369  ;
3370
3371
3372
3373
3374#------------------------------------------------------------
3375# ATmega128
3376#------------------------------------------------------------
3377
3378part
3379    id               = "m128";
3380    desc             = "ATmega128";
3381    has_jtag         = yes;
3382    stk500_devcode   = 0xB2;
3383    avr910_devcode   = 0x43;
3384    signature        = 0x1e 0x97 0x02;
3385    chip_erase_delay = 9000;
3386    pagel            = 0xD7;
3387    bs2              = 0xA0;
3388    reset            = dedicated;
3389    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3390                       "x x x x  x x x x    x x x x  x x x x";
3391
3392    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
3393                       "x x x x  x x x x    x x x x  x x x x";
3394
3395    timeout		= 200;
3396    stabdelay		= 100;
3397    cmdexedelay		= 25;
3398    synchloops		= 32;
3399    bytedelay		= 0;
3400    pollindex		= 3;
3401    pollvalue		= 0x53;
3402    predelay		= 1;
3403    postdelay		= 1;
3404    pollmethod		= 0;
3405
3406    pp_controlstack     =
3407        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3408        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3409        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3410        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
3411    hventerstabdelay    = 100;
3412    progmodedelay       = 0;
3413    latchcycles         = 6;
3414    togglevtg           = 0;
3415    poweroffdelay       = 0;
3416    resetdelayms        = 0;
3417    resetdelayus        = 0;
3418    hvleavestabdelay    = 15;
3419    chiperasepulsewidth = 0;
3420    chiperasepolltimeout = 10;
3421    programfusepulsewidth = 0;
3422    programfusepolltimeout = 5;
3423    programlockpulsewidth = 0;
3424    programlockpolltimeout = 5;
3425
3426    idr                 = 0x22;
3427    spmcr               = 0x68;
3428    rampz               = 0x3b;
3429    allowfullpagebitstream = yes;
3430
3431    ocdrev              = 1;
3432
3433    memory "eeprom"
3434        paged           = no; /* leave this "no" */
3435        page_size       = 8;  /* for parallel programming */
3436        size            = 4096;
3437        min_write_delay = 9000;
3438        max_write_delay = 9000;
3439        readback_p1     = 0xff;
3440        readback_p2     = 0xff;
3441        read            = "  1   0   1   0      0   0   0   0",
3442                          "  x   x   x   x    a11 a10  a9  a8",
3443                          " a7  a6  a5  a4     a3  a2  a1  a0",
3444                          "  o   o   o   o      o   o   o   o";
3445
3446        write           = "  1   1   0   0      0   0   0   0",
3447                          "  x   x   x   x    a11 a10  a9  a8",
3448                          " a7  a6  a5  a4     a3  a2  a1  a0",
3449                          "  i   i   i   i      i   i   i   i";
3450
3451	mode		= 0x04;
3452	delay		= 12;
3453	blocksize	= 64;
3454	readsize	= 256;
3455      ;
3456
3457    memory "flash"
3458        paged           = yes;
3459        size            = 131072;
3460        page_size       = 256;
3461        num_pages       = 512;
3462        min_write_delay = 4500;
3463        max_write_delay = 4500;
3464        readback_p1     = 0xff;
3465        readback_p2     = 0xff;
3466        read_lo         = "  0   0   1   0      0   0   0   0",
3467                          "a15 a14 a13 a12    a11 a10  a9  a8",
3468                          " a7  a6  a5  a4     a3  a2  a1  a0",
3469                          "  o   o   o   o      o   o   o   o";
3470
3471        read_hi         = "  0   0   1   0      1   0   0   0",
3472                          "a15 a14 a13 a12    a11 a10  a9  a8",
3473                          " a7  a6  a5  a4     a3  a2  a1  a0",
3474                          "  o   o   o   o      o   o   o   o";
3475
3476        loadpage_lo     = "  0   1   0   0      0   0   0   0",
3477                          "  x   x   x   x      x   x   x   x",
3478                          "  x  a6  a5  a4     a3  a2  a1  a0",
3479                          "  i   i   i   i      i   i   i   i";
3480
3481        loadpage_hi     = "  0   1   0   0      1   0   0   0",
3482                          "  x   x   x   x      x   x   x   x",
3483                          "  x  a6  a5  a4     a3  a2  a1  a0",
3484                          "  i   i   i   i      i   i   i   i";
3485
3486        writepage       = "  0   1   0   0      1   1   0   0",
3487                          "a15 a14 a13 a12    a11 a10  a9  a8",
3488                          " a7   x   x   x      x   x   x   x",
3489                          "  x   x   x   x      x   x   x   x";
3490
3491	mode		= 0x21;
3492	delay		= 6;
3493	blocksize	= 128;
3494	readsize	= 256;
3495      ;
3496
3497    memory "lfuse"
3498        size            = 1;
3499        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
3500                          "x x x x  x x x x  i i i i  i i i i";
3501
3502        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
3503                          "x x x x  x x x x  o o o o  o o o o";
3504        min_write_delay = 9000;
3505        max_write_delay = 9000;
3506      ;
3507
3508    memory "hfuse"
3509        size            = 1;
3510        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
3511                          "x x x x  x x x x  i i i i  i i i i";
3512
3513        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
3514                          "x x x x  x x x x  o o o o  o o o o";
3515        min_write_delay = 9000;
3516        max_write_delay = 9000;
3517      ;
3518
3519    memory "efuse"
3520        size            = 1;
3521        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3522                          "x x x x  x x x x  x x x x  x x i i";
3523
3524        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3525                          "x x x x  x x x x  o o o o  o o o o";
3526        min_write_delay = 9000;
3527        max_write_delay = 9000;
3528      ;
3529
3530    memory "lock"
3531        size            = 1;
3532        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3533                          "x x x x  x x x x   x x o o  o o o o";
3534
3535        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3536                          "x x x x  x x x x   1 1 i i  i i i i";
3537        min_write_delay = 9000;
3538        max_write_delay = 9000;
3539      ;
3540
3541    memory "calibration"
3542        size            = 4;
3543        read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
3544                          "0 0 0 0  0 0 a1 a0  o o o o  o o o o";
3545      ;
3546
3547    memory "signature"
3548        size            = 3;
3549        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3550                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3551      ;
3552  ;
3553
3554#------------------------------------------------------------
3555# AT90CAN128
3556#------------------------------------------------------------
3557
3558part
3559    id               = "c128";
3560    desc             = "AT90CAN128";
3561    has_jtag         = yes;
3562    stk500_devcode   = 0xB3;
3563#    avr910_devcode   = 0x43;
3564    signature        = 0x1e 0x97 0x81;
3565    chip_erase_delay = 9000;
3566    pagel            = 0xD7;
3567    bs2              = 0xA0;
3568    reset            = dedicated;
3569    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3570                       "x x x x  x x x x    x x x x  x x x x";
3571
3572    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
3573                       "x x x x  x x x x    x x x x  x x x x";
3574
3575    timeout		= 200;
3576    stabdelay		= 100;
3577    cmdexedelay		= 25;
3578    synchloops		= 32;
3579    bytedelay		= 0;
3580    pollindex		= 3;
3581    pollvalue		= 0x53;
3582    predelay		= 1;
3583    postdelay		= 1;
3584    pollmethod		= 1;
3585
3586    pp_controlstack     =
3587        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3588        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3589        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3590        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
3591    hventerstabdelay    = 100;
3592    progmodedelay       = 0;
3593    latchcycles         = 6;
3594    togglevtg           = 0;
3595    poweroffdelay       = 0;
3596    resetdelayms        = 0;
3597    resetdelayus        = 0;
3598    hvleavestabdelay    = 15;
3599    chiperasepulsewidth = 0;
3600    chiperasepolltimeout = 10;
3601    programfusepulsewidth = 0;
3602    programfusepolltimeout = 5;
3603    programlockpulsewidth = 0;
3604    programlockpolltimeout = 5;
3605
3606    idr                 = 0x31;
3607    spmcr               = 0x57;
3608    rampz               = 0x3b;
3609    eecr                = 0x3f;
3610    allowfullpagebitstream = no;
3611
3612    ocdrev              = 3;
3613
3614    memory "eeprom"
3615        paged           = no; /* leave this "no" */
3616        page_size       = 8;  /* for parallel programming */
3617        size            = 4096;
3618        min_write_delay = 9000;
3619        max_write_delay = 9000;
3620        readback_p1     = 0xff;
3621        readback_p2     = 0xff;
3622	read            = "  1   0   1   0      0   0   0   0",
3623                          "  0   0   0   x    a11 a10  a9  a8",
3624                          " a7  a6  a5  a4     a3  a2  a1  a0",
3625                          "  o   o   o   o      o   o   o   o";
3626
3627	write           = "  1   1   0   0      0   0   0   0",
3628                          "  0   0   0   x    a11 a10  a9  a8",
3629                          " a7  a6  a5  a4     a3  a2  a1  a0",
3630                          "  i   i   i   i      i   i   i   i";
3631
3632	loadpage_lo	= "  1   1   0   0      0   0   0   1",
3633			  "  0   0   0   0      0   0   0   0",
3634			  "  0   0   0   0      0  a2  a1  a0",
3635			  "  i   i   i   i      i   i   i   i";
3636
3637	writepage	= "  1   1   0   0      0   0   1   0",
3638			  "  0   0   x   x    a11 a10  a9  a8",
3639			  " a7  a6  a5  a4     a3   0   0   0",
3640			  "  x   x   x   x      x   x   x   x";
3641
3642
3643	mode		= 0x41;
3644	delay		= 20;
3645	blocksize	= 8;
3646	readsize	= 256;
3647      ;
3648
3649    memory "flash"
3650        paged           = yes;
3651        size            = 131072;
3652        page_size       = 256;
3653        num_pages       = 512;
3654        min_write_delay = 4500;
3655        max_write_delay = 4500;
3656        readback_p1     = 0xff;
3657        readback_p2     = 0xff;
3658        read_lo         = "  0   0   1   0      0   0   0   0",
3659                          "a15 a14 a13 a12    a11 a10  a9  a8",
3660                          " a7  a6  a5  a4     a3  a2  a1  a0",
3661                          "  o   o   o   o      o   o   o   o";
3662
3663        read_hi         = "  0   0   1   0      1   0   0   0",
3664                          "a15 a14 a13 a12    a11 a10  a9  a8",
3665                          " a7  a6  a5  a4     a3  a2  a1  a0",
3666                          "  o   o   o   o      o   o   o   o";
3667
3668        loadpage_lo     = "  0   1   0   0      0   0   0   0",
3669                          "  0   0   0   x      x   x   x   x",
3670                          "  x  a6  a5  a4     a3  a2  a1  a0",
3671                          "  i   i   i   i      i   i   i   i";
3672
3673        loadpage_hi     = "  0   1   0   0      1   0   0   0",
3674                          "  0   0   0   x      x   x   x   x",
3675                          "  x  a6  a5  a4     a3  a2  a1  a0",
3676                          "  i   i   i   i      i   i   i   i";
3677
3678        writepage       = "  0   1   0   0      1   1   0   0",
3679                          "a15 a14 a13 a12    a11 a10  a9  a8",
3680                          " a7   x   x   x      x   x   x   x",
3681                          "  x   x   x   x      x   x   x   x";
3682
3683	mode		= 0x41;
3684	delay		= 6;
3685	blocksize	= 256;
3686	readsize	= 256;
3687      ;
3688
3689    memory "lfuse"
3690        size            = 1;
3691        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
3692                          "x x x x  x x x x  i i i i  i i i i";
3693
3694        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
3695                          "x x x x  x x x x  o o o o  o o o o";
3696        min_write_delay = 9000;
3697        max_write_delay = 9000;
3698      ;
3699
3700    memory "hfuse"
3701        size            = 1;
3702        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
3703                          "x x x x  x x x x  i i i i  i i i i";
3704
3705        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
3706                          "x x x x  x x x x  o o o o  o o o o";
3707        min_write_delay = 9000;
3708        max_write_delay = 9000;
3709      ;
3710
3711    memory "efuse"
3712        size            = 1;
3713        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3714                          "x x x x  x x x x  x x x x  i i i i";
3715
3716        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3717                          "x x x x  x x x x  o o o o  o o o o";
3718        min_write_delay = 9000;
3719        max_write_delay = 9000;
3720      ;
3721
3722    memory "lock"
3723        size            = 1;
3724        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3725                          "x x x x  x x x x   x x o o  o o o o";
3726
3727        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3728                          "x x x x  x x x x   1 1 i i  i i i i";
3729        min_write_delay = 9000;
3730        max_write_delay = 9000;
3731      ;
3732
3733    memory "calibration"
3734        size            = 1;
3735        read            = "0 0 1 1  1 0 0 0  0 0 0 x  x x x x",
3736                          "0 0 0 0  0 0 0 0  o o o o  o o o o";
3737      ;
3738
3739    memory "signature"
3740        size            = 3;
3741        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3742                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3743      ;
3744  ;
3745
3746#------------------------------------------------------------
3747# AT90CAN64
3748#------------------------------------------------------------
3749
3750part
3751    id               = "c64";
3752    desc             = "AT90CAN64";
3753    has_jtag         = yes;
3754    stk500_devcode   = 0xB3;
3755#    avr910_devcode   = 0x43;
3756    signature        = 0x1e 0x96 0x81;
3757    chip_erase_delay = 9000;
3758    pagel            = 0xD7;
3759    bs2              = 0xA0;
3760    reset            = dedicated;
3761    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3762                       "x x x x  x x x x    x x x x  x x x x";
3763
3764    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
3765                       "x x x x  x x x x    x x x x  x x x x";
3766
3767    timeout		= 200;
3768    stabdelay		= 100;
3769    cmdexedelay		= 25;
3770    synchloops		= 32;
3771    bytedelay		= 0;
3772    pollindex		= 3;
3773    pollvalue		= 0x53;
3774    predelay		= 1;
3775    postdelay		= 1;
3776    pollmethod		= 1;
3777
3778    pp_controlstack     =
3779        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3780        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3781        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3782        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
3783    hventerstabdelay    = 100;
3784    progmodedelay       = 0;
3785    latchcycles         = 6;
3786    togglevtg           = 0;
3787    poweroffdelay       = 0;
3788    resetdelayms        = 0;
3789    resetdelayus        = 0;
3790    hvleavestabdelay    = 15;
3791    chiperasepulsewidth = 0;
3792    chiperasepolltimeout = 10;
3793    programfusepulsewidth = 0;
3794    programfusepolltimeout = 5;
3795    programlockpulsewidth = 0;
3796    programlockpolltimeout = 5;
3797
3798    idr                 = 0x31;
3799    spmcr               = 0x57;
3800    rampz               = 0x3b;
3801    eecr                = 0x3f;
3802    allowfullpagebitstream = no;
3803
3804    ocdrev              = 3;
3805
3806    memory "eeprom"
3807        paged           = no; /* leave this "no" */
3808        page_size       = 8;  /* for parallel programming */
3809        size            = 2048;
3810        min_write_delay = 9000;
3811        max_write_delay = 9000;
3812        readback_p1     = 0xff;
3813        readback_p2     = 0xff;
3814	read            = "  1   0   1   0      0   0   0   0",
3815                          "  0   0   0   x      x a10  a9  a8",
3816                          " a7  a6  a5  a4     a3  a2  a1  a0",
3817                          "  o   o   o   o      o   o   o   o";
3818
3819	write           = "  1   1   0   0      0   0   0   0",
3820                          "  0   0   0   x      x a10  a9  a8",
3821                          " a7  a6  a5  a4     a3  a2  a1  a0",
3822                          "  i   i   i   i      i   i   i   i";
3823
3824	loadpage_lo	= "  1   1   0   0      0   0   0   1",
3825			  "  0   0   0   0      0   0   0   0",
3826			  "  0   0   0   0      0  a2  a1  a0",
3827			  "  i   i   i   i      i   i   i   i";
3828
3829	writepage	= "  1   1   0   0      0   0   1   0",
3830			  "  0   0   x   x      x a10  a9  a8",
3831			  " a7  a6  a5  a4     a3   0   0   0",
3832			  "  x   x   x   x      x   x   x   x";
3833
3834
3835	mode		= 0x41;
3836	delay		= 20;
3837	blocksize	= 8;
3838	readsize	= 256;
3839      ;
3840
3841    memory "flash"
3842        paged           = yes;
3843        size            = 65536;
3844        page_size       = 256;
3845        num_pages       = 256;
3846        min_write_delay = 4500;
3847        max_write_delay = 4500;
3848        readback_p1     = 0xff;
3849        readback_p2     = 0xff;
3850        read_lo         = "  0   0   1   0      0   0   0   0",
3851                          "a15 a14 a13 a12    a11 a10  a9  a8",
3852                          " a7  a6  a5  a4     a3  a2  a1  a0",
3853                          "  o   o   o   o      o   o   o   o";
3854
3855        read_hi         = "  0   0   1   0      1   0   0   0",
3856                          "a15 a14 a13 a12    a11 a10  a9  a8",
3857                          " a7  a6  a5  a4     a3  a2  a1  a0",
3858                          "  o   o   o   o      o   o   o   o";
3859
3860        loadpage_lo     = "  0   1   0   0      0   0   0   0",
3861                          "  0   0   0   x      x   x   x   x",
3862                          "  x  a6  a5  a4     a3  a2  a1  a0",
3863                          "  i   i   i   i      i   i   i   i";
3864
3865        loadpage_hi     = "  0   1   0   0      1   0   0   0",
3866                          "  0   0   0   x      x   x   x   x",
3867                          "  x  a6  a5  a4     a3  a2  a1  a0",
3868                          "  i   i   i   i      i   i   i   i";
3869
3870        writepage       = "  0   1   0   0      1   1   0   0",
3871                          "a15 a14 a13 a12    a11 a10  a9  a8",
3872                          " a7   x   x   x      x   x   x   x",
3873                          "  x   x   x   x      x   x   x   x";
3874
3875	mode		= 0x41;
3876	delay		= 6;
3877	blocksize	= 256;
3878	readsize	= 256;
3879      ;
3880
3881    memory "lfuse"
3882        size            = 1;
3883        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
3884                          "x x x x  x x x x  i i i i  i i i i";
3885
3886        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
3887                          "x x x x  x x x x  o o o o  o o o o";
3888        min_write_delay = 9000;
3889        max_write_delay = 9000;
3890      ;
3891
3892    memory "hfuse"
3893        size            = 1;
3894        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
3895                          "x x x x  x x x x  i i i i  i i i i";
3896
3897        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
3898                          "x x x x  x x x x  o o o o  o o o o";
3899        min_write_delay = 9000;
3900        max_write_delay = 9000;
3901      ;
3902
3903    memory "efuse"
3904        size            = 1;
3905        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3906                          "x x x x  x x x x  x x x x  i i i i";
3907
3908        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3909                          "x x x x  x x x x  o o o o  o o o o";
3910        min_write_delay = 9000;
3911        max_write_delay = 9000;
3912      ;
3913
3914    memory "lock"
3915        size            = 1;
3916        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3917                          "x x x x  x x x x   x x o o  o o o o";
3918
3919        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3920                          "x x x x  x x x x   1 1 i i  i i i i";
3921        min_write_delay = 9000;
3922        max_write_delay = 9000;
3923      ;
3924
3925    memory "calibration"
3926        size            = 1;
3927        read            = "0 0 1 1  1 0 0 0  0 0 0 x  x x x x",
3928                          "0 0 0 0  0 0 0 0  o o o o  o o o o";
3929      ;
3930
3931    memory "signature"
3932        size            = 3;
3933        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3934                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3935      ;
3936  ;
3937
3938#------------------------------------------------------------
3939# AT90CAN32
3940#------------------------------------------------------------
3941
3942part
3943    id               = "c32";
3944    desc             = "AT90CAN32";
3945    has_jtag         = yes;
3946    stk500_devcode   = 0xB3;
3947#    avr910_devcode   = 0x43;
3948    signature        = 0x1e 0x95 0x81;
3949    chip_erase_delay = 9000;
3950    pagel            = 0xD7;
3951    bs2              = 0xA0;
3952    reset            = dedicated;
3953    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3954                       "x x x x  x x x x    x x x x  x x x x";
3955
3956    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
3957                       "x x x x  x x x x    x x x x  x x x x";
3958
3959    timeout		= 200;
3960    stabdelay		= 100;
3961    cmdexedelay		= 25;
3962    synchloops		= 32;
3963    bytedelay		= 0;
3964    pollindex		= 3;
3965    pollvalue		= 0x53;
3966    predelay		= 1;
3967    postdelay		= 1;
3968    pollmethod		= 1;
3969
3970    pp_controlstack     =
3971        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3972        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3973        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3974        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
3975    hventerstabdelay    = 100;
3976    progmodedelay       = 0;
3977    latchcycles         = 6;
3978    togglevtg           = 0;
3979    poweroffdelay       = 0;
3980    resetdelayms        = 0;
3981    resetdelayus        = 0;
3982    hvleavestabdelay    = 15;
3983    chiperasepulsewidth = 0;
3984    chiperasepolltimeout = 10;
3985    programfusepulsewidth = 0;
3986    programfusepolltimeout = 5;
3987    programlockpulsewidth = 0;
3988    programlockpolltimeout = 5;
3989
3990    idr                 = 0x31;
3991    spmcr               = 0x57;
3992    rampz               = 0x3b;
3993    eecr                = 0x3f;
3994    allowfullpagebitstream = no;
3995
3996    ocdrev              = 3;
3997
3998    memory "eeprom"
3999        paged           = no; /* leave this "no" */
4000        page_size       = 8;  /* for parallel programming */
4001        size            = 1024;
4002        min_write_delay = 9000;
4003        max_write_delay = 9000;
4004        readback_p1     = 0xff;
4005        readback_p2     = 0xff;
4006	read            = "  1   0   1   0      0   0   0   0",
4007                          "  0   0   0   x      x   x  a9  a8",
4008                          " a7  a6  a5  a4     a3  a2  a1  a0",
4009                          "  o   o   o   o      o   o   o   o";
4010
4011	write           = "  1   1   0   0      0   0   0   0",
4012                          "  0   0   0   x      x   x  a9  a8",
4013                          " a7  a6  a5  a4     a3  a2  a1  a0",
4014                          "  i   i   i   i      i   i   i   i";
4015
4016	loadpage_lo	= "  1   1   0   0      0   0   0   1",
4017			  "  0   0   0   0      0   0   0   0",
4018			  "  0   0   0   0      0  a2  a1  a0",
4019			  "  i   i   i   i      i   i   i   i";
4020
4021	writepage	= "  1   1   0   0      0   0   1   0",
4022			  "  0   0   x   x      x   x  a9  a8",
4023			  " a7  a6  a5  a4     a3   0   0   0",
4024			  "  x   x   x   x      x   x   x   x";
4025
4026
4027	mode		= 0x41;
4028	delay		= 20;
4029	blocksize	= 8;
4030	readsize	= 256;
4031      ;
4032
4033    memory "flash"
4034        paged           = yes;
4035        size            = 32768;
4036        page_size       = 256;
4037        num_pages       = 128;
4038        min_write_delay = 4500;
4039        max_write_delay = 4500;
4040        readback_p1     = 0xff;
4041        readback_p2     = 0xff;
4042        read_lo         = "  0   0   1   0      0   0   0   0",
4043                          "a15 a14 a13 a12    a11 a10  a9  a8",
4044                          " a7  a6  a5  a4     a3  a2  a1  a0",
4045                          "  o   o   o   o      o   o   o   o";
4046
4047        read_hi         = "  0   0   1   0      1   0   0   0",
4048                          "a15 a14 a13 a12    a11 a10  a9  a8",
4049                          " a7  a6  a5  a4     a3  a2  a1  a0",
4050                          "  o   o   o   o      o   o   o   o";
4051
4052        loadpage_lo     = "  0   1   0   0      0   0   0   0",
4053                          "  0   0   0   x      x   x   x   x",
4054                          "  x  a6  a5  a4     a3  a2  a1  a0",
4055                          "  i   i   i   i      i   i   i   i";
4056
4057        loadpage_hi     = "  0   1   0   0      1   0   0   0",
4058                          "  0   0   0   x      x   x   x   x",
4059                          "  x  a6  a5  a4     a3  a2  a1  a0",
4060                          "  i   i   i   i      i   i   i   i";
4061
4062        writepage       = "  0   1   0   0      1   1   0   0",
4063                          "a15 a14 a13 a12    a11 a10  a9  a8",
4064                          " a7   x   x   x      x   x   x   x",
4065                          "  x   x   x   x      x   x   x   x";
4066
4067	mode		= 0x41;
4068	delay		= 6;
4069	blocksize	= 256;
4070	readsize	= 256;
4071      ;
4072
4073    memory "lfuse"
4074        size            = 1;
4075        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
4076                          "x x x x  x x x x  i i i i  i i i i";
4077
4078        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
4079                          "x x x x  x x x x  o o o o  o o o o";
4080        min_write_delay = 9000;
4081        max_write_delay = 9000;
4082      ;
4083
4084    memory "hfuse"
4085        size            = 1;
4086        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
4087                          "x x x x  x x x x  i i i i  i i i i";
4088
4089        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
4090                          "x x x x  x x x x  o o o o  o o o o";
4091        min_write_delay = 9000;
4092        max_write_delay = 9000;
4093      ;
4094
4095    memory "efuse"
4096        size            = 1;
4097        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4098                          "x x x x  x x x x  x x x x  i i i i";
4099
4100        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4101                          "x x x x  x x x x  o o o o  o o o o";
4102        min_write_delay = 9000;
4103        max_write_delay = 9000;
4104      ;
4105
4106    memory "lock"
4107        size            = 1;
4108        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4109                          "x x x x  x x x x   x x o o  o o o o";
4110
4111        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4112                          "x x x x  x x x x   1 1 i i  i i i i";
4113        min_write_delay = 9000;
4114        max_write_delay = 9000;
4115      ;
4116
4117    memory "calibration"
4118        size            = 1;
4119        read            = "0 0 1 1  1 0 0 0  0 0 0 x  x x x x",
4120                          "0 0 0 0  0 0 0 0  o o o o  o o o o";
4121      ;
4122
4123    memory "signature"
4124        size            = 3;
4125        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4126                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4127      ;
4128  ;
4129
4130
4131#------------------------------------------------------------
4132# ATmega16
4133#------------------------------------------------------------
4134
4135part
4136    id               = "m16";
4137    desc             = "ATmega16";
4138    has_jtag         = yes;
4139    stk500_devcode   = 0x82;
4140    avr910_devcode   = 0x74;
4141    signature        = 0x1e 0x94 0x03;
4142    pagel            = 0xd7;
4143    bs2              = 0xa0;
4144    chip_erase_delay = 9000;
4145    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4146                       "x x x x  x x x x    x x x x  x x x x";
4147
4148    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4149                       "x x x x  x x x x    x x x x  x x x x";
4150
4151    timeout		= 200;
4152    stabdelay		= 100;
4153    cmdexedelay		= 25;
4154    synchloops		= 32;
4155    bytedelay		= 0;
4156    pollindex		= 3;
4157    pollvalue		= 0x53;
4158    predelay		= 1;
4159    postdelay		= 1;
4160    pollmethod		= 0;
4161
4162    pp_controlstack     =
4163	0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4164	0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4165	0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4166	0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
4167    hventerstabdelay    = 100;
4168    progmodedelay       = 100;
4169    latchcycles         = 6;
4170    togglevtg           = 0;
4171    poweroffdelay       = 0;
4172    resetdelayms        = 0;
4173    resetdelayus        = 0;
4174    hvleavestabdelay    = 15;
4175    resetdelay          = 15;
4176    chiperasepulsewidth = 0;
4177    chiperasepolltimeout = 10;
4178    programfusepulsewidth = 0;
4179    programfusepolltimeout = 5;
4180    programlockpulsewidth = 0;
4181    programlockpolltimeout = 5;
4182
4183    idr                 = 0x31;
4184    spmcr               = 0x57;
4185    allowfullpagebitstream = yes;
4186
4187    ocdrev              = 2;
4188
4189    memory "eeprom"
4190        paged           = no; /* leave this "no" */
4191        page_size       = 4;  /* for parallel programming */
4192        size            = 512;
4193        min_write_delay = 9000;
4194        max_write_delay = 9000;
4195        readback_p1     = 0xff;
4196        readback_p2     = 0xff;
4197	read            = "  1   0   1   0      0   0   0   0",
4198                          "  0   0   x   x      x   x  a9  a8",
4199                          " a7  a6  a5  a4     a3  a2  a1  a0",
4200                          "  o   o   o   o      o   o   o   o";
4201
4202	write           = "  1   1   0   0      0   0   0   0",
4203                          "  0   0   x   x      x   x  a9  a8",
4204                          " a7  a6  a5  a4     a3  a2  a1  a0",
4205                          "  i   i   i   i      i   i   i   i";
4206
4207	loadpage_lo	= "  1   1   0   0      0   0   0   1",
4208			  "  0   0   0   0      0   0   0   0",
4209			  "  0   0   0   0      0   0  a1  a0",
4210			  "  i   i   i   i      i   i   i   i";
4211
4212	writepage	= "  1   1   0   0      0   0   1   0",
4213			  "  0   0   x   x      x   x  a9  a8",
4214			  " a7  a6  a5  a4     a3  a2   0   0",
4215			  "  x   x   x   x      x   x   x   x";
4216
4217	mode		= 0x04;
4218	delay		= 10;
4219	blocksize	= 128;
4220	readsize	= 256;
4221      ;
4222
4223    memory "flash"
4224        paged           = yes;
4225        size            = 16384;
4226        page_size       = 128;
4227        num_pages       = 128;
4228        min_write_delay = 4500;
4229        max_write_delay = 4500;
4230        readback_p1     = 0xff;
4231        readback_p2     = 0xff;
4232        read_lo         = "  0   0   1   0      0   0   0   0",
4233                          "  0   0 a13 a12    a11 a10  a9  a8",
4234                          " a7  a6  a5  a4     a3  a2  a1  a0",
4235                          "  o   o   o   o      o   o   o   o";
4236
4237        read_hi         = "  0   0   1   0      1   0   0   0",
4238                          "  0   0 a13 a12    a11 a10  a9  a8",
4239                          " a7  a6  a5  a4     a3  a2  a1  a0",
4240                          "  o   o   o   o      o   o   o   o";
4241
4242        loadpage_lo     = "  0   1   0   0      0   0   0   0",
4243                          "  0   0   x   x      x   x   x   x",
4244                          "  x   x  a5  a4     a3  a2  a1  a0",
4245                          "  i   i   i   i      i   i   i   i";
4246
4247        loadpage_hi     = "  0   1   0   0      1   0   0   0",
4248                          "  0   0   x   x      x   x   x   x",
4249                          "  x   x  a5  a4     a3  a2  a1  a0",
4250                          "  i   i   i   i      i   i   i   i";
4251
4252        writepage       = "  0   1   0   0      1   1   0   0",
4253                          "  0   0 a13 a12    a11 a10  a9  a8",
4254                          " a7  a6   x   x      x   x   x   x",
4255                          "  x   x   x   x      x   x   x   x";
4256
4257	mode		= 0x21;
4258	delay		= 6;
4259	blocksize	= 128;
4260	readsize	= 256;
4261      ;
4262
4263    memory "lock"
4264        size            = 1;
4265        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4266                          "x x x x  x x x x   x x o o  o o o o";
4267
4268        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4269                          "x x x x  x x x x   1 1 i i  i i i i";
4270        min_write_delay = 9000;
4271        max_write_delay = 9000;
4272      ;
4273
4274    memory "lfuse"
4275        size            = 1;
4276        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4277                          "x x x x  x x x x   o o o o  o o o o";
4278
4279        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4280                          "x x x x  x x x x   i i i i  i i i i";
4281        min_write_delay = 9000;
4282        max_write_delay = 9000;
4283      ;
4284
4285    memory "hfuse"
4286        size            = 1;
4287        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4288                          "x x x x  x x x x   o o o o  o o o o";
4289
4290        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4291                          "x x x x  x x x x   i i i i  i i i i";
4292        min_write_delay = 9000;
4293        max_write_delay = 9000;
4294      ;
4295    memory "signature"
4296        size            = 3;
4297        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4298                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4299      ;
4300    memory "calibration"
4301        size            = 4;
4302
4303        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4304                          "0 0 0 0  0 0 a1 a0 o o o o  o o o o";
4305        ;
4306  ;
4307
4308
4309#------------------------------------------------------------
4310# ATmega164P
4311#------------------------------------------------------------
4312
4313# close to ATmega16
4314
4315part parent "m16"
4316    id               = "m164p";
4317    desc             = "ATmega164P";
4318    signature        = 0x1e 0x94 0x0a;
4319
4320    progmodedelay       = 0;
4321    latchcycles         = 5;
4322    togglevtg           = 1;
4323    poweroffdelay       = 15;
4324    resetdelayms        = 1;
4325    allowfullpagebitstream = no;
4326    chip_erase_delay = 55000;
4327
4328    ocdrev              = 3;
4329  ;
4330
4331
4332#------------------------------------------------------------
4333# ATmega324P
4334#------------------------------------------------------------
4335
4336# similar to ATmega164P
4337
4338part
4339    id               = "m324p";
4340    desc             = "ATmega324P";
4341    has_jtag         = yes;
4342    stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4343    avr910_devcode   = 0x74;
4344    signature        = 0x1e 0x95 0x08;
4345    pagel            = 0xd7;
4346    bs2              = 0xa0;
4347    chip_erase_delay = 55000;
4348    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4349                       "x x x x  x x x x    x x x x  x x x x";
4350
4351    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4352                       "x x x x  x x x x    x x x x  x x x x";
4353
4354    timeout		= 200;
4355    stabdelay		= 100;
4356    cmdexedelay		= 25;
4357    synchloops		= 32;
4358    bytedelay		= 0;
4359    pollindex		= 3;
4360    pollvalue		= 0x53;
4361    predelay		= 1;
4362    postdelay		= 1;
4363    pollmethod		= 0;
4364
4365    pp_controlstack     =
4366        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4367        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4368        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4369        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
4370    hventerstabdelay    = 100;
4371    progmodedelay       = 0;
4372    latchcycles         = 5;
4373    togglevtg           = 1;
4374    poweroffdelay       = 15;
4375    resetdelayms        = 1;
4376    resetdelayus        = 0;
4377    hvleavestabdelay    = 15;
4378    chiperasepulsewidth = 0;
4379    chiperasepolltimeout = 10;
4380    programfusepulsewidth = 0;
4381    programfusepolltimeout = 5;
4382    programlockpulsewidth = 0;
4383    programlockpolltimeout = 5;
4384
4385    idr                 = 0x31;
4386    spmcr               = 0x57;
4387    allowfullpagebitstream = no;
4388
4389    ocdrev              = 3;
4390
4391    memory "eeprom"
4392        paged           = no; /* leave this "no" */
4393        page_size       = 4;  /* for parallel programming */
4394        size            = 1024;
4395        min_write_delay = 9000;
4396        max_write_delay = 9000;
4397        readback_p1     = 0xff;
4398        readback_p2     = 0xff;
4399	read            = "  1   0   1   0      0   0   0   0",
4400                          "  0   0   x   x      x a10  a9  a8",
4401                          " a7  a6  a5  a4     a3  a2  a1  a0",
4402                          "  o   o   o   o      o   o   o   o";
4403
4404	write           = "  1   1   0   0      0   0   0   0",
4405                          "  0   0   x   x      x a10  a9  a8",
4406                          " a7  a6  a5  a4     a3  a2  a1  a0",
4407                          "  i   i   i   i      i   i   i   i";
4408
4409	loadpage_lo	= "  1   1   0   0      0   0   0   1",
4410			  "  0   0   0   0      0   0   0   0",
4411			  "  0   0   0   0      0   0  a1  a0",
4412			  "  i   i   i   i      i   i   i   i";
4413
4414	writepage	= "  1   1   0   0      0   0   1   0",
4415			  "  0   0   x   x      x a10  a9  a8",
4416			  " a7  a6  a5  a4     a3  a2   0   0",
4417			  "  x   x   x   x      x   x   x   x";
4418
4419	mode		= 0x41;
4420	delay		= 10;
4421	blocksize	= 128;
4422	readsize	= 256;
4423      ;
4424
4425    memory "flash"
4426        paged           = yes;
4427        size            = 32768;
4428        page_size       = 128;
4429        num_pages       = 256;
4430        min_write_delay = 4500;
4431        max_write_delay = 4500;
4432        readback_p1     = 0xff;
4433        readback_p2     = 0xff;
4434        read_lo         = "  0   0   1   0      0   0   0   0",
4435                          "  0 a14 a13 a12    a11 a10  a9  a8",
4436                          " a7  a6  a5  a4     a3  a2  a1  a0",
4437                          "  o   o   o   o      o   o   o   o";
4438
4439        read_hi         = "  0   0   1   0      1   0   0   0",
4440                          "  0 a14 a13 a12    a11 a10  a9  a8",
4441                          " a7  a6  a5  a4     a3  a2  a1  a0",
4442                          "  o   o   o   o      o   o   o   o";
4443
4444        loadpage_lo     = "  0   1   0   0      0   0   0   0",
4445                          "  0   0   x   x      x   x   x   x",
4446                          "  x   x  a5  a4     a3  a2  a1  a0",
4447                          "  i   i   i   i      i   i   i   i";
4448
4449        loadpage_hi     = "  0   1   0   0      1   0   0   0",
4450                          "  0   0   x   x      x   x   x   x",
4451                          "  x   x  a5  a4     a3  a2  a1  a0",
4452                          "  i   i   i   i      i   i   i   i";
4453
4454        writepage       = "  0   1   0   0      1   1   0   0",
4455                          "  0 a14 a13 a12    a11 a10  a9  a8",
4456                          " a7  a6   x   x      x   x   x   x",
4457                          "  x   x   x   x      x   x   x   x";
4458
4459	mode		= 0x21;
4460	delay		= 6;
4461	blocksize	= 256;
4462	readsize	= 256;
4463      ;
4464
4465    memory "lock"
4466        size            = 1;
4467        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4468                          "x x x x  x x x x   x x o o  o o o o";
4469
4470        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4471                          "x x x x  x x x x   1 1 i i  i i i i";
4472        min_write_delay = 9000;
4473        max_write_delay = 9000;
4474      ;
4475
4476    memory "lfuse"
4477        size            = 1;
4478        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4479                          "x x x x  x x x x   o o o o  o o o o";
4480
4481        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4482                          "x x x x  x x x x   i i i i  i i i i";
4483        min_write_delay = 9000;
4484        max_write_delay = 9000;
4485      ;
4486
4487    memory "hfuse"
4488        size            = 1;
4489        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4490                          "x x x x  x x x x   o o o o  o o o o";
4491
4492        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4493                          "x x x x  x x x x   i i i i  i i i i";
4494        min_write_delay = 9000;
4495        max_write_delay = 9000;
4496      ;
4497
4498    memory "efuse"
4499        size            = 1;
4500
4501        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4502                          "x x x x  x x x x  o o o o  o o o o";
4503
4504        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4505                          "x x x x  x x x x  1 1 1 1  1 i i i";
4506        min_write_delay = 9000;
4507        max_write_delay = 9000;
4508      ;
4509
4510    memory "signature"
4511        size            = 3;
4512        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4513                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4514      ;
4515
4516    memory "calibration"
4517        size            = 1;
4518
4519        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4520                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
4521        ;
4522  ;
4523
4524
4525#------------------------------------------------------------
4526# ATmega324PA
4527#------------------------------------------------------------
4528
4529# similar to ATmega324P
4530
4531part parent "m324p"
4532    id               = "m324pa";
4533    desc             = "ATmega324PA";
4534    signature        = 0x1e 0x95 0x11;
4535
4536    ocdrev              = 3;
4537  ;
4538
4539
4540#------------------------------------------------------------
4541# ATmega644
4542#------------------------------------------------------------
4543
4544# similar to ATmega164
4545
4546part
4547    id               = "m644";
4548    desc             = "ATmega644";
4549    has_jtag         = yes;
4550    stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4551    avr910_devcode   = 0x74;
4552    signature        = 0x1e 0x96 0x09;
4553    pagel            = 0xd7;
4554    bs2              = 0xa0;
4555    chip_erase_delay = 55000;
4556    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4557                       "x x x x  x x x x    x x x x  x x x x";
4558
4559    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4560                       "x x x x  x x x x    x x x x  x x x x";
4561
4562    timeout		= 200;
4563    stabdelay		= 100;
4564    cmdexedelay		= 25;
4565    synchloops		= 32;
4566    bytedelay		= 0;
4567    pollindex		= 3;
4568    pollvalue		= 0x53;
4569    predelay		= 1;
4570    postdelay		= 1;
4571    pollmethod		= 0;
4572
4573    pp_controlstack     =
4574        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4575        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4576        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4577        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
4578    hventerstabdelay    = 100;
4579    progmodedelay       = 0;
4580    latchcycles         = 6;
4581    togglevtg           = 0;
4582    poweroffdelay       = 0;
4583    resetdelayms        = 0;
4584    resetdelayus        = 0;
4585    hvleavestabdelay    = 15;
4586    chiperasepulsewidth = 0;
4587    chiperasepolltimeout = 10;
4588    programfusepulsewidth = 0;
4589    programfusepolltimeout = 5;
4590    programlockpulsewidth = 0;
4591    programlockpolltimeout = 5;
4592
4593    idr                 = 0x31;
4594    spmcr               = 0x57;
4595    allowfullpagebitstream = no;
4596
4597    ocdrev              = 3;
4598
4599    memory "eeprom"
4600        paged           = no; /* leave this "no" */
4601        page_size       = 8;  /* for parallel programming */
4602        size            = 2048;
4603        min_write_delay = 9000;
4604        max_write_delay = 9000;
4605        readback_p1     = 0xff;
4606        readback_p2     = 0xff;
4607	read            = "  1   0   1   0      0   0   0   0",
4608                          "  0   0   x   x    a11 a10  a9  a8",
4609                          " a7  a6  a5  a4     a3  a2  a1  a0",
4610                          "  o   o   o   o      o   o   o   o";
4611
4612	write           = "  1   1   0   0      0   0   0   0",
4613                          "  0   0   x   x    a11 a10  a9  a8",
4614                          " a7  a6  a5  a4     a3  a2  a1  a0",
4615                          "  i   i   i   i      i   i   i   i";
4616
4617	loadpage_lo	= "  1   1   0   0      0   0   0   1",
4618			  "  0   0   0   0      0   0   0   0",
4619			  "  0   0   0   0      0  a2  a1  a0",
4620			  "  i   i   i   i      i   i   i   i";
4621
4622	writepage	= "  1   1   0   0      0   0   1   0",
4623			  "  0   0   x   x    a11 a10  a9  a8",
4624			  " a7  a6  a5  a4     a3   0   0   0",
4625			  "  x   x   x   x      x   x   x   x";
4626
4627	mode		= 0x41;
4628	delay		= 10;
4629	blocksize	= 128;
4630	readsize	= 256;
4631      ;
4632
4633    memory "flash"
4634        paged           = yes;
4635        size            = 65536;
4636        page_size       = 256;
4637        num_pages       = 256;
4638        min_write_delay = 4500;
4639        max_write_delay = 4500;
4640        readback_p1     = 0xff;
4641        readback_p2     = 0xff;
4642        read_lo         = "  0   0   1   0      0   0   0   0",
4643                          "a15 a14 a13 a12    a11 a10  a9  a8",
4644                          " a7  a6  a5  a4     a3  a2  a1  a0",
4645                          "  o   o   o   o      o   o   o   o";
4646
4647        read_hi         = "  0   0   1   0      1   0   0   0",
4648                          "a15 a14 a13 a12    a11 a10  a9  a8",
4649                          " a7  a6  a5  a4     a3  a2  a1  a0",
4650                          "  o   o   o   o      o   o   o   o";
4651
4652        loadpage_lo     = "  0   1   0   0      0   0   0   0",
4653                          "  0   0   x   x      x   x   x   x",
4654                          "  x  a6  a5  a4     a3  a2  a1  a0",
4655                          "  i   i   i   i      i   i   i   i";
4656
4657        loadpage_hi     = "  0   1   0   0      1   0   0   0",
4658                          "  0   0   x   x      x   x   x   x",
4659                          "  x  a6  a5  a4     a3  a2  a1  a0",
4660                          "  i   i   i   i      i   i   i   i";
4661
4662        writepage       = "  0   1   0   0      1   1   0   0",
4663                          "a15 a14 a13 a12    a11 a10  a9  a8",
4664                          " a7   x   x   x      x   x   x   x",
4665                          "  x   x   x   x      x   x   x   x";
4666
4667	mode		= 0x21;
4668	delay		= 6;
4669	blocksize	= 256;
4670	readsize	= 256;
4671      ;
4672
4673    memory "lock"
4674        size            = 1;
4675        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4676                          "x x x x  x x x x   x x o o  o o o o";
4677
4678        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4679                          "x x x x  x x x x   1 1 i i  i i i i";
4680        min_write_delay = 9000;
4681        max_write_delay = 9000;
4682      ;
4683
4684    memory "lfuse"
4685        size            = 1;
4686        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4687                          "x x x x  x x x x   o o o o  o o o o";
4688
4689        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4690                          "x x x x  x x x x   i i i i  i i i i";
4691        min_write_delay = 9000;
4692        max_write_delay = 9000;
4693      ;
4694
4695    memory "hfuse"
4696        size            = 1;
4697        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4698                          "x x x x  x x x x   o o o o  o o o o";
4699
4700        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4701                          "x x x x  x x x x   i i i i  i i i i";
4702        min_write_delay = 9000;
4703        max_write_delay = 9000;
4704      ;
4705
4706    memory "efuse"
4707        size            = 1;
4708
4709        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4710                          "x x x x  x x x x  o o o o  o o o o";
4711
4712        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4713                          "x x x x  x x x x  1 1 1 1  1 i i i";
4714        min_write_delay = 9000;
4715        max_write_delay = 9000;
4716      ;
4717
4718    memory "signature"
4719        size            = 3;
4720        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4721                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4722      ;
4723
4724    memory "calibration"
4725        size            = 1;
4726
4727        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4728                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
4729        ;
4730  ;
4731
4732#------------------------------------------------------------
4733# ATmega644P
4734#------------------------------------------------------------
4735
4736# similar to ATmega164p
4737
4738part parent "m644"
4739    id               = "m644p";
4740    desc             = "ATmega644P";
4741    signature        = 0x1e 0x96 0x0a;
4742
4743    ocdrev              = 3;
4744  ;
4745
4746
4747
4748#------------------------------------------------------------
4749# ATmega1284
4750#------------------------------------------------------------
4751
4752# similar to ATmega164
4753
4754part
4755    id               = "m1284";
4756    desc             = "ATmega1284";
4757    has_jtag         = yes;
4758    stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4759    avr910_devcode   = 0x74;
4760    signature        = 0x1e 0x97 0x06;
4761    pagel            = 0xd7;
4762    bs2              = 0xa0;
4763    chip_erase_delay = 55000;
4764    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4765                       "x x x x  x x x x    x x x x  x x x x";
4766
4767    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4768                       "x x x x  x x x x    x x x x  x x x x";
4769
4770    timeout		= 200;
4771    stabdelay		= 100;
4772    cmdexedelay		= 25;
4773    synchloops		= 32;
4774    bytedelay		= 0;
4775    pollindex		= 3;
4776    pollvalue		= 0x53;
4777    predelay		= 1;
4778    postdelay		= 1;
4779    pollmethod		= 1;
4780
4781    pp_controlstack     =
4782        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4783        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4784        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4785        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
4786    hventerstabdelay    = 100;
4787    progmodedelay       = 0;
4788    latchcycles         = 6;
4789    togglevtg           = 1;
4790    poweroffdelay       = 15;
4791    resetdelayms        = 1;
4792    resetdelayus        = 0;
4793    hvleavestabdelay    = 15;
4794    chiperasepulsewidth = 0;
4795    chiperasepolltimeout = 10;
4796    programfusepulsewidth = 0;
4797    programfusepolltimeout = 5;
4798    programlockpulsewidth = 0;
4799    programlockpolltimeout = 5;
4800
4801    idr                 = 0x31;
4802    spmcr               = 0x57;
4803    allowfullpagebitstream = no;
4804
4805    ocdrev              = 3;
4806
4807    memory "eeprom"
4808        paged           = no; /* leave this "no" */
4809        page_size       = 8;  /* for parallel programming */
4810        size            = 4096;
4811        min_write_delay = 9000;
4812        max_write_delay = 9000;
4813        readback_p1     = 0xff;
4814        readback_p2     = 0xff;
4815	read            = "  1   0   1   0      0   0   0   0",
4816                          "  0   0   x   x    a11 a10  a9  a8",
4817                          " a7  a6  a5  a4     a3  a2  a1  a0",
4818                          "  o   o   o   o      o   o   o   o";
4819
4820	write           = "  1   1   0   0      0   0   0   0",
4821                          "  0   0   x   x    a11 a10  a9  a8",
4822                          " a7  a6  a5  a4     a3  a2  a1  a0",
4823                          "  i   i   i   i      i   i   i   i";
4824
4825	loadpage_lo	= "  1   1   0   0      0   0   0   1",
4826			  "  0   0   0   0      0   0   0   0",
4827			  "  0   0   0   0      0  a2  a1  a0",
4828			  "  i   i   i   i      i   i   i   i";
4829
4830	writepage	= "  1   1   0   0      0   0   1   0",
4831			  "  0   0   x   x    a11 a10  a9  a8",
4832			  " a7  a6  a5  a4     a3   0   0   0",
4833			  "  x   x   x   x      x   x   x   x";
4834
4835	mode		= 0x41;
4836	delay		= 10;
4837	blocksize	= 128;
4838	readsize	= 256;
4839      ;
4840
4841    memory "flash"
4842        paged           = yes;
4843        size            = 131072;
4844        page_size       = 256;
4845        num_pages       = 512;
4846        min_write_delay = 4500;
4847        max_write_delay = 4500;
4848        readback_p1     = 0xff;
4849        readback_p2     = 0xff;
4850        read_lo         = "  0   0   1   0      0   0   0   0",
4851                          "a15 a14 a13 a12    a11 a10  a9  a8",
4852                          " a7  a6  a5  a4     a3  a2  a1  a0",
4853                          "  o   o   o   o      o   o   o   o";
4854
4855        read_hi         = "  0   0   1   0      1   0   0   0",
4856                          "a15 a14 a13 a12    a11 a10  a9  a8",
4857                          " a7  a6  a5  a4     a3  a2  a1  a0",
4858                          "  o   o   o   o      o   o   o   o";
4859
4860        loadpage_lo     = "  0   1   0   0      0   0   0   0",
4861                          "  0   0   x   x      x   x   x   x",
4862                          "  x  a6  a5  a4     a3  a2  a1  a0",
4863                          "  i   i   i   i      i   i   i   i";
4864
4865        loadpage_hi     = "  0   1   0   0      1   0   0   0",
4866                          "  0   0   x   x      x   x   x   x",
4867                          "  x  a6  a5  a4     a3  a2  a1  a0",
4868                          "  i   i   i   i      i   i   i   i";
4869
4870        writepage       = "  0   1   0   0      1   1   0   0",
4871                          "a15 a14 a13 a12    a11 a10  a9  a8",
4872                          " a7   x   x   x      x   x   x   x",
4873                          "  x   x   x   x      x   x   x   x";
4874
4875	mode		= 0x41;
4876	delay		= 10;
4877	blocksize	= 256;
4878	readsize	= 256;
4879      ;
4880
4881    memory "lock"
4882        size            = 1;
4883        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4884                          "x x x x  x x x x   x x o o  o o o o";
4885
4886        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4887                          "x x x x  x x x x   1 1 i i  i i i i";
4888        min_write_delay = 9000;
4889        max_write_delay = 9000;
4890      ;
4891
4892    memory "lfuse"
4893        size            = 1;
4894        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4895                          "x x x x  x x x x   o o o o  o o o o";
4896
4897        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4898                          "x x x x  x x x x   i i i i  i i i i";
4899        min_write_delay = 9000;
4900        max_write_delay = 9000;
4901      ;
4902
4903    memory "hfuse"
4904        size            = 1;
4905        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4906                          "x x x x  x x x x   o o o o  o o o o";
4907
4908        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4909                          "x x x x  x x x x   i i i i  i i i i";
4910        min_write_delay = 9000;
4911        max_write_delay = 9000;
4912      ;
4913
4914    memory "efuse"
4915        size            = 1;
4916
4917        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4918                          "x x x x  x x x x  o o o o  o o o o";
4919
4920        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4921                          "x x x x  x x x x  1 1 1 1  1 i i i";
4922        min_write_delay = 9000;
4923        max_write_delay = 9000;
4924      ;
4925
4926    memory "signature"
4927        size            = 3;
4928        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4929                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4930      ;
4931
4932    memory "calibration"
4933        size            = 1;
4934
4935        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4936                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
4937        ;
4938  ;
4939
4940
4941
4942#------------------------------------------------------------
4943# ATmega1284P
4944#------------------------------------------------------------
4945
4946# similar to ATmega164p
4947
4948part
4949    id               = "m1284p";
4950    desc             = "ATmega1284P";
4951    has_jtag         = yes;
4952    stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4953    avr910_devcode   = 0x74;
4954    signature        = 0x1e 0x97 0x05;
4955    pagel            = 0xd7;
4956    bs2              = 0xa0;
4957    chip_erase_delay = 55000;
4958    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4959                       "x x x x  x x x x    x x x x  x x x x";
4960
4961    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4962                       "x x x x  x x x x    x x x x  x x x x";
4963
4964    timeout		= 200;
4965    stabdelay		= 100;
4966    cmdexedelay		= 25;
4967    synchloops		= 32;
4968    bytedelay		= 0;
4969    pollindex		= 3;
4970    pollvalue		= 0x53;
4971    predelay		= 1;
4972    postdelay		= 1;
4973    pollmethod		= 1;
4974
4975    pp_controlstack     =
4976        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4977        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4978        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4979        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
4980    hventerstabdelay    = 100;
4981    progmodedelay       = 0;
4982    latchcycles         = 6;
4983    togglevtg           = 1;
4984    poweroffdelay       = 15;
4985    resetdelayms        = 1;
4986    resetdelayus        = 0;
4987    hvleavestabdelay    = 15;
4988    chiperasepulsewidth = 0;
4989    chiperasepolltimeout = 10;
4990    programfusepulsewidth = 0;
4991    programfusepolltimeout = 5;
4992    programlockpulsewidth = 0;
4993    programlockpolltimeout = 5;
4994
4995    idr                 = 0x31;
4996    spmcr               = 0x57;
4997    allowfullpagebitstream = no;
4998
4999    ocdrev              = 3;
5000
5001    memory "eeprom"
5002        paged           = no; /* leave this "no" */
5003        page_size       = 8;  /* for parallel programming */
5004        size            = 4096;
5005        min_write_delay = 9000;
5006        max_write_delay = 9000;
5007        readback_p1     = 0xff;
5008        readback_p2     = 0xff;
5009	read            = "  1   0   1   0      0   0   0   0",
5010                          "  0   0   x   x    a11 a10  a9  a8",
5011                          " a7  a6  a5  a4     a3  a2  a1  a0",
5012                          "  o   o   o   o      o   o   o   o";
5013
5014	write           = "  1   1   0   0      0   0   0   0",
5015                          "  0   0   x   x    a11 a10  a9  a8",
5016                          " a7  a6  a5  a4     a3  a2  a1  a0",
5017                          "  i   i   i   i      i   i   i   i";
5018
5019	loadpage_lo	= "  1   1   0   0      0   0   0   1",
5020			  "  0   0   0   0      0   0   0   0",
5021			  "  0   0   0   0      0  a2  a1  a0",
5022			  "  i   i   i   i      i   i   i   i";
5023
5024	writepage	= "  1   1   0   0      0   0   1   0",
5025			  "  0   0   x   x    a11 a10  a9  a8",
5026			  " a7  a6  a5  a4     a3   0   0   0",
5027			  "  x   x   x   x      x   x   x   x";
5028
5029	mode		= 0x41;
5030	delay		= 10;
5031	blocksize	= 128;
5032	readsize	= 256;
5033      ;
5034
5035    memory "flash"
5036        paged           = yes;
5037        size            = 131072;
5038        page_size       = 256;
5039        num_pages       = 512;
5040        min_write_delay = 4500;
5041        max_write_delay = 4500;
5042        readback_p1     = 0xff;
5043        readback_p2     = 0xff;
5044        read_lo         = "  0   0   1   0      0   0   0   0",
5045                          "a15 a14 a13 a12    a11 a10  a9  a8",
5046                          " a7  a6  a5  a4     a3  a2  a1  a0",
5047                          "  o   o   o   o      o   o   o   o";
5048
5049        read_hi         = "  0   0   1   0      1   0   0   0",
5050                          "a15 a14 a13 a12    a11 a10  a9  a8",
5051                          " a7  a6  a5  a4     a3  a2  a1  a0",
5052                          "  o   o   o   o      o   o   o   o";
5053
5054        loadpage_lo     = "  0   1   0   0      0   0   0   0",
5055                          "  0   0   x   x      x   x   x   x",
5056                          "  x  a6  a5  a4     a3  a2  a1  a0",
5057                          "  i   i   i   i      i   i   i   i";
5058
5059        loadpage_hi     = "  0   1   0   0      1   0   0   0",
5060                          "  0   0   x   x      x   x   x   x",
5061                          "  x  a6  a5  a4     a3  a2  a1  a0",
5062                          "  i   i   i   i      i   i   i   i";
5063
5064        writepage       = "  0   1   0   0      1   1   0   0",
5065                          "a15 a14 a13 a12    a11 a10  a9  a8",
5066                          " a7   x   x   x      x   x   x   x",
5067                          "  x   x   x   x      x   x   x   x";
5068
5069	mode		= 0x41;
5070	delay		= 10;
5071	blocksize	= 256;
5072	readsize	= 256;
5073      ;
5074
5075    memory "lock"
5076        size            = 1;
5077        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5078                          "x x x x  x x x x   x x o o  o o o o";
5079
5080        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5081                          "x x x x  x x x x   1 1 i i  i i i i";
5082        min_write_delay = 9000;
5083        max_write_delay = 9000;
5084      ;
5085
5086    memory "lfuse"
5087        size            = 1;
5088        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5089                          "x x x x  x x x x   o o o o  o o o o";
5090
5091        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5092                          "x x x x  x x x x   i i i i  i i i i";
5093        min_write_delay = 9000;
5094        max_write_delay = 9000;
5095      ;
5096
5097    memory "hfuse"
5098        size            = 1;
5099        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5100                          "x x x x  x x x x   o o o o  o o o o";
5101
5102        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5103                          "x x x x  x x x x   i i i i  i i i i";
5104        min_write_delay = 9000;
5105        max_write_delay = 9000;
5106      ;
5107
5108    memory "efuse"
5109        size            = 1;
5110
5111        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
5112                          "x x x x  x x x x  o o o o  o o o o";
5113
5114        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
5115                          "x x x x  x x x x  1 1 1 1  1 i i i";
5116        min_write_delay = 9000;
5117        max_write_delay = 9000;
5118      ;
5119
5120    memory "signature"
5121        size            = 3;
5122        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
5123                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5124      ;
5125
5126    memory "calibration"
5127        size            = 1;
5128
5129        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
5130                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
5131        ;
5132  ;
5133
5134
5135
5136#------------------------------------------------------------
5137# ATmega162
5138#------------------------------------------------------------
5139
5140part
5141    id               = "m162";
5142    desc             = "ATmega162";
5143    has_jtag         = yes;
5144    stk500_devcode   = 0x83;
5145    avr910_devcode   = 0x63;
5146    signature        = 0x1e 0x94 0x04;
5147    chip_erase_delay = 9000;
5148    pagel            = 0xd7;
5149    bs2              = 0xa0;
5150
5151    idr              = 0x04;
5152    spmcr            = 0x57;
5153    allowfullpagebitstream = yes;
5154
5155    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5156                       "x x x x  x x x x    x x x x  x x x x";
5157
5158    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
5159                       "x x x x  x x x x    x x x x  x x x x";
5160
5161    ocdrev              = 2;
5162
5163    memory "flash"
5164        paged           = yes;
5165        size            = 16384;
5166        page_size       = 128;
5167        num_pages       = 128;
5168        min_write_delay = 4500;
5169        max_write_delay = 4500;
5170        readback_p1     = 0xff;
5171        readback_p2     = 0xff;
5172
5173        read_lo         = "  0   0   1   0      0   0   0   0",
5174                          "  0   0 a13 a12    a11 a10  a9  a8",
5175                          " a7  a6  a5  a4     a3  a2  a1  a0",
5176                          "  o   o   o   o      o   o   o   o";
5177
5178        read_hi         = "  0   0   1   0      1   0   0   0",
5179                          "  0   0 a13 a12    a11 a10  a9  a8",
5180                          " a7  a6  a5  a4     a3  a2  a1  a0",
5181                          "  o   o   o   o      o   o   o   o";
5182
5183        loadpage_lo     = "  0   1   0   0      0   0   0   0",
5184                          "  0   0   x   x      x   x   x   x",
5185                          "  x   x  a5  a4     a3  a2  a1  a0",
5186                          "  i   i   i   i      i   i   i   i";
5187
5188        loadpage_hi     = "  0   1   0   0      1   0   0   0",
5189                          "  0   0   x   x      x   x   x   x",
5190                          "  x   x  a5  a4     a3  a2  a1  a0",
5191                          "  i   i   i   i      i   i   i   i";
5192
5193        writepage       = "  0   1   0   0      1   1   0   0",
5194                          "  0   0 a13 a12    a11 a10  a9  a8",
5195                          " a7  a6   x   x      x   x   x   x",
5196                          "  x   x   x   x      x   x   x   x";
5197       mode        = 0x41;
5198    delay       = 10;
5199    blocksize   = 128;
5200    readsize    = 256;
5201
5202        ;
5203
5204    timeout		= 200;
5205    stabdelay		= 100;
5206    cmdexedelay		= 25;
5207    synchloops		= 32;
5208    bytedelay		= 0;
5209    pollindex		= 3;
5210    pollvalue		= 0x53;
5211    predelay		= 1;
5212    postdelay		= 1;
5213    pollmethod		= 0;
5214
5215    pp_controlstack     =
5216        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5217        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5218        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5219        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5220    hventerstabdelay    = 100;
5221    progmodedelay       = 0;
5222    latchcycles         = 6;
5223    togglevtg           = 0;
5224    poweroffdelay       = 0;
5225    resetdelayms        = 0;
5226    resetdelayus        = 0;
5227    hvleavestabdelay    = 15;
5228    chiperasepulsewidth = 0;
5229    chiperasepolltimeout = 10;
5230    programfusepulsewidth = 0;
5231    programfusepolltimeout = 5;
5232    programlockpulsewidth = 0;
5233    programlockpolltimeout = 5;
5234
5235    memory "eeprom"
5236        paged           = no; /* leave this "no" */
5237        page_size       = 4;  /* for parallel programming */
5238        size            = 512;
5239        min_write_delay = 9000;
5240        max_write_delay = 9000;
5241        readback_p1     = 0xff;
5242        readback_p2     = 0xff;
5243
5244                read            = "  1   0   1   0      0   0   0   0",
5245                          "  0   0   x   x      x   x  a9  a8",
5246                          " a7  a6  a5  a4     a3  a2  a1  a0",
5247                          "  o   o   o   o      o   o   o   o";
5248
5249                write           = "  1   1   0   0      0   0   0   0",
5250                          "  0   0   x   x      x   x  a9  a8",
5251                          " a7  a6  a5  a4     a3  a2  a1  a0",
5252                          "  i   i   i   i      i   i   i   i";
5253
5254	loadpage_lo	= "  1   1   0   0      0   0   0   1",
5255			  "  0   0   0   0      0   0   0   0",
5256			  "  0   0   0   0      0   0  a1  a0",
5257			  "  i   i   i   i      i   i   i   i";
5258
5259	writepage	= "  1   1   0   0      0   0   1   0",
5260			  "  0   0   x   x      x   x  a9  a8",
5261			  " a7  a6  a5  a4     a3  a2   0   0",
5262			  "  x   x   x   x      x   x   x   x";
5263
5264	mode		= 0x41;
5265	delay		= 20;
5266	blocksize	= 4;
5267	readsize	= 256;
5268        ;
5269
5270    memory "lfuse"
5271        size            = 1;
5272        min_write_delay = 16000;
5273        max_write_delay = 16000;
5274        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5275                          "x x x x  x x x x   o o o o  o o o o";
5276
5277        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5278                          "x x x x  x x x x   i i i i  i i i i";
5279        ;
5280
5281    memory "hfuse"
5282        size            = 1;
5283        min_write_delay = 16000;
5284        max_write_delay = 16000;
5285
5286        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5287                          "x x x x  x x x x   o o o o  o o o o";
5288
5289        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5290                          "x x x x  x x x x   i i i i  i i i i";
5291        ;
5292
5293    memory "efuse"
5294        size            = 1;
5295        min_write_delay = 16000;
5296        max_write_delay = 16000;
5297
5298        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
5299                          "x x x x  x x x x  o o o o  o o o o";
5300
5301        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
5302                          "x x x x  x x x x  1 1 1 1  1 i i i";
5303      ;
5304
5305    memory "lock"
5306        size            = 1;
5307        min_write_delay = 16000;
5308        max_write_delay = 16000;
5309
5310        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5311                          "x x x x  x x x x   x x o o  o o o o";
5312
5313        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5314                          "x x x x  x x x x   1 1 i i  i i i i";
5315        ;
5316
5317    memory "signature"
5318        size            = 3;
5319
5320        read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
5321                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5322        ;
5323
5324    memory "calibration"
5325        size            = 1;
5326
5327        read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
5328                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
5329        ;
5330;
5331
5332
5333
5334#------------------------------------------------------------
5335# ATmega163
5336#------------------------------------------------------------
5337
5338part
5339    id               = "m163";
5340    desc             = "ATmega163";
5341    stk500_devcode   = 0x81;
5342    avr910_devcode   = 0x64;
5343    signature        = 0x1e 0x94 0x02;
5344    chip_erase_delay = 32000;
5345    pagel            = 0xd7;
5346    bs2              = 0xa0;
5347    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5348                       "x x x x  x x x x    x x x x  x x x x";
5349
5350    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5351                       "x x x x  x x x x    x x x x  x x x x";
5352
5353    timeout             = 200;
5354    stabdelay           = 100;
5355    cmdexedelay         = 25;
5356    synchloops          = 32;
5357    bytedelay           = 0;
5358    pollindex           = 3;
5359    pollvalue           = 0x53;
5360    predelay            = 1;
5361    postdelay           = 1;
5362    pollmethod          = 0;
5363
5364    pp_controlstack     =
5365        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5366        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5367        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5368        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5369    hventerstabdelay    = 100;
5370    progmodedelay       = 0;
5371    latchcycles         = 0;
5372    togglevtg           = 0;
5373    poweroffdelay       = 0;
5374    resetdelayms        = 0;
5375    resetdelayus        = 0;
5376    hvleavestabdelay    = 15;
5377    chiperasepulsewidth = 0;
5378    chiperasepolltimeout = 30;
5379    programfusepulsewidth = 0;
5380    programfusepolltimeout = 2;
5381    programlockpulsewidth = 0;
5382    programlockpolltimeout = 2;
5383
5384
5385   memory "eeprom"
5386        size            = 512;
5387        min_write_delay = 4000;
5388        max_write_delay = 4000;
5389        readback_p1     = 0xff;
5390        readback_p2     = 0xff;
5391	read            = "  1   0   1   0      0   0   0   0",
5392                          "  x   x   x   x      x   x   x  a8",
5393                          " a7  a6  a5  a4     a3  a2  a1  a0",
5394                          "  o   o   o   o      o   o   o   o";
5395
5396	write           = "  1   1   0   0      0   0   0   0",
5397                          "  x   x   x   x      x   x   x  a8",
5398                          " a7  a6  a5  a4     a3  a2  a1  a0",
5399                          "  i   i   i   i      i   i   i   i";
5400        mode            = 0x41;
5401        delay           = 20;
5402        blocksize       = 4;
5403        readsize        = 256;
5404      ;
5405
5406    memory "flash"
5407        paged           = yes;
5408        size            = 16384;
5409        page_size       = 128;
5410        num_pages       = 128;
5411        min_write_delay = 16000;
5412        max_write_delay = 16000;
5413        readback_p1     = 0xff;
5414        readback_p2     = 0xff;
5415        read_lo         = "  0   0   1   0      0   0   0   0",
5416                          "  x   x   x a12    a11 a10  a9  a8",
5417                          " a7  a6  a5  a4     a3  a2  a1  a0",
5418                          "  o   o   o   o      o   o   o   o";
5419
5420        read_hi         = "  0   0   1   0      1   0   0   0",
5421                          "  x   x   x a12    a11 a10  a9  a8",
5422                          " a7  a6  a5  a4     a3  a2  a1  a0",
5423                          "  o   o   o   o      o   o   o   o";
5424
5425        loadpage_lo     = "  0   1   0   0      0   0   0   0",
5426                          "  x   x   x   x      x   x   x   x",
5427                          "  x   x  a5  a4     a3  a2  a1  a0",
5428                          "  i   i   i   i      i   i   i   i";
5429
5430        loadpage_hi     = "  0   1   0   0      1   0   0   0",
5431                          "  x   x   x   x      x   x   x   x",
5432                          "  x   x  a5  a4     a3  a2  a1  a0",
5433                          "  i   i   i   i      i   i   i   i";
5434
5435        writepage       = "  0   1   0   0      1   1   0   0",
5436                          "  x   x   x a12    a11 a10  a9  a8",
5437                          " a7  a6   x   x      x   x   x   x",
5438                          "  x   x   x   x      x   x   x   x";
5439
5440	mode		= 0x11;
5441	delay		= 20;
5442	blocksize	= 128;
5443	readsize	= 256;
5444      ;
5445
5446    memory "lfuse"
5447        size            = 1;
5448        min_write_delay = 2000;
5449        max_write_delay = 2000;
5450        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5451                          "x x x x  x x x x   o o x x  o o o o";
5452
5453        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5454                          "x x x x  x x x x   i i 1 1  i i i i";
5455      ;
5456
5457    memory "hfuse"
5458        size            = 1;
5459        min_write_delay = 2000;
5460        max_write_delay = 2000;
5461        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5462                          "x x x x  x x x x   x x x x  1 o o o";
5463
5464        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5465                          "x x x x  x x x x   1 1 1 1  1 i i i";
5466      ;
5467
5468    memory "lock"
5469        size            = 1;
5470        min_write_delay = 2000;
5471        max_write_delay = 2000;
5472        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5473                          "x x x x  0 x x x   x x o o  o o o o";
5474
5475        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5476                          "x x x x  x x x x   1 1 i i  i i i i";
5477      ;
5478
5479    memory "signature"
5480        size            = 3;
5481        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
5482                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5483      ;
5484
5485    memory "calibration"
5486        size            = 1;
5487        read            = "0 0 1 1  1 0 0 0   x x x x  x x x x",
5488                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
5489      ;
5490  ;
5491
5492#------------------------------------------------------------
5493# ATmega169
5494#------------------------------------------------------------
5495
5496part
5497    id               = "m169";
5498    desc             = "ATmega169";
5499    has_jtag         = yes;
5500    stk500_devcode   = 0x85;
5501    avr910_devcode   = 0x78;
5502    signature        = 0x1e 0x94 0x05;
5503    chip_erase_delay = 9000;
5504    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5505                       "x x x x  x x x x    x x x x  x x x x";
5506
5507    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5508                       "x x x x  x x x x    x x x x  x x x x";
5509    timeout		= 200;
5510    stabdelay		= 100;
5511    cmdexedelay		= 25;
5512    synchloops		= 32;
5513    bytedelay		= 0;
5514    pollindex		= 3;
5515    pollvalue		= 0x53;
5516    predelay		= 1;
5517    postdelay		= 1;
5518    pollmethod		= 1;
5519
5520    pp_controlstack     =
5521        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5522        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5523        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5524        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5525    hventerstabdelay    = 100;
5526    progmodedelay       = 0;
5527    latchcycles         = 5;
5528    togglevtg           = 1;
5529    poweroffdelay       = 15;
5530    resetdelayms        = 1;
5531    resetdelayus        = 0;
5532    hvleavestabdelay    = 15;
5533    chiperasepulsewidth = 0;
5534    chiperasepolltimeout = 10;
5535    programfusepulsewidth = 0;
5536    programfusepolltimeout = 5;
5537    programlockpulsewidth = 0;
5538    programlockpolltimeout = 5;
5539
5540    idr                 = 0x31;
5541    spmcr               = 0x57;
5542
5543    ocdrev              = 2;
5544
5545   memory "eeprom"
5546        paged           = no; /* leave this "no" */
5547        page_size       = 4;  /* for parallel programming */
5548        size            = 512;
5549        min_write_delay = 9000;
5550        max_write_delay = 9000;
5551        readback_p1     = 0xff;
5552        readback_p2     = 0xff;
5553	read            = "  1   0   1   0      0   0   0   0",
5554                          "  x   x   x   x      x   x   x  a8",
5555                          " a7  a6  a5  a4     a3  a2  a1  a0",
5556                          "  o   o   o   o      o   o   o   o";
5557
5558	write           = "  1   1   0   0      0   0   0   0",
5559                          "  x   x   x   x      x   x   x  a8",
5560                          " a7  a6  a5  a4     a3  a2  a1  a0",
5561                          "  i   i   i   i      i   i   i   i";
5562
5563	loadpage_lo	= "  1   1   0   0      0   0   0   1",
5564			  "  0   0   0   0      0   0   0   0",
5565			  "  0   0   0   0      0   0  a1  a0",
5566			  "  i   i   i   i      i   i   i   i";
5567
5568	writepage	= "  1   1   0   0      0   0   1   0",
5569			  "  0   0   x   x      x   x   x  a8",
5570			  " a7  a6  a5  a4     a3  a2   0   0",
5571			  "  x   x   x   x      x   x   x   x";
5572
5573	mode		= 0x41;
5574	delay		= 20;
5575	blocksize	= 4;
5576	readsize	= 256;
5577      ;
5578
5579    memory "flash"
5580        paged           = yes;
5581        size            = 16384;
5582        page_size       = 128;
5583        num_pages       = 128;
5584        min_write_delay = 4500;
5585        max_write_delay = 4500;
5586        readback_p1     = 0xff;
5587        readback_p2     = 0xff;
5588        read_lo         = "  0   0   1   0      0   0   0   0",
5589                          "  x   x   x a12    a11 a10  a9  a8",
5590                          " a7  a6  a5  a4     a3  a2  a1  a0",
5591                          "  o   o   o   o      o   o   o   o";
5592
5593        read_hi         = "  0   0   1   0      1   0   0   0",
5594                          "  x   x   x a12    a11 a10  a9  a8",
5595                          " a7  a6  a5  a4     a3  a2  a1  a0",
5596                          "  o   o   o   o      o   o   o   o";
5597
5598        loadpage_lo     = "  0   1   0   0      0   0   0   0",
5599                          "  x   x   x   x      x   x   x   x",
5600                          "  x   x  a5  a4     a3  a2  a1  a0",
5601                          "  i   i   i   i      i   i   i   i";
5602
5603        loadpage_hi     = "  0   1   0   0      1   0   0   0",
5604                          "  x   x   x   x      x   x   x   x",
5605                          "  x   x  a5  a4     a3  a2  a1  a0",
5606                          "  i   i   i   i      i   i   i   i";
5607
5608        writepage       = "  0   1   0   0      1   1   0   0",
5609                          "  x   x   x a12    a11 a10  a9  a8",
5610                          " a7  a6   x   x      x   x   x   x",
5611                          "  x   x   x   x      x   x   x   x";
5612
5613	mode		= 0x41;
5614	delay		= 6;
5615	blocksize	= 128;
5616	readsize	= 256;
5617      ;
5618
5619    memory "lfuse"
5620        size            = 1;
5621        min_write_delay = 2000;
5622        max_write_delay = 2000;
5623        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5624                          "x x x x  x x x x   o o o o  o o o o";
5625
5626        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5627                          "x x x x  x x x x   i i i i  i i i i";
5628      ;
5629
5630    memory "hfuse"
5631        size            = 1;
5632        min_write_delay = 2000;
5633        max_write_delay = 2000;
5634        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5635                          "x x x x  x x x x   o o o o  o o o o";
5636
5637        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5638                          "x x x x  x x x x   i i i i  i i i i";
5639      ;
5640
5641    memory "efuse"
5642        size            = 1;
5643        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
5644                          "x x x x  x x x x  x x x x  i i i i";
5645
5646        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
5647                          "x x x x  x x x x  o o o o  o o o o";
5648      ;
5649
5650    memory "lock"
5651        size            = 1;
5652        min_write_delay = 2000;
5653        max_write_delay = 2000;
5654        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5655                          "x x x x  x x x x   x x o o  o o o o";
5656
5657        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5658                          "x x x x  x x x x   1 1 i i  i i i i";
5659      ;
5660
5661    memory "signature"
5662        size            = 3;
5663        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
5664                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5665      ;
5666
5667    memory "calibration"
5668        size            = 1;
5669        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
5670                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
5671      ;
5672  ;
5673
5674#------------------------------------------------------------
5675# ATmega329
5676#------------------------------------------------------------
5677
5678part
5679    id               = "m329";
5680    desc             = "ATmega329";
5681    has_jtag         = yes;
5682#    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
5683#    avr910_devcode   = 0x?;  # try the ATmega169 one:
5684    avr910_devcode   = 0x75;
5685    signature        = 0x1e 0x95 0x03;
5686    chip_erase_delay = 9000;
5687    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5688                       "x x x x  x x x x    x x x x  x x x x";
5689
5690    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5691                       "x x x x  x x x x    x x x x  x x x x";
5692    timeout		= 200;
5693    stabdelay		= 100;
5694    cmdexedelay		= 25;
5695    synchloops		= 32;
5696    bytedelay		= 0;
5697    pollindex		= 3;
5698    pollvalue		= 0x53;
5699    predelay		= 1;
5700    postdelay		= 1;
5701    pollmethod		= 1;
5702
5703    pp_controlstack     =
5704        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5705        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5706        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5707        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5708    hventerstabdelay    = 100;
5709    progmodedelay       = 0;
5710    latchcycles         = 5;
5711    togglevtg           = 1;
5712    poweroffdelay       = 15;
5713    resetdelayms        = 1;
5714    resetdelayus        = 0;
5715    hvleavestabdelay    = 15;
5716    chiperasepulsewidth = 0;
5717    chiperasepolltimeout = 10;
5718    programfusepulsewidth = 0;
5719    programfusepolltimeout = 5;
5720    programlockpulsewidth = 0;
5721    programlockpolltimeout = 5;
5722
5723    idr                 = 0x31;
5724    spmcr               = 0x57;
5725
5726    ocdrev              = 3;
5727
5728   memory "eeprom"
5729        paged           = no; /* leave this "no" */
5730        page_size       = 4;  /* for parallel programming */
5731        size            = 1024;
5732        min_write_delay = 9000;
5733        max_write_delay = 9000;
5734        readback_p1     = 0xff;
5735        readback_p2     = 0xff;
5736	read            = "  1   0   1   0      0   0   0   0",
5737                          "  x   x   x   x      x   x  a9  a8",
5738                          " a7  a6  a5  a4     a3  a2  a1  a0",
5739                          "  o   o   o   o      o   o   o   o";
5740
5741	write           = "  1   1   0   0      0   0   0   0",
5742                          "  x   x   x   x      x   x  a9  a8",
5743                          " a7  a6  a5  a4     a3  a2  a1  a0",
5744                          "  i   i   i   i      i   i   i   i";
5745
5746	loadpage_lo	= "  1   1   0   0      0   0   0   1",
5747			  "  0   0   0   0      0   0   0   0",
5748			  "  0   0   0   0      0   0  a1  a0",
5749			  "  i   i   i   i      i   i   i   i";
5750
5751	writepage	= "  1   1   0   0      0   0   1   0",
5752			  "  0   0   x   x      x   x  a9  a8",
5753			  " a7  a6  a5  a4     a3  a2   0   0",
5754			  "  x   x   x   x      x   x   x   x";
5755
5756	mode		= 0x41;
5757	delay		= 20;
5758	blocksize	= 8;
5759	readsize	= 256;
5760      ;
5761
5762    memory "flash"
5763        paged           = yes;
5764        size            = 32768;
5765        page_size       = 128;
5766        num_pages       = 256;
5767        min_write_delay = 4500;
5768        max_write_delay = 4500;
5769        readback_p1     = 0xff;
5770        readback_p2     = 0xff;
5771        read_lo         = "  0   0   1   0      0   0   0   0",
5772                          "  x a14 a13 a12    a11 a10  a9  a8",
5773                          " a7  a6  a5  a4     a3  a2  a1  a0",
5774                          "  o   o   o   o      o   o   o   o";
5775
5776        read_hi         = "  0   0   1   0      1   0   0   0",
5777                          "  x a14 a13 a12    a11 a10  a9  a8",
5778                          " a7  a6  a5  a4     a3  a2  a1  a0",
5779                          "  o   o   o   o      o   o   o   o";
5780
5781        loadpage_lo     = "  0   1   0   0      0   0   0   0",
5782                          "  x   x   x   x      x   x   x   x",
5783                          "  x   x  a5  a4     a3  a2  a1  a0",
5784                          "  i   i   i   i      i   i   i   i";
5785
5786        loadpage_hi     = "  0   1   0   0      1   0   0   0",
5787                          "  x   x   x   x      x   x   x   x",
5788                          "  x   x  a5  a4     a3  a2  a1  a0",
5789                          "  i   i   i   i      i   i   i   i";
5790
5791        writepage       = "  0   1   0   0      1   1   0   0",
5792                          "  x   x   x a12    a11 a10  a9  a8",
5793                          " a7  a6   x   x      x   x   x   x",
5794                          "  x   x   x   x      x   x   x   x";
5795
5796	mode		= 0x41;
5797	delay		= 6;
5798	blocksize	= 256;
5799	readsize	= 256;
5800      ;
5801
5802    memory "lfuse"
5803        size            = 1;
5804        min_write_delay = 4500;
5805        max_write_delay = 4500;
5806        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5807                          "x x x x  x x x x   o o o o  o o o o";
5808
5809        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5810                          "x x x x  x x x x   i i i i  i i i i";
5811      ;
5812
5813    memory "hfuse"
5814        size            = 1;
5815        min_write_delay = 4500;
5816        max_write_delay = 4500;
5817        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5818                          "x x x x  x x x x   o o o o  o o o o";
5819
5820        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5821                          "x x x x  x x x x   i i i i  i i i i";
5822      ;
5823
5824    memory "efuse"
5825        size            = 1;
5826        min_write_delay = 4500;
5827        max_write_delay = 4500;
5828        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
5829                          "x x x x  x x x x   o o o o  o o o o";
5830
5831        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
5832                          "x x x x  x x x x   x x x x  x i i i";
5833      ;
5834
5835    memory "lock"
5836        size            = 1;
5837        min_write_delay = 4500;
5838        max_write_delay = 4500;
5839        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5840                          "x x x x  x x x x   x x o o  o o o o";
5841
5842        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5843                          "x x x x  x x x x   1 1 i i  i i i i";
5844      ;
5845
5846    memory "signature"
5847        size            = 3;
5848        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
5849                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5850      ;
5851
5852    memory "calibration"
5853        size            = 1;
5854        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
5855                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
5856      ;
5857  ;
5858
5859#------------------------------------------------------------
5860# ATmega329P
5861#------------------------------------------------------------
5862# Identical to ATmega329 except of the signature
5863
5864part parent "m329"
5865    id               = "m329p";
5866    desc             = "ATmega329P";
5867    signature        = 0x1e 0x95 0x0b;
5868
5869    ocdrev              = 3;
5870  ;
5871
5872#------------------------------------------------------------
5873# ATmega3290
5874#------------------------------------------------------------
5875
5876# identical to ATmega329
5877
5878part parent "m329"
5879    id               = "m3290";
5880    desc             = "ATmega3290";
5881    signature        = 0x1e 0x95 0x04;
5882
5883    ocdrev              = 3;
5884  ;
5885
5886#------------------------------------------------------------
5887# ATmega3290P
5888#------------------------------------------------------------
5889
5890# identical to ATmega3290 except of the signature
5891
5892part parent "m3290"
5893    id               = "m3290p";
5894    desc             = "ATmega3290P";
5895    signature        = 0x1e 0x95 0x0c;
5896
5897    ocdrev              = 3;
5898  ;
5899
5900#------------------------------------------------------------
5901# ATmega649
5902#------------------------------------------------------------
5903
5904part
5905    id               = "m649";
5906    desc             = "ATmega649";
5907    has_jtag         = yes;
5908#    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
5909#    avr910_devcode   = 0x?;  # try the ATmega169 one:
5910    avr910_devcode   = 0x75;
5911    signature        = 0x1e 0x96 0x03;
5912    chip_erase_delay = 9000;
5913    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5914                       "x x x x  x x x x    x x x x  x x x x";
5915
5916    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5917                       "x x x x  x x x x    x x x x  x x x x";
5918    timeout		= 200;
5919    stabdelay		= 100;
5920    cmdexedelay		= 25;
5921    synchloops		= 32;
5922    bytedelay		= 0;
5923    pollindex		= 3;
5924    pollvalue		= 0x53;
5925    predelay		= 1;
5926    postdelay		= 1;
5927    pollmethod		= 1;
5928
5929    pp_controlstack     =
5930        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5931        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5932        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5933        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5934    hventerstabdelay    = 100;
5935    progmodedelay       = 0;
5936    latchcycles         = 5;
5937    togglevtg           = 1;
5938    poweroffdelay       = 15;
5939    resetdelayms        = 1;
5940    resetdelayus        = 0;
5941    hvleavestabdelay    = 15;
5942    chiperasepulsewidth = 0;
5943    chiperasepolltimeout = 10;
5944    programfusepulsewidth = 0;
5945    programfusepolltimeout = 5;
5946    programlockpulsewidth = 0;
5947    programlockpolltimeout = 5;
5948
5949    idr                 = 0x31;
5950    spmcr               = 0x57;
5951
5952    ocdrev              = 3;
5953
5954   memory "eeprom"
5955        paged           = no; /* leave this "no" */
5956        page_size       = 8;  /* for parallel programming */
5957        size            = 2048;
5958        min_write_delay = 9000;
5959        max_write_delay = 9000;
5960        readback_p1     = 0xff;
5961        readback_p2     = 0xff;
5962	read            = "  1   0   1   0      0   0   0   0",
5963                          "  x   x   x   x      x a10  a9  a8",
5964                          " a7  a6  a5  a4     a3  a2  a1  a0",
5965                          "  o   o   o   o      o   o   o   o";
5966
5967	write           = "  1   1   0   0      0   0   0   0",
5968                          "  x   x   x   x      x a10  a9  a8",
5969                          " a7  a6  a5  a4     a3  a2  a1  a0",
5970                          "  i   i   i   i      i   i   i   i";
5971
5972	loadpage_lo	= "  1   1   0   0      0   0   0   1",
5973			  "  0   0   0   0      0   0   0   0",
5974			  "  0   0   0   0      0  a2  a1  a0",
5975			  "  i   i   i   i      i   i   i   i";
5976
5977	writepage	= "  1   1   0   0      0   0   1   0",
5978			  "  0   0   x   x      x a10  a9  a8",
5979			  " a7  a6  a5  a4     a3   0   0   0",
5980			  "  x   x   x   x      x   x   x   x";
5981
5982	mode		= 0x41;
5983	delay		= 20;
5984	blocksize	= 8;
5985	readsize	= 256;
5986      ;
5987
5988    memory "flash"
5989        paged           = yes;
5990        size            = 65536;
5991        page_size       = 256;
5992        num_pages       = 256;
5993        min_write_delay = 4500;
5994        max_write_delay = 4500;
5995        readback_p1     = 0xff;
5996        readback_p2     = 0xff;
5997        read_lo         = "  0   0   1   0      0   0   0   0",
5998                          "a15 a14 a13 a12    a11 a10  a9  a8",
5999                          " a7  a6  a5  a4     a3  a2  a1  a0",
6000                          "  o   o   o   o      o   o   o   o";
6001
6002        read_hi         = "  0   0   1   0      1   0   0   0",
6003                          "a15 a14 a13 a12    a11 a10  a9  a8",
6004                          " a7  a6  a5  a4     a3  a2  a1  a0",
6005                          "  o   o   o   o      o   o   o   o";
6006
6007        loadpage_lo     = "  0   1   0   0      0   0   0   0",
6008                          "  x   x   x   x      x   x   x   x",
6009                          "  x  a6  a5  a4     a3  a2  a1  a0",
6010                          "  i   i   i   i      i   i   i   i";
6011
6012        loadpage_hi     = "  0   1   0   0      1   0   0   0",
6013                          "  x   x   x   x      x   x   x   x",
6014                          "  x  a6  a5  a4     a3  a2  a1  a0",
6015                          "  i   i   i   i      i   i   i   i";
6016
6017        writepage       = "  0   1   0   0      1   1   0   0",
6018                          "  x   x   x a12    a11 a10  a9  a8",
6019                          " a7   x   x   x      x   x   x   x",
6020                          "  x   x   x   x      x   x   x   x";
6021
6022	mode		= 0x41;
6023	delay		= 6;
6024	blocksize	= 256;
6025	readsize	= 256;
6026      ;
6027
6028    memory "lfuse"
6029        size            = 1;
6030        min_write_delay = 4500;
6031        max_write_delay = 4500;
6032        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6033                          "x x x x  x x x x   o o o o  o o o o";
6034
6035        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6036                          "x x x x  x x x x   i i i i  i i i i";
6037      ;
6038
6039    memory "hfuse"
6040        size            = 1;
6041        min_write_delay = 4500;
6042        max_write_delay = 4500;
6043        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6044                          "x x x x  x x x x   o o o o  o o o o";
6045
6046        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6047                          "x x x x  x x x x   i i i i  i i i i";
6048      ;
6049
6050    memory "efuse"
6051        size            = 1;
6052        min_write_delay = 4500;
6053        max_write_delay = 4500;
6054        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
6055                          "x x x x  x x x x   o o o o  o o o o";
6056
6057        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
6058                          "x x x x  x x x x   x x x x  x i i i";
6059      ;
6060
6061    memory "lock"
6062        size            = 1;
6063        min_write_delay = 4500;
6064        max_write_delay = 4500;
6065        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6066                          "x x x x  x x x x   x x o o  o o o o";
6067
6068        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6069                          "x x x x  x x x x   1 1 i i  i i i i";
6070      ;
6071
6072    memory "signature"
6073        size            = 3;
6074        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
6075                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6076      ;
6077
6078    memory "calibration"
6079        size            = 1;
6080        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
6081                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
6082      ;
6083  ;
6084
6085#------------------------------------------------------------
6086# ATmega6490
6087#------------------------------------------------------------
6088
6089# identical to ATmega649
6090
6091part parent "m649"
6092    id               = "m6490";
6093    desc             = "ATmega6490";
6094    signature        = 0x1e 0x96 0x04;
6095
6096    ocdrev              = 3;
6097  ;
6098
6099#------------------------------------------------------------
6100# ATmega32
6101#------------------------------------------------------------
6102
6103part
6104    id               = "m32";
6105    desc             = "ATmega32";
6106    has_jtag         = yes;
6107    stk500_devcode   = 0x91;
6108    avr910_devcode   = 0x72;
6109    signature        = 0x1e 0x95 0x02;
6110    chip_erase_delay = 9000;
6111    pagel            = 0xd7;
6112    bs2              = 0xa0;
6113    reset            = dedicated;
6114    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6115                       "x x x x  x x x x    x x x x  x x x x";
6116
6117    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
6118                       "x x x x  x x x x    x x x x  x x x x";
6119    timeout		= 200;
6120    stabdelay		= 100;
6121    cmdexedelay		= 25;
6122    synchloops		= 32;
6123    bytedelay		= 0;
6124    pollindex		= 3;
6125    pollvalue		= 0x53;
6126    predelay		= 1;
6127    postdelay		= 1;
6128    pollmethod		= 0;
6129
6130    pp_controlstack     =
6131        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6132        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6133        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6134        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6135    hventerstabdelay    = 100;
6136    progmodedelay       = 0;
6137    latchcycles         = 6;
6138    togglevtg           = 0;
6139    poweroffdelay       = 0;
6140    resetdelayms        = 0;
6141    resetdelayus        = 0;
6142    hvleavestabdelay    = 15;
6143    chiperasepulsewidth = 0;
6144    chiperasepolltimeout = 10;
6145    programfusepulsewidth = 0;
6146    programfusepolltimeout = 5;
6147    programlockpulsewidth = 0;
6148    programlockpolltimeout = 5;
6149
6150    idr                 = 0x31;
6151    spmcr               = 0x57;
6152    allowfullpagebitstream = yes;
6153
6154    ocdrev              = 2;
6155
6156   memory "eeprom"
6157        paged           = no;   /* leave this "no" */
6158        page_size       = 4;    /* for parallel programming */
6159        size            = 1024;
6160        min_write_delay = 9000;
6161        max_write_delay = 9000;
6162        readback_p1     = 0xff;
6163        readback_p2     = 0xff;
6164        read            = "  1   0   1   0      0   0   0   0",
6165                          "  0   0   x   x      x   x  a9  a8",
6166                          " a7  a6  a5  a4     a3  a2  a1  a0",
6167                          "  o   o   o   o      o   o   o   o";
6168
6169        write           = "  1   1   0   0      0   0   0   0",
6170                          "  0   0   x   x      x   x  a9  a8",
6171                          " a7  a6  a5  a4     a3  a2  a1  a0",
6172                          "  i   i   i   i      i   i   i   i";
6173
6174	loadpage_lo	= "  1   1   0   0      0   0   0   1",
6175			  "  0   0   0   0      0   0   0   0",
6176			  "  0   0   0   0      0   0  a1  a0",
6177			  "  i   i   i   i      i   i   i   i";
6178
6179	writepage	= "  1   1   0   0      0   0   1   0",
6180			  "  0   0   x   x      x   x  a9  a8",
6181			  " a7  a6  a5  a4     a3  a2   0   0",
6182			  "  x   x   x   x      x   x   x   x";
6183
6184	mode		= 0x04;
6185	delay		= 10;
6186	blocksize	= 64;
6187	readsize	= 256;
6188      ;
6189
6190    memory "flash"
6191        paged           = yes;
6192        size            = 32768;
6193        page_size       = 128;
6194        num_pages       = 256;
6195        min_write_delay = 4500;
6196        max_write_delay = 4500;
6197        readback_p1     = 0xff;
6198        readback_p2     = 0xff;
6199        read_lo         = "  0   0   1   0      0   0   0   0",
6200                          "  0   0 a13 a12    a11 a10  a9  a8",
6201                          " a7  a6  a5  a4     a3  a2  a1  a0",
6202                          "  o   o   o   o      o   o   o   o";
6203
6204        read_hi         = "  0   0   1   0      1   0   0   0",
6205                          "  0   0 a13 a12    a11 a10  a9  a8",
6206                          " a7  a6  a5  a4     a3  a2  a1  a0",
6207                          "  o   o   o   o      o   o   o   o";
6208
6209        loadpage_lo     = "  0   1   0   0      0   0   0   0",
6210                          "  0   0   x   x      x   x   x   x",
6211                          "  x   x  a5  a4     a3  a2  a1  a0",
6212                          "  i   i   i   i      i   i   i   i";
6213
6214        loadpage_hi     = "  0   1   0   0      1   0   0   0",
6215                          "  0   0   x   x      x   x   x   x",
6216                          "  x   x  a5  a4     a3  a2  a1  a0",
6217                          "  i   i   i   i      i   i   i   i";
6218
6219        writepage       = "  0   1   0   0      1   1   0   0",
6220                          "  0   0 a13 a12    a11 a10  a9  a8",
6221                          " a7  a6   x   x      x   x   x   x",
6222                          "  x   x   x   x      x   x   x   x";
6223
6224	mode		= 0x21;
6225	delay		= 6;
6226	blocksize	= 64;
6227	readsize	= 256;
6228      ;
6229
6230    memory "lfuse"
6231        size            = 1;
6232        min_write_delay = 2000;
6233        max_write_delay = 2000;
6234        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6235                          "x x x x  x x x x   o o o o  o o o o";
6236
6237        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6238                          "x x x x  x x x x   i i i i  i i i i";
6239      ;
6240
6241    memory "hfuse"
6242        size            = 1;
6243        min_write_delay = 2000;
6244        max_write_delay = 2000;
6245        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6246                          "x x x x  x x x x   o o o o  o o o o";
6247
6248        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6249                          "x x x x  x x x x   i i i i  i i i i";
6250      ;
6251
6252    memory "lock"
6253        size            = 1;
6254        min_write_delay = 2000;
6255        max_write_delay = 2000;
6256        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6257                          "x x x x  x x x x   x x o o  o o o o";
6258
6259        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6260                          "x x x x  x x x x   1 1 i i  i i i i";
6261      ;
6262
6263    memory "signature"
6264        size            = 3;
6265        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x x",
6266                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o o";
6267      ;
6268
6269    memory "calibration"
6270        size            = 4;
6271        read            = "0 0 1 1  1 0 0 0    0 0 x x  x x x x",
6272                          "0 0 0 0  0 0 a1 a0  o o o o  o o o o";
6273      ;
6274  ;
6275
6276#------------------------------------------------------------
6277# ATmega161
6278#------------------------------------------------------------
6279
6280part
6281    id               = "m161";
6282    desc             = "ATmega161";
6283    stk500_devcode   = 0x80;
6284    avr910_devcode   = 0x60;
6285    signature        = 0x1e 0x94 0x01;
6286    chip_erase_delay = 28000;
6287    pagel            = 0xd7;
6288    bs2              = 0xa0;
6289    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6290                       "x x x x  x x x x    x x x x  x x x x";
6291
6292    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
6293                       "x x x x  x x x x    x x x x  x x x x";
6294    timeout		= 200;
6295    stabdelay		= 100;
6296    cmdexedelay		= 25;
6297    synchloops		= 32;
6298    bytedelay		= 0;
6299    pollindex		= 3;
6300    pollvalue		= 0x53;
6301    predelay		= 1;
6302    postdelay		= 1;
6303    pollmethod		= 0;
6304
6305    pp_controlstack     =
6306        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6307        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6308        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6309        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6310    hventerstabdelay    = 100;
6311    progmodedelay       = 0;
6312    latchcycles         = 0;
6313    togglevtg           = 0;
6314    poweroffdelay       = 0;
6315    resetdelayms        = 0;
6316    resetdelayus        = 0;
6317    hvleavestabdelay    = 15;
6318    chiperasepulsewidth = 0;
6319    chiperasepolltimeout = 30;
6320    programfusepulsewidth = 0;
6321    programfusepolltimeout = 2;
6322    programlockpulsewidth = 0;
6323    programlockpolltimeout = 2;
6324
6325   memory "eeprom"
6326        size            = 512;
6327        min_write_delay = 3400;
6328        max_write_delay = 3400;
6329        readback_p1     = 0xff;
6330        readback_p2     = 0xff;
6331	read            = "  1   0   1   0      0   0   0   0",
6332                          "  x   x   x   x      x   x   x  a8",
6333                          " a7  a6  a5  a4     a3  a2  a1  a0",
6334                          "  o   o   o   o      o   o   o   o";
6335
6336	write           = "  1   1   0   0      0   0   0   0",
6337                          "  x   x   x   x      x   x   x  a8",
6338                          " a7  a6  a5  a4     a3  a2  a1  a0",
6339                          "  i   i   i   i      i   i   i   i";
6340
6341	mode		= 0x04;
6342	delay		= 5;
6343	blocksize	= 128;
6344	readsize	= 256;
6345      ;
6346
6347    memory "flash"
6348        paged           = yes;
6349        size            = 16384;
6350        page_size       = 128;
6351        num_pages       = 128;
6352        min_write_delay = 14000;
6353        max_write_delay = 14000;
6354        readback_p1     = 0xff;
6355        readback_p2     = 0xff;
6356        read_lo         = "  0   0   1   0      0   0   0   0",
6357                          "  x   x   x a12    a11 a10  a9  a8",
6358                          " a7  a6  a5  a4     a3  a2  a1  a0",
6359                          "  o   o   o   o      o   o   o   o";
6360
6361        read_hi         = "  0   0   1   0      1   0   0   0",
6362                          "  x   x   x a12    a11 a10  a9  a8",
6363                          " a7  a6  a5  a4     a3  a2  a1  a0",
6364                          "  o   o   o   o      o   o   o   o";
6365
6366        loadpage_lo     = "  0   1   0   0      0   0   0   0",
6367                          "  x   x   x   x      x   x   x   x",
6368                          "  x   x  a5  a4     a3  a2  a1  a0",
6369                          "  i   i   i   i      i   i   i   i";
6370
6371        loadpage_hi     = "  0   1   0   0      1   0   0   0",
6372                          "  x   x   x   x      x   x   x   x",
6373                          "  x   x  a5  a4     a3  a2  a1  a0",
6374                          "  i   i   i   i      i   i   i   i";
6375
6376        writepage       = "  0   1   0   0      1   1   0   0",
6377                          "  x   x   x a12    a11 a10  a9  a8",
6378                          " a7  a6   x   x      x   x   x   x",
6379                          "  x   x   x   x      x   x   x   x";
6380
6381	mode		= 0x21;
6382	delay		= 16;
6383	blocksize	= 128;
6384	readsize	= 256;
6385      ;
6386
6387    memory "fuse"
6388        size            = 1;
6389        min_write_delay = 2000;
6390        max_write_delay = 2000;
6391        read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
6392                          "x x x x  x x x x   x o x o  o o o o";
6393
6394        write           = "1 0 1 0  1 1 0 0   1 0 1 x  x x x x",
6395                          "x x x x  x x x x   1 i 1 i  i i i i";
6396      ;
6397
6398    memory "lock"
6399        size            = 1;
6400        min_write_delay = 2000;
6401        max_write_delay = 2000;
6402        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6403                          "x x x x  x x x x   x x o o  o o o o";
6404
6405        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6406                          "x x x x  x x x x   1 1 i i  i i i i";
6407      ;
6408    memory "signature"
6409        size            = 3;
6410        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
6411                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6412      ;
6413  ;
6414
6415
6416#------------------------------------------------------------
6417# ATmega8
6418#------------------------------------------------------------
6419
6420part
6421    id               = "m8";
6422    desc             = "ATmega8";
6423    stk500_devcode   = 0x70;
6424    avr910_devcode   = 0x76;
6425    signature        = 0x1e 0x93 0x07;
6426    pagel            = 0xd7;
6427    bs2              = 0xc2;
6428    chip_erase_delay = 10000;
6429    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6430                       "x x x x  x x x x    x x x x  x x x x";
6431
6432    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
6433                       "x x x x  x x x x    x x x x  x x x x";
6434
6435    timeout		= 200;
6436    stabdelay		= 100;
6437    cmdexedelay		= 25;
6438    synchloops		= 32;
6439    bytedelay		= 0;
6440    pollindex		= 3;
6441    pollvalue		= 0x53;
6442    predelay		= 1;
6443    postdelay		= 1;
6444    pollmethod		= 0;
6445
6446    pp_controlstack     =
6447	0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6448	0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6449	0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6450	0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6451    hventerstabdelay    = 100;
6452    progmodedelay       = 0;
6453    latchcycles         = 5;
6454    togglevtg           = 1;
6455    poweroffdelay       = 15;
6456    resetdelayms        = 2;
6457    resetdelayus        = 0;
6458    hvleavestabdelay    = 15;
6459    resetdelay          = 15;
6460    chiperasepulsewidth = 0;
6461    chiperasepolltimeout = 10;
6462    programfusepulsewidth = 0;
6463    programfusepolltimeout = 5;
6464    programlockpulsewidth = 0;
6465    programlockpolltimeout = 5;
6466
6467    memory "eeprom"
6468        size            = 512;
6469        page_size       = 4;
6470        min_write_delay = 9000;
6471        max_write_delay = 9000;
6472        readback_p1     = 0xff;
6473        readback_p2     = 0xff;
6474	read            = "  1   0   1   0      0   0   0   0",
6475                          "  0   0   x   x      x   x   x  a8",
6476                          " a7  a6  a5  a4     a3  a2  a1  a0",
6477                          "  o   o   o   o      o   o   o   o";
6478
6479	write           = "  1   1   0   0      0   0   0   0",
6480                          "  0   0   x   x      x   x   x  a8",
6481                          " a7  a6  a5  a4     a3  a2  a1  a0",
6482                          "  i   i   i   i      i   i   i   i";
6483
6484	mode		= 0x04;
6485	delay		= 20;
6486	blocksize	= 128;
6487	readsize	= 256;
6488      ;
6489    memory "flash"
6490        paged           = yes;
6491        size            = 8192;
6492        page_size       = 64;
6493        num_pages       = 128;
6494        min_write_delay = 4500;
6495        max_write_delay = 4500;
6496        readback_p1     = 0xff;
6497        readback_p2     = 0x00;
6498        read_lo         = "  0   0   1   0    0   0   0   0",
6499                          "  0   0   0   0  a11 a10  a9  a8",
6500                          " a7  a6  a5  a4   a3  a2  a1  a0",
6501                          "  o   o   o   o    o   o   o   o";
6502
6503        read_hi         = "  0   0   1   0    1   0   0   0",
6504                          "  0   0   0   0  a11 a10  a9  a8",
6505                          " a7  a6  a5  a4   a3  a2  a1  a0",
6506                          "  o   o   o   o    o   o   o   o";
6507
6508        loadpage_lo     = "  0   1   0   0      0   0   0   0",
6509                          "  0   0   0   0      x   x   x   x",
6510                          "  x   x   x  a4     a3  a2  a1  a0",
6511                          "  i   i   i   i      i   i   i   i";
6512
6513        loadpage_hi     = "  0   1   0   0      1   0   0   0",
6514                          "  0   0   0   0      x   x   x   x",
6515                          "  x   x   x  a4     a3  a2  a1  a0",
6516                          "  i   i   i   i      i   i   i   i";
6517
6518        writepage       = "  0   1   0   0      1   1   0   0",
6519                          "  0   0   0   0    a11 a10  a9  a8",
6520                          " a7  a6  a5   x      x   x   x   x",
6521                          "  x   x   x   x      x   x   x   x";
6522
6523	mode		= 0x21;
6524	delay		= 10;
6525	blocksize	= 64;
6526	readsize	= 256;
6527      ;
6528
6529    memory "lfuse"
6530        size            = 1;
6531        min_write_delay = 2000;
6532        max_write_delay = 2000;
6533        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6534                          "x x x x  x x x x   o o o o  o o o o";
6535
6536        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6537                          "x x x x  x x x x   i i i i  i i i i";
6538      ;
6539
6540    memory "hfuse"
6541        size            = 1;
6542        min_write_delay = 2000;
6543        max_write_delay = 2000;
6544        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6545                          "x x x x  x x x x   o o o o  o o o o";
6546
6547        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6548                          "x x x x  x x x x   i i i i  i i i i";
6549      ;
6550
6551    memory "efuse"
6552        size            = 0;
6553      ;
6554
6555
6556    memory "lock"
6557        size            = 1;
6558        min_write_delay = 2000;
6559        max_write_delay = 2000;
6560        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6561                          "x x x x  x x x x   x x o o  o o o o";
6562
6563        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6564                          "x x x x  x x x x   1 1 i i  i i i i";
6565      ;
6566
6567    memory "calibration"
6568        size            = 4;
6569        read            = "0  0  1  1   1  0  0  0   0  0  x  x   x  x  x  x",
6570                          "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
6571      ;
6572
6573    memory "signature"
6574        size            = 3;
6575        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
6576                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6577      ;
6578  ;
6579
6580
6581
6582#------------------------------------------------------------
6583# ATmega8515
6584#------------------------------------------------------------
6585
6586part
6587    id               = "m8515";
6588    desc             = "ATmega8515";
6589    stk500_devcode   = 0x63;
6590    avr910_devcode   = 0x3A;
6591    signature        = 0x1e 0x93 0x06;
6592    chip_erase_delay = 9000;
6593    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6594                       "x x x x  x x x x    x x x x  x x x x";
6595
6596    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
6597                       "x x x x  x x x x    x x x x  x x x x";
6598
6599    timeout		= 200;
6600    stabdelay		= 100;
6601    cmdexedelay		= 25;
6602    synchloops		= 32;
6603    bytedelay		= 0;
6604    pollindex		= 3;
6605    pollvalue		= 0x53;
6606    predelay		= 1;
6607    postdelay		= 1;
6608    pollmethod		= 0;
6609
6610    pp_controlstack     =
6611        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6612        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6613        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6614        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6615    hventerstabdelay    = 100;
6616    progmodedelay       = 0;
6617    latchcycles         = 6;
6618    togglevtg           = 0;
6619    poweroffdelay       = 0;
6620    resetdelayms        = 0;
6621    resetdelayus        = 0;
6622    hvleavestabdelay    = 15;
6623    chiperasepulsewidth = 0;
6624    chiperasepolltimeout = 10;
6625    programfusepulsewidth = 0;
6626    programfusepolltimeout = 5;
6627    programlockpulsewidth = 0;
6628    programlockpolltimeout = 5;
6629
6630    memory "eeprom"
6631        size            = 512;
6632        min_write_delay = 9000;
6633        max_write_delay = 9000;
6634        readback_p1     = 0xff;
6635        readback_p2     = 0xff;
6636 read            = "  1   0   1   0      0   0   0   0",
6637                          "  0   0   x   x      x   x   x  a8",
6638                          " a7  a6  a5  a4     a3  a2  a1  a0",
6639                          "  o   o   o   o      o   o   o   o";
6640
6641 write           = "  1   1   0   0      0   0   0   0",
6642                          "  0   0   x   x      x   x   x  a8",
6643                          " a7  a6  a5  a4     a3  a2  a1  a0",
6644                          "  i   i   i   i      i   i   i   i";
6645
6646	mode		= 0x04;
6647	delay		= 20;
6648	blocksize	= 128;
6649	readsize	= 256;
6650      ;
6651    memory "flash"
6652        paged           = yes;
6653        size            = 8192;
6654        page_size       = 64;
6655        num_pages       = 128;
6656        min_write_delay = 4500;
6657        max_write_delay = 4500;
6658        readback_p1     = 0xff;
6659        readback_p2     = 0xff;
6660        read_lo         = "  0   0   1   0    0   0   0   0",
6661                          "  0   0   0   0  a11 a10  a9  a8",
6662                          " a7  a6  a5  a4   a3  a2  a1  a0",
6663                          "  o   o   o   o    o   o   o   o";
6664
6665        read_hi         = "  0   0   1   0    1   0   0   0",
6666                          "  0   0   0   0  a11 a10  a9  a8",
6667                          " a7  a6  a5  a4   a3  a2  a1  a0",
6668                          "  o   o   o   o    o   o   o   o";
6669
6670        loadpage_lo     = "  0   1   0   0      0   0   0   0",
6671                          "  0   0   0   0      x   x   x   x",
6672                          "  x   x   x  a4     a3  a2  a1  a0",
6673                          "  i   i   i   i      i   i   i   i";
6674
6675        loadpage_hi     = "  0   1   0   0      1   0   0   0",
6676                          "  0   0   0   0      x   x   x   x",
6677                          "  x   x   x  a4     a3  a2  a1  a0",
6678                          "  i   i   i   i      i   i   i   i";
6679
6680        writepage       = "  0   1   0   0      1   1   0   0",
6681                          "  0   0   0   0    a11 a10  a9  a8",
6682                          " a7  a6  a5   x      x   x   x   x",
6683                          "  x   x   x   x      x   x   x   x";
6684
6685	mode		= 0x21;
6686	delay		= 6;
6687	blocksize	= 64;
6688	readsize	= 256;
6689      ;
6690
6691    memory "lfuse"
6692        size            = 1;
6693        min_write_delay = 4500;
6694        max_write_delay = 4500;
6695        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6696                          "x x x x  x x x x   o o o o  o o o o";
6697
6698        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6699                          "x x x x  x x x x   i i i i  i i i i";
6700      ;
6701
6702    memory "hfuse"
6703        size            = 1;
6704        min_write_delay = 4500;
6705        max_write_delay = 4500;
6706        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6707                          "x x x x  x x x x   o o o o  o o o o";
6708
6709        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6710                          "x x x x  x x x x   i i i i  i i i i";
6711      ;
6712
6713    memory "lock"
6714        size            = 1;
6715        min_write_delay = 4500;
6716        max_write_delay = 4500;
6717        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6718                          "x x x x  x x x x   x x o o  o o o o";
6719
6720        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6721                          "x x x x  x x x x   1 1 i i  i i i i";
6722      ;
6723
6724    memory "calibration"
6725        size            = 4;
6726        read            = "0 0 1 1  1 0 0 0     0 0 x x  x x x x",
6727                          "0 0 0 0  0 0 a1 a0   o o o o  o o o o";
6728      ;
6729
6730    memory "signature"
6731        size            = 3;
6732        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
6733                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6734      ;
6735  ;
6736
6737
6738
6739
6740#------------------------------------------------------------
6741# ATmega8535
6742#------------------------------------------------------------
6743
6744part
6745    id               = "m8535";
6746    desc             = "ATmega8535";
6747    stk500_devcode   = 0x64;
6748    avr910_devcode   = 0x69;
6749    signature        = 0x1e 0x93 0x08;
6750    pagel            = 0xd7;
6751    bs2              = 0xa0;
6752    chip_erase_delay = 9000;
6753    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6754                       "x x x x  x x x x    x x x x  x x x x";
6755
6756    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
6757                       "x x x x  x x x x    x x x x  x x x x";
6758
6759    timeout		= 200;
6760    stabdelay		= 100;
6761    cmdexedelay		= 25;
6762    synchloops		= 32;
6763    bytedelay		= 0;
6764    pollindex		= 3;
6765    pollvalue		= 0x53;
6766    predelay		= 1;
6767    postdelay		= 1;
6768    pollmethod		= 0;
6769
6770    pp_controlstack     =
6771        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6772        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6773        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6774        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6775    hventerstabdelay    = 100;
6776    progmodedelay       = 0;
6777    latchcycles         = 6;
6778    togglevtg           = 0;
6779    poweroffdelay       = 0;
6780    resetdelayms        = 0;
6781    resetdelayus        = 0;
6782    hvleavestabdelay    = 15;
6783    chiperasepulsewidth = 0;
6784    chiperasepolltimeout = 10;
6785    programfusepulsewidth = 0;
6786    programfusepolltimeout = 5;
6787    programlockpulsewidth = 0;
6788    programlockpolltimeout = 5;
6789
6790    memory "eeprom"
6791        size            = 512;
6792        min_write_delay = 9000;
6793        max_write_delay = 9000;
6794        readback_p1     = 0xff;
6795        readback_p2     = 0xff;
6796	read            = "  1   0   1   0      0   0   0   0",
6797                          "  0   0   x   x      x   x   x  a8",
6798                          " a7  a6  a5  a4     a3  a2  a1  a0",
6799                          "  o   o   o   o      o   o   o   o";
6800
6801	write           = "  1   1   0   0      0   0   0   0",
6802                          "  0   0   x   x      x   x   x  a8",
6803                          " a7  a6  a5  a4     a3  a2  a1  a0",
6804                          "  i   i   i   i      i   i   i   i";
6805
6806	mode		= 0x04;
6807	delay		= 20;
6808	blocksize	= 128;
6809	readsize	= 256;
6810      ;
6811    memory "flash"
6812        paged           = yes;
6813        size            = 8192;
6814        page_size       = 64;
6815        num_pages       = 128;
6816        min_write_delay = 4500;
6817        max_write_delay = 4500;
6818        readback_p1     = 0xff;
6819        readback_p2     = 0xff;
6820        read_lo         = "  0   0   1   0    0   0   0   0",
6821                          "  0   0   0   0  a11 a10  a9  a8",
6822                          " a7  a6  a5  a4   a3  a2  a1  a0",
6823                          "  o   o   o   o    o   o   o   o";
6824
6825        read_hi         = "  0   0   1   0    1   0   0   0",
6826                          "  0   0   0   0  a11 a10  a9  a8",
6827                          " a7  a6  a5  a4   a3  a2  a1  a0",
6828                          "  o   o   o   o    o   o   o   o";
6829
6830        loadpage_lo     = "  0   1   0   0      0   0   0   0",
6831                          "  0   0   0   0      x   x   x   x",
6832                          "  x   x   x  a4     a3  a2  a1  a0",
6833                          "  i   i   i   i      i   i   i   i";
6834
6835        loadpage_hi     = "  0   1   0   0      1   0   0   0",
6836                          "  0   0   0   0      x   x   x   x",
6837                          "  x   x   x  a4     a3  a2  a1  a0",
6838                          "  i   i   i   i      i   i   i   i";
6839
6840        writepage       = "  0   1   0   0      1   1   0   0",
6841                          "  0   0   0   0    a11 a10  a9  a8",
6842                          " a7  a6  a5   x      x   x   x   x",
6843                          "  x   x   x   x      x   x   x   x";
6844
6845	mode		= 0x21;
6846	delay		= 6;
6847	blocksize	= 64;
6848	readsize	= 256;
6849      ;
6850
6851    memory "lfuse"
6852        size            = 1;
6853        min_write_delay = 2000;
6854        max_write_delay = 2000;
6855        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6856                          "x x x x  x x x x   o o o o  o o o o";
6857
6858        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6859                          "x x x x  x x x x   i i i i  i i i i";
6860      ;
6861
6862    memory "hfuse"
6863        size            = 1;
6864        min_write_delay = 2000;
6865        max_write_delay = 2000;
6866        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6867                          "x x x x  x x x x   o o o o  o o o o";
6868
6869        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6870                          "x x x x  x x x x   i i i i  i i i i";
6871      ;
6872
6873    memory "lock"
6874        size            = 1;
6875        min_write_delay = 2000;
6876        max_write_delay = 2000;
6877        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6878                          "x x x x  x x x x   x x o o  o o o o";
6879
6880        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6881                          "x x x x  x x x x   1 1 i i  i i i i";
6882      ;
6883
6884    memory "calibration"
6885        size            = 4;
6886        read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
6887                          "0 0 0 0  0 0 a1 a0 o o o o  o o o o";
6888      ;
6889
6890    memory "signature"
6891        size            = 3;
6892        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
6893                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6894      ;
6895  ;
6896
6897
6898#------------------------------------------------------------
6899# ATtiny26
6900#------------------------------------------------------------
6901
6902part
6903    id                  = "t26";
6904    desc                = "ATtiny26";
6905    stk500_devcode      = 0x21;
6906    avr910_devcode      = 0x5e;
6907    signature           = 0x1e 0x91 0x09;
6908    pagel               = 0xb3;
6909    bs2                 = 0xb2;
6910    chip_erase_delay    = 9000;
6911    pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
6912                          "x x x x  x x x x   x x x x  x x x x";
6913
6914    chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
6915                          "x x x x  x x x x   x x x x  x x x x";
6916
6917    timeout		= 200;
6918    stabdelay		= 100;
6919    cmdexedelay		= 25;
6920    synchloops		= 32;
6921    bytedelay		= 0;
6922    pollindex		= 3;
6923    pollvalue		= 0x53;
6924    predelay		= 1;
6925    postdelay		= 1;
6926    pollmethod		= 0;
6927
6928    pp_controlstack     =
6929        0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC,
6930        0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC,
6931        0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C,
6932        0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
6933    hventerstabdelay    = 100;
6934    progmodedelay       = 0;
6935    latchcycles         = 5;
6936    togglevtg           = 1;
6937    poweroffdelay       = 15;
6938    resetdelayms        = 2;
6939    resetdelayus        = 0;
6940    hvleavestabdelay    = 15;
6941    chiperasepulsewidth = 0;
6942    chiperasepolltimeout = 10;
6943    programfusepulsewidth = 0;
6944    programfusepolltimeout = 5;
6945    programlockpulsewidth = 0;
6946    programlockpolltimeout = 5;
6947
6948    memory "eeprom"
6949        size            = 128;
6950        min_write_delay = 9000;
6951        max_write_delay = 9000;
6952        readback_p1     = 0xff;
6953        readback_p2     = 0xff;
6954        read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
6955                          "x a6 a5 a4  a3 a2 a1 a0    o o o o  o o o o";
6956
6957        write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
6958                          "x a6 a5 a4  a3 a2 a1 a0    i i i i  i i i i";
6959
6960	mode		= 0x04;
6961	delay		= 10;
6962	blocksize	= 64;
6963	readsize	= 256;
6964    ;
6965
6966    memory "flash"
6967        paged           = yes;
6968        size            = 2048;
6969        page_size       = 32;
6970        num_pages       = 64;
6971        min_write_delay = 4500;
6972        max_write_delay = 4500;
6973        readback_p1     = 0xff;
6974        readback_p2     = 0xff;
6975        read_lo         = "  0  0  1  0   0  0  0  0",
6976                          "  x  x  x  x   x  x a9 a8",
6977                          " a7 a6 a5 a4  a3 a2 a1 a0",
6978                          "  o  o  o  o   o  o  o  o";
6979
6980        read_hi         = "  0  0  1  0   1  0  0  0",
6981                          "  x  x  x  x   x  x a9 a8",
6982                          " a7 a6 a5 a4  a3 a2 a1 a0",
6983                          "  o  o  o  o   o  o  o  o";
6984
6985        loadpage_lo     = "  0  1  0  0   0  0  0  0",
6986                          "  x  x  x  x   x  x  x  x",
6987                          "  x  x  x  x  a3 a2 a1 a0",
6988                          "  i  i  i  i   i  i  i  i";
6989
6990        loadpage_hi     = "  0  1  0  0   1  0  0  0",
6991                          "  x  x  x  x   x  x  x  x",
6992                          "  x  x  x  x  a3 a2 a1 a0",
6993                          "  i  i  i  i   i  i  i  i";
6994
6995        writepage       = "  0  1  0  0   1  1  0  0",
6996                          "  x  x  x  x   x  x a9 a8",
6997                          " a7 a6 a5 a4   x  x  x  x",
6998                          "  x  x  x  x   x  x  x  x";
6999
7000	mode		= 0x21;
7001	delay		= 6;
7002	blocksize	= 16;
7003	readsize	= 256;
7004    ;
7005
7006    memory "signature"
7007        size            = 3;
7008        read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
7009                          "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7010    ;
7011
7012    memory "lock"
7013        size            = 1;
7014        read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
7015                          "x  x  x  x   x  x  x  x    x x x x  x x o o";
7016
7017        write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
7018                          "x  x  x  x   x  x  x  x    x x x x  x x x x";
7019        min_write_delay = 9000;
7020        max_write_delay = 9000;
7021    ;
7022
7023    memory "lfuse"
7024        size            = 1;
7025        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
7026                          "x x x x  x x x x  i i i i  i i i i";
7027
7028        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
7029                          "x x x x  x x x x  o o o o  o o o o";
7030        min_write_delay = 9000;
7031        max_write_delay = 9000;
7032      ;
7033
7034    memory "hfuse"
7035        size            = 1;
7036        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
7037                          "x x x x  x x x x  x x x i  i i i i";
7038
7039        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
7040                          "x x x x  x x x x  o o o o  o o o o";
7041        min_write_delay = 9000;
7042        max_write_delay = 9000;
7043      ;
7044
7045    memory "calibration"
7046        size            = 4;
7047        read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
7048                          "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7049    ;
7050
7051;
7052
7053
7054#------------------------------------------------------------
7055# ATtiny261
7056#------------------------------------------------------------
7057# Close to ATtiny26
7058
7059part
7060    id                  = "t261";
7061    desc                = "ATtiny261";
7062     has_debugwire = yes;
7063     flash_instr   = 0xB4, 0x00, 0x10;
7064     eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
7065	             0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC,
7066	             0x99, 0xE1, 0xBB, 0xAC;
7067#    stk500_devcode      = 0x21;
7068#    avr910_devcode      = 0x5e;
7069    signature           = 0x1e 0x91 0x0c;
7070    pagel               = 0xb3;
7071    bs2                 = 0xb2;
7072    chip_erase_delay    = 4000;
7073
7074    pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
7075                          "x x x x  x x x x   x x x x  x x x x";
7076
7077    chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
7078                          "x x x x  x x x x   x x x x  x x x x";
7079
7080    timeout		= 200;
7081    stabdelay		= 100;
7082    cmdexedelay		= 25;
7083    synchloops		= 32;
7084    bytedelay		= 0;
7085    pollindex		= 3;
7086    pollvalue		= 0x53;
7087    predelay		= 1;
7088    postdelay		= 1;
7089    pollmethod		= 0;
7090
7091    pp_controlstack     =
7092        0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC,
7093        0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC,
7094        0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C,
7095        0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
7096    hventerstabdelay    = 100;
7097    progmodedelay       = 0;
7098    latchcycles         = 5;
7099    togglevtg           = 1;
7100    poweroffdelay       = 15;
7101    resetdelayms        = 2;
7102    resetdelayus        = 0;
7103    hvleavestabdelay    = 15;
7104    chiperasepulsewidth = 0;
7105    chiperasepolltimeout = 10;
7106    programfusepulsewidth = 0;
7107    programfusepolltimeout = 5;
7108    programlockpulsewidth = 0;
7109    programlockpolltimeout = 5;
7110
7111    ocdrev              = 1;
7112
7113    memory "eeprom"
7114        paged           = no;
7115        size            = 128;
7116        page_size       = 4;
7117        num_pages       = 32;
7118        min_write_delay = 4000;
7119        max_write_delay = 4000;
7120        readback_p1     = 0xff;
7121        readback_p2     = 0xff;
7122
7123        read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
7124                          "x a6 a5 a4  a3 a2 a1 a0    o o o o  o o o o";
7125
7126        write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
7127                          "x a6 a5 a4  a3 a2 a1 a0    i i i i  i i i i";
7128
7129	loadpage_lo	= "  1   1   0   0      0   0   0   1",
7130			  "  0   0   0   0      0   0   0   0",
7131			  "  0   0   0   0      0   0  a1  a0",
7132			  "  i   i   i   i      i   i   i   i";
7133
7134	writepage	= "  1   1   0   0      0   0   1   0",
7135			  "  0   0   x   x      x   x   x   x",
7136			  "  x  a6  a5  a4     a3  a2   0   0",
7137			  "  x   x   x   x      x   x   x   x";
7138
7139	mode		= 0x41;
7140	delay		= 10;
7141	blocksize	= 4;
7142	readsize	= 256;
7143    ;
7144
7145    memory "flash"
7146        paged           = yes;
7147        size            = 2048;
7148        page_size       = 32;
7149        num_pages       = 64;
7150        min_write_delay = 4500;
7151        max_write_delay = 4500;
7152        readback_p1     = 0xff;
7153        readback_p2     = 0xff;
7154
7155        read_lo         = "  0  0  1  0   0  0  0  0",
7156                          "  x  x  x  x   x  x a9 a8",
7157                          " a7 a6 a5 a4  a3 a2 a1 a0",
7158                          "  o  o  o  o   o  o  o  o";
7159
7160        read_hi         = "  0  0  1  0   1  0  0  0",
7161                          "  x  x  x  x   x  x a9 a8",
7162                          " a7 a6 a5 a4  a3 a2 a1 a0",
7163                          "  o  o  o  o   o  o  o  o";
7164
7165        loadpage_lo     = "  0  1  0  0   0  0  0  0",
7166                          "  x  x  x  x   x  x  x  x",
7167                          "  x  x  x  x  a3 a2 a1 a0",
7168                          "  i  i  i  i   i  i  i  i";
7169
7170        loadpage_hi     = "  0  1  0  0   1  0  0  0",
7171                          "  x  x  x  x   x  x  x  x",
7172                          "  x  x  x  x  a3 a2 a1 a0",
7173                          "  i  i  i  i   i  i  i  i";
7174
7175        writepage       = "  0  1  0  0   1  1  0  0",
7176                          "  x  x  x  x   x  x a9 a8",
7177                          " a7 a6 a5 a4   x  x  x  x",
7178                          "  x  x  x  x   x  x  x  x";
7179
7180	mode		= 0x41;
7181	delay		= 6;
7182	blocksize	= 32;
7183	readsize	= 256;
7184    ;
7185
7186    memory "signature"
7187        size            = 3;
7188        read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
7189                          "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7190    ;
7191
7192    memory "lock"
7193        size            = 1;
7194        read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
7195                          "x  x  x  x   x  x  x  x    x x x x  x x o o";
7196
7197        write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
7198                          "x  x  x  x   x  x  x  x    x x x x  x x x x";
7199        min_write_delay = 4500;
7200        max_write_delay = 4500;
7201    ;
7202
7203    memory "lfuse"
7204        size            = 1;
7205        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
7206                          "x x x x  x x x x  i i i i  i i i i";
7207
7208        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
7209                          "x x x x  x x x x  o o o o  o o o o";
7210        min_write_delay = 4500;
7211        max_write_delay = 4500;
7212      ;
7213
7214    memory "hfuse"
7215        size            = 1;
7216        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
7217                          "x x x x  x x x x  i i i i  i i i i";
7218
7219        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
7220                          "x x x x  x x x x  o o o o  o o o o";
7221        min_write_delay = 4500;
7222        max_write_delay = 4500;
7223      ;
7224
7225    memory "efuse"
7226        size            = 1;
7227        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
7228                          "x x x x  x x x x   x x x x  x x x i";
7229
7230        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
7231                          "x x x x  x x x x   o o o o  o o o o";
7232        min_write_delay = 4500;
7233        max_write_delay = 4500;
7234      ;
7235
7236    memory "calibration"
7237        size            = 1;
7238        read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
7239                          "0  0  0  0   0  0  0  0    o o o o  o o o o";
7240    ;
7241
7242;
7243
7244
7245#------------------------------------------------------------
7246# ATtiny461
7247#------------------------------------------------------------
7248# Close to ATtiny261
7249
7250part
7251    id                  = "t461";
7252    desc                = "ATtiny461";
7253     has_debugwire = yes;
7254     flash_instr   = 0xB4, 0x00, 0x10;
7255     eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
7256	             0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC,
7257	             0x99, 0xE1, 0xBB, 0xAC;
7258#    stk500_devcode      = 0x21;
7259#    avr910_devcode      = 0x5e;
7260    signature           = 0x1e 0x92 0x08;
7261    pagel               = 0xb3;
7262    bs2                 = 0xb2;
7263    chip_erase_delay    = 4000;
7264
7265    pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
7266                          "x x x x  x x x x   x x x x  x x x x";
7267
7268    chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
7269                          "x x x x  x x x x   x x x x  x x x x";
7270
7271    timeout		= 200;
7272    stabdelay		= 100;
7273    cmdexedelay		= 25;
7274    synchloops		= 32;
7275    bytedelay		= 0;
7276    pollindex		= 3;
7277    pollvalue		= 0x53;
7278    predelay		= 1;
7279    postdelay		= 1;
7280    pollmethod		= 0;
7281
7282    pp_controlstack     =
7283        0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC,
7284        0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC,
7285        0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C,
7286        0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
7287    hventerstabdelay    = 100;
7288    progmodedelay       = 0;
7289    latchcycles         = 5;
7290    togglevtg           = 1;
7291    poweroffdelay       = 15;
7292    resetdelayms        = 2;
7293    resetdelayus        = 0;
7294    hvleavestabdelay    = 15;
7295    chiperasepulsewidth = 0;
7296    chiperasepolltimeout = 10;
7297    programfusepulsewidth = 0;
7298    programfusepolltimeout = 5;
7299    programlockpulsewidth = 0;
7300    programlockpolltimeout = 5;
7301
7302    ocdrev              = 1;
7303
7304    memory "eeprom"
7305        paged           = no;
7306        size            = 256;
7307        page_size       = 4;
7308        num_pages       = 64;
7309        min_write_delay = 4000;
7310        max_write_delay = 4000;
7311        readback_p1     = 0xff;
7312        readback_p2     = 0xff;
7313
7314        read            = " 1  0  1  0   0  0  0  0    x x x x  x x x x",
7315                          "a7 a6 a5 a4  a3 a2 a1 a0    o o o o  o o o o";
7316
7317        write           = " 1  1  0  0   0  0  0  0    x x x x  x x x x",
7318                          "a7 a6 a5 a4  a3 a2 a1 a0    i i i i  i i i i";
7319
7320	loadpage_lo	= "  1   1   0   0      0   0   0   1",
7321			  "  0   0   0   0      0   0   0   0",
7322			  "  0   0   0   0      0   0  a1  a0",
7323			  "  i   i   i   i      i   i   i   i";
7324
7325	writepage	= "  1   1   0   0      0   0   1   0",
7326			  "  0   0   x   x      x   x   x   x",
7327			  " a7  a6  a5  a4     a3  a2   0   0",
7328			  "  x   x   x   x      x   x   x   x";
7329
7330	mode		= 0x41;
7331	delay		= 10;
7332	blocksize	= 4;
7333	readsize	= 256;
7334    ;
7335
7336    memory "flash"
7337        paged           = yes;
7338        size            = 4096;
7339        page_size       = 64;
7340        num_pages       = 64;
7341        min_write_delay = 4500;
7342        max_write_delay = 4500;
7343        readback_p1     = 0xff;
7344        readback_p2     = 0xff;
7345
7346        read_lo         = "  0  0  1  0   0   0  0  0",
7347                          "  x  x  x  x   x a10 a9 a8",
7348                          " a7 a6 a5 a4  a3  a2 a1 a0",
7349                          "  o  o  o  o   o   o  o  o";
7350
7351        read_hi         = "  0  0  1  0   1   0  0  0",
7352                          "  x  x  x  x   x a10 a9 a8",
7353                          " a7 a6 a5 a4  a3  a2 a1 a0",
7354                          "  o  o  o  o   o   o  o  o";
7355
7356        loadpage_lo     = "  0  1  0  0   0  0  0  0",
7357                          "  x  x  x  x   x  x  x  x",
7358                          "  x  x  x a4  a3 a2 a1 a0",
7359                          "  i  i  i  i   i  i  i  i";
7360
7361        loadpage_hi     = "  0  1  0  0   1  0  0  0",
7362                          "  x  x  x  x   x  x  x  x",
7363                          "  x  x  x a4  a3 a2 a1 a0",
7364                          "  i  i  i  i   i  i  i  i";
7365
7366        writepage       = "  0  1  0  0   1   1  0  0",
7367                          "  x  x  x  x   x a10 a9 a8",
7368                          " a7 a6 a5  x   x   x  x  x",
7369                          "  x  x  x  x   x   x  x  x";
7370
7371	mode		= 0x41;
7372	delay		= 6;
7373	blocksize	= 64;
7374	readsize	= 256;
7375    ;
7376
7377    memory "signature"
7378        size            = 3;
7379        read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
7380                          "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7381    ;
7382
7383    memory "lock"
7384        size            = 1;
7385        read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
7386                          "x  x  x  x   x  x  x  x    x x x x  x x o o";
7387
7388        write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
7389                          "x  x  x  x   x  x  x  x    x x x x  x x x x";
7390        min_write_delay = 4500;
7391        max_write_delay = 4500;
7392    ;
7393
7394    memory "lfuse"
7395        size            = 1;
7396        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
7397                          "x x x x  x x x x  i i i i  i i i i";
7398
7399        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
7400                          "x x x x  x x x x  o o o o  o o o o";
7401        min_write_delay = 4500;
7402        max_write_delay = 4500;
7403      ;
7404
7405    memory "hfuse"
7406        size            = 1;
7407        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
7408                          "x x x x  x x x x  i i i i  i i i i";
7409
7410        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
7411                          "x x x x  x x x x  o o o o  o o o o";
7412        min_write_delay = 4500;
7413        max_write_delay = 4500;
7414      ;
7415
7416    memory "efuse"
7417        size            = 1;
7418        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
7419                          "x x x x  x x x x   x x x x  x x x i";
7420
7421        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
7422                          "x x x x  x x x x   o o o o  o o o o";
7423        min_write_delay = 4500;
7424        max_write_delay = 4500;
7425      ;
7426
7427    memory "calibration"
7428        size            = 1;
7429        read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
7430                          "0  0  0  0   0  0  0  0    o o o o  o o o o";
7431    ;
7432
7433;
7434
7435
7436#------------------------------------------------------------
7437# ATtiny861
7438#------------------------------------------------------------
7439# Close to ATtiny461
7440
7441part
7442    id                  = "t861";
7443    desc                = "ATtiny861";
7444     has_debugwire = yes;
7445     flash_instr   = 0xB4, 0x00, 0x10;
7446     eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
7447	             0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC,
7448	             0x99, 0xE1, 0xBB, 0xAC;
7449#    stk500_devcode      = 0x21;
7450#    avr910_devcode      = 0x5e;
7451    signature           = 0x1e 0x93 0x0d;
7452    pagel               = 0xb3;
7453    bs2                 = 0xb2;
7454    chip_erase_delay    = 4000;
7455
7456    pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
7457                          "x x x x  x x x x   x x x x  x x x x";
7458
7459    chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
7460                          "x x x x  x x x x   x x x x  x x x x";
7461
7462    timeout		= 200;
7463    stabdelay		= 100;
7464    cmdexedelay		= 25;
7465    synchloops		= 32;
7466    bytedelay		= 0;
7467    pollindex		= 3;
7468    pollvalue		= 0x53;
7469    predelay		= 1;
7470    postdelay		= 1;
7471    pollmethod		= 0;
7472
7473    pp_controlstack     =
7474        0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC,
7475        0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC,
7476        0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C,
7477        0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
7478    hventerstabdelay    = 100;
7479    progmodedelay       = 0;
7480    latchcycles         = 5;
7481    togglevtg           = 1;
7482    poweroffdelay       = 15;
7483    resetdelayms        = 2;
7484    resetdelayus        = 0;
7485    hvleavestabdelay    = 15;
7486    chiperasepulsewidth = 0;
7487    chiperasepolltimeout = 10;
7488    programfusepulsewidth = 0;
7489    programfusepolltimeout = 5;
7490    programlockpulsewidth = 0;
7491    programlockpolltimeout = 5;
7492
7493    ocdrev              = 1;
7494
7495    memory "eeprom"
7496        paged           = no;
7497        size            = 512;
7498        num_pages       = 128;
7499        page_size       = 4;
7500        min_write_delay = 4000;
7501        max_write_delay = 4000;
7502        readback_p1     = 0xff;
7503        readback_p2     = 0xff;
7504
7505        read            = " 1  0  1  0   0  0  0  0    x x x x  x x x a8",
7506                          "a7 a6 a5 a4  a3 a2 a1 a0    o o o o  o o o  o";
7507
7508        write           = " 1  1  0  0   0  0  0  0    x x x x  x x x a8",
7509                          "a7 a6 a5 a4  a3 a2 a1 a0    i i i i  i i i  i";
7510
7511	loadpage_lo	= "  1   1   0   0      0   0   0   1",
7512			  "  0   0   0   0      0   0   0   0",
7513			  "  0   0   0   0      0   0  a1  a0",
7514			  "  i   i   i   i      i   i   i   i";
7515
7516	writepage	= "  1   1   0   0      0   0   1   0",
7517			  "  0   0   x   x      x   x   x  a8",
7518			  " a7  a6  a5  a4     a3  a2   0   0",
7519			  "  x   x   x   x      x   x   x   x";
7520
7521	mode		= 0x41;
7522	delay		= 10;
7523	blocksize	= 4;
7524	readsize	= 256;
7525    ;
7526
7527    memory "flash"
7528        paged           = yes;
7529        size            = 8192;
7530        page_size       = 64;
7531        num_pages       = 128;
7532        min_write_delay = 4500;
7533        max_write_delay = 4500;
7534        readback_p1     = 0xff;
7535        readback_p2     = 0xff;
7536
7537        read_lo         = "  0  0  1  0   0   0  0  0",
7538                          "  x  x  x  x a11 a10 a9 a8",
7539                          " a7 a6 a5 a4  a3  a2 a1 a0",
7540                          "  o  o  o  o   o   o  o  o";
7541
7542        read_hi         = "  0  0  1  0   1   0  0  0",
7543                          "  x  x  x  x a11 a10 a9 a8",
7544                          " a7 a6 a5 a4  a3  a2 a1 a0",
7545                          "  o  o  o  o   o   o  o  o";
7546
7547        loadpage_lo     = "  0  1  0  0   0  0  0  0",
7548                          "  x  x  x  x   x  x  x  x",
7549                          "  x  x  x a4  a3 a2 a1 a0",
7550                          "  i  i  i  i   i  i  i  i";
7551
7552        loadpage_hi     = "  0  1  0  0   1  0  0  0",
7553                          "  x  x  x  x   x  x  x  x",
7554                          "  x  x  x a4  a3 a2 a1 a0",
7555                          "  i  i  i  i   i  i  i  i";
7556
7557        writepage       = "  0  1  0  0   1   1  0  0",
7558                          "  x  x  x  x a11 a10 a9 a8",
7559                          " a7 a6 a5  x   x   x  x  x",
7560                          "  x  x  x  x   x   x  x  x";
7561
7562	mode		= 0x41;
7563	delay		= 6;
7564	blocksize	= 64;
7565	readsize	= 256;
7566    ;
7567
7568    memory "signature"
7569        size            = 3;
7570        read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
7571                          "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7572    ;
7573
7574    memory "lock"
7575        size            = 1;
7576        read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
7577                          "x  x  x  x   x  x  x  x    x x x x  x x o o";
7578
7579        write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
7580                          "x  x  x  x   x  x  x  x    x x x x  x x x x";
7581        min_write_delay = 4500;
7582        max_write_delay = 4500;
7583    ;
7584
7585    memory "lfuse"
7586        size            = 1;
7587        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
7588                          "x x x x  x x x x  i i i i  i i i i";
7589
7590        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
7591                          "x x x x  x x x x  o o o o  o o o o";
7592        min_write_delay = 4500;
7593        max_write_delay = 4500;
7594      ;
7595
7596    memory "hfuse"
7597        size            = 1;
7598        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
7599                          "x x x x  x x x x  i i i i  i i i i";
7600
7601        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
7602                          "x x x x  x x x x  o o o o  o o o o";
7603        min_write_delay = 4500;
7604        max_write_delay = 4500;
7605      ;
7606
7607    memory "efuse"
7608        size            = 1;
7609        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
7610                          "x x x x  x x x x   x x x x  x x x i";
7611
7612        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
7613                          "x x x x  x x x x   o o o o  o o o o";
7614        min_write_delay = 4500;
7615        max_write_delay = 4500;
7616      ;
7617
7618    memory "calibration"
7619        size            = 1;
7620        read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
7621                          "0  0  0  0   0  0  0  0    o o o o  o o o o";
7622    ;
7623
7624;
7625
7626
7627#------------------------------------------------------------
7628# ATtiny28
7629#------------------------------------------------------------
7630
7631# This is an HVPP-only device.
7632
7633part
7634    id                  = "t28";
7635    desc                = "ATtiny28";
7636    stk500_devcode      = 0x22;
7637    avr910_devcode      = 0x5c;
7638    signature           = 0x1e 0x91 0x07;
7639
7640    pp_controlstack     =
7641        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
7642        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
7643        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
7644        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
7645    hventerstabdelay    = 100;
7646    progmodedelay       = 0;
7647    latchcycles         = 0;
7648    togglevtg           = 0;
7649    poweroffdelay       = 0;
7650    resetdelayms        = 0;
7651    resetdelayus        = 0;
7652    hvleavestabdelay    = 15;
7653    resetdelay          = 15;
7654    chiperasepulsewidth = 0;
7655    chiperasepolltimeout = 10;
7656    programfusepulsewidth = 0;
7657    programfusepolltimeout = 5;
7658    programlockpulsewidth = 0;
7659    programlockpolltimeout = 5;
7660
7661    memory "flash"
7662        size            = 2048;
7663        page_size       = 2;
7664        readsize        = 256;
7665        delay           = 5;
7666    ;
7667
7668    memory "signature"
7669        size            = 3;
7670    ;
7671
7672    memory "lock"
7673        size            = 1;
7674    ;
7675
7676    memory "calibration"
7677        size            = 1;
7678    ;
7679
7680    memory "fuse"
7681        size            = 1;
7682    ;
7683;
7684
7685
7686
7687#------------------------------------------------------------
7688# ATmega48
7689#------------------------------------------------------------
7690
7691part
7692    id               = "m48";
7693    desc             = "ATmega48";
7694     has_debugwire = yes;
7695     flash_instr   = 0xB6, 0x01, 0x11;
7696     eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
7697	             0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
7698	             0x99, 0xF9, 0xBB, 0xAF;
7699    stk500_devcode   = 0x59;
7700#    avr910_devcode   = 0x;
7701    signature        = 0x1e 0x92 0x05;
7702    pagel            = 0xd7;
7703    bs2              = 0xc2;
7704    chip_erase_delay = 45000;
7705    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
7706                       "x x x x  x x x x    x x x x  x x x x";
7707
7708    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
7709                       "x x x x  x x x x    x x x x  x x x x";
7710
7711    timeout		= 200;
7712    stabdelay		= 100;
7713    cmdexedelay		= 25;
7714    synchloops		= 32;
7715    bytedelay		= 0;
7716    pollindex		= 3;
7717    pollvalue		= 0x53;
7718    predelay		= 1;
7719    postdelay		= 1;
7720    pollmethod		= 1;
7721
7722    pp_controlstack     =
7723	0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
7724	0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
7725	0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
7726	0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
7727    hventerstabdelay    = 100;
7728    progmodedelay       = 0;
7729    latchcycles         = 5;
7730    togglevtg           = 1;
7731    poweroffdelay       = 15;
7732    resetdelayms        = 1;
7733    resetdelayus        = 0;
7734    hvleavestabdelay    = 15;
7735    resetdelay          = 15;
7736    chiperasepulsewidth = 0;
7737    chiperasepolltimeout = 10;
7738    programfusepulsewidth = 0;
7739    programfusepolltimeout = 5;
7740    programlockpulsewidth = 0;
7741    programlockpolltimeout = 5;
7742
7743    ocdrev              = 1;
7744
7745    memory "eeprom"
7746        paged           = no;
7747        page_size       = 4;
7748        size            = 256;
7749        min_write_delay = 3600;
7750        max_write_delay = 3600;
7751        readback_p1     = 0xff;
7752        readback_p2     = 0xff;
7753	read            = "  1   0   1   0      0   0   0   0",
7754                          "  0   0   0   x      x   x   x   x",
7755                          " a7  a6  a5  a4     a3  a2  a1  a0",
7756                          "  o   o   o   o      o   o   o   o";
7757
7758	write           = "  1   1   0   0      0   0   0   0",
7759                          "  0   0   0   x      x   x   x   x",
7760                          " a7  a6  a5  a4     a3  a2  a1  a0",
7761                          "  i   i   i   i      i   i   i   i";
7762
7763	loadpage_lo	= "  1   1   0   0      0   0   0   1",
7764			  "  0   0   0   0      0   0   0   0",
7765			  "  0   0   0   0      0   0  a1  a0",
7766			  "  i   i   i   i      i   i   i   i";
7767
7768	writepage	= "  1   1   0   0      0   0   1   0",
7769			  "  0   0   x   x      x   x   x   x",
7770			  " a7  a6  a5  a4     a3  a2   0   0",
7771			  "  x   x   x   x      x   x   x   x";
7772
7773	mode		= 0x41;
7774	delay		= 20;
7775	blocksize	= 4;
7776	readsize	= 256;
7777      ;
7778    memory "flash"
7779        paged           = yes;
7780        size            = 4096;
7781        page_size       = 64;
7782        num_pages       = 64;
7783        min_write_delay = 4500;
7784        max_write_delay = 4500;
7785        readback_p1     = 0x00;
7786        readback_p2     = 0x00;
7787        read_lo         = "  0   0   1   0    0   0   0   0",
7788                          "  0   0   0   0    0 a10  a9  a8",
7789                          " a7  a6  a5  a4   a3  a2  a1  a0",
7790                          "  o   o   o   o    o   o   o   o";
7791
7792        read_hi         = "  0   0   1   0    1   0   0   0",
7793                          "  0   0   0   0    0 a10  a9  a8",
7794                          " a7  a6  a5  a4   a3  a2  a1  a0",
7795                          "  o   o   o   o    o   o   o   o";
7796
7797        loadpage_lo     = "  0   1   0   0      0   0   0   0",
7798                          "  0   0   0   x      x   x   x   x",
7799                          "  x   x   x  a4     a3  a2  a1  a0",
7800                          "  i   i   i   i      i   i   i   i";
7801
7802        loadpage_hi     = "  0   1   0   0      1   0   0   0",
7803                          "  0   0   0   x      x   x   x   x",
7804                          "  x   x   x  a4     a3  a2  a1  a0",
7805                          "  i   i   i   i      i   i   i   i";
7806
7807        writepage       = "  0   1   0   0      1   1   0   0",
7808                          "  0   0   0   0      0 a10  a9  a8",
7809                          " a7  a6  a5   x      x   x   x   x",
7810                          "  x   x   x   x      x   x   x   x";
7811
7812	mode		= 0x41;
7813	delay		= 6;
7814	blocksize	= 64;
7815	readsize	= 256;
7816      ;
7817
7818    memory "lfuse"
7819        size            = 1;
7820        min_write_delay = 4500;
7821        max_write_delay = 4500;
7822        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
7823                          "x x x x  x x x x   o o o o  o o o o";
7824
7825        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
7826                          "x x x x  x x x x   i i i i  i i i i";
7827      ;
7828
7829    memory "hfuse"
7830        size            = 1;
7831        min_write_delay = 4500;
7832        max_write_delay = 4500;
7833        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
7834                          "x x x x  x x x x   o o o o  o o o o";
7835
7836        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
7837                          "x x x x  x x x x   i i i i  i i i i";
7838      ;
7839
7840    memory "efuse"
7841        size            = 1;
7842        min_write_delay = 4500;
7843        max_write_delay = 4500;
7844        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
7845                          "x x x x  x x x x   o o o o  o o o o";
7846
7847        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
7848                          "x x x x  x x x x   x x x x  x x x i";
7849      ;
7850
7851    memory "lock"
7852        size            = 1;
7853        min_write_delay = 4500;
7854        max_write_delay = 4500;
7855        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
7856                          "x x x x  x x x x   x x o o  o o o o";
7857
7858        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
7859                          "x x x x  x x x x   1 1 i i  i i i i";
7860      ;
7861
7862    memory "calibration"
7863        size            = 1;
7864        read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
7865                          "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
7866      ;
7867
7868    memory "signature"
7869        size            = 3;
7870        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
7871                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
7872      ;
7873  ;
7874
7875#------------------------------------------------------------
7876# ATmega48P
7877#------------------------------------------------------------
7878
7879part parent "m48"
7880    id               = "m48p";
7881    desc             = "ATmega48P";
7882    signature        = 0x1e 0x92 0x0a;
7883
7884    ocdrev              = 1;
7885  ;
7886
7887#------------------------------------------------------------
7888# ATmega48PB
7889#------------------------------------------------------------
7890
7891part parent "m48"
7892    id               = "m48pb";
7893    desc             = "ATmega48PB";
7894    signature        = 0x1e 0x92 0x10;
7895
7896    ocdrev              = 1;
7897  ;
7898
7899#------------------------------------------------------------
7900# ATmega88
7901#------------------------------------------------------------
7902
7903part
7904    id               = "m88";
7905    desc             = "ATmega88";
7906     has_debugwire = yes;
7907     flash_instr   = 0xB6, 0x01, 0x11;
7908     eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
7909	             0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
7910	             0x99, 0xF9, 0xBB, 0xAF;
7911    stk500_devcode   = 0x73;
7912#    avr910_devcode   = 0x;
7913    signature        = 0x1e 0x93 0x0a;
7914    pagel            = 0xd7;
7915    bs2              = 0xc2;
7916    chip_erase_delay = 9000;
7917    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
7918                       "x x x x  x x x x    x x x x  x x x x";
7919
7920    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
7921                       "x x x x  x x x x    x x x x  x x x x";
7922
7923    timeout		= 200;
7924    stabdelay		= 100;
7925    cmdexedelay		= 25;
7926    synchloops		= 32;
7927    bytedelay		= 0;
7928    pollindex		= 3;
7929    pollvalue		= 0x53;
7930    predelay		= 1;
7931    postdelay		= 1;
7932    pollmethod		= 1;
7933
7934    pp_controlstack     =
7935	0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
7936	0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
7937	0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
7938	0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
7939    hventerstabdelay    = 100;
7940    progmodedelay       = 0;
7941    latchcycles         = 5;
7942    togglevtg           = 1;
7943    poweroffdelay       = 15;
7944    resetdelayms        = 1;
7945    resetdelayus        = 0;
7946    hvleavestabdelay    = 15;
7947    resetdelay          = 15;
7948    chiperasepulsewidth = 0;
7949    chiperasepolltimeout = 10;
7950    programfusepulsewidth = 0;
7951    programfusepolltimeout = 5;
7952    programlockpulsewidth = 0;
7953    programlockpolltimeout = 5;
7954
7955    ocdrev              = 1;
7956
7957    memory "eeprom"
7958        paged           = no;
7959        page_size       = 4;
7960        size            = 512;
7961        min_write_delay = 3600;
7962        max_write_delay = 3600;
7963        readback_p1     = 0xff;
7964        readback_p2     = 0xff;
7965	read            = "  1   0   1   0      0   0   0   0",
7966                          "  0   0   0   x      x   x   x  a8",
7967                          " a7  a6  a5  a4     a3  a2  a1  a0",
7968                          "  o   o   o   o      o   o   o   o";
7969
7970	write           = "  1   1   0   0      0   0   0   0",
7971                          "  0   0   0   x      x   x   x  a8",
7972                          " a7  a6  a5  a4     a3  a2  a1  a0",
7973                          "  i   i   i   i      i   i   i   i";
7974
7975	loadpage_lo	= "  1   1   0   0      0   0   0   1",
7976			  "  0   0   0   0      0   0   0   0",
7977			  "  0   0   0   0      0   0  a1  a0",
7978			  "  i   i   i   i      i   i   i   i";
7979
7980	writepage	= "  1   1   0   0      0   0   1   0",
7981			  "  0   0   x   x      x   x   x  a8",
7982			  " a7  a6  a5  a4     a3  a2   0   0",
7983			  "  x   x   x   x      x   x   x   x";
7984
7985	mode		= 0x41;
7986	delay		= 20;
7987	blocksize	= 4;
7988	readsize	= 256;
7989      ;
7990    memory "flash"
7991        paged           = yes;
7992        size            = 8192;
7993        page_size       = 64;
7994        num_pages       = 128;
7995        min_write_delay = 4500;
7996        max_write_delay = 4500;
7997        readback_p1     = 0xff;
7998        readback_p2     = 0xff;
7999        read_lo         = "  0   0   1   0    0   0   0   0",
8000                          "  0   0   0   0  a11 a10  a9  a8",
8001                          " a7  a6  a5  a4   a3  a2  a1  a0",
8002                          "  o   o   o   o    o   o   o   o";
8003
8004        read_hi         = "  0   0   1   0    1   0   0   0",
8005                          "  0   0   0   0  a11 a10  a9  a8",
8006                          " a7  a6  a5  a4   a3  a2  a1  a0",
8007                          "  o   o   o   o    o   o   o   o";
8008
8009        loadpage_lo     = "  0   1   0   0      0   0   0   0",
8010                          "  0   0   0   x      x   x   x   x",
8011                          "  x   x   x  a4     a3  a2  a1  a0",
8012                          "  i   i   i   i      i   i   i   i";
8013
8014        loadpage_hi     = "  0   1   0   0      1   0   0   0",
8015                          "  0   0   0   x      x   x   x   x",
8016                          "  x   x   x  a4     a3  a2  a1  a0",
8017                          "  i   i   i   i      i   i   i   i";
8018
8019        writepage       = "  0   1   0   0      1   1   0   0",
8020                          "  0   0   0   0    a11 a10  a9  a8",
8021                          " a7  a6  a5   x      x   x   x   x",
8022                          "  x   x   x   x      x   x   x   x";
8023
8024	mode		= 0x41;
8025	delay		= 6;
8026	blocksize	= 64;
8027	readsize	= 256;
8028      ;
8029
8030    memory "lfuse"
8031        size            = 1;
8032        min_write_delay = 4500;
8033        max_write_delay = 4500;
8034        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
8035                          "x x x x  x x x x   o o o o  o o o o";
8036
8037        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
8038                          "x x x x  x x x x   i i i i  i i i i";
8039      ;
8040
8041    memory "hfuse"
8042        size            = 1;
8043        min_write_delay = 4500;
8044        max_write_delay = 4500;
8045        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
8046                          "x x x x  x x x x   o o o o  o o o o";
8047
8048        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
8049                          "x x x x  x x x x   i i i i  i i i i";
8050      ;
8051
8052    memory "efuse"
8053        size            = 1;
8054        min_write_delay = 4500;
8055        max_write_delay = 4500;
8056        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
8057                          "x x x x  x x x x   o o o o  o o o o";
8058
8059        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
8060                          "x x x x  x x x x   x x x x  x i i i";
8061      ;
8062
8063    memory "lock"
8064        size            = 1;
8065        min_write_delay = 4500;
8066        max_write_delay = 4500;
8067        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
8068                          "x x x x  x x x x   x x o o  o o o o";
8069
8070        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
8071                          "x x x x  x x x x   1 1 i i  i i i i";
8072      ;
8073
8074    memory "calibration"
8075        size            = 1;
8076        read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
8077                          "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
8078      ;
8079
8080    memory "signature"
8081        size            = 3;
8082        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
8083                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
8084      ;
8085  ;
8086
8087#------------------------------------------------------------
8088# ATmega88P
8089#------------------------------------------------------------
8090
8091part parent "m88"
8092    id               = "m88p";
8093    desc             = "ATmega88P";
8094    signature        = 0x1e 0x93 0x0f;
8095
8096    ocdrev              = 1;
8097  ;
8098
8099#------------------------------------------------------------
8100# ATmega88PB
8101#------------------------------------------------------------
8102
8103part parent "m88"
8104    id               = "m88pb";
8105    desc             = "ATmega88PB";
8106    signature        = 0x1e 0x93 0x16;
8107
8108    ocdrev              = 1;
8109  ;
8110
8111#------------------------------------------------------------
8112# ATmega168
8113#------------------------------------------------------------
8114
8115part
8116    id              = "m168";
8117    desc            = "ATmega168";
8118     has_debugwire = yes;
8119     flash_instr   = 0xB6, 0x01, 0x11;
8120     eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
8121	             0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
8122	             0x99, 0xF9, 0xBB, 0xAF;
8123    stk500_devcode  = 0x86;
8124    # avr910_devcode = 0x;
8125    signature       = 0x1e 0x94 0x06;
8126    pagel           = 0xd7;
8127    bs2             = 0xc2;
8128    chip_erase_delay = 9000;
8129    pgm_enable       = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
8130                       "x x x x x x x x x x x x x x x x";
8131
8132    chip_erase       = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
8133                       "x x x x x x x x x x x x x x x x";
8134
8135    timeout         = 200;
8136    stabdelay       = 100;
8137    cmdexedelay     = 25;
8138    synchloops      = 32;
8139    bytedelay       = 0;
8140    pollindex       = 3;
8141    pollvalue       = 0x53;
8142    predelay        = 1;
8143    postdelay       = 1;
8144    pollmethod      = 1;
8145
8146    pp_controlstack     =
8147	0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
8148	0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
8149	0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
8150	0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8151    hventerstabdelay    = 100;
8152    progmodedelay       = 0;
8153    latchcycles         = 5;
8154    togglevtg           = 1;
8155    poweroffdelay       = 15;
8156    resetdelayms        = 1;
8157    resetdelayus        = 0;
8158    hvleavestabdelay    = 15;
8159    resetdelay          = 15;
8160    chiperasepulsewidth = 0;
8161    chiperasepolltimeout = 10;
8162    programfusepulsewidth = 0;
8163    programfusepolltimeout = 5;
8164    programlockpulsewidth = 0;
8165    programlockpolltimeout = 5;
8166
8167    ocdrev              = 1;
8168
8169    memory "eeprom"
8170        paged           = no;
8171        page_size       = 4;
8172        size            = 512;
8173        min_write_delay = 3600;
8174        max_write_delay = 3600;
8175        readback_p1     = 0xff;
8176        readback_p2     = 0xff;
8177        read            = " 1 0 1 0 0 0 0 0",
8178                          " 0 0 0 x x x x a8",
8179                          " a7 a6 a5 a4 a3 a2 a1 a0",
8180                          " o o o o o o o o";
8181
8182        write           = " 1 1 0 0 0 0 0 0",
8183                          " 0 0 0 x x x x a8",
8184                          " a7 a6 a5 a4 a3 a2 a1 a0",
8185                          " i i i i i i i i";
8186
8187	loadpage_lo	= "  1   1   0   0      0   0   0   1",
8188			  "  0   0   0   0      0   0   0   0",
8189			  "  0   0   0   0      0   0  a1  a0",
8190			  "  i   i   i   i      i   i   i   i";
8191
8192	writepage	= "  1   1   0   0      0   0   1   0",
8193			  "  0   0   x   x      x   x   x  a8",
8194			  " a7  a6  a5  a4     a3  a2   0   0",
8195			  "  x   x   x   x      x   x   x   x";
8196
8197	mode		= 0x41;
8198	delay		= 20;
8199	blocksize	= 4;
8200	readsize	= 256;
8201        ;
8202
8203    memory "flash"
8204        paged           = yes;
8205        size            = 16384;
8206        page_size       = 128;
8207        num_pages       = 128;
8208        min_write_delay = 4500;
8209        max_write_delay = 4500;
8210        readback_p1     = 0xff;
8211        readback_p2     = 0xff;
8212        read_lo         = " 0 0 1 0 0 0 0 0",
8213                          " 0 0 0 a12 a11 a10 a9 a8",
8214                          " a7 a6 a5 a4 a3 a2 a1 a0",
8215                          " o o o o o o o o";
8216
8217        read_hi          = " 0 0 1 0 1 0 0 0",
8218                           " 0 0 0 a12 a11 a10 a9 a8",
8219                           " a7 a6 a5 a4 a3 a2 a1 a0",
8220                           " o o o o o o o o";
8221
8222        loadpage_lo     = " 0 1 0 0 0 0 0 0",
8223                          " 0 0 0 x x x x x",
8224                          " x x a5 a4 a3 a2 a1 a0",
8225                          " i i i i i i i i";
8226
8227        loadpage_hi     = " 0 1 0 0 1 0 0 0",
8228                          " 0 0 0 x x x x x",
8229                          " x x a5 a4 a3 a2 a1 a0",
8230                          " i i i i i i i i";
8231
8232        writepage       = " 0 1 0 0 1 1 0 0",
8233                          " 0 0 0 a12 a11 a10 a9 a8",
8234                          " a7 a6 x x x x x x",
8235                          " x x x x x x x x";
8236
8237        mode        = 0x41;
8238        delay       = 6;
8239        blocksize   = 128;
8240        readsize    = 256;
8241
8242        ;
8243
8244    memory "lfuse"
8245        size            = 1;
8246        min_write_delay = 4500;
8247        max_write_delay = 4500;
8248        read            = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
8249                          "x x x x x x x x o o o o o o o o";
8250
8251        write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
8252                          "x x x x x x x x i i i i i i i i";
8253        ;
8254
8255    memory "hfuse"
8256        size            = 1;
8257        min_write_delay = 4500;
8258        max_write_delay = 4500;
8259        read            = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
8260                          "x x x x x x x x o o o o o o o o";
8261
8262        write           = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
8263                          "x x x x x x x x i i i i i i i i";
8264        ;
8265
8266    memory "efuse"
8267        size            = 1;
8268        min_write_delay = 4500;
8269        max_write_delay = 4500;
8270        read            = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
8271                          "x x x x x x x x o o o o o o o o";
8272
8273        write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
8274                          "x x x x x x x x x x x x x i i i";
8275        ;
8276
8277    memory "lock"
8278        size            = 1;
8279        min_write_delay = 4500;
8280        max_write_delay = 4500;
8281        read            = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
8282                          "x x x x x x x x x x o o o o o o";
8283
8284        write           = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
8285                          "x x x x x x x x 1 1 i i i i i i";
8286        ;
8287
8288    memory "calibration"
8289        size            = 1;
8290        read            = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
8291                          "0 0 0 0 0 0 0 0 o o o o o o o o";
8292        ;
8293
8294    memory "signature"
8295        size            = 3;
8296        read            = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
8297                          "x x x x x x a1 a0 o o o o o o o o";
8298        ;
8299;
8300
8301#------------------------------------------------------------
8302# ATmega168P
8303#------------------------------------------------------------
8304
8305part parent "m168"
8306    id              = "m168p";
8307    desc            = "ATmega168P";
8308    signature       = 0x1e 0x94 0x0b;
8309
8310    ocdrev              = 1;
8311;
8312
8313#------------------------------------------------------------
8314# ATmega168PB
8315#------------------------------------------------------------
8316
8317part parent "m168"
8318    id              = "m168pb";
8319    desc            = "ATmega168PB";
8320    signature       = 0x1e 0x94 0x15;
8321
8322    ocdrev              = 1;
8323;
8324
8325#------------------------------------------------------------
8326# ATtiny88
8327#------------------------------------------------------------
8328
8329part
8330    id               = "t88";
8331    desc             = "ATtiny88";
8332     has_debugwire = yes;
8333     flash_instr   = 0xB6, 0x01, 0x11;
8334     eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
8335	             0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
8336	             0x99, 0xF9, 0xBB, 0xAF;
8337    stk500_devcode   = 0x73;
8338#    avr910_devcode   = 0x;
8339    signature        = 0x1e 0x93 0x11;
8340    pagel            = 0xd7;
8341    bs2              = 0xc2;
8342    chip_erase_delay = 9000;
8343    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
8344                       "x x x x  x x x x    x x x x  x x x x";
8345
8346    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
8347                       "x x x x  x x x x    x x x x  x x x x";
8348
8349    timeout		= 200;
8350    stabdelay		= 100;
8351    cmdexedelay		= 25;
8352    synchloops		= 32;
8353    bytedelay		= 0;
8354    pollindex		= 3;
8355    pollvalue		= 0x53;
8356    predelay		= 1;
8357    postdelay		= 1;
8358    pollmethod		= 1;
8359
8360    pp_controlstack     =
8361	0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
8362	0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
8363	0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
8364	0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8365    hventerstabdelay    = 100;
8366    progmodedelay       = 0;
8367    latchcycles         = 5;
8368    togglevtg           = 1;
8369    poweroffdelay       = 15;
8370    resetdelayms        = 1;
8371    resetdelayus        = 0;
8372    hvleavestabdelay    = 15;
8373    resetdelay          = 15;
8374    chiperasepulsewidth = 0;
8375    chiperasepolltimeout = 10;
8376    programfusepulsewidth = 0;
8377    programfusepolltimeout = 5;
8378    programlockpulsewidth = 0;
8379    programlockpolltimeout = 5;
8380
8381    ocdrev              = 1;
8382
8383    memory "eeprom"
8384        paged           = no;
8385        page_size       = 4;
8386        size            = 64;
8387        min_write_delay = 3600;
8388        max_write_delay = 3600;
8389        readback_p1     = 0xff;
8390        readback_p2     = 0xff;
8391	read            = "  1   0   1   0      0   0   0   0",
8392                          "  0   0   0   x      x   x   x   x",
8393                          "  x  a6  a5  a4     a3  a2  a1  a0",
8394                          "  o   o   o   o      o   o   o   o";
8395
8396	write           = "  1   1   0   0      0   0   0   0",
8397                          "  0   0   0   x      x   x   x   x",
8398                          "  x  a6  a5  a4     a3  a2  a1  a0",
8399                          "  i   i   i   i      i   i   i   i";
8400
8401	loadpage_lo	= "  1   1   0   0      0   0   0   1",
8402			  "  0   0   0   0      0   0   0   0",
8403			  "  0   0   0   0      0   0  a1  a0",
8404			  "  i   i   i   i      i   i   i   i";
8405
8406	writepage	= "  1   1   0   0      0   0   1   0",
8407			  "  0   0   x   x      x   x   x   x",
8408			  "  x  a6  a5  a4     a3  a2   0   0",
8409			  "  x   x   x   x      x   x   x   x";
8410
8411	mode		= 0x41;
8412	delay		= 20;
8413	blocksize	= 4;
8414	readsize	= 64;
8415      ;
8416    memory "flash"
8417        paged           = yes;
8418        size            = 8192;
8419        page_size       = 64;
8420        num_pages       = 128;
8421        min_write_delay = 4500;
8422        max_write_delay = 4500;
8423        readback_p1     = 0xff;
8424        readback_p2     = 0xff;
8425        read_lo         = "  0   0   1   0    0   0   0   0",
8426                          "  0   0   0   0  a11 a10  a9  a8",
8427                          " a7  a6  a5  a4   a3  a2  a1  a0",
8428                          "  o   o   o   o    o   o   o   o";
8429
8430        read_hi         = "  0   0   1   0    1   0   0   0",
8431                          "  0   0   0   0  a11 a10  a9  a8",
8432                          " a7  a6  a5  a4   a3  a2  a1  a0",
8433                          "  o   o   o   o    o   o   o   o";
8434
8435        loadpage_lo     = "  0   1   0   0      0   0   0   0",
8436                          "  0   0   0   x      x   x   x   x",
8437                          "  x   x   x  a4     a3  a2  a1  a0",
8438                          "  i   i   i   i      i   i   i   i";
8439
8440        loadpage_hi     = "  0   1   0   0      1   0   0   0",
8441                          "  0   0   0   x      x   x   x   x",
8442                          "  x   x   x  a4     a3  a2  a1  a0",
8443                          "  i   i   i   i      i   i   i   i";
8444
8445        writepage       = "  0   1   0   0      1   1   0   0",
8446                          "  0   0   0   0    a11 a10  a9  a8",
8447                          " a7  a6  a5   x      x   x   x   x",
8448                          "  x   x   x   x      x   x   x   x";
8449
8450	mode		= 0x41;
8451	delay		= 6;
8452	blocksize	= 64;
8453	readsize	= 256;
8454      ;
8455
8456    memory "lfuse"
8457        size            = 1;
8458        min_write_delay = 4500;
8459        max_write_delay = 4500;
8460        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
8461                          "x x x x  x x x x   o o o o  o o o o";
8462
8463        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
8464                          "x x x x  x x x x   i i i i  i i i i";
8465      ;
8466
8467    memory "hfuse"
8468        size            = 1;
8469        min_write_delay = 4500;
8470        max_write_delay = 4500;
8471        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
8472                          "x x x x  x x x x   o o o o  o o o o";
8473
8474        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
8475                          "x x x x  x x x x   i i i i  i i i i";
8476      ;
8477
8478    memory "efuse"
8479        size            = 1;
8480        min_write_delay = 4500;
8481        max_write_delay = 4500;
8482        read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
8483                          "x x x x  x x x x   o o o o  o o o o";
8484
8485        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
8486                          "x x x x  x x x x   x x x x  x x x i";
8487      ;
8488
8489    memory "lock"
8490        size            = 1;
8491        min_write_delay = 4500;
8492        max_write_delay = 4500;
8493        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
8494                          "x x x x  x x x x   x x o o  o o o o";
8495
8496        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
8497                          "x x x x  x x x x   1 1 i i  i i i i";
8498      ;
8499
8500    memory "calibration"
8501        size            = 1;
8502        read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
8503                          "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
8504      ;
8505
8506    memory "signature"
8507        size            = 3;
8508        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
8509                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
8510      ;
8511  ;
8512
8513#------------------------------------------------------------
8514# ATmega328
8515#------------------------------------------------------------
8516
8517part
8518    id			= "m328";
8519    desc		= "ATmega328";
8520    has_debugwire	= yes;
8521    flash_instr		= 0xB6, 0x01, 0x11;
8522    eeprom_instr	= 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
8523			  0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
8524			  0x99, 0xF9, 0xBB, 0xAF;
8525    stk500_devcode	= 0x86;
8526    # avr910_devcode	= 0x;
8527    signature		= 0x1e 0x95 0x14;
8528    pagel		= 0xd7;
8529    bs2			= 0xc2;
8530    chip_erase_delay	= 9000;
8531    pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
8532		 "x x x x x x x x x x x x x x x x";
8533
8534    chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
8535		 "x x x x x x x x x x x x x x x x";
8536
8537    timeout	= 200;
8538    stabdelay	= 100;
8539    cmdexedelay	= 25;
8540    synchloops	= 32;
8541    bytedelay	= 0;
8542    pollindex	= 3;
8543    pollvalue	= 0x53;
8544    predelay	= 1;
8545    postdelay	= 1;
8546    pollmethod	= 1;
8547
8548    pp_controlstack =
8549	0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
8550	0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
8551	0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
8552	0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8553    hventerstabdelay	= 100;
8554    progmodedelay	= 0;
8555    latchcycles		= 5;
8556    togglevtg		= 1;
8557    poweroffdelay	= 15;
8558    resetdelayms	= 1;
8559    resetdelayus	= 0;
8560    hvleavestabdelay	= 15;
8561    resetdelay		= 15;
8562    chiperasepulsewidth	= 0;
8563    chiperasepolltimeout = 10;
8564    programfusepulsewidth = 0;
8565    programfusepolltimeout = 5;
8566    programlockpulsewidth = 0;
8567    programlockpolltimeout = 5;
8568
8569    ocdrev              = 1;
8570
8571    memory "eeprom"
8572	paged		= no;
8573	page_size	= 4;
8574	size		= 1024;
8575	min_write_delay = 3600;
8576	max_write_delay = 3600;
8577	readback_p1	= 0xff;
8578	readback_p2	= 0xff;
8579	read = " 1 0 1 0 0 0 0 0",
8580	       " 0 0 0 x x x a9 a8",
8581	       " a7 a6 a5 a4 a3 a2 a1 a0",
8582	       " o o o o o o o o";
8583
8584	write = " 1 1 0 0 0 0 0 0",
8585	      	" 0 0 0 x x x a9 a8",
8586		" a7 a6 a5 a4 a3 a2 a1 a0",
8587		" i i i i i i i i";
8588
8589	loadpage_lo = " 1 1 0 0 0 0 0 1",
8590		      " 0 0 0 0 0 0 0 0",
8591		      " 0 0 0 0 0 0 a1 a0",
8592		      " i i i i i i i i";
8593
8594	writepage = " 1 1 0 0 0 0 1 0",
8595		    " 0 0 x x x x a9 a8",
8596		    " a7 a6 a5 a4 a3 a2 0 0",
8597		    " x x x x x x x x";
8598
8599	mode		= 0x41;
8600	delay		= 20;
8601	blocksize	= 4;
8602	readsize	= 256;
8603    ;
8604
8605    memory "flash"
8606	paged		= yes;
8607	size		= 32768;
8608	page_size	= 128;
8609	num_pages	= 256;
8610	min_write_delay = 4500;
8611	max_write_delay = 4500;
8612	readback_p1	= 0xff;
8613	readback_p2	= 0xff;
8614	read_lo = " 0 0 1 0 0 0 0 0",
8615		  " 0 0 a13 a12 a11 a10 a9 a8",
8616		  " a7 a6 a5 a4 a3 a2 a1 a0",
8617		  " o o o o o o o o";
8618
8619	read_hi = " 0 0 1 0 1 0 0 0",
8620		  " 0 0 a13 a12 a11 a10 a9 a8",
8621		  " a7 a6 a5 a4 a3 a2 a1 a0",
8622		  " o o o o o o o o";
8623
8624	loadpage_lo = " 0 1 0 0 0 0 0 0",
8625		      " 0 0 0 x x x x x",
8626		      " x x a5 a4 a3 a2 a1 a0",
8627		      " i i i i i i i i";
8628
8629	loadpage_hi = " 0 1 0 0 1 0 0 0",
8630		      " 0 0 0 x x x x x",
8631		      " x x a5 a4 a3 a2 a1 a0",
8632		      " i i i i i i i i";
8633
8634	writepage = " 0 1 0 0 1 1 0 0",
8635		    " 0 0 a13 a12 a11 a10 a9 a8",
8636		    " a7 a6 x x x x x x",
8637		    " x x x x x x x x";
8638
8639	mode		= 0x41;
8640	delay		= 6;
8641	blocksize	= 128;
8642	readsize	= 256;
8643
8644    ;
8645
8646    memory "lfuse"
8647	size = 1;
8648	min_write_delay = 4500;
8649	max_write_delay = 4500;
8650	read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
8651	       "x x x x x x x x o o o o o o o o";
8652
8653	write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
8654	      	"x x x x x x x x i i i i i i i i";
8655    ;
8656
8657    memory "hfuse"
8658	size = 1;
8659	min_write_delay = 4500;
8660	max_write_delay = 4500;
8661	read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
8662	       "x x x x x x x x o o o o o o o o";
8663
8664	write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
8665	      	"x x x x x x x x i i i i i i i i";
8666    ;
8667
8668    memory "efuse"
8669	size = 1;
8670	min_write_delay = 4500;
8671	max_write_delay = 4500;
8672	read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
8673	       "x x x x x x x x o o o o o o o o";
8674
8675	write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
8676	      	"x x x x x x x x x x x x x i i i";
8677    ;
8678
8679    memory "lock"
8680	size = 1;
8681	min_write_delay = 4500;
8682	max_write_delay = 4500;
8683	read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
8684	       "x x x x x x x x x x o o o o o o";
8685
8686	write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
8687	      	"x x x x x x x x 1 1 i i i i i i";
8688    ;
8689
8690    memory "calibration"
8691	size = 1;
8692	read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
8693	       "0 0 0 0 0 0 0 0 o o o o o o o o";
8694    ;
8695
8696    memory "signature"
8697	size = 3;
8698	read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
8699	       "x x x x x x a1 a0 o o o o o o o o";
8700    ;
8701;
8702
8703part parent "m328"
8704    id			= "m328p";
8705    desc		= "ATmega328P";
8706    signature		= 0x1e 0x95 0x0F;
8707
8708    ocdrev              = 1;
8709;
8710
8711#------------------------------------------------------------
8712# ATmega32m1
8713#------------------------------------------------------------
8714
8715part parent "m328"
8716    id              = "m32m1";
8717    desc            = "ATmega32M1";
8718    # stk500_devcode	= 0x;
8719    # avr910_devcode	= 0x;
8720    signature       = 0x1e 0x95 0x84;
8721    bs2             = 0xe2;
8722
8723    memory "efuse"
8724        read            = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
8725                          "x x x x x x x x o o o o o o o o";
8726        write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
8727                          "x x x x x x x x x x i i i i i i";
8728    ;
8729;
8730
8731#------------------------------------------------------------
8732# ATtiny2313
8733#------------------------------------------------------------
8734
8735part
8736     id            = "t2313";
8737     desc          = "ATtiny2313";
8738     has_debugwire = yes;
8739     flash_instr   = 0xB2, 0x0F, 0x1F;
8740     eeprom_instr  = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
8741	             0xBA, 0x0F, 0xB2, 0x0F, 0xBA, 0x0D, 0xBB, 0xBC,
8742	             0x99, 0xE1, 0xBB, 0xAC;
8743     stk500_devcode   = 0x23;
8744##   Use the ATtiny26 devcode:
8745     avr910_devcode   = 0x5e;
8746     signature        = 0x1e 0x91 0x0a;
8747     pagel            = 0xD4;
8748     bs2              = 0xD6;
8749     reset            = io;
8750     chip_erase_delay = 9000;
8751
8752     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
8753                        "x x x x  x x x x    x x x x  x x x x";
8754
8755     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
8756                        "x x x x  x x x x    x x x x  x x x x";
8757
8758    timeout		= 200;
8759    stabdelay		= 100;
8760    cmdexedelay		= 25;
8761    synchloops		= 32;
8762    bytedelay		= 0;
8763    pollindex		= 3;
8764    pollvalue		= 0x53;
8765    predelay		= 1;
8766    postdelay		= 1;
8767    pollmethod		= 1;
8768
8769    pp_controlstack     =
8770        0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E,
8771        0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E,
8772        0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A,
8773        0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8774    hventerstabdelay    = 100;
8775    progmodedelay       = 0;
8776    latchcycles         = 5;
8777    togglevtg           = 1;
8778    poweroffdelay       = 15;
8779    resetdelayms        = 1;
8780    resetdelayus        = 0;
8781    hvleavestabdelay    = 15;
8782    chiperasepulsewidth = 0;
8783    chiperasepolltimeout = 10;
8784    programfusepulsewidth = 0;
8785    programfusepolltimeout = 5;
8786    programlockpulsewidth = 0;
8787    programlockpolltimeout = 5;
8788
8789    ocdrev              = 0;
8790
8791     memory "eeprom"
8792         size            = 128;
8793        paged           = no;
8794        page_size       = 4;
8795         min_write_delay = 4000;
8796         max_write_delay = 4500;
8797         readback_p1     = 0xff;
8798         readback_p2     = 0xff;
8799         read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x x",
8800                           "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
8801
8802         write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x x",
8803                           "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
8804
8805	loadpage_lo	= "  1   1   0   0      0   0   0   1",
8806			  "  0   0   0   0      0   0   0   0",
8807			  "  0   0   0   0      0   0  a1  a0",
8808			  "  i   i   i   i      i   i   i   i";
8809
8810	writepage	= "  1   1   0   0      0   0   1   0",
8811			  "  0   0   x   x      x   x   x   x",
8812			  "  x  a6  a5  a4     a3  a2   0   0",
8813			  "  x   x   x   x      x   x   x   x";
8814
8815	mode		= 0x41;
8816	delay		= 6;
8817	blocksize	= 4;
8818	readsize	= 256;
8819       ;
8820     memory "flash"
8821         paged           = yes;
8822         size            = 2048;
8823         page_size       = 32;
8824         num_pages       = 64;
8825         min_write_delay = 4500;
8826         max_write_delay = 4500;
8827         readback_p1     = 0xff;
8828         readback_p2     = 0xff;
8829         read_lo         = "  0   0   1   0    0   0   0   0",
8830                           "  0   0   0   0    0   0  a9  a8",
8831                           " a7  a6  a5  a4   a3  a2  a1  a0",
8832                           "  o   o   o   o    o   o   o   o";
8833
8834         read_hi         = "  0   0   1   0    1   0   0   0",
8835                           "  0   0   0   0    0   0  a9  a8",
8836                           " a7  a6  a5  a4   a3  a2  a1  a0",
8837                           "  o   o   o   o    o   o   o   o";
8838
8839# The information in the data sheet of April/2004 is wrong, this works:
8840         loadpage_lo     = "  0   1   0   0    0   0   0   0",
8841                           "  0   0   0   x    x   x   x   x",
8842                           "  x   x   x   x   a3  a2  a1  a0",
8843                           "  i   i   i   i    i   i   i   i";
8844
8845# The information in the data sheet of April/2004 is wrong, this works:
8846         loadpage_hi     = "  0   1   0   0    1   0   0   0",
8847                           "  0   0   0   x    x   x   x   x",
8848                           "  x   x   x   x   a3  a2  a1  a0",
8849                           "  i   i   i   i    i   i   i   i";
8850
8851# The information in the data sheet of April/2004 is wrong, this works:
8852         writepage       = "  0  1  0  0   1  1  0  0",
8853                           "  0  0  0  0   0  0 a9 a8",
8854                           " a7 a6 a5 a4   x  x  x  x",
8855                           "  x  x  x  x   x  x  x  x";
8856
8857	mode		= 0x41;
8858	delay		= 6;
8859	blocksize	= 32;
8860	readsize	= 256;
8861       ;
8862#   ATtiny2313 has Signature Bytes: 0x1E 0x91 0x0A.
8863     memory "signature"
8864         size            = 3;
8865         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
8866                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
8867       ;
8868     memory "lock"
8869         size            = 1;
8870         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
8871                           "x x x x  x x x x  1 1 i i  i i i i";
8872         read           = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
8873                          "x x x x  x x x x  x x o o  o o o o";
8874        min_write_delay = 9000;
8875        max_write_delay = 9000;
8876       ;
8877
8878     memory "lfuse"
8879         size            = 1;
8880         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
8881                           "x x x x  x x x x  i i i i  i i i i";
8882
8883         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
8884                           "x x x x  x x x x  o o o o  o o o o";
8885        min_write_delay = 9000;
8886        max_write_delay = 9000;
8887       ;
8888
8889     memory "hfuse"
8890         size            = 1;
8891         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
8892                           "x x x x  x x x x  i i i i  i i i i";
8893
8894         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
8895                           "x x x x  x x x x  o o o o  o o o o";
8896        min_write_delay = 9000;
8897        max_write_delay = 9000;
8898       ;
8899
8900     memory "efuse"
8901         size            = 1;
8902         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
8903                           "x x x x  x x x x  x x x x  x x x i";
8904
8905         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
8906                           "x x x x  x x x x  o o o o  o o o o";
8907        min_write_delay = 9000;
8908        max_write_delay = 9000;
8909     ;
8910# The Tiny2313 has calibration data for both 4 MHz and 8 MHz.
8911# The information in the data sheet of April/2004 is wrong, this works:
8912
8913     memory "calibration"
8914         size            = 2;
8915         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
8916                           "0  0  0  0   0  0  0  a0   o o o o  o o o o";
8917     ;
8918  ;
8919
8920#------------------------------------------------------------
8921# ATtiny4313
8922#------------------------------------------------------------
8923
8924part
8925     id            = "t4313";
8926     desc          = "ATtiny4313";
8927     has_debugwire = yes;
8928     flash_instr   = 0xB2, 0x0F, 0x1F;
8929     eeprom_instr  = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
8930	             0xBA, 0x0F, 0xB2, 0x0F, 0xBA, 0x0D, 0xBB, 0xBC,
8931	             0x99, 0xE1, 0xBB, 0xAC;
8932     stk500_devcode   = 0x23;
8933##   Use the ATtiny26 devcode:
8934     avr910_devcode   = 0x5e;
8935     signature        = 0x1e 0x92 0x0d;
8936     pagel            = 0xD4;
8937     bs2              = 0xD6;
8938     reset            = io;
8939     chip_erase_delay = 9000;
8940
8941     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
8942                        "x x x x  x x x x    x x x x  x x x x";
8943
8944     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
8945                        "x x x x  x x x x    x x x x  x x x x";
8946
8947    timeout		= 200;
8948    stabdelay		= 100;
8949    cmdexedelay		= 25;
8950    synchloops		= 32;
8951    bytedelay		= 0;
8952    pollindex		= 3;
8953    pollvalue		= 0x53;
8954    predelay		= 1;
8955    postdelay		= 1;
8956    pollmethod		= 1;
8957
8958    pp_controlstack     =
8959        0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E,
8960        0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E,
8961        0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A,
8962        0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8963    hventerstabdelay    = 100;
8964    progmodedelay       = 0;
8965    latchcycles         = 5;
8966    togglevtg           = 1;
8967    poweroffdelay       = 15;
8968    resetdelayms        = 1;
8969    resetdelayus        = 0;
8970    hvleavestabdelay    = 15;
8971    chiperasepulsewidth = 0;
8972    chiperasepolltimeout = 10;
8973    programfusepulsewidth = 0;
8974    programfusepolltimeout = 5;
8975    programlockpulsewidth = 0;
8976    programlockpolltimeout = 5;
8977
8978    ocdrev              = 0;
8979
8980     memory "eeprom"
8981         size            = 256;
8982        paged           = no;
8983        page_size       = 4;
8984         min_write_delay = 4000;
8985         max_write_delay = 4500;
8986         readback_p1     = 0xff;
8987         readback_p2     = 0xff;
8988         read            = "1   0  1  0   0  0  0  0   0 0 0 x  x x x x",
8989                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
8990
8991         write           = "1   1  0  0   0  0  0  0   0 0 0 x  x x x x",
8992                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
8993
8994	loadpage_lo	= "  1   1   0   0      0   0   0   1",
8995			  "  0   0   0   0      0   0   0   0",
8996			  "  0   0   0   0      0   0  a1  a0",
8997			  "  i   i   i   i      i   i   i   i";
8998
8999	writepage	= "  1   1   0   0      0   0   1   0",
9000			  "  0   0   x   x      x   x   x   x",
9001			  " a7  a6  a5  a4     a3  a2   0   0",
9002			  "  x   x   x   x      x   x   x   x";
9003
9004	mode		= 0x41;
9005	delay		= 6;
9006	blocksize	= 4;
9007	readsize	= 256;
9008       ;
9009     memory "flash"
9010         paged           = yes;
9011         size            = 4096;
9012         page_size       = 64;
9013         num_pages       = 64;
9014         min_write_delay = 4500;
9015         max_write_delay = 4500;
9016         readback_p1     = 0xff;
9017         readback_p2     = 0xff;
9018         read_lo         = "  0   0   1   0    0   0   0   0",
9019                           "  0   0   0   0    0 a10  a9  a8",
9020                           " a7  a6  a5  a4   a3  a2  a1  a0",
9021                           "  o   o   o   o    o   o   o   o";
9022
9023         read_hi         = "  0   0   1   0    1   0   0   0",
9024                           "  0   0   0   0    0 a10  a9  a8",
9025                           " a7  a6  a5  a4   a3  a2  a1  a0",
9026                           "  o   o   o   o    o   o   o   o";
9027
9028         loadpage_lo     = "  0   1   0   0    0   0   0   0",
9029                           "  0   0   0   x    x   x   x   x",
9030                           "  x   x   x  a4   a3  a2  a1  a0",
9031                           "  i   i   i   i    i   i   i   i";
9032
9033         loadpage_hi     = "  0   1   0   0    1   0   0   0",
9034                           "  0   0   0   x    x   x   x   x",
9035                           "  x   x   x  a4   a3  a2  a1  a0",
9036                           "  i   i   i   i    i   i   i   i";
9037
9038         writepage       = "  0  1  0  0   1   1  0  0",
9039                           "  0  0  0  0   0 a10 a9 a8",
9040                           " a7 a6 a5  x   x   x  x  x",
9041                           "  x  x  x  x   x   x  x  x";
9042
9043	mode		= 0x41;
9044	delay		= 6;
9045	blocksize	= 32;
9046	readsize	= 256;
9047       ;
9048#   ATtiny4313 has Signature Bytes: 0x1E 0x92 0x0D.
9049     memory "signature"
9050         size            = 3;
9051         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
9052                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9053       ;
9054     memory "lock"
9055         size            = 1;
9056         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9057                           "x x x x  x x x x  1 1 i i  i i i i";
9058         read           = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9059                          "x x x x  x x x x  x x o o  o o o o";
9060        min_write_delay = 9000;
9061        max_write_delay = 9000;
9062       ;
9063
9064     memory "lfuse"
9065         size            = 1;
9066         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9067                           "x x x x  x x x x  i i i i  i i i i";
9068
9069         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9070                           "x x x x  x x x x  o o o o  o o o o";
9071        min_write_delay = 9000;
9072        max_write_delay = 9000;
9073       ;
9074
9075     memory "hfuse"
9076         size            = 1;
9077         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9078                           "x x x x  x x x x  i i i i  i i i i";
9079
9080         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9081                           "x x x x  x x x x  o o o o  o o o o";
9082        min_write_delay = 9000;
9083        max_write_delay = 9000;
9084       ;
9085
9086     memory "efuse"
9087         size            = 1;
9088         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9089                           "x x x x  x x x x  x x x x  x x x i";
9090
9091         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9092                           "x x x x  x x x x  o o o o  o o o o";
9093        min_write_delay = 9000;
9094        max_write_delay = 9000;
9095     ;
9096
9097     memory "calibration"
9098         size            = 2;
9099         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9100                           "0  0  0  0   0  0  0  a0   o o o o  o o o o";
9101     ;
9102  ;
9103
9104#------------------------------------------------------------
9105# AT90PWM2
9106#------------------------------------------------------------
9107
9108part
9109     id            = "pwm2";
9110     desc          = "AT90PWM2";
9111     has_debugwire = yes;
9112     flash_instr   = 0xB6, 0x01, 0x11;
9113     eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
9114	             0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
9115	             0x99, 0xF9, 0xBB, 0xAF;
9116     stk500_devcode   = 0x65;
9117##  avr910_devcode   = ?;
9118     signature        = 0x1e 0x93 0x81;
9119     pagel            = 0xD8;
9120     bs2              = 0xE2;
9121     reset            = io;
9122     chip_erase_delay = 9000;
9123
9124     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9125                        "x x x x  x x x x    x x x x  x x x x";
9126
9127     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
9128                        "x x x x  x x x x    x x x x  x x x x";
9129
9130    timeout		= 200;
9131    stabdelay		= 100;
9132    cmdexedelay		= 25;
9133    synchloops		= 32;
9134    bytedelay		= 0;
9135    pollindex		= 3;
9136    pollvalue		= 0x53;
9137    predelay		= 1;
9138    postdelay		= 1;
9139    pollmethod		= 1;
9140
9141    pp_controlstack     =
9142        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
9143        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
9144        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
9145        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
9146    hventerstabdelay    = 100;
9147    progmodedelay       = 0;
9148    latchcycles         = 5;
9149    togglevtg           = 1;
9150    poweroffdelay       = 15;
9151    resetdelayms        = 1;
9152    resetdelayus        = 0;
9153    hvleavestabdelay    = 15;
9154    chiperasepulsewidth = 0;
9155    chiperasepolltimeout = 10;
9156    programfusepulsewidth = 0;
9157    programfusepolltimeout = 5;
9158    programlockpulsewidth = 0;
9159    programlockpolltimeout = 5;
9160
9161     memory "eeprom"
9162         size            = 512;
9163        paged           = no;
9164        page_size       = 4;
9165         min_write_delay = 4000;
9166         max_write_delay = 4500;
9167         readback_p1     = 0xff;
9168         readback_p2     = 0xff;
9169         read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x a8",
9170                           "a7 a6 a5 a4  a3 a2 a1 a0  o o o o  o o o o";
9171
9172         write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x a8",
9173                           "a7 a6 a5 a4  a3 a2 a1 a0  i i i i  i i i i";
9174
9175	loadpage_lo	= "  1   1   0   0      0   0   0   1",
9176			  "  0   0   0   0      0   0   0   0",
9177			  "  0   0   0   0      0   0  a1  a0",
9178			  "  i   i   i   i      i   i   i   i";
9179
9180	writepage	= "  1   1   0   0      0   0   1   0",
9181			  "  0   0   x   x      x   x   x   x",
9182			  " a7  a6  a5  a4     a3  a2   0   0",
9183			  "  x   x   x   x      x   x   x   x";
9184
9185	mode		= 0x41;
9186	delay		= 6;
9187	blocksize	= 4;
9188	readsize	= 256;
9189       ;
9190     memory "flash"
9191         paged           = yes;
9192         size            = 8192;
9193         page_size       = 64;
9194         num_pages       = 128;
9195         min_write_delay = 4500;
9196         max_write_delay = 4500;
9197         readback_p1     = 0xff;
9198         readback_p2     = 0xff;
9199         read_lo         = "  0   0   1   0    0   0   0   0",
9200                           "  0   0   0   0   a11 a10 a9  a8",
9201                           " a7  a6  a5  a4   a3  a2  a1  a0",
9202                           "  o   o   o   o    o   o   o   o";
9203
9204         read_hi         = "  0   0   1   0    1   0   0   0",
9205                           "  0   0   0   0   a11 a10 a9  a8",
9206                           " a7  a6  a5  a4   a3  a2  a1  a0",
9207                           "  o   o   o   o    o   o   o   o";
9208
9209         loadpage_lo     = "  0   1   0   0    0   0   0   0",
9210                           "  0   0   0   x    x   x   x   x",
9211                           "  x   x   x  a4   a3  a2  a1  a0",
9212                           "  i   i   i   i    i   i   i   i";
9213
9214         loadpage_hi     = "  0   1   0   0    1   0   0   0",
9215                           "  0   0   0   x    x   x   x   x",
9216                           "  x   x   x  a4   a3  a2  a1  a0",
9217                           "  i   i   i   i    i   i   i   i";
9218
9219         writepage       = "  0  1  0  0   1   1   0   0",
9220                           "  0  0  0  0   a11 a10 a9  a8",
9221                           " a7 a6 a5  x   x   x   x   x",
9222                           "  x  x  x  x   x   x   x   x";
9223
9224	mode		= 0x41;
9225	delay		= 6;
9226	blocksize	= 64;
9227	readsize	= 256;
9228       ;
9229#   AT90PWM2 has Signature Bytes: 0x1E 0x93 0x81.
9230     memory "signature"
9231         size            = 3;
9232         read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
9233                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9234       ;
9235     memory "lock"
9236         size            = 1;
9237         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9238                           "x x x x  x x x x  1 1 i i  i i i i";
9239
9240         read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9241                           "x x x x  x x x x  x x o o  o o o o";
9242        min_write_delay = 9000;
9243        max_write_delay = 9000;
9244       ;
9245
9246     memory "lfuse"
9247         size            = 1;
9248         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9249                           "x x x x  x x x x  i i i i  i i i i";
9250
9251         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9252                           "x x x x  x x x x  o o o o  o o o o";
9253        min_write_delay = 9000;
9254        max_write_delay = 9000;
9255       ;
9256
9257     memory "hfuse"
9258         size            = 1;
9259         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9260                           "x x x x  x x x x  i i i i  i i i i";
9261
9262         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9263                           "x x x x  x x x x  o o o o  o o o o";
9264        min_write_delay = 9000;
9265        max_write_delay = 9000;
9266       ;
9267
9268     memory "efuse"
9269         size            = 1;
9270         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9271                           "x x x x  x x x x  i i i i  i i i i";
9272
9273         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9274                           "x x x x  x x x x  o o o o  o o o o";
9275        min_write_delay = 9000;
9276        max_write_delay = 9000;
9277     ;
9278
9279     memory "calibration"
9280         size            = 1;
9281         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9282                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
9283     ;
9284  ;
9285
9286#------------------------------------------------------------
9287# AT90PWM3
9288#------------------------------------------------------------
9289
9290# Completely identical to AT90PWM2 (including the signature!)
9291
9292part parent "pwm2"
9293     id            = "pwm3";
9294     desc          = "AT90PWM3";
9295  ;
9296
9297#------------------------------------------------------------
9298# AT90PWM2B
9299#------------------------------------------------------------
9300# Same as AT90PWM2 but different signature.
9301
9302part parent "pwm2"
9303     id            = "pwm2b";
9304     desc          = "AT90PWM2B";
9305     signature     = 0x1e 0x93 0x83;
9306
9307    ocdrev              = 1;
9308  ;
9309
9310#------------------------------------------------------------
9311# AT90PWM3B
9312#------------------------------------------------------------
9313
9314# Completely identical to AT90PWM2B (including the signature!)
9315
9316part parent "pwm2b"
9317     id            = "pwm3b";
9318     desc          = "AT90PWM3B";
9319
9320    ocdrev              = 1;
9321  ;
9322
9323#------------------------------------------------------------
9324# AT90PWM316
9325#------------------------------------------------------------
9326
9327# Similar to AT90PWM3B, but with 16 kiB flash, 512 B EEPROM, and 1024 B SRAM.
9328
9329part parent "pwm3b"
9330     id            = "pwm316";
9331     desc          = "AT90PWM316";
9332     signature     = 0x1e 0x94 0x83;
9333
9334    ocdrev              = 1;
9335
9336    memory "flash"
9337        paged           = yes;
9338        size            = 16384;
9339        page_size       = 128;
9340        num_pages       = 128;
9341        min_write_delay = 4500;
9342        max_write_delay = 4500;
9343        readback_p1     = 0xff;
9344        readback_p2     = 0xff;
9345        read_lo         = "  0   0   1   0      0   0   0   0",
9346                          "  0   0 a13 a12    a11 a10  a9  a8",
9347                          " a7  a6  a5  a4     a3  a2  a1  a0",
9348                          "  o   o   o   o      o   o   o   o";
9349
9350        read_hi         = "  0   0   1   0      1   0   0   0",
9351                          "  0   0 a13 a12    a11 a10  a9  a8",
9352                          " a7  a6  a5  a4     a3  a2  a1  a0",
9353                          "  o   o   o   o      o   o   o   o";
9354
9355        loadpage_lo     = "  0   1   0   0      0   0   0   0",
9356                          "  0   0   x   x      x   x   x   x",
9357                          "  x   x  a5  a4     a3  a2  a1  a0",
9358                          "  i   i   i   i      i   i   i   i";
9359
9360        loadpage_hi     = "  0   1   0   0      1   0   0   0",
9361                          "  0   0   x   x      x   x   x   x",
9362                          "  x   x  a5  a4     a3  a2  a1  a0",
9363                          "  i   i   i   i      i   i   i   i";
9364
9365        writepage       = "  0   1   0   0      1   1   0   0",
9366                          "  0   0 a13 a12    a11 a10  a9  a8",
9367                          " a7  a6   x   x      x   x   x   x",
9368                          "  x   x   x   x      x   x   x   x";
9369
9370	mode		= 0x21;
9371	delay		= 6;
9372	blocksize	= 128;
9373	readsize	= 256;
9374      ;
9375  ;
9376
9377#------------------------------------------------------------
9378# AT90PWM216
9379#------------------------------------------------------------
9380# Completely identical to AT90PWM316 (including the signature!)
9381
9382part parent "pwm316"
9383     id = "pwm216";
9384     desc = "AT90PWM216";
9385  ;
9386
9387#------------------------------------------------------------
9388# ATtiny25
9389#------------------------------------------------------------
9390
9391part
9392     id            = "t25";
9393     desc          = "ATtiny25";
9394     has_debugwire = yes;
9395     flash_instr   = 0xB4, 0x02, 0x12;
9396     eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
9397	             0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC,
9398	             0x99, 0xE1, 0xBB, 0xAC;
9399## no STK500 devcode in XML file, use the ATtiny45 one
9400     stk500_devcode   = 0x14;
9401##  avr910_devcode   = ?;
9402##  Try the AT90S2313 devcode:
9403     avr910_devcode   = 0x20;
9404     signature        = 0x1e 0x91 0x08;
9405     reset            = io;
9406     chip_erase_delay = 4500;
9407
9408     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9409                        "x x x x  x x x x    x x x x  x x x x";
9410
9411     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
9412                        "x x x x  x x x x    x x x x  x x x x";
9413
9414    timeout		= 200;
9415    stabdelay		= 100;
9416    cmdexedelay		= 25;
9417    synchloops		= 32;
9418    bytedelay		= 0;
9419    pollindex		= 3;
9420    pollvalue		= 0x53;
9421    predelay		= 1;
9422    postdelay		= 1;
9423    pollmethod		= 1;
9424
9425    hvsp_controlstack   =
9426        0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
9427        0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
9428        0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
9429        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
9430    hventerstabdelay    = 100;
9431    hvspcmdexedelay     = 0;
9432    synchcycles         = 6;
9433    latchcycles         = 1;
9434    togglevtg           = 1;
9435    poweroffdelay       = 25;
9436    resetdelayms        = 1;
9437    resetdelayus        = 0;
9438    hvleavestabdelay    = 100;
9439    resetdelay          = 25;
9440    chiperasepolltimeout = 40;
9441    chiperasetime       = 0;
9442    programfusepolltimeout = 25;
9443    programlockpolltimeout = 25;
9444
9445    ocdrev              = 1;
9446
9447     memory "eeprom"
9448         size            = 128;
9449        paged           = no;
9450        page_size       = 4;
9451         min_write_delay = 4000;
9452         max_write_delay = 4500;
9453         readback_p1     = 0xff;
9454         readback_p2     = 0xff;
9455         read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x x",
9456                           "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
9457
9458         write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x x",
9459                           "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
9460
9461	loadpage_lo	= "  1   1   0   0      0   0   0   1",
9462			  "  0   0   0   0      0   0   0   0",
9463			  "  0   0   0   0      0   0  a1  a0",
9464			  "  i   i   i   i      i   i   i   i";
9465
9466	writepage	= "  1   1   0   0      0   0   1   0",
9467			  "  0   0   x   x      x   x   x   x",
9468			  "  x  a6  a5  a4     a3  a2   0   0",
9469			  "  x   x   x   x      x   x   x   x";
9470
9471	mode		= 0x41;
9472	delay		= 6;
9473	blocksize	= 4;
9474	readsize	= 256;
9475       ;
9476     memory "flash"
9477         paged           = yes;
9478         size            = 2048;
9479         page_size       = 32;
9480         num_pages       = 64;
9481         min_write_delay = 4500;
9482         max_write_delay = 4500;
9483         readback_p1     = 0xff;
9484         readback_p2     = 0xff;
9485         read_lo         = "  0   0   1   0    0   0   0   0",
9486                           "  0   0   0   0    0   0  a9  a8",
9487                           " a7  a6  a5  a4   a3  a2  a1  a0",
9488                           "  o   o   o   o    o   o   o   o";
9489
9490         read_hi         = "  0   0   1   0    1   0   0   0",
9491                           "  0   0   0   0    0   0  a9  a8",
9492                           " a7  a6  a5  a4   a3  a2  a1  a0",
9493                           "  o   o   o   o    o   o   o   o";
9494
9495         loadpage_lo     = "  0   1   0   0    0   0   0   0",
9496                           "  0   0   0   x    x   x   x   x",
9497                           "  x   x   x   x   a3  a2  a1  a0",
9498                           "  i   i   i   i    i   i   i   i";
9499
9500         loadpage_hi     = "  0   1   0   0    1   0   0   0",
9501                           "  0   0   0   x    x   x   x   x",
9502                           "  x   x   x   x   a3  a2  a1  a0",
9503                           "  i   i   i   i    i   i   i   i";
9504
9505         writepage       = "  0  1  0  0   1  1  0  0",
9506                           "  0  0  0  0   0  0 a9 a8",
9507                           " a7 a6 a5 a4   x  x  x  x",
9508                           "  x  x  x  x   x  x  x  x";
9509
9510	mode		= 0x41;
9511	delay		= 6;
9512	blocksize	= 32;
9513	readsize	= 256;
9514       ;
9515#   ATtiny25 has Signature Bytes: 0x1E 0x91 0x08.
9516     memory "signature"
9517         size            = 3;
9518         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
9519                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9520       ;
9521     memory "lock"
9522         size            = 1;
9523         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9524                           "x x x x  x x x x  1 1 i i  i i i i";
9525         read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9526                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
9527        min_write_delay = 9000;
9528        max_write_delay = 9000;
9529       ;
9530
9531     memory "lfuse"
9532         size            = 1;
9533         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9534                           "x x x x  x x x x  i i i i  i i i i";
9535
9536         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9537                           "x x x x  x x x x  o o o o  o o o o";
9538        min_write_delay = 9000;
9539        max_write_delay = 9000;
9540       ;
9541
9542     memory "hfuse"
9543         size            = 1;
9544         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9545                           "x x x x  x x x x  i i i i  i i i i";
9546
9547         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9548                           "x x x x  x x x x  o o o o  o o o o";
9549        min_write_delay = 9000;
9550        max_write_delay = 9000;
9551       ;
9552
9553     memory "efuse"
9554         size            = 1;
9555         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9556                           "x x x x  x x x x  x x x x  x x x i";
9557
9558         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9559                           "x x x x  x x x x  o o o o  o o o o";
9560        min_write_delay = 9000;
9561        max_write_delay = 9000;
9562     ;
9563
9564     memory "calibration"
9565         size            = 1;
9566         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9567                           "0  0  0  0   0  0  0  a0   o o o o  o o o o";
9568     ;
9569  ;
9570
9571#------------------------------------------------------------
9572# ATtiny45
9573#------------------------------------------------------------
9574
9575part
9576     id            = "t45";
9577     desc          = "ATtiny45";
9578     has_debugwire = yes;
9579     flash_instr   = 0xB4, 0x02, 0x12;
9580     eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
9581	             0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC,
9582	             0x99, 0xE1, 0xBB, 0xAC;
9583     stk500_devcode   = 0x14;
9584##  avr910_devcode   = ?;
9585##  Try the AT90S2313 devcode:
9586     avr910_devcode   = 0x20;
9587     signature        = 0x1e 0x92 0x06;
9588     reset            = io;
9589     chip_erase_delay = 4500;
9590
9591     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9592                        "x x x x  x x x x    x x x x  x x x x";
9593
9594     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
9595                        "x x x x  x x x x    x x x x  x x x x";
9596
9597    timeout		= 200;
9598    stabdelay		= 100;
9599    cmdexedelay		= 25;
9600    synchloops		= 32;
9601    bytedelay		= 0;
9602    pollindex		= 3;
9603    pollvalue		= 0x53;
9604    predelay		= 1;
9605    postdelay		= 1;
9606    pollmethod		= 1;
9607
9608    hvsp_controlstack     =
9609	0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
9610        0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
9611        0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
9612        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
9613    hventerstabdelay    = 100;
9614    progmodedelay       = 0;
9615    hvspcmdexedelay     = 0;
9616    synchcycles         = 6;
9617    latchcycles         = 1;
9618    togglevtg           = 1;
9619    poweroffdelay       = 25;
9620    resetdelayms        = 1;
9621    resetdelayus        = 0;
9622    hvleavestabdelay    = 100;
9623    resetdelay          = 25;
9624    chiperasepolltimeout = 40;
9625    chiperasetime       = 0;
9626    programfusepolltimeout = 25;
9627    programlockpolltimeout = 25;
9628
9629    ocdrev              = 1;
9630
9631     memory "eeprom"
9632         size            = 256;
9633         page_size       = 4;
9634         min_write_delay = 4000;
9635         max_write_delay = 4500;
9636         readback_p1     = 0xff;
9637         readback_p2     = 0xff;
9638         read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x x",
9639                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
9640
9641         write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
9642                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
9643
9644	loadpage_lo	= "  1   1   0   0      0   0   0   1",
9645			  "  0   0   0   0      0   0   0   0",
9646			  "  0   0   0   0      0   0  a1  a0",
9647			  "  i   i   i   i      i   i   i   i";
9648
9649	writepage	= "  1   1   0   0      0   0   1   0",
9650			  "  0   0   x   x      x   x   x   x",
9651			  " a7  a6  a5  a4     a3  a2   0   0",
9652			  "  x   x   x   x      x   x   x   x";
9653
9654	mode		= 0x41;
9655	delay		= 6;
9656	blocksize	= 4;
9657	readsize	= 256;
9658       ;
9659     memory "flash"
9660         paged           = yes;
9661         size            = 4096;
9662         page_size       = 64;
9663         num_pages       = 64;
9664         min_write_delay = 4500;
9665         max_write_delay = 4500;
9666         readback_p1     = 0xff;
9667         readback_p2     = 0xff;
9668         read_lo         = "  0   0   1   0    0   0   0   0",
9669                           "  0   0   0   0    0  a10 a9  a8",
9670                           " a7  a6  a5  a4   a3  a2  a1  a0",
9671                           "  o   o   o   o    o   o   o   o";
9672
9673         read_hi         = "  0   0   1   0    1   0   0   0",
9674                           "  0   0   0   0    0  a10 a9  a8",
9675                           " a7  a6  a5  a4   a3  a2  a1  a0",
9676                           "  o   o   o   o    o   o   o   o";
9677
9678         loadpage_lo     = "  0   1   0   0    0   0   0   0",
9679                           "  0   0   0   x    x   x   x   x",
9680                           "  x   x   x  a4   a3  a2  a1  a0",
9681                           "  i   i   i   i    i   i   i   i";
9682
9683         loadpage_hi     = "  0   1   0   0    1   0   0   0",
9684                           "  0   0   0   x    x   x   x   x",
9685                           "  x   x   x  a4   a3  a2  a1  a0",
9686                           "  i   i   i   i    i   i   i   i";
9687
9688         writepage       = "  0  1  0  0   1  1  0  0",
9689                           "  0  0  0  0   0 a10 a9 a8",
9690                           " a7 a6 a5  x   x  x  x  x",
9691                           "  x  x  x  x   x  x  x  x";
9692
9693	mode		= 0x41;
9694	delay		= 6;
9695	blocksize	= 32;
9696	readsize	= 256;
9697       ;
9698#   ATtiny45 has Signature Bytes: 0x1E 0x92 0x08. (Data sheet 2586C-AVR-06/05 (doc2586.pdf) indicates otherwise!)
9699     memory "signature"
9700         size            = 3;
9701         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
9702                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9703       ;
9704     memory "lock"
9705         size            = 1;
9706         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9707                           "x x x x  x x x x  1 1 i i  i i i i";
9708         read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9709                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
9710        min_write_delay = 9000;
9711        max_write_delay = 9000;
9712       ;
9713
9714     memory "lfuse"
9715         size            = 1;
9716         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9717                           "x x x x  x x x x  i i i i  i i i i";
9718
9719         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9720                           "x x x x  x x x x  o o o o  o o o o";
9721        min_write_delay = 9000;
9722        max_write_delay = 9000;
9723       ;
9724
9725     memory "hfuse"
9726         size            = 1;
9727         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9728                           "x x x x  x x x x  i i i i  i i i i";
9729
9730         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9731                           "x x x x  x x x x  o o o o  o o o o";
9732        min_write_delay = 9000;
9733        max_write_delay = 9000;
9734       ;
9735
9736     memory "efuse"
9737         size            = 1;
9738         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9739                           "x x x x  x x x x  x x x x  x x x i";
9740
9741         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9742                           "x x x x  x x x x  o o o o  o o o o";
9743        min_write_delay = 9000;
9744        max_write_delay = 9000;
9745     ;
9746
9747     memory "calibration"
9748         size            = 1;
9749         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9750                           "0  0  0  0   0  0  0  a0   o o o o  o o o o";
9751     ;
9752  ;
9753
9754#------------------------------------------------------------
9755# ATtiny85
9756#------------------------------------------------------------
9757
9758part
9759     id            = "t85";
9760     desc          = "ATtiny85";
9761     has_debugwire = yes;
9762     flash_instr   = 0xB4, 0x02, 0x12;
9763     eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
9764	             0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC,
9765	             0x99, 0xE1, 0xBB, 0xAC;
9766## no STK500 devcode in XML file, use the ATtiny45 one
9767     stk500_devcode   = 0x14;
9768##  avr910_devcode   = ?;
9769##  Try the AT90S2313 devcode:
9770     avr910_devcode   = 0x20;
9771     signature        = 0x1e 0x93 0x0b;
9772     reset            = io;
9773     chip_erase_delay = 400000;
9774
9775     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9776                        "x x x x  x x x x    x x x x  x x x x";
9777
9778     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
9779                        "x x x x  x x x x    x x x x  x x x x";
9780
9781    timeout		= 200;
9782    stabdelay		= 100;
9783    cmdexedelay		= 25;
9784    synchloops		= 32;
9785    bytedelay		= 0;
9786    pollindex		= 3;
9787    pollvalue		= 0x53;
9788    predelay		= 1;
9789    postdelay		= 1;
9790    pollmethod		= 1;
9791
9792    hvsp_controlstack   =
9793        0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
9794        0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
9795        0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
9796        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
9797    hventerstabdelay    = 100;
9798    hvspcmdexedelay     = 0;
9799    synchcycles         = 6;
9800    latchcycles         = 1;
9801    togglevtg           = 1;
9802    poweroffdelay       = 25;
9803    resetdelayms        = 1;
9804    resetdelayus        = 0;
9805    hvleavestabdelay    = 100;
9806    resetdelay          = 25;
9807    chiperasepolltimeout = 40;
9808    chiperasetime       = 0;
9809    programfusepolltimeout = 25;
9810    programlockpolltimeout = 25;
9811
9812    ocdrev              = 1;
9813
9814     memory "eeprom"
9815         size            = 512;
9816        paged           = no;
9817        page_size       = 4;
9818         min_write_delay = 30000;
9819         max_write_delay = 30000;
9820         readback_p1     = 0xff;
9821         readback_p2     = 0xff;
9822         read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x a8",
9823                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
9824
9825         write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x a8",
9826                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
9827
9828	loadpage_lo	= "  1   1   0   0      0   0   0   1",
9829			  "  0   0   0   0      0   0   0   0",
9830			  "  0   0   0   0      0   0  a1  a0",
9831			  "  i   i   i   i      i   i   i   i";
9832
9833	writepage	= "  1   1   0   0      0   0   1   0",
9834			  "  0   0   x   x      x   x   x  a8",
9835			  " a7  a6  a5  a4     a3  a2   0   0",
9836			  "  x   x   x   x      x   x   x   x";
9837
9838	mode		= 0x41;
9839	delay		= 12;
9840	blocksize	= 4;
9841	readsize	= 256;
9842       ;
9843     memory "flash"
9844         paged           = yes;
9845         size            = 8192;
9846         page_size       = 64;
9847         num_pages       = 128;
9848         min_write_delay = 4500;
9849         max_write_delay = 4500;
9850         readback_p1     = 0xff;
9851         readback_p2     = 0xff;
9852         read_lo         = "  0   0   1   0    0   0   0   0",
9853                           "  0   0   0   0  a11 a10  a9  a8",
9854                           " a7  a6  a5  a4   a3  a2  a1  a0",
9855                           "  o   o   o   o    o   o   o   o";
9856
9857         read_hi         = "  0   0   1   0    1   0   0   0",
9858                           "  0   0   0   0  a11 a10  a9  a8",
9859                           " a7  a6  a5  a4   a3  a2  a1  a0",
9860                           "  o   o   o   o    o   o   o   o";
9861
9862         loadpage_lo     = "  0   1   0   0    0   0   0   0",
9863                           "  0   0   0   x    x   x   x   x",
9864                           "  x   x   x  a4   a3  a2  a1  a0",
9865                           "  i   i   i   i    i   i   i   i";
9866
9867         loadpage_hi     = "  0   1   0   0    1   0   0   0",
9868                           "  0   0   0   x    x   x   x   x",
9869                           "  x   x   x  a4   a3  a2  a1  a0",
9870                           "  i   i   i   i    i   i   i   i";
9871
9872         writepage       = "  0  1  0  0   1   1   0  0",
9873                           "  0  0  0  0  a11 a10 a9 a8",
9874                           " a7 a6 a5  x   x  x  x  x",
9875                           "  x  x  x  x   x  x  x  x";
9876
9877	mode		= 0x41;
9878	delay		= 6;
9879	blocksize	= 32;
9880	readsize	= 256;
9881       ;
9882#   ATtiny85 has Signature Bytes: 0x1E 0x93 0x08.
9883     memory "signature"
9884         size            = 3;
9885         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
9886                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9887       ;
9888     memory "lock"
9889         size            = 1;
9890         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9891                           "x x x x  x x x x  1 1 i i  i i i i";
9892         read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9893                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
9894        min_write_delay = 9000;
9895        max_write_delay = 9000;
9896       ;
9897
9898     memory "lfuse"
9899         size            = 1;
9900         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9901                           "x x x x  x x x x  i i i i  i i i i";
9902
9903         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9904                           "x x x x  x x x x  o o o o  o o o o";
9905        min_write_delay = 9000;
9906        max_write_delay = 9000;
9907       ;
9908
9909     memory "hfuse"
9910         size            = 1;
9911         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9912                           "x x x x  x x x x  i i i i  i i i i";
9913
9914         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9915                           "x x x x  x x x x  o o o o  o o o o";
9916        min_write_delay = 9000;
9917        max_write_delay = 9000;
9918       ;
9919
9920     memory "efuse"
9921         size            = 1;
9922         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9923                           "x x x x  x x x x  x x x x  x x x i";
9924
9925         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9926                           "x x x x  x x x x  o o o o  o o o o";
9927        min_write_delay = 9000;
9928        max_write_delay = 9000;
9929     ;
9930
9931     memory "calibration"
9932         size            = 1;
9933         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9934                           "0  0  0  0   0  0  0  a0   o o o o  o o o o";
9935     ;
9936  ;
9937
9938#------------------------------------------------------------
9939# ATmega640
9940#------------------------------------------------------------
9941# Almost same as ATmega1280, except for different memory sizes
9942
9943part
9944    id               = "m640";
9945    desc             = "ATmega640";
9946    signature        = 0x1e 0x96 0x08;
9947    has_jtag         = yes;
9948#    stk500_devcode   = 0xB2;
9949#    avr910_devcode   = 0x43;
9950    chip_erase_delay = 9000;
9951    pagel            = 0xD7;
9952    bs2              = 0xA0;
9953    reset            = dedicated;
9954    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9955                       "x x x x  x x x x    x x x x  x x x x";
9956
9957    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
9958                       "x x x x  x x x x    x x x x  x x x x";
9959
9960    timeout		= 200;
9961    stabdelay		= 100;
9962    cmdexedelay		= 25;
9963    synchloops		= 32;
9964    bytedelay		= 0;
9965    pollindex		= 3;
9966    pollvalue		= 0x53;
9967    predelay		= 1;
9968    postdelay		= 1;
9969    pollmethod		= 1;
9970
9971    pp_controlstack     =
9972        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
9973        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
9974        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
9975        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
9976    hventerstabdelay    = 100;
9977    progmodedelay       = 0;
9978    latchcycles         = 5;
9979    togglevtg           = 1;
9980    poweroffdelay       = 15;
9981    resetdelayms        = 1;
9982    resetdelayus        = 0;
9983    hvleavestabdelay    = 15;
9984    chiperasepulsewidth = 0;
9985    chiperasepolltimeout = 10;
9986    programfusepulsewidth = 0;
9987    programfusepolltimeout = 5;
9988    programlockpulsewidth = 0;
9989    programlockpolltimeout = 5;
9990
9991    idr                 = 0x31;
9992    spmcr               = 0x57;
9993    rampz               = 0x3b;
9994    allowfullpagebitstream = no;
9995
9996    ocdrev              = 3;
9997
9998    memory "eeprom"
9999        paged           = no; /* leave this "no" */
10000        page_size       = 8;  /* for parallel programming */
10001        size            = 4096;
10002        min_write_delay = 9000;
10003        max_write_delay = 9000;
10004        readback_p1     = 0x00;
10005        readback_p2     = 0x00;
10006        read            = "  1   0   1   0      0   0   0   0",
10007                          "  x   x   x   x    a11 a10  a9  a8",
10008                          " a7  a6  a5  a4     a3  a2  a1  a0",
10009                          "  o   o   o   o      o   o   o   o";
10010
10011        write           = "  1   1   0   0      0   0   0   0",
10012                          "  x   x   x   x    a11 a10  a9  a8",
10013                          " a7  a6  a5  a4     a3  a2  a1  a0",
10014                          "  i   i   i   i      i   i   i   i";
10015
10016	loadpage_lo	= "  1   1   0   0      0   0   0   1",
10017			  "  0   0   0   0      0   0   0   0",
10018			  "  0   0   0   0      0  a2  a1  a0",
10019			  "  i   i   i   i      i   i   i   i";
10020
10021	writepage	= "  1   1   0   0      0   0   1   0",
10022			  "  0   0   x   x    a11 a10  a9  a8",
10023			  " a7  a6  a5  a4     a3   0   0   0",
10024			  "  x   x   x   x      x   x   x   x";
10025
10026	mode		= 0x41;
10027	delay		= 10;
10028	blocksize	= 8;
10029	readsize	= 256;
10030      ;
10031
10032    memory "flash"
10033        paged           = yes;
10034        size            = 65536;
10035        page_size       = 256;
10036        num_pages       = 256;
10037        min_write_delay = 4500;
10038        max_write_delay = 4500;
10039        readback_p1     = 0x00;
10040        readback_p2     = 0x00;
10041        read_lo         = "  0   0   1   0      0   0   0   0",
10042                          "  0 a14 a13 a12    a11 a10  a9  a8",
10043                          " a7  a6  a5  a4     a3  a2  a1  a0",
10044                          "  o   o   o   o      o   o   o   o";
10045
10046        read_hi         = "  0   0   1   0      1   0   0   0",
10047                          "  0 a14 a13 a12    a11 a10  a9  a8",
10048                          " a7  a6  a5  a4     a3  a2  a1  a0",
10049                          "  o   o   o   o      o   o   o   o";
10050
10051        loadpage_lo     = "  0   1   0   0      0   0   0   0",
10052                          "  x   x   x   x      x   x   x   x",
10053                          "  x  a6  a5  a4     a3  a2  a1  a0",
10054                          "  i   i   i   i      i   i   i   i";
10055
10056        loadpage_hi     = "  0   1   0   0      1   0   0   0",
10057                          "  x   x   x   x      x   x   x   x",
10058                          "  x  a6  a5  a4     a3  a2  a1  a0",
10059                          "  i   i   i   i      i   i   i   i";
10060
10061        writepage       = "  0   1   0   0      1   1   0   0",
10062                          "  0 a14 a13 a12    a11 a10  a9  a8",
10063                          " a7   x   x   x      x   x   x   x",
10064                          "  x   x   x   x      x   x   x   x";
10065
10066	mode		= 0x41;
10067	delay		= 10;
10068	blocksize	= 256;
10069	readsize	= 256;
10070      ;
10071
10072    memory "lfuse"
10073        size            = 1;
10074        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10075                          "x x x x  x x x x  i i i i  i i i i";
10076
10077        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10078                          "x x x x  x x x x  o o o o  o o o o";
10079        min_write_delay = 9000;
10080        max_write_delay = 9000;
10081      ;
10082
10083    memory "hfuse"
10084        size            = 1;
10085        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10086                          "x x x x  x x x x  i i i i  i i i i";
10087
10088        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10089                          "x x x x  x x x x  o o o o  o o o o";
10090        min_write_delay = 9000;
10091        max_write_delay = 9000;
10092      ;
10093
10094    memory "efuse"
10095        size            = 1;
10096        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10097                          "x x x x  x x x x  x x x x  x i i i";
10098
10099        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10100                          "x x x x  x x x x  o o o o  o o o o";
10101        min_write_delay = 9000;
10102        max_write_delay = 9000;
10103      ;
10104
10105    memory "lock"
10106        size            = 1;
10107        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
10108                          "x x x x  x x x x   x x o o  o o o o";
10109
10110        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
10111                          "x x x x  x x x x   1 1 i i  i i i i";
10112        min_write_delay = 9000;
10113        max_write_delay = 9000;
10114      ;
10115
10116    memory "calibration"
10117        size            = 1;
10118        read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
10119                          "0 0 0 0  0 0 0 0    o o o o  o o o o";
10120      ;
10121
10122    memory "signature"
10123        size            = 3;
10124        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
10125                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10126      ;
10127  ;
10128
10129#------------------------------------------------------------
10130# ATmega1280
10131#------------------------------------------------------------
10132
10133part
10134    id               = "m1280";
10135    desc             = "ATmega1280";
10136    signature        = 0x1e 0x97 0x03;
10137    has_jtag         = yes;
10138#    stk500_devcode   = 0xB2;
10139#    avr910_devcode   = 0x43;
10140    chip_erase_delay = 9000;
10141    pagel            = 0xD7;
10142    bs2              = 0xA0;
10143    reset            = dedicated;
10144    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10145                       "x x x x  x x x x    x x x x  x x x x";
10146
10147    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
10148                       "x x x x  x x x x    x x x x  x x x x";
10149
10150    timeout		= 200;
10151    stabdelay		= 100;
10152    cmdexedelay		= 25;
10153    synchloops		= 32;
10154    bytedelay		= 0;
10155    pollindex		= 3;
10156    pollvalue		= 0x53;
10157    predelay		= 1;
10158    postdelay		= 1;
10159    pollmethod		= 1;
10160
10161    pp_controlstack     =
10162        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
10163        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
10164        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
10165        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
10166    hventerstabdelay    = 100;
10167    progmodedelay       = 0;
10168    latchcycles         = 5;
10169    togglevtg           = 1;
10170    poweroffdelay       = 15;
10171    resetdelayms        = 1;
10172    resetdelayus        = 0;
10173    hvleavestabdelay    = 15;
10174    chiperasepulsewidth = 0;
10175    chiperasepolltimeout = 10;
10176    programfusepulsewidth = 0;
10177    programfusepolltimeout = 5;
10178    programlockpulsewidth = 0;
10179    programlockpolltimeout = 5;
10180
10181    idr                 = 0x31;
10182    spmcr               = 0x57;
10183    rampz               = 0x3b;
10184    allowfullpagebitstream = no;
10185
10186    ocdrev              = 3;
10187
10188    memory "eeprom"
10189        paged           = no; /* leave this "no" */
10190        page_size       = 8;  /* for parallel programming */
10191        size            = 4096;
10192        min_write_delay = 9000;
10193        max_write_delay = 9000;
10194        readback_p1     = 0x00;
10195        readback_p2     = 0x00;
10196        read            = "  1   0   1   0      0   0   0   0",
10197                          "  x   x   x   x    a11 a10  a9  a8",
10198                          " a7  a6  a5  a4     a3  a2  a1  a0",
10199                          "  o   o   o   o      o   o   o   o";
10200
10201        write           = "  1   1   0   0      0   0   0   0",
10202                          "  x   x   x   x    a11 a10  a9  a8",
10203                          " a7  a6  a5  a4     a3  a2  a1  a0",
10204                          "  i   i   i   i      i   i   i   i";
10205
10206	loadpage_lo	= "  1   1   0   0      0   0   0   1",
10207			  "  0   0   0   0      0   0   0   0",
10208			  "  0   0   0   0      0  a2  a1  a0",
10209			  "  i   i   i   i      i   i   i   i";
10210
10211	writepage	= "  1   1   0   0      0   0   1   0",
10212			  "  0   0   x   x    a11 a10  a9  a8",
10213			  " a7  a6  a5  a4     a3   0   0   0",
10214			  "  x   x   x   x      x   x   x   x";
10215
10216	mode		= 0x41;
10217	delay		= 10;
10218	blocksize	= 8;
10219	readsize	= 256;
10220      ;
10221
10222    memory "flash"
10223        paged           = yes;
10224        size            = 131072;
10225        page_size       = 256;
10226        num_pages       = 512;
10227        min_write_delay = 4500;
10228        max_write_delay = 4500;
10229        readback_p1     = 0x00;
10230        readback_p2     = 0x00;
10231        read_lo         = "  0   0   1   0      0   0   0   0",
10232                          "a15 a14 a13 a12    a11 a10  a9  a8",
10233                          " a7  a6  a5  a4     a3  a2  a1  a0",
10234                          "  o   o   o   o      o   o   o   o";
10235
10236        read_hi         = "  0   0   1   0      1   0   0   0",
10237                          "a15 a14 a13 a12    a11 a10  a9  a8",
10238                          " a7  a6  a5  a4     a3  a2  a1  a0",
10239                          "  o   o   o   o      o   o   o   o";
10240
10241        loadpage_lo     = "  0   1   0   0      0   0   0   0",
10242                          "  x   x   x   x      x   x   x   x",
10243                          "  x  a6  a5  a4     a3  a2  a1  a0",
10244                          "  i   i   i   i      i   i   i   i";
10245
10246        loadpage_hi     = "  0   1   0   0      1   0   0   0",
10247                          "  x   x   x   x      x   x   x   x",
10248                          "  x  a6  a5  a4     a3  a2  a1  a0",
10249                          "  i   i   i   i      i   i   i   i";
10250
10251        writepage       = "  0   1   0   0      1   1   0   0",
10252                          "a15 a14 a13 a12    a11 a10  a9  a8",
10253                          " a7   x   x   x      x   x   x   x",
10254                          "  x   x   x   x      x   x   x   x";
10255
10256	mode		= 0x41;
10257	delay		= 10;
10258	blocksize	= 256;
10259	readsize	= 256;
10260      ;
10261
10262    memory "lfuse"
10263        size            = 1;
10264        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10265                          "x x x x  x x x x  i i i i  i i i i";
10266
10267        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10268                          "x x x x  x x x x  o o o o  o o o o";
10269        min_write_delay = 9000;
10270        max_write_delay = 9000;
10271      ;
10272
10273    memory "hfuse"
10274        size            = 1;
10275        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10276                          "x x x x  x x x x  i i i i  i i i i";
10277
10278        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10279                          "x x x x  x x x x  o o o o  o o o o";
10280        min_write_delay = 9000;
10281        max_write_delay = 9000;
10282      ;
10283
10284    memory "efuse"
10285        size            = 1;
10286        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10287                          "x x x x  x x x x  x x x x  x i i i";
10288
10289        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10290                          "x x x x  x x x x  o o o o  o o o o";
10291        min_write_delay = 9000;
10292        max_write_delay = 9000;
10293      ;
10294
10295    memory "lock"
10296        size            = 1;
10297        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
10298                          "x x x x  x x x x   x x o o  o o o o";
10299
10300        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
10301                          "x x x x  x x x x   1 1 i i  i i i i";
10302        min_write_delay = 9000;
10303        max_write_delay = 9000;
10304      ;
10305
10306    memory "calibration"
10307        size            = 1;
10308        read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
10309                          "0 0 0 0  0 0 0 0    o o o o  o o o o";
10310      ;
10311
10312    memory "signature"
10313        size            = 3;
10314        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
10315                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10316      ;
10317  ;
10318
10319#------------------------------------------------------------
10320# ATmega1281
10321#------------------------------------------------------------
10322# Identical to ATmega1280
10323
10324part parent "m1280"
10325    id               = "m1281";
10326    desc             = "ATmega1281";
10327    signature        = 0x1e 0x97 0x04;
10328
10329    ocdrev              = 3;
10330  ;
10331
10332#------------------------------------------------------------
10333# ATmega2560
10334#------------------------------------------------------------
10335
10336part
10337    id               = "m2560";
10338    desc             = "ATmega2560";
10339    signature        = 0x1e 0x98 0x01;
10340    has_jtag         = yes;
10341    stk500_devcode   = 0xB2;
10342#    avr910_devcode   = 0x43;
10343    chip_erase_delay = 9000;
10344    pagel            = 0xD7;
10345    bs2              = 0xA0;
10346    reset            = dedicated;
10347    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10348                       "x x x x  x x x x    x x x x  x x x x";
10349
10350    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
10351                       "x x x x  x x x x    x x x x  x x x x";
10352
10353    timeout		= 200;
10354    stabdelay		= 100;
10355    cmdexedelay		= 25;
10356    synchloops		= 32;
10357    bytedelay		= 0;
10358    pollindex		= 3;
10359    pollvalue		= 0x53;
10360    predelay		= 1;
10361    postdelay		= 1;
10362    pollmethod		= 1;
10363
10364    pp_controlstack     =
10365        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
10366        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
10367        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
10368        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
10369    hventerstabdelay    = 100;
10370    progmodedelay       = 0;
10371    latchcycles         = 5;
10372    togglevtg           = 1;
10373    poweroffdelay       = 15;
10374    resetdelayms        = 1;
10375    resetdelayus        = 0;
10376    hvleavestabdelay    = 15;
10377    chiperasepulsewidth = 0;
10378    chiperasepolltimeout = 10;
10379    programfusepulsewidth = 0;
10380    programfusepolltimeout = 5;
10381    programlockpulsewidth = 0;
10382    programlockpolltimeout = 5;
10383
10384    idr                 = 0x31;
10385    spmcr               = 0x57;
10386    rampz               = 0x3b;
10387    allowfullpagebitstream = no;
10388
10389    ocdrev              = 4;
10390
10391    memory "eeprom"
10392        paged           = no; /* leave this "no" */
10393        page_size       = 8;  /* for parallel programming */
10394        size            = 4096;
10395        min_write_delay = 9000;
10396        max_write_delay = 9000;
10397        readback_p1     = 0x00;
10398        readback_p2     = 0x00;
10399        read            = "  1   0   1   0      0   0   0   0",
10400                          "  x   x   x   x    a11 a10  a9  a8",
10401                          " a7  a6  a5  a4     a3  a2  a1  a0",
10402                          "  o   o   o   o      o   o   o   o";
10403
10404        write           = "  1   1   0   0      0   0   0   0",
10405                          "  x   x   x   x    a11 a10  a9  a8",
10406                          " a7  a6  a5  a4     a3  a2  a1  a0",
10407                          "  i   i   i   i      i   i   i   i";
10408
10409	loadpage_lo	= "  1   1   0   0      0   0   0   1",
10410			  "  0   0   0   0      0   0   0   0",
10411			  "  0   0   0   0      0  a2  a1  a0",
10412			  "  i   i   i   i      i   i   i   i";
10413
10414	writepage	= "  1   1   0   0      0   0   1   0",
10415			  "  0   0   x   x    a11 a10  a9  a8",
10416			  " a7  a6  a5  a4     a3   0   0   0",
10417			  "  x   x   x   x      x   x   x   x";
10418
10419	mode		= 0x41;
10420	delay		= 10;
10421	blocksize	= 8;
10422	readsize	= 256;
10423      ;
10424
10425    memory "flash"
10426        paged           = yes;
10427        size            = 262144;
10428        page_size       = 256;
10429        num_pages       = 1024;
10430        min_write_delay = 4500;
10431        max_write_delay = 4500;
10432        readback_p1     = 0x00;
10433        readback_p2     = 0x00;
10434        read_lo         = "  0   0   1   0      0   0   0   0",
10435                          "a15 a14 a13 a12    a11 a10  a9  a8",
10436                          " a7  a6  a5  a4     a3  a2  a1  a0",
10437                          "  o   o   o   o      o   o   o   o";
10438
10439        read_hi         = "  0   0   1   0      1   0   0   0",
10440                          "a15 a14 a13 a12    a11 a10  a9  a8",
10441                          " a7  a6  a5  a4     a3  a2  a1  a0",
10442                          "  o   o   o   o      o   o   o   o";
10443
10444        loadpage_lo     = "  0   1   0   0      0   0   0   0",
10445                          "  x   x   x   x      x   x   x   x",
10446                          "  x  a6  a5  a4     a3  a2  a1  a0",
10447                          "  i   i   i   i      i   i   i   i";
10448
10449        loadpage_hi     = "  0   1   0   0      1   0   0   0",
10450                          "  x   x   x   x      x   x   x   x",
10451                          "  x  a6  a5  a4     a3  a2  a1  a0",
10452                          "  i   i   i   i      i   i   i   i";
10453
10454        writepage       = "  0   1   0   0      1   1   0   0",
10455                          "a15 a14 a13 a12    a11 a10  a9  a8",
10456                          " a7   x   x   x      x   x   x   x",
10457                          "  x   x   x   x      x   x   x   x";
10458
10459        load_ext_addr   = "  0   1   0   0      1   1   0   1",
10460                          "  0   0   0   0      0   0   0   0",
10461                          "  0   0   0   0      0   0   0 a16",
10462                          "  0   0   0   0      0   0   0   0";
10463
10464	mode		= 0x41;
10465	delay		= 10;
10466	blocksize	= 256;
10467	readsize	= 256;
10468      ;
10469
10470    memory "lfuse"
10471        size            = 1;
10472        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10473                          "x x x x  x x x x  i i i i  i i i i";
10474
10475        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10476                          "x x x x  x x x x  o o o o  o o o o";
10477        min_write_delay = 9000;
10478        max_write_delay = 9000;
10479      ;
10480
10481    memory "hfuse"
10482        size            = 1;
10483        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10484                          "x x x x  x x x x  i i i i  i i i i";
10485
10486        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10487                          "x x x x  x x x x  o o o o  o o o o";
10488        min_write_delay = 9000;
10489        max_write_delay = 9000;
10490      ;
10491
10492    memory "efuse"
10493        size            = 1;
10494        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10495                          "x x x x  x x x x  x x x x  x i i i";
10496
10497        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10498                          "x x x x  x x x x  o o o o  o o o o";
10499        min_write_delay = 9000;
10500        max_write_delay = 9000;
10501      ;
10502
10503    memory "lock"
10504        size            = 1;
10505        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
10506                          "x x x x  x x x x   x x o o  o o o o";
10507
10508        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
10509                          "x x x x  x x x x   1 1 i i  i i i i";
10510        min_write_delay = 9000;
10511        max_write_delay = 9000;
10512      ;
10513
10514    memory "calibration"
10515        size            = 1;
10516        read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
10517                          "0 0 0 0  0 0 0 0    o o o o  o o o o";
10518      ;
10519
10520    memory "signature"
10521        size            = 3;
10522        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
10523                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10524      ;
10525  ;
10526
10527#------------------------------------------------------------
10528# ATmega2561
10529#------------------------------------------------------------
10530
10531part parent "m2560"
10532    id               = "m2561";
10533    desc             = "ATmega2561";
10534    signature        = 0x1e 0x98 0x02;
10535
10536    ocdrev              = 4;
10537  ;
10538
10539#------------------------------------------------------------
10540# ATmega128RFA1
10541#------------------------------------------------------------
10542# Identical to ATmega2561 but half the ROM
10543
10544part parent "m2561"
10545    id               = "m128rfa1";
10546    desc             = "ATmega128RFA1";
10547    signature        = 0x1e 0xa7 0x01;
10548    chip_erase_delay = 55000;
10549    bs2              = 0xE2;
10550
10551    ocdrev              = 3;
10552
10553    memory "flash"
10554        paged           = yes;
10555        size            = 131072;
10556        page_size       = 256;
10557        num_pages       = 512;
10558        min_write_delay = 50000;
10559        max_write_delay = 50000;
10560        readback_p1     = 0x00;
10561        readback_p2     = 0x00;
10562        read_lo         = "  0   0   1   0      0   0   0   0",
10563                          "a15 a14 a13 a12    a11 a10  a9  a8",
10564                          " a7  a6  a5  a4     a3  a2  a1  a0",
10565                          "  o   o   o   o      o   o   o   o";
10566
10567        read_hi         = "  0   0   1   0      1   0   0   0",
10568                          "a15 a14 a13 a12    a11 a10  a9  a8",
10569                          " a7  a6  a5  a4     a3  a2  a1  a0",
10570                          "  o   o   o   o      o   o   o   o";
10571
10572        loadpage_lo     = "  0   1   0   0      0   0   0   0",
10573                          "  x   x   x   x      x   x   x   x",
10574                          "  x  a6  a5  a4     a3  a2  a1  a0",
10575                          "  i   i   i   i      i   i   i   i";
10576
10577        loadpage_hi     = "  0   1   0   0      1   0   0   0",
10578                          "  x   x   x   x      x   x   x   x",
10579                          "  x  a6  a5  a4     a3  a2  a1  a0",
10580                          "  i   i   i   i      i   i   i   i";
10581
10582        writepage       = "  0   1   0   0      1   1   0   0",
10583                          "a15 a14 a13 a12    a11 a10  a9  a8",
10584                          " a7   x   x   x      x   x   x   x",
10585                          "  x   x   x   x      x   x   x   x";
10586
10587	mode		= 0x41;
10588	delay		= 20;
10589	blocksize	= 256;
10590	readsize	= 256;
10591      ;
10592  ;
10593
10594#------------------------------------------------------------
10595# ATmega256RFR2
10596#------------------------------------------------------------
10597
10598part parent "m2561"
10599    id               = "m256rfr2";
10600    desc             = "ATmega256RFR2";
10601    signature        = 0x1e 0xa8 0x02;
10602    chip_erase_delay = 18500;
10603    bs2              = 0xE2;
10604
10605    memory "eeprom"
10606        paged           = no; /* leave this "no" */
10607        page_size       = 8;  /* for parallel programming */
10608        size            = 8192;
10609        min_write_delay = 13000;
10610        max_write_delay = 13000;
10611        readback_p1     = 0x00;
10612        readback_p2     = 0x00;
10613        read            = "  1   0   1   0      0   0   0   0",
10614                          "  x   x   x a12    a11 a10  a9  a8",
10615                          " a7  a6  a5  a4     a3  a2  a1  a0",
10616                          "  o   o   o   o      o   o   o   o";
10617
10618        write           = "  1   1   0   0      0   0   0   0",
10619                          "  x   x   x a12    a11 a10  a9  a8",
10620                          " a7  a6  a5  a4     a3  a2  a1  a0",
10621                          "  i   i   i   i      i   i   i   i";
10622
10623	loadpage_lo	= "  1   1   0   0      0   0   0   1",
10624			  "  0   0   0   0      0   0   0   0",
10625			  "  0   0   0   0      0  a2  a1  a0",
10626			  "  i   i   i   i      i   i   i   i";
10627
10628	writepage	= "  1   1   0   0      0   0   1   0",
10629			  "  0   0   x a12    a11 a10  a9  a8",
10630			  " a7  a6  a5  a4     a3   0   0   0",
10631			  "  x   x   x   x      x   x   x   x";
10632
10633	mode		= 0x41;
10634	delay		= 10;
10635	blocksize	= 8;
10636	readsize	= 256;
10637      ;
10638
10639
10640    ocdrev              = 4;
10641  ;
10642
10643#------------------------------------------------------------
10644# ATmega128RFR2
10645#------------------------------------------------------------
10646
10647part parent "m128rfa1"
10648    id               = "m128rfr2";
10649    desc             = "ATmega128RFR2";
10650    signature        = 0x1e 0xa7 0x02;
10651
10652
10653    ocdrev              = 3;
10654  ;
10655
10656#------------------------------------------------------------
10657# ATmega64RFR2
10658#------------------------------------------------------------
10659
10660part parent "m128rfa1"
10661    id               = "m64rfr2";
10662    desc             = "ATmega64RFR2";
10663    signature        = 0x1e 0xa6 0x02;
10664
10665
10666    ocdrev              = 3;
10667
10668    memory "flash"
10669        paged           = yes;
10670        size            = 65536;
10671        page_size       = 256;
10672        num_pages       = 256;
10673        min_write_delay = 50000;
10674        max_write_delay = 50000;
10675        readback_p1     = 0x00;
10676        readback_p2     = 0x00;
10677        read_lo         = "  0   0   1   0      0   0   0   0",
10678                          "  0 a14 a13 a12    a11 a10  a9  a8",
10679                          " a7  a6  a5  a4     a3  a2  a1  a0",
10680                          "  o   o   o   o      o   o   o   o";
10681
10682        read_hi         = "  0   0   1   0      1   0   0   0",
10683                          "  0 a14 a13 a12    a11 a10  a9  a8",
10684                          " a7  a6  a5  a4     a3  a2  a1  a0",
10685                          "  o   o   o   o      o   o   o   o";
10686
10687        loadpage_lo     = "  0   1   0   0      0   0   0   0",
10688                          "  x   x   x   x      x   x   x   x",
10689                          "  x  a6  a5  a4     a3  a2  a1  a0",
10690                          "  i   i   i   i      i   i   i   i";
10691
10692        loadpage_hi     = "  0   1   0   0      1   0   0   0",
10693                          "  x   x   x   x      x   x   x   x",
10694                          "  x  a6  a5  a4     a3  a2  a1  a0",
10695                          "  i   i   i   i      i   i   i   i";
10696
10697        writepage       = "  0   1   0   0      1   1   0   0",
10698                          "  0 a14 a13 a12    a11 a10  a9  a8",
10699                          " a7   x   x   x      x   x   x   x",
10700                          "  x   x   x   x      x   x   x   x";
10701
10702	mode		= 0x41;
10703	delay		= 20;
10704	blocksize	= 256;
10705	readsize	= 256;
10706      ;
10707
10708    memory "eeprom"
10709        paged           = no; /* leave this "no" */
10710        page_size       = 8;  /* for parallel programming */
10711        size            = 2048;
10712        min_write_delay = 13000;
10713        max_write_delay = 13000;
10714        readback_p1     = 0x00;
10715        readback_p2     = 0x00;
10716        read            = "  1   0   1   0      0   0   0   0",
10717                          "  x   x   x   x      x a10  a9  a8",
10718                          " a7  a6  a5  a4     a3  a2  a1  a0",
10719                          "  o   o   o   o      o   o   o   o";
10720
10721        write           = "  1   1   0   0      0   0   0   0",
10722                          "  x   x   x   x      x a10  a9  a8",
10723                          " a7  a6  a5  a4     a3  a2  a1  a0",
10724                          "  i   i   i   i      i   i   i   i";
10725
10726	loadpage_lo	= "  1   1   0   0      0   0   0   1",
10727			  "  0   0   0   0      0   0   0   0",
10728			  "  0   0   0   0      0  a2  a1  a0",
10729			  "  i   i   i   i      i   i   i   i";
10730
10731	writepage	= "  1   1   0   0      0   0   1   0",
10732			  "  0   0   x   x      x a10  a9  a8",
10733			  " a7  a6  a5  a4     a3   0   0   0",
10734			  "  x   x   x   x      x   x   x   x";
10735
10736	mode		= 0x41;
10737	delay		= 10;
10738	blocksize	= 8;
10739	readsize	= 256;
10740      ;
10741
10742
10743  ;
10744
10745#------------------------------------------------------------
10746# ATmega2564RFR2
10747#------------------------------------------------------------
10748
10749part parent "m256rfr2"
10750    id               = "m2564rfr2";
10751    desc             = "ATmega2564RFR2";
10752    signature        = 0x1e 0xa8 0x03;
10753  ;
10754
10755#------------------------------------------------------------
10756# ATmega1284RFR2
10757#------------------------------------------------------------
10758
10759part parent "m128rfr2"
10760    id               = "m1284rfr2";
10761    desc             = "ATmega1284RFR2";
10762    signature        = 0x1e 0xa7 0x03;
10763  ;
10764
10765#------------------------------------------------------------
10766# ATmega644RFR2
10767#------------------------------------------------------------
10768
10769part parent "m64rfr2"
10770    id               = "m644rfr2";
10771    desc             = "ATmega644RFR2";
10772    signature        = 0x1e 0xa6 0x03;
10773  ;
10774
10775#------------------------------------------------------------
10776# ATtiny24
10777#------------------------------------------------------------
10778
10779part
10780     id            = "t24";
10781     desc          = "ATtiny24";
10782     has_debugwire = yes;
10783     flash_instr   = 0xB4, 0x07, 0x17;
10784     eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
10785	             0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
10786	             0x99, 0xE1, 0xBB, 0xAC;
10787## no STK500 devcode in XML file, use the ATtiny45 one
10788     stk500_devcode   = 0x14;
10789##  avr910_devcode   = ?;
10790##  Try the AT90S2313 devcode:
10791     avr910_devcode   = 0x20;
10792     signature        = 0x1e 0x91 0x0b;
10793     reset            = io;
10794     chip_erase_delay = 4500;
10795
10796     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10797                        "x x x x  x x x x    x x x x  x x x x";
10798
10799     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
10800                        "x x x x  x x x x    x x x x  x x x x";
10801
10802    timeout		= 200;
10803    stabdelay		= 100;
10804    cmdexedelay		= 25;
10805    synchloops		= 32;
10806    bytedelay		= 0;
10807    pollindex		= 3;
10808    pollvalue		= 0x53;
10809    predelay		= 1;
10810    postdelay		= 1;
10811    pollmethod		= 1;
10812
10813    hvsp_controlstack   =
10814        0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
10815        0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
10816        0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
10817        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F;
10818    hventerstabdelay    = 100;
10819    hvspcmdexedelay     = 0;
10820    synchcycles         = 6;
10821    latchcycles         = 1;
10822    togglevtg           = 1;
10823    poweroffdelay       = 25;
10824    resetdelayms        = 0;
10825    resetdelayus        = 70;
10826    hvleavestabdelay    = 100;
10827    resetdelay          = 25;
10828    chiperasepolltimeout = 40;
10829    chiperasetime       = 0;
10830    programfusepolltimeout = 25;
10831    programlockpolltimeout = 25;
10832
10833    ocdrev              = 1;
10834
10835     memory "eeprom"
10836         size            = 128;
10837        paged           = no;
10838        page_size       = 4;
10839         min_write_delay = 4000;
10840         max_write_delay = 4500;
10841         readback_p1     = 0xff;
10842         readback_p2     = 0xff;
10843         read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x x",
10844                           "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
10845
10846         write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x x",
10847                           "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
10848
10849	loadpage_lo	= "  1   1   0   0      0   0   0   1",
10850			  "  0   0   0   0      0   0   0   0",
10851			  "  0   0   0   0      0   0  a1  a0",
10852			  "  i   i   i   i      i   i   i   i";
10853
10854	writepage	= "  1   1   0   0      0   0   1   0",
10855			  "  0   0   x   x      x   x   x   x",
10856			  "  x  a6  a5  a4     a3  a2   0   0",
10857			  "  x   x   x   x      x   x   x   x";
10858
10859	mode		= 0x41;
10860	delay		= 6;
10861	blocksize	= 4;
10862	readsize	= 256;
10863       ;
10864     memory "flash"
10865         paged           = yes;
10866         size            = 2048;
10867         page_size       = 32;
10868         num_pages       = 64;
10869         min_write_delay = 4500;
10870         max_write_delay = 4500;
10871         readback_p1     = 0xff;
10872         readback_p2     = 0xff;
10873         read_lo         = "  0   0   1   0    0   0   0   0",
10874                           "  0   0   0   0    0   0  a9  a8",
10875                           " a7  a6  a5  a4   a3  a2  a1  a0",
10876                           "  o   o   o   o    o   o   o   o";
10877
10878         read_hi         = "  0   0   1   0    1   0   0   0",
10879                           "  0   0   0   0    0   0  a9  a8",
10880                           " a7  a6  a5  a4   a3  a2  a1  a0",
10881                           "  o   o   o   o    o   o   o   o";
10882
10883         loadpage_lo     = "  0   1   0   0    0   0   0   0",
10884                           "  0   0   0   x    x   x   x   x",
10885                           "  x   x   x   x   a3  a2  a1  a0",
10886                           "  i   i   i   i    i   i   i   i";
10887
10888         loadpage_hi     = "  0   1   0   0    1   0   0   0",
10889                           "  0   0   0   x    x   x   x   x",
10890                           "  x   x   x   x   a3  a2  a1  a0",
10891                           "  i   i   i   i    i   i   i   i";
10892
10893         writepage       = "  0  1  0  0   1  1  0  0",
10894                           "  0  0  0  0   0  0 a9 a8",
10895                           " a7 a6 a5 a4   x  x  x  x",
10896                           "  x  x  x  x   x  x  x  x";
10897
10898	mode		= 0x41;
10899	delay		= 6;
10900	blocksize	= 32;
10901	readsize	= 256;
10902       ;
10903#   ATtiny24 has Signature Bytes: 0x1E 0x91 0x0B.
10904     memory "signature"
10905         size            = 3;
10906         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
10907                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10908       ;
10909     memory "lock"
10910         size            = 1;
10911         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
10912                           "x x x x  x x x x  x x x x  x x i i";
10913         read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
10914                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
10915        min_write_delay = 9000;
10916        max_write_delay = 9000;
10917       ;
10918
10919     memory "lfuse"
10920         size            = 1;
10921         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10922                           "x x x x  x x x x  i i i i  i i i i";
10923
10924         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10925                           "x x x x  x x x x  o o o o  o o o o";
10926        min_write_delay = 9000;
10927        max_write_delay = 9000;
10928       ;
10929
10930     memory "hfuse"
10931         size            = 1;
10932         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10933                           "x x x x  x x x x  i i i i  i i i i";
10934
10935         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10936                           "x x x x  x x x x  o o o o  o o o o";
10937        min_write_delay = 9000;
10938        max_write_delay = 9000;
10939       ;
10940
10941     memory "efuse"
10942         size            = 1;
10943         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10944                           "x x x x  x x x x  x x x x  x x x i";
10945
10946         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10947                           "x x x x  x x x x  o o o o  o o o o";
10948        min_write_delay = 9000;
10949        max_write_delay = 9000;
10950     ;
10951
10952     memory "calibration"
10953         size            = 1;
10954         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
10955                           "0  0  0  0   0  0  0  a0   o o o o  o o o o";
10956     ;
10957  ;
10958
10959#------------------------------------------------------------
10960# ATtiny44
10961#------------------------------------------------------------
10962
10963part
10964     id            = "t44";
10965     desc          = "ATtiny44";
10966     has_debugwire = yes;
10967     flash_instr   = 0xB4, 0x07, 0x17;
10968     eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
10969                     0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
10970                     0x99, 0xE1, 0xBB, 0xAC;
10971## no STK500 devcode in XML file, use the ATtiny45 one
10972     stk500_devcode   = 0x14;
10973##  avr910_devcode   = ?;
10974##  Try the AT90S2313 devcode:
10975     avr910_devcode   = 0x20;
10976     signature        = 0x1e 0x92 0x07;
10977     reset            = io;
10978     chip_erase_delay = 4500;
10979
10980     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10981                        "x x x x  x x x x    x x x x  x x x x";
10982
10983     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
10984                        "x x x x  x x x x    x x x x  x x x x";
10985
10986    timeout		= 200;
10987    stabdelay		= 100;
10988    cmdexedelay		= 25;
10989    synchloops		= 32;
10990    bytedelay		= 0;
10991    pollindex		= 3;
10992    pollvalue		= 0x53;
10993    predelay		= 1;
10994    postdelay		= 1;
10995    pollmethod		= 1;
10996
10997    hvsp_controlstack   =
10998        0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
10999        0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
11000        0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
11001        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F;
11002    hventerstabdelay    = 100;
11003    hvspcmdexedelay     = 0;
11004    synchcycles         = 6;
11005    latchcycles         = 1;
11006    togglevtg           = 1;
11007    poweroffdelay       = 25;
11008    resetdelayms        = 0;
11009    resetdelayus        = 70;
11010    hvleavestabdelay    = 100;
11011    resetdelay          = 25;
11012    chiperasepolltimeout = 40;
11013    chiperasetime       = 0;
11014    programfusepolltimeout = 25;
11015    programlockpolltimeout = 25;
11016
11017    ocdrev              = 1;
11018
11019     memory "eeprom"
11020         size            = 256;
11021        paged           = no;
11022        page_size       = 4;
11023         min_write_delay = 4000;
11024         max_write_delay = 4500;
11025         readback_p1     = 0xff;
11026         readback_p2     = 0xff;
11027         read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x x",
11028                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
11029
11030         write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
11031                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
11032
11033	loadpage_lo	= "  1   1   0   0      0   0   0   1",
11034			  "  0   0   0   0      0   0   0   0",
11035			  "  0   0   0   0      0   0  a1  a0",
11036			  "  i   i   i   i      i   i   i   i";
11037
11038	writepage	= "  1   1   0   0      0   0   1   0",
11039			  "  0   0   x   x      x   x   x   x",
11040			  "  x  a6  a5  a4     a3  a2   0   0",
11041			  "  x   x   x   x      x   x   x   x";
11042
11043	mode		= 0x41;
11044	delay		= 6;
11045	blocksize	= 4;
11046	readsize	= 256;
11047       ;
11048     memory "flash"
11049         paged           = yes;
11050         size            = 4096;
11051         page_size       = 64;
11052         num_pages       = 64;
11053         min_write_delay = 4500;
11054         max_write_delay = 4500;
11055         readback_p1     = 0xff;
11056         readback_p2     = 0xff;
11057         read_lo         = "  0   0   1   0    0   0   0   0",
11058                           "  0   0   0   0    0  a10 a9  a8",
11059                           " a7  a6  a5  a4   a3  a2  a1  a0",
11060                           "  o   o   o   o    o   o   o   o";
11061
11062         read_hi         = "  0   0   1   0    1   0   0   0",
11063                           "  0   0   0   0    0  a10 a9  a8",
11064                           " a7  a6  a5  a4   a3  a2  a1  a0",
11065                           "  o   o   o   o    o   o   o   o";
11066
11067         loadpage_lo     = "  0   1   0   0    0   0   0   0",
11068                           "  0   0   0   x    x   x   x   x",
11069                           "  x   x   x  a4   a3  a2  a1  a0",
11070                           "  i   i   i   i    i   i   i   i";
11071
11072         loadpage_hi     = "  0   1   0   0    1   0   0   0",
11073                           "  0   0   0   x    x   x   x   x",
11074                           "  x   x   x  a4   a3  a2  a1  a0",
11075                           "  i   i   i   i    i   i   i   i";
11076
11077         writepage       = "  0  1  0  0   1  1  0  0",
11078                           "  0  0  0  0   0 a10 a9 a8",
11079                           " a7 a6 a5  x   x  x  x  x",
11080                           "  x  x  x  x   x  x  x  x";
11081
11082	mode		= 0x41;
11083	delay		= 6;
11084	blocksize	= 32;
11085	readsize	= 256;
11086       ;
11087#   ATtiny44 has Signature Bytes: 0x1E 0x92 0x07.
11088     memory "signature"
11089         size            = 3;
11090         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
11091                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11092       ;
11093     memory "lock"
11094         size            = 1;
11095         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
11096                           "x x x x  x x x x  x x x x  x x i i";
11097         read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
11098                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
11099        min_write_delay = 9000;
11100        max_write_delay = 9000;
11101       ;
11102
11103     memory "lfuse"
11104         size            = 1;
11105         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11106                           "x x x x  x x x x  i i i i  i i i i";
11107
11108         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11109                           "x x x x  x x x x  o o o o  o o o o";
11110        min_write_delay = 9000;
11111        max_write_delay = 9000;
11112       ;
11113
11114     memory "hfuse"
11115         size            = 1;
11116         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11117                           "x x x x  x x x x  i i i i  i i i i";
11118
11119         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11120                           "x x x x  x x x x  o o o o  o o o o";
11121        min_write_delay = 9000;
11122        max_write_delay = 9000;
11123       ;
11124
11125     memory "efuse"
11126         size            = 1;
11127         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11128                           "x x x x  x x x x  x x x x  x x x i";
11129
11130         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11131                           "x x x x  x x x x  o o o o  o o o o";
11132        min_write_delay = 9000;
11133        max_write_delay = 9000;
11134     ;
11135
11136     memory "calibration"
11137         size            = 1;
11138         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
11139                           "0  0  0  0   0  0  0  a0   o o o o  o o o o";
11140     ;
11141  ;
11142
11143#------------------------------------------------------------
11144# ATtiny84
11145#------------------------------------------------------------
11146
11147part
11148     id            = "t84";
11149     desc          = "ATtiny84";
11150     has_debugwire = yes;
11151     flash_instr   = 0xB4, 0x07, 0x17;
11152     eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
11153	             0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
11154	             0x99, 0xE1, 0xBB, 0xAC;
11155## no STK500 devcode in XML file, use the ATtiny45 one
11156     stk500_devcode   = 0x14;
11157##  avr910_devcode   = ?;
11158##  Try the AT90S2313 devcode:
11159     avr910_devcode   = 0x20;
11160     signature        = 0x1e 0x93 0x0c;
11161     reset            = io;
11162     chip_erase_delay = 4500;
11163
11164     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11165                        "x x x x  x x x x    x x x x  x x x x";
11166
11167     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
11168                        "x x x x  x x x x    x x x x  x x x x";
11169
11170    timeout		= 200;
11171    stabdelay		= 100;
11172    cmdexedelay		= 25;
11173    synchloops		= 32;
11174    bytedelay		= 0;
11175    pollindex		= 3;
11176    pollvalue		= 0x53;
11177    predelay		= 1;
11178    postdelay		= 1;
11179    pollmethod		= 1;
11180
11181    hvsp_controlstack   =
11182        0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
11183        0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
11184        0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
11185        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F;
11186    hventerstabdelay    = 100;
11187    hvspcmdexedelay     = 0;
11188    synchcycles         = 6;
11189    latchcycles         = 1;
11190    togglevtg           = 1;
11191    poweroffdelay       = 25;
11192    resetdelayms        = 0;
11193    resetdelayus        = 70;
11194    hvleavestabdelay    = 100;
11195    resetdelay          = 25;
11196    chiperasepolltimeout = 40;
11197    chiperasetime       = 0;
11198    programfusepolltimeout = 25;
11199    programlockpolltimeout = 25;
11200
11201    ocdrev              = 1;
11202
11203     memory "eeprom"
11204         size            = 512;
11205        paged           = no;
11206        page_size       = 4;
11207         min_write_delay = 4000;
11208         max_write_delay = 4500;
11209         readback_p1     = 0xff;
11210         readback_p2     = 0xff;
11211         read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x a8",
11212                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
11213
11214         write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x a8",
11215                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
11216
11217	loadpage_lo	= "  1   1   0   0      0   0   0   1",
11218			  "  0   0   0   0      0   0   0   0",
11219			  "  0   0   0   0      0   0  a1  a0",
11220			  "  i   i   i   i      i   i   i   i";
11221
11222	writepage	= "  1   1   0   0      0   0   1   0",
11223			  "  0   0   x   x      x   x   x   x",
11224			  "  x  a6  a5  a4     a3  a2   0   0",
11225			  "  x   x   x   x      x   x   x   x";
11226
11227	mode		= 0x41;
11228	delay		= 6;
11229	blocksize	= 4;
11230	readsize	= 256;
11231       ;
11232     memory "flash"
11233         paged           = yes;
11234         size            = 8192;
11235         page_size       = 64;
11236         num_pages       = 128;
11237         min_write_delay = 4500;
11238         max_write_delay = 4500;
11239         readback_p1     = 0xff;
11240         readback_p2     = 0xff;
11241         read_lo         = "  0   0   1   0    0   0   0   0",
11242                           "  0   0   0   0  a11 a10  a9  a8",
11243                           " a7  a6  a5  a4   a3  a2  a1  a0",
11244                           "  o   o   o   o    o   o   o   o";
11245
11246         read_hi         = "  0   0   1   0    1   0   0   0",
11247                           "  0   0   0   0  a11 a10  a9  a8",
11248                           " a7  a6  a5  a4   a3  a2  a1  a0",
11249                           "  o   o   o   o    o   o   o   o";
11250
11251         loadpage_lo     = "  0   1   0   0    0   0   0   0",
11252                           "  0   0   0   x    x   x   x   x",
11253                           "  x   x   x  a4   a3  a2  a1  a0",
11254                           "  i   i   i   i    i   i   i   i";
11255
11256         loadpage_hi     = "  0   1   0   0    1   0   0   0",
11257                           "  0   0   0   x    x   x   x   x",
11258                           "  x   x   x  a4   a3  a2  a1  a0",
11259                           "  i   i   i   i    i   i   i   i";
11260
11261         writepage       = "  0  1  0  0   1   1   0  0",
11262                           "  0  0  0  0  a11 a10 a9 a8",
11263                           " a7 a6 a5  x   x  x  x  x",
11264                           "  x  x  x  x   x  x  x  x";
11265
11266	mode		= 0x41;
11267	delay		= 6;
11268	blocksize	= 32;
11269	readsize	= 256;
11270       ;
11271#   ATtiny84 has Signature Bytes: 0x1E 0x93 0x0C.
11272     memory "signature"
11273         size            = 3;
11274         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
11275                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11276       ;
11277
11278     memory "lock"
11279         size            = 1;
11280         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
11281                           "x x x x  x x x x  x x x x  x x i i";
11282         read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
11283                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
11284        min_write_delay = 9000;
11285        max_write_delay = 9000;
11286       ;
11287
11288     memory "lfuse"
11289         size            = 1;
11290         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11291                           "x x x x  x x x x  i i i i  i i i i";
11292
11293         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11294                           "x x x x  x x x x  o o o o  o o o o";
11295        min_write_delay = 9000;
11296        max_write_delay = 9000;
11297       ;
11298
11299     memory "hfuse"
11300         size            = 1;
11301         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11302                           "x x x x  x x x x  i i i i  i i i i";
11303
11304         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11305                           "x x x x  x x x x  o o o o  o o o o";
11306        min_write_delay = 9000;
11307        max_write_delay = 9000;
11308       ;
11309
11310     memory "efuse"
11311         size            = 1;
11312         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11313                           "x x x x  x x x x  x x x x  x x x i";
11314
11315         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11316                           "x x x x  x x x x  o o o o  o o o o";
11317        min_write_delay = 9000;
11318        max_write_delay = 9000;
11319     ;
11320
11321     memory "calibration"
11322         size            = 1;
11323         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
11324                           "0  0  0  0   0  0  0  a0   o o o o  o o o o";
11325     ;
11326  ;
11327
11328#------------------------------------------------------------
11329# ATtiny43U
11330#------------------------------------------------------------
11331
11332part
11333    id            = "t43u";
11334    desc          = "ATtiny43u";
11335    has_debugwire = yes;
11336    flash_instr   = 0xB4, 0x07, 0x17;
11337    eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
11338                         0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
11339                         0x99, 0xE1, 0xBB, 0xAC;
11340    stk500_devcode   = 0x14;
11341##  avr910_devcode   = ?;
11342##  Try the AT90S2313 devcode:
11343    avr910_devcode   = 0x20;
11344    signature        = 0x1e 0x92 0x0C;
11345    reset            = io;
11346    chip_erase_delay = 1000;
11347
11348    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11349                        "x x x x  x x x x    x x x x  x x x x";
11350
11351    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
11352                        "x x x x  x x x x    x x x x  x x x x";
11353
11354    timeout                     = 200;
11355    stabdelay           = 100;
11356    cmdexedelay         = 25;
11357    synchloops          = 32;
11358    bytedelay           = 0;
11359    pollindex           = 3;
11360    pollvalue           = 0x53;
11361    predelay            = 1;
11362    postdelay           = 1;
11363    pollmethod          = 1;
11364        pp_controlstack = 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, 0x4E, 0x5E,
11365                                         0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, 0x06, 0x16, 0x46, 0x56,
11366                                         0x0A, 0x1A, 0x4A, 0x5A, 0x1E, 0x7C, 0x00, 0x01, 0x00, 0x00,
11367                                         0x00, 0x00;
11368    hventerstabdelay    = 100;
11369    progmodedelay       = 0;
11370    hvspcmdexedelay     = 0;
11371    latchcycles         = 5;
11372    togglevtg           = 1;
11373    poweroffdelay       = 20;
11374    resetdelayms        = 1;
11375    resetdelayus        = 0;
11376    hvleavestabdelay    = 15;
11377    resetdelay          = 15;
11378    chiperasepulsewidth = 0;
11379    chiperasepolltimeout = 10;
11380    programfusepulsewidth = 0;
11381    programfusepolltimeout = 5;
11382    programlockpulsewidth = 0;
11383    programlockpolltimeout = 5;
11384    memory "eeprom"
11385                size            = 64;
11386                paged                   = yes;
11387                page_size       = 4;
11388                num_pages               = 16;
11389                min_write_delay = 4000;
11390                max_write_delay = 4500;
11391                readback_p1     = 0xff;
11392                readback_p2     = 0xff;
11393                read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x x",
11394                                   "0  0 a4  a3 a2 a1 a0   o o o o  o o o o";
11395
11396                write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
11397                                   "0  0 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
11398
11399                loadpage_lo     = "  1   1   0   0      0   0   0   1",
11400                                  "  0   0   0   0      0   0   0   0",
11401                                  "  0   0   0   0      0   0  a1  a0",
11402                                  "  i   i   i   i      i   i   i   i";
11403
11404                writepage       = "  1   1   0   0      0   0   1   0",
11405                                  "  0   0   x   x      x   x   x   x",
11406                                  "  0   0  a5  a4     a3  a2   0   0",
11407                                  "  x   x   x   x      x   x   x   x";
11408
11409                mode            = 0x41;
11410                delay           = 5;
11411                blocksize       = 4;
11412                readsize        = 256;
11413        ;
11414    memory "flash"
11415        paged           = yes;
11416        size            = 4096;
11417        page_size       = 64;
11418        num_pages       = 64;
11419        min_write_delay = 4500;
11420        max_write_delay = 4500;
11421        readback_p1     = 0xff;
11422        readback_p2     = 0xff;
11423
11424        read_lo         = "  0   0   1   0    0   0   0   0",
11425                          "  0   0   0   0    0  a10 a9  a8",
11426                          " a7  a6  a5  a4   a3  a2  a1  a0",
11427                          "  o   o   o   o    o   o   o   o";
11428
11429        read_hi         = "  0   0   1   0    1   0   0   0",
11430                          "  0   0   0   0    0  a10 a9  a8",
11431                          " a7  a6  a5  a4   a3  a2  a1  a0",
11432                          "  o   o   o   o    o   o   o   o";
11433
11434        loadpage_lo     = "  0   1   0   0    0   0   0   0",
11435                          "  0   0   0   x    x   x   x   x",
11436                          "  x   x   x  a4   a3  a2  a1  a0",
11437                          "  i   i   i   i    i   i   i   i";
11438
11439        loadpage_hi     = "  0   1   0   0    1   0   0   0",
11440                          "  0   0   0   x    x   x   x   x",
11441                          "  x   x   x  a4   a3  a2  a1  a0",
11442                          "  i   i   i   i    i   i   i   i";
11443
11444        writepage       = "  0  1  0  0   1  1  0  0",
11445                          "  0  0  0  0   0 a10 a9 a8",
11446                          " a7 a6 a5  x   x  x  x  x",
11447                          "  x  x  x  x   x  x  x  x";
11448
11449                mode            = 0x41;
11450                delay           = 10;
11451                blocksize       = 64;
11452                readsize        = 256;
11453       ;
11454    memory "signature"
11455        size            = 3;
11456        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
11457                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11458    ;
11459    memory "lock"
11460        size            = 1;
11461        write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
11462                          "x x x x  x x x x  1 1 i i  i i i i";
11463        min_write_delay = 4500;
11464        max_write_delay = 4500;
11465    ;
11466
11467    memory "lfuse"
11468        size            = 1;
11469        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11470                          "x x x x  x x x x  i i i i  i i i i";
11471
11472        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11473                          "x x x x  x x x x  o o o o  o o o o";
11474        min_write_delay = 4500;
11475        max_write_delay = 4500;
11476        ;
11477
11478    memory "hfuse"
11479        size            = 1;
11480        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11481                          "x x x x  x x x x  i i i i  i i i i";
11482
11483        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11484                          "x x x x  x x x x  o o o o  o o o o";
11485        min_write_delay = 4500;
11486        max_write_delay = 4500;
11487        ;
11488
11489    memory "efuse"
11490        size            = 1;
11491        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11492                          "x x x x  x x x x  x x x x  x x x i";
11493
11494        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11495                          "x x x x  x x x x  o o o o  o o o o";
11496        min_write_delay = 4500;
11497        max_write_delay = 4500;
11498    ;
11499
11500    memory "calibration"
11501        size            = 2;
11502        read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
11503                          "0  0  0  0   0  0  0  a0   o o o o  o o o o";
11504    ;
11505;
11506
11507#------------------------------------------------------------
11508# ATmega32u4
11509#------------------------------------------------------------
11510
11511part
11512    id               = "m32u4";
11513    desc             = "ATmega32U4";
11514    signature        = 0x1e 0x95 0x87;
11515    usbpid           = 0x2ff4;
11516    has_jtag         = yes;
11517#    stk500_devcode   = 0xB2;
11518#    avr910_devcode   = 0x43;
11519    chip_erase_delay = 9000;
11520    pagel            = 0xD7;
11521    bs2              = 0xA0;
11522    reset            = dedicated;
11523    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11524                       "x x x x  x x x x    x x x x  x x x x";
11525
11526    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
11527                       "x x x x  x x x x    x x x x  x x x x";
11528
11529    timeout		= 200;
11530    stabdelay		= 100;
11531    cmdexedelay		= 25;
11532    synchloops		= 32;
11533    bytedelay		= 0;
11534    pollindex		= 3;
11535    pollvalue		= 0x53;
11536    predelay		= 1;
11537    postdelay		= 1;
11538    pollmethod		= 1;
11539
11540    pp_controlstack     =
11541        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
11542        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
11543        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
11544        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
11545    hventerstabdelay    = 100;
11546    progmodedelay       = 0;
11547    latchcycles         = 5;
11548    togglevtg           = 1;
11549    poweroffdelay       = 15;
11550    resetdelayms        = 1;
11551    resetdelayus        = 0;
11552    hvleavestabdelay    = 15;
11553    chiperasepulsewidth = 0;
11554    chiperasepolltimeout = 10;
11555    programfusepulsewidth = 0;
11556    programfusepolltimeout = 5;
11557    programlockpulsewidth = 0;
11558    programlockpolltimeout = 5;
11559
11560    idr                 = 0x31;
11561    spmcr               = 0x57;
11562    rampz               = 0x3b;
11563    allowfullpagebitstream = no;
11564
11565    ocdrev              = 3;
11566
11567    memory "eeprom"
11568        paged           = no; /* leave this "no" */
11569        page_size       = 4;  /* for parallel programming */
11570        size            = 1024;
11571        min_write_delay = 9000;
11572        max_write_delay = 9000;
11573        readback_p1     = 0x00;
11574        readback_p2     = 0x00;
11575        read            = "  1   0   1   0      0   0   0   0",
11576                          "  x   x   x   x      x a10  a9  a8",
11577                          " a7  a6  a5  a4     a3  a2  a1  a0",
11578                          "  o   o   o   o      o   o   o   o";
11579
11580        write           = "  1   1   0   0      0   0   0   0",
11581                          "  x   x   x   x      x a10  a9  a8",
11582                          " a7  a6  a5  a4     a3  a2  a1  a0",
11583                          "  i   i   i   i      i   i   i   i";
11584
11585	loadpage_lo	= "  1   1   0   0      0   0   0   1",
11586			  "  0   0   0   0      0   0   0   0",
11587			  "  0   0   0   0      0  a2  a1  a0",
11588			  "  i   i   i   i      i   i   i   i";
11589
11590	writepage	= "  1   1   0   0      0   0   1   0",
11591			  "  0   0   x   x      x a10  a9  a8",
11592			  " a7  a6  a5  a4     a3   0   0   0",
11593			  "  x   x   x   x      x   x   x   x";
11594
11595	mode		= 0x41;
11596	delay		= 20;
11597	blocksize	= 4;
11598	readsize	= 256;
11599      ;
11600
11601    memory "flash"
11602        paged           = yes;
11603        size            = 32768;
11604        page_size       = 128;
11605        num_pages       = 256;
11606        min_write_delay = 4500;
11607        max_write_delay = 4500;
11608        readback_p1     = 0x00;
11609        readback_p2     = 0x00;
11610        read_lo         = "  0   0   1   0      0   0   0   0",
11611                          "  0 a14 a13 a12    a11 a10  a9  a8",
11612                          " a7  a6  a5  a4     a3  a2  a1  a0",
11613                          "  o   o   o   o      o   o   o   o";
11614
11615        read_hi         = "  0   0   1   0      1   0   0   0",
11616                          "  0 a14 a13 a12    a11 a10  a9  a8",
11617                          " a7  a6  a5  a4     a3  a2  a1  a0",
11618                          "  o   o   o   o      o   o   o   o";
11619
11620        loadpage_lo     = "  0   1   0   0      0   0   0   0",
11621                          "  x   x   x   x      x   x   x   x",
11622                          "  x   x  a5  a4     a3  a2  a1  a0",
11623                          "  i   i   i   i      i   i   i   i";
11624
11625        loadpage_hi     = "  0   1   0   0      1   0   0   0",
11626                          "  x   x   x   x      x   x   x   x",
11627                          "  x   x  a5  a4     a3  a2  a1  a0",
11628                          "  i   i   i   i      i   i   i   i";
11629
11630        writepage       = "  0   1   0   0      1   1   0   0",
11631                          " a15 a14 a13 a12    a11 a10  a9  a8",
11632                          " a7  a6   x   x      x   x   x   x",
11633                          "  x   x   x   x      x   x   x   x";
11634
11635	mode		= 0x41;
11636	delay		= 6;
11637	blocksize	= 128;
11638	readsize	= 256;
11639      ;
11640
11641    memory "lfuse"
11642        size            = 1;
11643        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11644                          "x x x x  x x x x  i i i i  i i i i";
11645
11646        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11647                          "x x x x  x x x x  o o o o  o o o o";
11648        min_write_delay = 9000;
11649        max_write_delay = 9000;
11650      ;
11651
11652    memory "hfuse"
11653        size            = 1;
11654        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11655                          "x x x x  x x x x  i i i i  i i i i";
11656
11657        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11658                          "x x x x  x x x x  o o o o  o o o o";
11659        min_write_delay = 9000;
11660        max_write_delay = 9000;
11661      ;
11662
11663    memory "efuse"
11664        size            = 1;
11665        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11666                          "x x x x  x x x x  x x x x  i i i i";
11667
11668        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11669                          "x x x x  x x x x  o o o o  o o o o";
11670        min_write_delay = 9000;
11671        max_write_delay = 9000;
11672      ;
11673
11674    memory "lock"
11675        size            = 1;
11676        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
11677                          "x x x x  x x x x   x x o o  o o o o";
11678
11679        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
11680                          "x x x x  x x x x   1 1 i i  i i i i";
11681        min_write_delay = 9000;
11682        max_write_delay = 9000;
11683      ;
11684
11685    memory "calibration"
11686        size            = 1;
11687        read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
11688                          "0 0 0 0  0 0 0 0    o o o o  o o o o";
11689      ;
11690
11691    memory "signature"
11692        size            = 3;
11693        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
11694                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11695      ;
11696  ;
11697
11698#------------------------------------------------------------
11699# AT90USB646
11700#------------------------------------------------------------
11701
11702part
11703    id               = "usb646";
11704    desc             = "AT90USB646";
11705    signature        = 0x1e 0x96 0x82;
11706    usbpid           = 0x2ff9;
11707    has_jtag         = yes;
11708#    stk500_devcode   = 0xB2;
11709#    avr910_devcode   = 0x43;
11710    chip_erase_delay = 9000;
11711    pagel            = 0xD7;
11712    bs2              = 0xA0;
11713    reset            = dedicated;
11714    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11715                       "x x x x  x x x x    x x x x  x x x x";
11716
11717    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
11718                       "x x x x  x x x x    x x x x  x x x x";
11719
11720    timeout		= 200;
11721    stabdelay		= 100;
11722    cmdexedelay		= 25;
11723    synchloops		= 32;
11724    bytedelay		= 0;
11725    pollindex		= 3;
11726    pollvalue		= 0x53;
11727    predelay		= 1;
11728    postdelay		= 1;
11729    pollmethod		= 1;
11730
11731    pp_controlstack     =
11732        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
11733        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
11734        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
11735        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
11736    hventerstabdelay    = 100;
11737    progmodedelay       = 0;
11738    latchcycles         = 5;
11739    togglevtg           = 1;
11740    poweroffdelay       = 15;
11741    resetdelayms        = 1;
11742    resetdelayus        = 0;
11743    hvleavestabdelay    = 15;
11744    chiperasepulsewidth = 0;
11745    chiperasepolltimeout = 10;
11746    programfusepulsewidth = 0;
11747    programfusepolltimeout = 5;
11748    programlockpulsewidth = 0;
11749    programlockpolltimeout = 5;
11750
11751    idr                 = 0x31;
11752    spmcr               = 0x57;
11753    rampz               = 0x3b;
11754    allowfullpagebitstream = no;
11755
11756    ocdrev              = 3;
11757
11758    memory "eeprom"
11759        paged           = no; /* leave this "no" */
11760        page_size       = 8;  /* for parallel programming */
11761        size            = 2048;
11762        min_write_delay = 9000;
11763        max_write_delay = 9000;
11764        readback_p1     = 0x00;
11765        readback_p2     = 0x00;
11766        read            = "  1   0   1   0      0   0   0   0",
11767                          "  x   x   x   x      x a10  a9  a8",
11768                          " a7  a6  a5  a4     a3  a2  a1  a0",
11769                          "  o   o   o   o      o   o   o   o";
11770
11771        write           = "  1   1   0   0      0   0   0   0",
11772                          "  x   x   x   x      x a10  a9  a8",
11773                          " a7  a6  a5  a4     a3  a2  a1  a0",
11774                          "  i   i   i   i      i   i   i   i";
11775
11776	loadpage_lo	= "  1   1   0   0      0   0   0   1",
11777			  "  0   0   0   0      0   0   0   0",
11778			  "  0   0   0   0      0  a2  a1  a0",
11779			  "  i   i   i   i      i   i   i   i";
11780
11781	writepage	= "  1   1   0   0      0   0   1   0",
11782			  "  0   0   x   x      x a10  a9  a8",
11783			  " a7  a6  a5  a4     a3   0   0   0",
11784			  "  x   x   x   x      x   x   x   x";
11785
11786	mode		= 0x41;
11787	delay		= 10;
11788	blocksize	= 8;
11789	readsize	= 256;
11790      ;
11791
11792    memory "flash"
11793        paged           = yes;
11794        size            = 65536;
11795        page_size       = 256;
11796        num_pages       = 256;
11797        min_write_delay = 4500;
11798        max_write_delay = 4500;
11799        readback_p1     = 0x00;
11800        readback_p2     = 0x00;
11801        read_lo         = "  0   0   1   0      0   0   0   0",
11802                          "  0 a14 a13 a12    a11 a10  a9  a8",
11803                          " a7  a6  a5  a4     a3  a2  a1  a0",
11804                          "  o   o   o   o      o   o   o   o";
11805
11806        read_hi         = "  0   0   1   0      1   0   0   0",
11807                          "  0 a14 a13 a12    a11 a10  a9  a8",
11808                          " a7  a6  a5  a4     a3  a2  a1  a0",
11809                          "  o   o   o   o      o   o   o   o";
11810
11811        loadpage_lo     = "  0   1   0   0      0   0   0   0",
11812                          "  x   x   x   x      x   x   x   x",
11813                          "  x  a6  a5  a4     a3  a2  a1  a0",
11814                          "  i   i   i   i      i   i   i   i";
11815
11816        loadpage_hi     = "  0   1   0   0      1   0   0   0",
11817                          "  x   x   x   x      x   x   x   x",
11818                          "  x  a6  a5  a4     a3  a2  a1  a0",
11819                          "  i   i   i   i      i   i   i   i";
11820
11821        writepage       = "  0   1   0   0      1   1   0   0",
11822                          "  0 a14 a13 a12    a11 a10  a9  a8",
11823                          " a7   x   x   x      x   x   x   x",
11824                          "  x   x   x   x      x   x   x   x";
11825
11826	mode		= 0x41;
11827	delay		= 6;
11828	blocksize	= 256;
11829	readsize	= 256;
11830      ;
11831
11832    memory "lfuse"
11833        size            = 1;
11834        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11835                          "x x x x  x x x x  i i i i  i i i i";
11836
11837        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11838                          "x x x x  x x x x  o o o o  o o o o";
11839        min_write_delay = 9000;
11840        max_write_delay = 9000;
11841      ;
11842
11843    memory "hfuse"
11844        size            = 1;
11845        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11846                          "x x x x  x x x x  i i i i  i i i i";
11847
11848        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11849                          "x x x x  x x x x  o o o o  o o o o";
11850        min_write_delay = 9000;
11851        max_write_delay = 9000;
11852      ;
11853
11854    memory "efuse"
11855        size            = 1;
11856        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11857                          "x x x x  x x x x  x x x x  i i i i";
11858
11859        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11860                          "x x x x  x x x x  o o o o  o o o o";
11861        min_write_delay = 9000;
11862        max_write_delay = 9000;
11863      ;
11864
11865    memory "lock"
11866        size            = 1;
11867        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
11868                          "x x x x  x x x x   x x o o  o o o o";
11869
11870        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
11871                          "x x x x  x x x x   1 1 i i  i i i i";
11872        min_write_delay = 9000;
11873        max_write_delay = 9000;
11874      ;
11875
11876    memory "calibration"
11877        size            = 1;
11878        read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
11879                          "0 0 0 0  0 0 0 0    o o o o  o o o o";
11880      ;
11881
11882    memory "signature"
11883        size            = 3;
11884        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
11885                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11886      ;
11887  ;
11888
11889#------------------------------------------------------------
11890# AT90USB647
11891#------------------------------------------------------------
11892# identical to AT90USB646
11893
11894part parent "usb646"
11895    id               = "usb647";
11896    desc             = "AT90USB647";
11897    signature        = 0x1e 0x96 0x82;
11898
11899    ocdrev              = 3;
11900  ;
11901
11902#------------------------------------------------------------
11903# AT90USB1286
11904#------------------------------------------------------------
11905
11906part
11907    id               = "usb1286";
11908    desc             = "AT90USB1286";
11909    signature        = 0x1e 0x97 0x82;
11910    usbpid           = 0x2ffb;
11911    has_jtag         = yes;
11912#    stk500_devcode   = 0xB2;
11913#    avr910_devcode   = 0x43;
11914    chip_erase_delay = 9000;
11915    pagel            = 0xD7;
11916    bs2              = 0xA0;
11917    reset            = dedicated;
11918    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11919                       "x x x x  x x x x    x x x x  x x x x";
11920
11921    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
11922                       "x x x x  x x x x    x x x x  x x x x";
11923
11924    timeout		= 200;
11925    stabdelay		= 100;
11926    cmdexedelay		= 25;
11927    synchloops		= 32;
11928    bytedelay		= 0;
11929    pollindex		= 3;
11930    pollvalue		= 0x53;
11931    predelay		= 1;
11932    postdelay		= 1;
11933    pollmethod		= 1;
11934
11935    pp_controlstack     =
11936        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
11937        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
11938        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
11939        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
11940    hventerstabdelay    = 100;
11941    progmodedelay       = 0;
11942    latchcycles         = 5;
11943    togglevtg           = 1;
11944    poweroffdelay       = 15;
11945    resetdelayms        = 1;
11946    resetdelayus        = 0;
11947    hvleavestabdelay    = 15;
11948    chiperasepulsewidth = 0;
11949    chiperasepolltimeout = 10;
11950    programfusepulsewidth = 0;
11951    programfusepolltimeout = 5;
11952    programlockpulsewidth = 0;
11953    programlockpolltimeout = 5;
11954
11955    idr                 = 0x31;
11956    spmcr               = 0x57;
11957    rampz               = 0x3b;
11958    allowfullpagebitstream = no;
11959
11960    ocdrev              = 3;
11961
11962    memory "eeprom"
11963        paged           = no; /* leave this "no" */
11964        page_size       = 8;  /* for parallel programming */
11965        size            = 4096;
11966        min_write_delay = 9000;
11967        max_write_delay = 9000;
11968        readback_p1     = 0x00;
11969        readback_p2     = 0x00;
11970        read            = "  1   0   1   0      0   0   0   0",
11971                          "  x   x   x   x    a11 a10  a9  a8",
11972                          " a7  a6  a5  a4     a3  a2  a1  a0",
11973                          "  o   o   o   o      o   o   o   o";
11974
11975        write           = "  1   1   0   0      0   0   0   0",
11976                          "  x   x   x   x    a11 a10  a9  a8",
11977                          " a7  a6  a5  a4     a3  a2  a1  a0",
11978                          "  i   i   i   i      i   i   i   i";
11979
11980	loadpage_lo	= "  1   1   0   0      0   0   0   1",
11981			  "  0   0   0   0      0   0   0   0",
11982			  "  0   0   0   0      0  a2  a1  a0",
11983			  "  i   i   i   i      i   i   i   i";
11984
11985	writepage	= "  1   1   0   0      0   0   1   0",
11986			  "  0   0   x   x      x a10  a9  a8",
11987			  " a7  a6  a5  a4     a3   0   0   0",
11988			  "  x   x   x   x      x   x   x   x";
11989
11990	mode		= 0x41;
11991	delay		= 10;
11992	blocksize	= 8;
11993	readsize	= 256;
11994      ;
11995
11996    memory "flash"
11997        paged           = yes;
11998        size            = 131072;
11999        page_size       = 256;
12000        num_pages       = 512;
12001        min_write_delay = 4500;
12002        max_write_delay = 4500;
12003        readback_p1     = 0x00;
12004        readback_p2     = 0x00;
12005        read_lo         = "  0   0   1   0      0   0   0   0",
12006                          "a15 a14 a13 a12    a11 a10  a9  a8",
12007                          " a7  a6  a5  a4     a3  a2  a1  a0",
12008                          "  o   o   o   o      o   o   o   o";
12009
12010        read_hi         = "  0   0   1   0      1   0   0   0",
12011                          "a15 a14 a13 a12    a11 a10  a9  a8",
12012                          " a7  a6  a5  a4     a3  a2  a1  a0",
12013                          "  o   o   o   o      o   o   o   o";
12014
12015        loadpage_lo     = "  0   1   0   0      0   0   0   0",
12016                          "  x   x   x   x      x   x   x   x",
12017                          "  x  a6  a5  a4     a3  a2  a1  a0",
12018                          "  i   i   i   i      i   i   i   i";
12019
12020        loadpage_hi     = "  0   1   0   0      1   0   0   0",
12021                          "  x   x   x   x      x   x   x   x",
12022                          "  x  a6  a5  a4     a3  a2  a1  a0",
12023                          "  i   i   i   i      i   i   i   i";
12024
12025        writepage       = "  0   1   0   0      1   1   0   0",
12026                          "a15 a14 a13 a12    a11 a10  a9  a8",
12027                          " a7   x   x   x      x   x   x   x",
12028                          "  x   x   x   x      x   x   x   x";
12029
12030	mode		= 0x41;
12031	delay		= 6;
12032	blocksize	= 256;
12033	readsize	= 256;
12034      ;
12035
12036    memory "lfuse"
12037        size            = 1;
12038        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12039                          "x x x x  x x x x  i i i i  i i i i";
12040
12041        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12042                          "x x x x  x x x x  o o o o  o o o o";
12043        min_write_delay = 9000;
12044        max_write_delay = 9000;
12045      ;
12046
12047    memory "hfuse"
12048        size            = 1;
12049        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12050                          "x x x x  x x x x  i i i i  i i i i";
12051
12052        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12053                          "x x x x  x x x x  o o o o  o o o o";
12054        min_write_delay = 9000;
12055        max_write_delay = 9000;
12056      ;
12057
12058    memory "efuse"
12059        size            = 1;
12060        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12061                          "x x x x  x x x x  x x x x  i i i i";
12062
12063        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12064                          "x x x x  x x x x  o o o o  o o o o";
12065        min_write_delay = 9000;
12066        max_write_delay = 9000;
12067      ;
12068
12069    memory "lock"
12070        size            = 1;
12071        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12072                          "x x x x  x x x x   x x o o  o o o o";
12073
12074        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12075                          "x x x x  x x x x   1 1 i i  i i i i";
12076        min_write_delay = 9000;
12077        max_write_delay = 9000;
12078      ;
12079
12080    memory "calibration"
12081        size            = 1;
12082        read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
12083                          "0 0 0 0  0 0 0 0    o o o o  o o o o";
12084      ;
12085
12086    memory "signature"
12087        size            = 3;
12088        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
12089                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12090      ;
12091  ;
12092
12093#------------------------------------------------------------
12094# AT90USB1287
12095#------------------------------------------------------------
12096# identical to AT90USB1286
12097
12098part parent "usb1286"
12099    id               = "usb1287";
12100    desc             = "AT90USB1287";
12101    signature        = 0x1e 0x97 0x82;
12102
12103    ocdrev              = 3;
12104  ;
12105
12106#------------------------------------------------------------
12107# AT90USB162
12108#------------------------------------------------------------
12109
12110part
12111    id               = "usb162";
12112    desc             = "AT90USB162";
12113    has_jtag         = no;
12114    has_debugwire    = yes;
12115    signature        = 0x1e 0x94 0x82;
12116    usbpid           = 0x2ffa;
12117    chip_erase_delay = 9000;
12118    reset            = io;
12119    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12120                       "x x x x  x x x x    x x x x  x x x x";
12121    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12122                       "x x x x  x x x x    x x x x  x x x x";
12123    pagel            = 0xD7;
12124    bs2              = 0xC6;
12125
12126    timeout		= 200;
12127    stabdelay		= 100;
12128    cmdexedelay		= 25;
12129    synchloops		= 32;
12130    bytedelay		= 0;
12131    pollindex		= 3;
12132    pollvalue		= 0x53;
12133    predelay		= 1;
12134    postdelay		= 1;
12135    pollmethod		= 1;
12136    pp_controlstack     =
12137        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12138        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12139        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12140        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
12141    hventerstabdelay    = 100;
12142    progmodedelay       = 0;
12143    latchcycles         = 5;
12144    togglevtg           = 1;
12145    poweroffdelay       = 15;
12146    resetdelayms        = 1;
12147    resetdelayus        = 0;
12148    hvleavestabdelay    = 15;
12149    chiperasepulsewidth = 0;
12150    chiperasepolltimeout = 10;
12151    programfusepulsewidth = 0;
12152    programfusepolltimeout = 5;
12153    programlockpulsewidth = 0;
12154    programlockpolltimeout = 5;
12155
12156    ocdrev              = 1;
12157
12158    memory "eeprom"
12159        paged           = no; /* leave this "no" */
12160        page_size       = 4;  /* for parallel programming */
12161        size            = 512;
12162        num_pages       = 128;
12163        min_write_delay = 9000;
12164        max_write_delay = 9000;
12165        readback_p1     = 0x00;
12166        readback_p2     = 0x00;
12167        read            = "  1   0   1   0      0   0   0   0",
12168                          "  0   0   0   0    a11 a10  a9  a8",
12169                          " a7  a6  a5  a4     a3  a2  a1  a0",
12170                          "  o   o   o   o      o   o   o   o";
12171
12172        write           = "  1   1   0   0      0   0   0   0",
12173                          "  0   0   0   0    a11 a10  a9  a8",
12174                          " a7  a6  a5  a4     a3  a2  a1  a0",
12175                          "  i   i   i   i      i   i   i   i";
12176
12177	loadpage_lo	= "  1   1   0   0      0   0   0   1",
12178			  "  0   0   0   0      0   0   0   0",
12179			  "  0   0   0   0      0   0  a1  a0",
12180			  "  i   i   i   i      i   i   i   i";
12181
12182	writepage	= "  1   1   0   0      0   0   1   0",
12183                          "  0   0   0   0    a11 a10  a9  a8",
12184                          " a7  a6  a5  a4     a3  a2   0   0",
12185			  "  x   x   x   x      x   x   x   x";
12186
12187	mode		= 0x41;
12188	delay		= 20;
12189	blocksize	= 4;
12190	readsize	= 256;
12191      ;
12192
12193    memory "flash"
12194        paged           = yes;
12195        size            = 16384;
12196        page_size       = 128;
12197        num_pages       = 128;
12198        min_write_delay = 4500;
12199        max_write_delay = 4500;
12200        readback_p1     = 0x00;
12201        readback_p2     = 0x00;
12202        read_lo         = "  0   0   1   0      0   0   0   0",
12203                          "a15 a14 a13 a12    a11 a10  a9  a8",
12204                          " a7  a6  a5  a4     a3  a2  a1  a0",
12205                          "  o   o   o   o      o   o   o   o";
12206
12207        read_hi         = "  0   0   1   0      1   0   0   0",
12208                          "a15 a14 a13 a12    a11 a10  a9  a8",
12209                          " a7  a6  a5  a4     a3  a2  a1  a0",
12210                          "  o   o   o   o      o   o   o   o";
12211
12212        loadpage_lo     = "  0   1   0   0      0   0   0   0",
12213                          "  x   x   x   x      x   x   x   x",
12214                          "  x   x  a5  a4     a3  a2  a1  a0",
12215                          "  i   i   i   i      i   i   i   i";
12216
12217        loadpage_hi     = "  0   1   0   0      1   0   0   0",
12218                          "  x   x   x   x      x   x   x   x",
12219                          "  x   x  a5  a4     a3  a2  a1  a0",
12220                          "  i   i   i   i      i   i   i   i";
12221
12222        writepage       = "  0   1   0   0      1   1   0   0",
12223                          "a15 a14 a13 a12    a11 a10  a9  a8",
12224                          " a7  a6   x   x      x   x   x   x",
12225                          "  x   x   x   x      x   x   x   x";
12226
12227	mode		= 0x41;
12228	delay		= 6;
12229	blocksize	= 128;
12230	readsize	= 256;
12231      ;
12232
12233    memory "lfuse"
12234        size            = 1;
12235        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12236                          "x x x x  x x x x  i i i i  i i i i";
12237
12238        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12239                          "x x x x  x x x x  o o o o  o o o o";
12240        min_write_delay = 9000;
12241        max_write_delay = 9000;
12242      ;
12243
12244    memory "hfuse"
12245        size            = 1;
12246        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12247                          "x x x x  x x x x  i i i i  i i i i";
12248
12249        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12250                          "x x x x  x x x x  o o o o  o o o o";
12251        min_write_delay = 9000;
12252        max_write_delay = 9000;
12253      ;
12254
12255    memory "efuse"
12256        size            = 1;
12257        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12258                          "x x x x  x x x x  i i i i  i i i i";
12259
12260        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12261                          "x x x x  x x x x  o o o o  o o o o";
12262        min_write_delay = 9000;
12263        max_write_delay = 9000;
12264      ;
12265
12266    memory "lock"
12267        size            = 1;
12268        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12269                          "x x x x  x x x x   x x o o  o o o o";
12270
12271        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12272                          "x x x x  x x x x   1 1 i i  i i i i";
12273        min_write_delay = 9000;
12274        max_write_delay = 9000;
12275      ;
12276
12277    memory "calibration"
12278        size            = 1;
12279        read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
12280                          "0 0 0 0  0 0 0 0    o o o o  o o o o";
12281      ;
12282    memory "signature"
12283        size            = 3;
12284        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
12285                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12286      ;
12287  ;
12288
12289#------------------------------------------------------------
12290# AT90USB82
12291#------------------------------------------------------------
12292# Changes against AT90USB162 (beside IDs)
12293#    memory "flash"
12294#        size            = 8192;
12295#        num_pages       = 64;
12296
12297part
12298    id               = "usb82";
12299    desc             = "AT90USB82";
12300    has_jtag         = no;
12301    has_debugwire    = yes;
12302    signature        = 0x1e 0x93 0x82;
12303    usbpid           = 0x2ff7;
12304    chip_erase_delay = 9000;
12305    reset            = io;
12306    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12307                       "x x x x  x x x x    x x x x  x x x x";
12308    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12309                       "x x x x  x x x x    x x x x  x x x x";
12310    pagel            = 0xD7;
12311    bs2              = 0xC6;
12312
12313    timeout		= 200;
12314    stabdelay		= 100;
12315    cmdexedelay		= 25;
12316    synchloops		= 32;
12317    bytedelay		= 0;
12318    pollindex		= 3;
12319    pollvalue		= 0x53;
12320    predelay		= 1;
12321    postdelay		= 1;
12322    pollmethod		= 1;
12323    pp_controlstack     =
12324        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12325        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12326        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12327        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
12328    hventerstabdelay    = 100;
12329    progmodedelay       = 0;
12330    latchcycles         = 5;
12331    togglevtg           = 1;
12332    poweroffdelay       = 15;
12333    resetdelayms        = 1;
12334    resetdelayus        = 0;
12335    hvleavestabdelay    = 15;
12336    chiperasepulsewidth = 0;
12337    chiperasepolltimeout = 10;
12338    programfusepulsewidth = 0;
12339    programfusepolltimeout = 5;
12340    programlockpulsewidth = 0;
12341    programlockpolltimeout = 5;
12342
12343    ocdrev              = 1;
12344
12345    memory "eeprom"
12346        paged           = no; /* leave this "no" */
12347        page_size       = 4;  /* for parallel programming */
12348        size            = 512;
12349        num_pages       = 128;
12350        min_write_delay = 9000;
12351        max_write_delay = 9000;
12352        readback_p1     = 0x00;
12353        readback_p2     = 0x00;
12354        read            = "  1   0   1   0      0   0   0   0",
12355                          "  0   0   0   0    a11 a10  a9  a8",
12356                          " a7  a6  a5  a4     a3  a2  a1  a0",
12357                          "  o   o   o   o      o   o   o   o";
12358
12359        write           = "  1   1   0   0      0   0   0   0",
12360                          "  0   0   0   0    a11 a10  a9  a8",
12361                          " a7  a6  a5  a4     a3  a2  a1  a0",
12362                          "  i   i   i   i      i   i   i   i";
12363
12364	loadpage_lo	= "  1   1   0   0      0   0   0   1",
12365			  "  0   0   0   0      0   0   0   0",
12366			  "  0   0   0   0      0   0  a1  a0",
12367			  "  i   i   i   i      i   i   i   i";
12368
12369	writepage	= "  1   1   0   0      0   0   1   0",
12370                          "  0   0   0   0    a11 a10  a9  a8",
12371                          " a7  a6  a5  a4     a3  a2   0   0",
12372			  "  x   x   x   x      x   x   x   x";
12373
12374	mode		= 0x41;
12375	delay		= 20;
12376	blocksize	= 4;
12377	readsize	= 256;
12378      ;
12379
12380    memory "flash"
12381        paged           = yes;
12382        size            = 8192;
12383        page_size       = 128;
12384        num_pages       = 64;
12385        min_write_delay = 4500;
12386        max_write_delay = 4500;
12387        readback_p1     = 0x00;
12388        readback_p2     = 0x00;
12389        read_lo         = "  0   0   1   0      0   0   0   0",
12390                          "a15 a14 a13 a12    a11 a10  a9  a8",
12391                          " a7  a6  a5  a4     a3  a2  a1  a0",
12392                          "  o   o   o   o      o   o   o   o";
12393
12394        read_hi         = "  0   0   1   0      1   0   0   0",
12395                          "a15 a14 a13 a12    a11 a10  a9  a8",
12396                          " a7  a6  a5  a4     a3  a2  a1  a0",
12397                          "  o   o   o   o      o   o   o   o";
12398
12399        loadpage_lo     = "  0   1   0   0      0   0   0   0",
12400                          "  x   x   x   x      x   x   x   x",
12401                          "  x   x  a5  a4     a3  a2  a1  a0",
12402                          "  i   i   i   i      i   i   i   i";
12403
12404        loadpage_hi     = "  0   1   0   0      1   0   0   0",
12405                          "  x   x   x   x      x   x   x   x",
12406                          "  x   x  a5  a4     a3  a2  a1  a0",
12407                          "  i   i   i   i      i   i   i   i";
12408
12409        writepage       = "  0   1   0   0      1   1   0   0",
12410                          "a15 a14 a13 a12    a11 a10  a9  a8",
12411                          " a7  a6   x   x      x   x   x   x",
12412                          "  x   x   x   x      x   x   x   x";
12413
12414	mode		= 0x41;
12415	delay		= 6;
12416	blocksize	= 128;
12417	readsize	= 256;
12418      ;
12419
12420    memory "lfuse"
12421        size            = 1;
12422        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12423                          "x x x x  x x x x  i i i i  i i i i";
12424
12425        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12426                          "x x x x  x x x x  o o o o  o o o o";
12427        min_write_delay = 9000;
12428        max_write_delay = 9000;
12429      ;
12430
12431    memory "hfuse"
12432        size            = 1;
12433        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12434                          "x x x x  x x x x  i i i i  i i i i";
12435
12436        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12437                          "x x x x  x x x x  o o o o  o o o o";
12438        min_write_delay = 9000;
12439        max_write_delay = 9000;
12440      ;
12441
12442    memory "efuse"
12443        size            = 1;
12444        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12445                          "x x x x  x x x x  i i i i  i i i i";
12446
12447        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12448                          "x x x x  x x x x  o o o o  o o o o";
12449        min_write_delay = 9000;
12450        max_write_delay = 9000;
12451      ;
12452
12453    memory "lock"
12454        size            = 1;
12455        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12456                          "x x x x  x x x x   x x o o  o o o o";
12457
12458        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12459                          "x x x x  x x x x   1 1 i i  i i i i";
12460        min_write_delay = 9000;
12461        max_write_delay = 9000;
12462      ;
12463
12464    memory "calibration"
12465        size            = 1;
12466        read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
12467                          "0 0 0 0  0 0 0 0    o o o o  o o o o";
12468      ;
12469    memory "signature"
12470        size            = 3;
12471        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
12472                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12473      ;
12474  ;
12475
12476#------------------------------------------------------------
12477# ATmega32U2
12478#------------------------------------------------------------
12479# Changes against AT90USB162 (beside IDs)
12480#    memory "flash"
12481#        size            = 32768;
12482#        num_pages       = 256;
12483#    memory "eeprom"
12484#        size            = 1024;
12485#        num_pages       = 256;
12486part
12487    id               = "m32u2";
12488    desc             = "ATmega32U2";
12489    has_jtag         = no;
12490    has_debugwire    = yes;
12491    signature        = 0x1e 0x95 0x8a;
12492    usbpid           = 0x2ff0;
12493    chip_erase_delay = 9000;
12494    reset            = io;
12495    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12496                       "x x x x  x x x x    x x x x  x x x x";
12497    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12498                       "x x x x  x x x x    x x x x  x x x x";
12499    pagel            = 0xD7;
12500    bs2              = 0xC6;
12501
12502    timeout		= 200;
12503    stabdelay		= 100;
12504    cmdexedelay		= 25;
12505    synchloops		= 32;
12506    bytedelay		= 0;
12507    pollindex		= 3;
12508    pollvalue		= 0x53;
12509    predelay		= 1;
12510    postdelay		= 1;
12511    pollmethod		= 1;
12512    pp_controlstack     =
12513        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12514        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12515        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12516        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
12517    hventerstabdelay    = 100;
12518    progmodedelay       = 0;
12519    latchcycles         = 5;
12520    togglevtg           = 1;
12521    poweroffdelay       = 15;
12522    resetdelayms        = 1;
12523    resetdelayus        = 0;
12524    hvleavestabdelay    = 15;
12525    chiperasepulsewidth = 0;
12526    chiperasepolltimeout = 10;
12527    programfusepulsewidth = 0;
12528    programfusepolltimeout = 5;
12529    programlockpulsewidth = 0;
12530    programlockpolltimeout = 5;
12531
12532    ocdrev              = 1;
12533
12534    memory "eeprom"
12535        paged           = no; /* leave this "no" */
12536        page_size       = 4;  /* for parallel programming */
12537        size            = 1024;
12538        num_pages       = 256;
12539        min_write_delay = 9000;
12540        max_write_delay = 9000;
12541        readback_p1     = 0x00;
12542        readback_p2     = 0x00;
12543        read            = "  1   0   1   0      0   0   0   0",
12544                          "  0   0   0   0    a11 a10  a9  a8",
12545                          " a7  a6  a5  a4     a3  a2  a1  a0",
12546                          "  o   o   o   o      o   o   o   o";
12547
12548        write           = "  1   1   0   0      0   0   0   0",
12549                          "  0   0   0   0    a11 a10  a9  a8",
12550                          " a7  a6  a5  a4     a3  a2  a1  a0",
12551                          "  i   i   i   i      i   i   i   i";
12552
12553	loadpage_lo	= "  1   1   0   0      0   0   0   1",
12554			  "  0   0   0   0      0   0   0   0",
12555			  "  0   0   0   0      0   0  a1  a0",
12556			  "  i   i   i   i      i   i   i   i";
12557
12558	writepage	= "  1   1   0   0      0   0   1   0",
12559                          "  0   0   0   0    a11 a10  a9  a8",
12560                          " a7  a6  a5  a4     a3  a2   0   0",
12561			  "  x   x   x   x      x   x   x   x";
12562
12563	mode		= 0x41;
12564	delay		= 20;
12565	blocksize	= 4;
12566	readsize	= 256;
12567      ;
12568
12569    memory "flash"
12570        paged           = yes;
12571        size            = 32768;
12572        page_size       = 128;
12573        num_pages       = 256;
12574        min_write_delay = 4500;
12575        max_write_delay = 4500;
12576        readback_p1     = 0x00;
12577        readback_p2     = 0x00;
12578        read_lo         = "  0   0   1   0      0   0   0   0",
12579                          "a15 a14 a13 a12    a11 a10  a9  a8",
12580                          " a7  a6  a5  a4     a3  a2  a1  a0",
12581                          "  o   o   o   o      o   o   o   o";
12582
12583        read_hi         = "  0   0   1   0      1   0   0   0",
12584                          "a15 a14 a13 a12    a11 a10  a9  a8",
12585                          " a7  a6  a5  a4     a3  a2  a1  a0",
12586                          "  o   o   o   o      o   o   o   o";
12587
12588        loadpage_lo     = "  0   1   0   0      0   0   0   0",
12589                          "  x   x   x   x      x   x   x   x",
12590                          "  x   x  a5  a4     a3  a2  a1  a0",
12591                          "  i   i   i   i      i   i   i   i";
12592
12593        loadpage_hi     = "  0   1   0   0      1   0   0   0",
12594                          "  x   x   x   x      x   x   x   x",
12595                          "  x   x  a5  a4     a3  a2  a1  a0",
12596                          "  i   i   i   i      i   i   i   i";
12597
12598        writepage       = "  0   1   0   0      1   1   0   0",
12599                          "a15 a14 a13 a12    a11 a10  a9  a8",
12600                          " a7  a6   x   x      x   x   x   x",
12601                          "  x   x   x   x      x   x   x   x";
12602
12603	mode		= 0x41;
12604	delay		= 6;
12605	blocksize	= 128;
12606	readsize	= 256;
12607      ;
12608
12609    memory "lfuse"
12610        size            = 1;
12611        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12612                          "x x x x  x x x x  i i i i  i i i i";
12613
12614        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12615                          "x x x x  x x x x  o o o o  o o o o";
12616        min_write_delay = 9000;
12617        max_write_delay = 9000;
12618      ;
12619
12620    memory "hfuse"
12621        size            = 1;
12622        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12623                          "x x x x  x x x x  i i i i  i i i i";
12624
12625        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12626                          "x x x x  x x x x  o o o o  o o o o";
12627        min_write_delay = 9000;
12628        max_write_delay = 9000;
12629      ;
12630
12631    memory "efuse"
12632        size            = 1;
12633        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12634                          "x x x x  x x x x  i i i i  i i i i";
12635
12636        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12637                          "x x x x  x x x x  o o o o  o o o o";
12638        min_write_delay = 9000;
12639        max_write_delay = 9000;
12640      ;
12641
12642    memory "lock"
12643        size            = 1;
12644        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12645                          "x x x x  x x x x   x x o o  o o o o";
12646
12647        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12648                          "x x x x  x x x x   1 1 i i  i i i i";
12649        min_write_delay = 9000;
12650        max_write_delay = 9000;
12651      ;
12652
12653    memory "calibration"
12654        size            = 1;
12655        read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
12656                          "0 0 0 0  0 0 0 0    o o o o  o o o o";
12657      ;
12658    memory "signature"
12659        size            = 3;
12660        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
12661                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12662      ;
12663  ;
12664#------------------------------------------------------------
12665# ATmega16U2
12666#------------------------------------------------------------
12667# Changes against ATmega32U2 (beside IDs)
12668#    memory "flash"
12669#        size            = 16384;
12670#        num_pages       = 128;
12671#    memory "eeprom"
12672#        size            = 512;
12673#        num_pages       = 128;
12674part
12675    id               = "m16u2";
12676    desc             = "ATmega16U2";
12677    has_jtag         = no;
12678    has_debugwire    = yes;
12679    signature        = 0x1e 0x94 0x89;
12680    usbpid           = 0x2fef;
12681    chip_erase_delay = 9000;
12682    reset            = io;
12683    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12684                       "x x x x  x x x x    x x x x  x x x x";
12685    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12686                       "x x x x  x x x x    x x x x  x x x x";
12687    pagel            = 0xD7;
12688    bs2              = 0xC6;
12689
12690    timeout		= 200;
12691    stabdelay		= 100;
12692    cmdexedelay		= 25;
12693    synchloops		= 32;
12694    bytedelay		= 0;
12695    pollindex		= 3;
12696    pollvalue		= 0x53;
12697    predelay		= 1;
12698    postdelay		= 1;
12699    pollmethod		= 1;
12700    pp_controlstack     =
12701        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12702        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12703        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12704        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
12705    hventerstabdelay    = 100;
12706    progmodedelay       = 0;
12707    latchcycles         = 5;
12708    togglevtg           = 1;
12709    poweroffdelay       = 15;
12710    resetdelayms        = 1;
12711    resetdelayus        = 0;
12712    hvleavestabdelay    = 15;
12713    chiperasepulsewidth = 0;
12714    chiperasepolltimeout = 10;
12715    programfusepulsewidth = 0;
12716    programfusepolltimeout = 5;
12717    programlockpulsewidth = 0;
12718    programlockpolltimeout = 5;
12719
12720    ocdrev              = 1;
12721
12722    memory "eeprom"
12723        paged           = no; /* leave this "no" */
12724        page_size       = 4;  /* for parallel programming */
12725        size            = 512;
12726        num_pages       = 128;
12727        min_write_delay = 9000;
12728        max_write_delay = 9000;
12729        readback_p1     = 0x00;
12730        readback_p2     = 0x00;
12731        read            = "  1   0   1   0      0   0   0   0",
12732                          "  0   0   0   0    a11 a10  a9  a8",
12733                          " a7  a6  a5  a4     a3  a2  a1  a0",
12734                          "  o   o   o   o      o   o   o   o";
12735
12736        write           = "  1   1   0   0      0   0   0   0",
12737                          "  0   0   0   0    a11 a10  a9  a8",
12738                          " a7  a6  a5  a4     a3  a2  a1  a0",
12739                          "  i   i   i   i      i   i   i   i";
12740
12741	loadpage_lo	= "  1   1   0   0      0   0   0   1",
12742			  "  0   0   0   0      0   0   0   0",
12743			  "  0   0   0   0      0   0  a1  a0",
12744			  "  i   i   i   i      i   i   i   i";
12745
12746	writepage	= "  1   1   0   0      0   0   1   0",
12747                          "  0   0   0   0    a11 a10  a9  a8",
12748                          " a7  a6  a5  a4     a3  a2   0   0",
12749			  "  x   x   x   x      x   x   x   x";
12750
12751	mode		= 0x41;
12752	delay		= 20;
12753	blocksize	= 4;
12754	readsize	= 256;
12755      ;
12756
12757    memory "flash"
12758        paged           = yes;
12759        size            = 16384;
12760        page_size       = 128;
12761        num_pages       = 128;
12762        min_write_delay = 4500;
12763        max_write_delay = 4500;
12764        readback_p1     = 0x00;
12765        readback_p2     = 0x00;
12766        read_lo         = "  0   0   1   0      0   0   0   0",
12767                          "a15 a14 a13 a12    a11 a10  a9  a8",
12768                          " a7  a6  a5  a4     a3  a2  a1  a0",
12769                          "  o   o   o   o      o   o   o   o";
12770
12771        read_hi         = "  0   0   1   0      1   0   0   0",
12772                          "a15 a14 a13 a12    a11 a10  a9  a8",
12773                          " a7  a6  a5  a4     a3  a2  a1  a0",
12774                          "  o   o   o   o      o   o   o   o";
12775
12776        loadpage_lo     = "  0   1   0   0      0   0   0   0",
12777                          "  x   x   x   x      x   x   x   x",
12778                          "  x   x  a5  a4     a3  a2  a1  a0",
12779                          "  i   i   i   i      i   i   i   i";
12780
12781        loadpage_hi     = "  0   1   0   0      1   0   0   0",
12782                          "  x   x   x   x      x   x   x   x",
12783                          "  x   x  a5  a4     a3  a2  a1  a0",
12784                          "  i   i   i   i      i   i   i   i";
12785
12786        writepage       = "  0   1   0   0      1   1   0   0",
12787                          "a15 a14 a13 a12    a11 a10  a9  a8",
12788                          " a7  a6   x   x      x   x   x   x",
12789                          "  x   x   x   x      x   x   x   x";
12790
12791	mode		= 0x41;
12792	delay		= 6;
12793	blocksize	= 128;
12794	readsize	= 256;
12795      ;
12796
12797    memory "lfuse"
12798        size            = 1;
12799        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12800                          "x x x x  x x x x  i i i i  i i i i";
12801
12802        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12803                          "x x x x  x x x x  o o o o  o o o o";
12804        min_write_delay = 9000;
12805        max_write_delay = 9000;
12806      ;
12807
12808    memory "hfuse"
12809        size            = 1;
12810        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12811                          "x x x x  x x x x  i i i i  i i i i";
12812
12813        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12814                          "x x x x  x x x x  o o o o  o o o o";
12815        min_write_delay = 9000;
12816        max_write_delay = 9000;
12817      ;
12818
12819    memory "efuse"
12820        size            = 1;
12821        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12822                          "x x x x  x x x x  i i i i  i i i i";
12823
12824        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12825                          "x x x x  x x x x  o o o o  o o o o";
12826        min_write_delay = 9000;
12827        max_write_delay = 9000;
12828      ;
12829
12830    memory "lock"
12831        size            = 1;
12832        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12833                          "x x x x  x x x x   x x o o  o o o o";
12834
12835        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12836                          "x x x x  x x x x   1 1 i i  i i i i";
12837        min_write_delay = 9000;
12838        max_write_delay = 9000;
12839      ;
12840
12841    memory "calibration"
12842        size            = 1;
12843        read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
12844                          "0 0 0 0  0 0 0 0    o o o o  o o o o";
12845      ;
12846    memory "signature"
12847        size            = 3;
12848        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
12849                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12850      ;
12851  ;
12852
12853#------------------------------------------------------------
12854# ATmega8U2
12855#------------------------------------------------------------
12856# Changes against ATmega16U2 (beside IDs)
12857#    memory "flash"
12858#        size            = 8192;
12859#        page_size       = 64;
12860#        blocksize       = 64;
12861
12862part
12863    id               = "m8u2";
12864    desc             = "ATmega8U2";
12865    has_jtag         = no;
12866    has_debugwire    = yes;
12867    signature        = 0x1e 0x93 0x89;
12868    usbpid           = 0x2fee;
12869    chip_erase_delay = 9000;
12870    reset            = io;
12871    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12872                       "x x x x  x x x x    x x x x  x x x x";
12873    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12874                       "x x x x  x x x x    x x x x  x x x x";
12875    pagel            = 0xD7;
12876    bs2              = 0xC6;
12877
12878    timeout		= 200;
12879    stabdelay		= 100;
12880    cmdexedelay		= 25;
12881    synchloops		= 32;
12882    bytedelay		= 0;
12883    pollindex		= 3;
12884    pollvalue		= 0x53;
12885    predelay		= 1;
12886    postdelay		= 1;
12887    pollmethod		= 1;
12888    pp_controlstack     =
12889        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12890        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12891        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12892        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
12893    hventerstabdelay    = 100;
12894    progmodedelay       = 0;
12895    latchcycles         = 5;
12896    togglevtg           = 1;
12897    poweroffdelay       = 15;
12898    resetdelayms        = 1;
12899    resetdelayus        = 0;
12900    hvleavestabdelay    = 15;
12901    chiperasepulsewidth = 0;
12902    chiperasepolltimeout = 10;
12903    programfusepulsewidth = 0;
12904    programfusepolltimeout = 5;
12905    programlockpulsewidth = 0;
12906    programlockpolltimeout = 5;
12907
12908    ocdrev              = 1;
12909
12910    memory "eeprom"
12911        paged           = no; /* leave this "no" */
12912        page_size       = 4;  /* for parallel programming */
12913        size            = 512;
12914        num_pages       = 128;
12915        min_write_delay = 9000;
12916        max_write_delay = 9000;
12917        readback_p1     = 0x00;
12918        readback_p2     = 0x00;
12919        read            = "  1   0   1   0      0   0   0   0",
12920                          "  0   0   0   0    a11 a10  a9  a8",
12921                          " a7  a6  a5  a4     a3  a2  a1  a0",
12922                          "  o   o   o   o      o   o   o   o";
12923
12924        write           = "  1   1   0   0      0   0   0   0",
12925                          "  0   0   0   0    a11 a10  a9  a8",
12926                          " a7  a6  a5  a4     a3  a2  a1  a0",
12927                          "  i   i   i   i      i   i   i   i";
12928
12929	loadpage_lo	= "  1   1   0   0      0   0   0   1",
12930			  "  0   0   0   0      0   0   0   0",
12931			  "  0   0   0   0      0   0  a1  a0",
12932			  "  i   i   i   i      i   i   i   i";
12933
12934	writepage	= "  1   1   0   0      0   0   1   0",
12935                          "  0   0   0   0    a11 a10  a9  a8",
12936                          " a7  a6  a5  a4     a3  a2   0   0",
12937			  "  x   x   x   x      x   x   x   x";
12938
12939	mode		= 0x41;
12940	delay		= 20;
12941	blocksize	= 4;
12942	readsize	= 256;
12943      ;
12944
12945    memory "flash"
12946        paged           = yes;
12947        size            = 8192;
12948        page_size       = 128;
12949        num_pages       = 64;
12950        min_write_delay = 4500;
12951        max_write_delay = 4500;
12952        readback_p1     = 0x00;
12953        readback_p2     = 0x00;
12954        read_lo         = "  0   0   1   0      0   0   0   0",
12955                          "a15 a14 a13 a12    a11 a10  a9  a8",
12956                          " a7  a6  a5  a4     a3  a2  a1  a0",
12957                          "  o   o   o   o      o   o   o   o";
12958
12959        read_hi         = "  0   0   1   0      1   0   0   0",
12960                          "a15 a14 a13 a12    a11 a10  a9  a8",
12961                          " a7  a6  a5  a4     a3  a2  a1  a0",
12962                          "  o   o   o   o      o   o   o   o";
12963
12964        loadpage_lo     = "  0   1   0   0      0   0   0   0",
12965                          "  x   x   x   x      x   x   x   x",
12966                          "  x   x  a5  a4     a3  a2  a1  a0",
12967                          "  i   i   i   i      i   i   i   i";
12968
12969        loadpage_hi     = "  0   1   0   0      1   0   0   0",
12970                          "  x   x   x   x      x   x   x   x",
12971                          "  x   x  a5  a4     a3  a2  a1  a0",
12972                          "  i   i   i   i      i   i   i   i";
12973
12974        writepage       = "  0   1   0   0      1   1   0   0",
12975                          "a15 a14 a13 a12    a11 a10  a9  a8",
12976                          " a7  a6   x   x      x   x   x   x",
12977                          "  x   x   x   x      x   x   x   x";
12978
12979	mode		= 0x41;
12980	delay		= 6;
12981	blocksize	= 128;
12982	readsize	= 256;
12983      ;
12984
12985    memory "lfuse"
12986        size            = 1;
12987        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12988                          "x x x x  x x x x  i i i i  i i i i";
12989
12990        read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12991                          "x x x x  x x x x  o o o o  o o o o";
12992        min_write_delay = 9000;
12993        max_write_delay = 9000;
12994      ;
12995
12996    memory "hfuse"
12997        size            = 1;
12998        write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12999                          "x x x x  x x x x  i i i i  i i i i";
13000
13001        read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
13002                          "x x x x  x x x x  o o o o  o o o o";
13003        min_write_delay = 9000;
13004        max_write_delay = 9000;
13005      ;
13006
13007    memory "efuse"
13008        size            = 1;
13009        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
13010                          "x x x x  x x x x  i i i i  i i i i";
13011
13012        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
13013                          "x x x x  x x x x  o o o o  o o o o";
13014        min_write_delay = 9000;
13015        max_write_delay = 9000;
13016      ;
13017
13018    memory "lock"
13019        size            = 1;
13020        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
13021                          "x x x x  x x x x   x x o o  o o o o";
13022
13023        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
13024                          "x x x x  x x x x   1 1 i i  i i i i";
13025        min_write_delay = 9000;
13026        max_write_delay = 9000;
13027      ;
13028
13029    memory "calibration"
13030        size            = 1;
13031        read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
13032                          "0 0 0 0  0 0 0 0    o o o o  o o o o";
13033      ;
13034    memory "signature"
13035        size            = 3;
13036        read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
13037                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
13038      ;
13039  ;
13040#------------------------------------------------------------
13041# ATmega325
13042#------------------------------------------------------------
13043
13044part
13045    id               = "m325";
13046    desc             = "ATmega325";
13047    signature        = 0x1e 0x95 0x05;
13048    has_jtag         = yes;
13049#   stk500_devcode   = 0x??; # No STK500v1 support?
13050#   avr910_devcode   = 0x??; # Try the ATmega16 one
13051    avr910_devcode   = 0x74;
13052    pagel            = 0xd7;
13053    bs2              = 0xa0;
13054    chip_erase_delay = 9000;
13055    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
13056                       "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
13057
13058    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
13059                       "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
13060
13061    timeout             = 200;
13062    stabdelay           = 100;
13063    cmdexedelay         = 25;
13064    synchloops          = 32;
13065    bytedelay           = 0;
13066    pollindex           = 3;
13067    pollvalue           = 0x53;
13068    predelay            = 1;
13069    postdelay           = 1;
13070    pollmethod          = 1;
13071
13072    pp_controlstack     =
13073        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
13074        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
13075        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
13076        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
13077    hventerstabdelay    = 100;
13078    progmodedelay       = 0;
13079    latchcycles         = 5;
13080    togglevtg           = 1;
13081    poweroffdelay       = 15;
13082    resetdelayms        = 1;
13083    resetdelayus        = 0;
13084    hvleavestabdelay    = 15;
13085    chiperasepulsewidth = 0;
13086    chiperasepolltimeout = 10;
13087    programfusepulsewidth = 0;
13088    programfusepolltimeout = 5;
13089    programlockpulsewidth = 0;
13090    programlockpolltimeout = 5;
13091
13092    idr                 = 0x31;
13093    spmcr               = 0x57;
13094    allowfullpagebitstream = no;
13095
13096    ocdrev              = 3;
13097
13098    memory "eeprom"
13099        paged           = no; /* leave this "no" */
13100        page_size       = 4;  /* for parallel programming */
13101        size            = 1024;
13102        min_write_delay = 9000;
13103        max_write_delay = 9000;
13104        readback_p1     = 0xff;
13105        readback_p2     = 0xff;
13106        read            = "  1   0   1   0      0   0   0   0",
13107                          "  0   0   0   0      0   0  a9  a8",
13108                          " a7  a6  a5  a4     a3  a2  a1  a0",
13109                          "  o   o   o   o      o   o   o   o";
13110
13111        write           = "  1   1   0   0      0   0   0   0",
13112                          "  0   0   0   0      0   0  a9  a8",
13113                          " a7  a6  a5  a4     a3  a2  a1  a0",
13114                          "  i   i   i   i      i   i   i   i";
13115
13116        loadpage_lo     = "  1   1   0   0      0   0   0   1",
13117                          "  0   0   0   0      0   0   0   0",
13118                          "  0   0   0   0      0   0  a1  a0",
13119                          "  i   i   i   i      i   i   i   i";
13120
13121        writepage       = "  1   1   0   0      0   0   1   0",
13122                          "  0   0   0   0      0   0  a9  a8",
13123                          " a7  a6  a5  a4     a3  a2   0   0",
13124                          "  x   x   x   x      x   x   x   x";
13125
13126        mode            = 0x41;
13127        delay           = 10;
13128        blocksize       = 4;
13129        readsize        = 256;
13130      ;
13131
13132    memory "flash"
13133        paged           = yes;
13134        size            = 32768;
13135        page_size       = 128;
13136        num_pages       = 256;
13137        min_write_delay = 4500;
13138        max_write_delay = 4500;
13139        readback_p1     = 0xff;
13140        readback_p2     = 0xff;
13141        read_lo         = "  0   0   1   0      0   0   0   0",
13142                          "  0 a14 a13 a12    a11 a10  a9  a8",
13143                          " a7  a6  a5  a4     a3  a2  a1  a0",
13144                          "  o   o   o   o      o   o   o   o";
13145
13146        read_hi         = "  0   0   1   0      1   0   0   0",
13147                          "  0 a14 a13 a12    a11 a10  a9  a8",
13148                          " a7  a6  a5  a4     a3  a2  a1  a0",
13149                          "  o   o   o   o      o   o   o   o";
13150
13151        loadpage_lo     = "  0   1   0   0      0   0   0   0",
13152                          "  0   0   0   0      0   0   0   0",
13153                          " a7  a6  a5  a4     a3  a2  a1  a0",
13154                          "  i   i   i   i      i   i   i   i";
13155
13156        loadpage_hi     = "  0   1   0   0      1   0   0   0",
13157                          "  0   0   0   0      0   0   0   0",
13158                          " a7  a6  a5  a4     a3  a2  a1  a0",
13159                          "  i   i   i   i      i   i   i   i";
13160
13161        writepage       = "  0   1   0   0      1   1   0   0",
13162                          "  0 a14 a13 a12    a11 a10  a9  a8",
13163                          " a7  a6  a5  a4     a3  a2  a1  a0",
13164                          "  x   x   x   x      x   x   x   x";
13165
13166        mode            = 0x41;
13167        delay           = 10;
13168        blocksize       = 128;
13169        readsize        = 256;
13170      ;
13171
13172    memory "lock"
13173        size            = 1;
13174        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
13175                          "x x x x  x x x x   x x o o  o o o o";
13176
13177        write           = "1 0 1 0  1 1 0 0   1 1 1 0  0 0 0 0",
13178                          "0 0 0 0  0 0 0 0   1 1 i i  i i i i";
13179        min_write_delay = 9000;
13180        max_write_delay = 9000;
13181      ;
13182
13183    memory "lfuse"
13184        size            = 1;
13185        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
13186                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
13187
13188        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
13189                          "0 0 0 0  0 0 0 0   i i i i  i i i i";
13190        min_write_delay = 9000;
13191        max_write_delay = 9000;
13192      ;
13193
13194    memory "hfuse"
13195        size            = 1;
13196        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
13197                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
13198
13199        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
13200                          "0 0 0 0  0 0 0 0   i i i i  i i i i";
13201        min_write_delay = 9000;
13202        max_write_delay = 9000;
13203      ;
13204
13205    memory "efuse"
13206        size            = 1;
13207
13208        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
13209                          "0 0 0 0  0 0 0 0  o o o o  o o o o";
13210
13211        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
13212                          "0 0 0 0  0 0 0 0  1 1 1 1  1 i i i";
13213        min_write_delay = 9000;
13214        max_write_delay = 9000;
13215      ;
13216
13217    memory "signature"
13218        size            = 3;
13219        read            = "0  0  1  1   0  0  0  0   0  0  0  0   0  0  0  0",
13220                          "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
13221      ;
13222
13223    memory "calibration"
13224        size            = 1;
13225
13226        read            = "0 0 1 1  1 0 0 0   0 0 0 0  0 0 0 0",
13227                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
13228        ;
13229  ;
13230
13231#------------------------------------------------------------
13232# ATmega645
13233#------------------------------------------------------------
13234
13235part
13236    id               = "m645";
13237    desc             = "ATmega645";
13238    signature        = 0x1E 0x96 0x05;
13239    has_jtag         = yes;
13240#   stk500_devcode   = 0x??; # No STK500v1 support?
13241#   avr910_devcode   = 0x??; # Try the ATmega16 one
13242    avr910_devcode   = 0x74;
13243    pagel            = 0xd7;
13244    bs2              = 0xa0;
13245    chip_erase_delay = 9000;
13246    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
13247                       "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
13248
13249    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
13250                       "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
13251
13252    timeout             = 200;
13253    stabdelay           = 100;
13254    cmdexedelay         = 25;
13255    synchloops          = 32;
13256    bytedelay           = 0;
13257    pollindex           = 3;
13258    pollvalue           = 0x53;
13259    predelay            = 1;
13260    postdelay           = 1;
13261    pollmethod          = 1;
13262
13263    pp_controlstack     =
13264        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
13265        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
13266        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
13267        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
13268    hventerstabdelay    = 100;
13269    progmodedelay       = 0;
13270    latchcycles         = 5;
13271    togglevtg           = 1;
13272    poweroffdelay       = 15;
13273    resetdelayms        = 1;
13274    resetdelayus        = 0;
13275    hvleavestabdelay    = 15;
13276    chiperasepulsewidth = 0;
13277    chiperasepolltimeout = 10;
13278    programfusepulsewidth = 0;
13279    programfusepolltimeout = 5;
13280    programlockpulsewidth = 0;
13281    programlockpolltimeout = 5;
13282
13283    idr                 = 0x31;
13284    spmcr               = 0x57;
13285    allowfullpagebitstream = no;
13286
13287    ocdrev              = 3;
13288
13289    memory "eeprom"
13290        paged           = no; /* leave this "no" */
13291        page_size       = 8;  /* for parallel programming */
13292        size            = 2048;
13293        min_write_delay = 9000;
13294        max_write_delay = 9000;
13295        readback_p1     = 0xff;
13296        readback_p2     = 0xff;
13297        read            = "  1   0   1   0      0   0   0   0",
13298                          "  0   0   0   0      0 a10  a9  a8",
13299                          " a7  a6  a5  a4     a3  a2  a1  a0",
13300                          "  o   o   o   o      o   o   o   o";
13301
13302        write           = "  1   1   0   0      0   0   0   0",
13303                          "  0   0   0   0      0 a10  a9  a8",
13304                          " a7  a6  a5  a4     a3  a2  a1  a0",
13305                          "  i   i   i   i      i   i   i   i";
13306
13307        loadpage_lo     = "  1   1   0   0      0   0   0   1",
13308                          "  0   0   0   0      0   0   0   0",
13309                          "  0   0   0   0      0  a2  a1  a0",
13310                          "  i   i   i   i      i   i   i   i";
13311
13312        writepage       = "  1   1   0   0      0   0   1   0",
13313                          "  0   0   0   0      0 a10  a9  a8",
13314                          " a7  a6  a5  a4     a3   0   0   0",
13315                          "  x   x   x   x      x   x   x   x";
13316
13317        mode            = 0x41;
13318        delay           = 10;
13319        blocksize       = 8;
13320        readsize        = 256;
13321      ;
13322
13323    memory "flash"
13324        paged           = yes;
13325        size            = 65536;
13326        page_size       = 256;
13327        num_pages       = 256;
13328        min_write_delay = 4500;
13329        max_write_delay = 4500;
13330        readback_p1     = 0xff;
13331        readback_p2     = 0xff;
13332        read_lo         = "   0   0   1   0      0   0   0   0",
13333                          " a15 a14 a13 a12    a11 a10  a9  a8",
13334                          "  a7  a6  a5  a4     a3  a2  a1  a0",
13335                          "   o   o   o   o      o   o   o   o";
13336
13337        read_hi         = "   0   0   1   0      1   0   0   0",
13338                          " a15 a14 a13 a12    a11 a10  a9  a8",
13339                          "  a7  a6  a5  a4     a3  a2  a1  a0",
13340                          "   o   o   o   o      o   o   o   o";
13341
13342        loadpage_lo     = "  0   1   0   0      0   0   0   0",
13343                          "  0   0   0   0      0   0   0   0",
13344                          "  a7 a6  a5  a4     a3  a2  a1  a0",
13345                          "  i   i   i   i      i   i   i   i";
13346
13347        loadpage_hi     = "  0   1   0   0      1   0   0   0",
13348                          "  0   0   0   0      0   0   0   0",
13349                          "  a7 a6  a5  a4     a3  a2  a1  a0",
13350                          "  i   i   i   i      i   i   i   i";
13351
13352        writepage       = "   0   1   0   0      1   1   0   0",
13353                          " a15 a14 a13 a12    a11 a10  a9  a8",
13354                          "  a7  a6  a5  a4     a3  a2  a1  a0",
13355                          "   0   0   0   0      0   0   0   0";
13356
13357        mode            = 0x41;
13358        delay           = 10;
13359        blocksize       = 128;
13360        readsize        = 256;
13361      ;
13362
13363    memory "lock"
13364        size            = 1;
13365        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
13366                          "x x x x  x x x x   x x o o  o o o o";
13367
13368        write           = "1 0 1 0  1 1 0 0   1 1 1 0  0 0 0 0",
13369                          "0 0 0 0  0 0 0 0   1 1 i i  i i i i";
13370        min_write_delay = 9000;
13371        max_write_delay = 9000;
13372      ;
13373
13374    memory "lfuse"
13375        size            = 1;
13376        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
13377                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
13378
13379        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
13380                          "0 0 0 0  0 0 0 0   i i i i  i i i i";
13381        min_write_delay = 9000;
13382        max_write_delay = 9000;
13383      ;
13384
13385    memory "hfuse"
13386        size            = 1;
13387        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
13388                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
13389
13390        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
13391                          "0 0 0 0  0 0 0 0   i i i i  i i i i";
13392        min_write_delay = 9000;
13393        max_write_delay = 9000;
13394      ;
13395
13396    memory "efuse"
13397        size            = 1;
13398
13399        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
13400                          "0 0 0 0  0 0 0 0  o o o o  o o o o";
13401
13402        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
13403                          "0 0 0 0  0 0 0 0  1 1 1 1  1 i i i";
13404        min_write_delay = 9000;
13405        max_write_delay = 9000;
13406      ;
13407
13408    memory "signature"
13409        size            = 3;
13410        read            = "0  0  1  1   0  0  0  0   0  0  0  0   0  0  0  0",
13411                          "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
13412      ;
13413
13414    memory "calibration"
13415        size            = 1;
13416
13417        read            = "0 0 1 1  1 0 0 0   0 0 0 0  0 0 0 0",
13418                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
13419        ;
13420  ;
13421
13422#------------------------------------------------------------
13423# ATmega3250
13424#------------------------------------------------------------
13425
13426part parent "m325"
13427    id               = "m3250";
13428    desc             = "ATmega3250";
13429    signature        = 0x1E 0x95 0x06;
13430
13431    ocdrev              = 3;
13432  ;
13433
13434#------------------------------------------------------------
13435# ATmega6450
13436#------------------------------------------------------------
13437
13438part parent "m645"
13439    id               = "m6450";
13440    desc             = "ATmega6450";
13441    signature        = 0x1E 0x96 0x06;
13442
13443    ocdrev              = 3;
13444  ;
13445
13446#------------------------------------------------------------
13447# AVR XMEGA family common values
13448#------------------------------------------------------------
13449
13450part
13451    id		= ".xmega";
13452    desc	= "AVR XMEGA family common values";
13453    has_pdi	= yes;
13454    nvm_base	= 0x01c0;
13455    mcu_base	= 0x0090;
13456
13457    memory "signature"
13458        size		= 3;
13459        offset		= 0x1000090;
13460    ;
13461
13462    memory "prodsig"
13463        size		= 0x32;
13464        offset		= 0x8e0200;
13465        page_size	= 0x32;
13466        readsize	= 0x32;
13467    ;
13468
13469    memory "fuse1"
13470        size		= 1;
13471        offset		= 0x8f0021;
13472    ;
13473
13474    memory "fuse2"
13475        size		= 1;
13476        offset		= 0x8f0022;
13477    ;
13478
13479    memory "fuse4"
13480        size		= 1;
13481        offset		= 0x8f0024;
13482    ;
13483
13484    memory "fuse5"
13485        size		= 1;
13486        offset		= 0x8f0025;
13487    ;
13488
13489    memory "lock"
13490        size		= 1;
13491        offset		= 0x8f0027;
13492    ;
13493
13494    memory "data"
13495        # SRAM, only used to supply the offset
13496        offset		= 0x1000000;
13497    ;
13498;
13499
13500#------------------------------------------------------------
13501# ATxmega16A4U
13502#------------------------------------------------------------
13503
13504part parent ".xmega"
13505    id		= "x16a4u";
13506    desc	= "ATxmega16A4U";
13507    signature	= 0x1e 0x94 0x41;
13508    usbpid	= 0x2fe3;
13509
13510    memory "eeprom"
13511        size		= 0x400;
13512        offset		= 0x8c0000;
13513        page_size	= 0x20;
13514        readsize	= 0x100;
13515    ;
13516
13517    memory "application"
13518        size		= 0x4000;
13519        offset		= 0x800000;
13520        page_size	= 0x100;
13521        readsize	= 0x100;
13522    ;
13523
13524    memory "apptable"
13525        size		= 0x1000;
13526        offset		= 0x803000;
13527        page_size	= 0x100;
13528        readsize	= 0x100;
13529    ;
13530
13531    memory "boot"
13532        size		= 0x1000;
13533        offset		= 0x804000;
13534        page_size	= 0x100;
13535        readsize	= 0x100;
13536    ;
13537
13538    memory "flash"
13539        size		= 0x5000;
13540        offset		= 0x800000;
13541        page_size	= 0x100;
13542        readsize	= 0x100;
13543    ;
13544
13545    memory "usersig"
13546        size		= 0x100;
13547        offset		= 0x8e0400;
13548        page_size	= 0x100;
13549        readsize	= 0x100;
13550    ;
13551;
13552
13553#------------------------------------------------------------
13554# ATxmega16C4
13555#------------------------------------------------------------
13556
13557part parent "x16a4u"
13558    id		= "x16c4";
13559    desc	= "ATxmega16C4";
13560    signature	= 0x1e 0x95 0x44;
13561;
13562
13563#------------------------------------------------------------
13564# ATxmega16D4
13565#------------------------------------------------------------
13566
13567part parent "x16a4u"
13568    id		= "x16d4";
13569    desc	= "ATxmega16D4";
13570    signature	= 0x1e 0x94 0x42;
13571;
13572
13573#------------------------------------------------------------
13574# ATxmega16A4
13575#------------------------------------------------------------
13576
13577part parent "x16a4u"
13578    id		= "x16a4";
13579    desc	= "ATxmega16A4";
13580    signature	= 0x1e 0x94 0x41;
13581    has_jtag	= yes;
13582
13583    memory "fuse0"
13584        size		= 1;
13585        offset		= 0x8f0020;
13586    ;
13587;
13588
13589#------------------------------------------------------------
13590# ATxmega32A4U
13591#------------------------------------------------------------
13592
13593part parent ".xmega"
13594    id		= "x32a4u";
13595    desc	= "ATxmega32A4U";
13596    signature	= 0x1e 0x95 0x41;
13597    usbpid	= 0x2fe4;
13598
13599    memory "eeprom"
13600        size		= 0x400;
13601        offset		= 0x8c0000;
13602        page_size	= 0x20;
13603        readsize	= 0x100;
13604    ;
13605
13606    memory "application"
13607        size		= 0x8000;
13608        offset		= 0x800000;
13609        page_size	= 0x100;
13610        readsize	= 0x100;
13611    ;
13612
13613    memory "apptable"
13614        size		= 0x1000;
13615        offset		= 0x807000;
13616        page_size	= 0x100;
13617        readsize	= 0x100;
13618    ;
13619
13620    memory "boot"
13621        size		= 0x1000;
13622        offset		= 0x808000;
13623        page_size	= 0x100;
13624        readsize	= 0x100;
13625    ;
13626
13627    memory "flash"
13628        size		= 0x9000;
13629        offset		= 0x800000;
13630        page_size	= 0x100;
13631        readsize	= 0x100;
13632    ;
13633
13634    memory "usersig"
13635        size		= 0x100;
13636        offset		= 0x8e0400;
13637        page_size	= 0x100;
13638        readsize	= 0x100;
13639    ;
13640;
13641
13642#------------------------------------------------------------
13643# ATxmega32C4
13644#------------------------------------------------------------
13645
13646part parent "x32a4u"
13647    id		= "x32c4";
13648    desc	= "ATxmega32C4";
13649    signature	= 0x1e 0x94 0x43;
13650;
13651
13652#------------------------------------------------------------
13653# ATxmega32D4
13654#------------------------------------------------------------
13655
13656part parent "x32a4u"
13657    id		= "x32d4";
13658    desc	= "ATxmega32D4";
13659    signature	= 0x1e 0x95 0x42;
13660;
13661
13662#------------------------------------------------------------
13663# ATxmega32A4
13664#------------------------------------------------------------
13665
13666part parent "x32a4u"
13667    id		= "x32a4";
13668    desc	= "ATxmega32A4";
13669    signature	= 0x1e 0x95 0x41;
13670    has_jtag	= yes;
13671
13672    memory "fuse0"
13673        size		= 1;
13674        offset		= 0x8f0020;
13675    ;
13676;
13677
13678#------------------------------------------------------------
13679# ATxmega64A4U
13680#------------------------------------------------------------
13681
13682part parent ".xmega"
13683    id		= "x64a4u";
13684    desc	= "ATxmega64A4U";
13685    signature	= 0x1e 0x96 0x46;
13686    usbpid	= 0x2fe5;
13687
13688    memory "eeprom"
13689        size		= 0x800;
13690        offset		= 0x8c0000;
13691        page_size	= 0x20;
13692        readsize	= 0x100;
13693    ;
13694
13695    memory "application"
13696        size		= 0x10000;
13697        offset		= 0x800000;
13698        page_size	= 0x100;
13699        readsize	= 0x100;
13700    ;
13701
13702    memory "apptable"
13703        size		= 0x1000;
13704        offset		= 0x80f000;
13705        page_size	= 0x100;
13706        readsize	= 0x100;
13707    ;
13708
13709    memory "boot"
13710        size		= 0x1000;
13711        offset		= 0x810000;
13712        page_size	= 0x100;
13713        readsize	= 0x100;
13714    ;
13715
13716    memory "flash"
13717        size		= 0x11000;
13718        offset		= 0x800000;
13719        page_size	= 0x100;
13720        readsize	= 0x100;
13721    ;
13722
13723    memory "usersig"
13724        size		= 0x100;
13725        offset		= 0x8e0400;
13726        page_size	= 0x100;
13727        readsize	= 0x100;
13728    ;
13729;
13730
13731#------------------------------------------------------------
13732# ATxmega64C3
13733#------------------------------------------------------------
13734
13735part parent "x64a4u"
13736    id		= "x64c3";
13737    desc	= "ATxmega64C3";
13738    signature	= 0x1e 0x96 0x49;
13739    usbpid	= 0x2fd6;
13740;
13741
13742#------------------------------------------------------------
13743# ATxmega64D3
13744#------------------------------------------------------------
13745
13746part parent "x64a4u"
13747    id		= "x64d3";
13748    desc	= "ATxmega64D3";
13749    signature	= 0x1e 0x96 0x4a;
13750;
13751
13752#------------------------------------------------------------
13753# ATxmega64D4
13754#------------------------------------------------------------
13755
13756part parent "x64a4u"
13757    id		= "x64d4";
13758    desc	= "ATxmega64D4";
13759    signature	= 0x1e 0x96 0x47;
13760;
13761
13762#------------------------------------------------------------
13763# ATxmega64A1
13764#------------------------------------------------------------
13765
13766part parent "x64a4u"
13767    id		= "x64a1";
13768    desc	= "ATxmega64A1";
13769    signature	= 0x1e 0x96 0x4e;
13770    has_jtag	= yes;
13771
13772    memory "fuse0"
13773        size		= 1;
13774        offset		= 0x8f0020;
13775    ;
13776;
13777
13778#------------------------------------------------------------
13779# ATxmega64A1U
13780#------------------------------------------------------------
13781
13782part parent "x64a1"
13783    id		= "x64a1u";
13784    desc	= "ATxmega64A1U";
13785    signature	= 0x1e 0x96 0x4e;
13786    usbpid	= 0x2fe8;
13787;
13788
13789#------------------------------------------------------------
13790# ATxmega64A3
13791#------------------------------------------------------------
13792
13793part parent "x64a1"
13794    id		= "x64a3";
13795    desc	= "ATxmega64A3";
13796    signature	= 0x1e 0x96 0x42;
13797;
13798
13799#------------------------------------------------------------
13800# ATxmega64A3U
13801#------------------------------------------------------------
13802
13803part parent "x64a1"
13804    id		= "x64a3u";
13805    desc	= "ATxmega64A3U";
13806    signature	= 0x1e 0x96 0x42;
13807    usbpid	= 0x2fe5;
13808;
13809
13810#------------------------------------------------------------
13811# ATxmega64A4
13812#------------------------------------------------------------
13813
13814part parent "x64a1"
13815    id		= "x64a4";
13816    desc	= "ATxmega64A4";
13817    signature	= 0x1e 0x96 0x46;
13818;
13819
13820#------------------------------------------------------------
13821# ATxmega64B1
13822#------------------------------------------------------------
13823
13824part parent "x64a1"
13825    id		= "x64b1";
13826    desc	= "ATxmega64B1";
13827    signature	= 0x1e 0x96 0x52;
13828    usbpid	= 0x2fe1;
13829;
13830
13831#------------------------------------------------------------
13832# ATxmega64B3
13833#------------------------------------------------------------
13834
13835part parent "x64a1"
13836    id		= "x64b3";
13837    desc	= "ATxmega64B3";
13838    signature	= 0x1e 0x96 0x51;
13839    usbpid	= 0x2fdf;
13840;
13841
13842#------------------------------------------------------------
13843# ATxmega128C3
13844#------------------------------------------------------------
13845
13846part parent ".xmega"
13847    id		= "x128c3";
13848    desc	= "ATxmega128C3";
13849    signature	= 0x1e 0x97 0x52;
13850    usbpid	= 0x2fd7;
13851
13852    memory "eeprom"
13853        size		= 0x800;
13854        offset		= 0x8c0000;
13855        page_size	= 0x20;
13856        readsize	= 0x100;
13857    ;
13858
13859    memory "application"
13860        size		= 0x20000;
13861        offset		= 0x800000;
13862        page_size	= 0x200;
13863        readsize	= 0x100;
13864    ;
13865
13866    memory "apptable"
13867        size		= 0x2000;
13868        offset		= 0x81e000;
13869        page_size	= 0x200;
13870        readsize	= 0x100;
13871    ;
13872
13873    memory "boot"
13874        size		= 0x2000;
13875        offset		= 0x820000;
13876        page_size	= 0x200;
13877        readsize	= 0x100;
13878    ;
13879
13880    memory "flash"
13881        size		= 0x22000;
13882        offset		= 0x800000;
13883        page_size	= 0x200;
13884        readsize	= 0x100;
13885    ;
13886
13887    memory "usersig"
13888        size		= 0x200;
13889        offset		= 0x8e0400;
13890        page_size	= 0x200;
13891        readsize	= 0x100;
13892    ;
13893;
13894
13895#------------------------------------------------------------
13896# ATxmega128D3
13897#------------------------------------------------------------
13898
13899part parent "x128c3"
13900    id		= "x128d3";
13901    desc	= "ATxmega128D3";
13902    signature	= 0x1e 0x97 0x48;
13903;
13904
13905#------------------------------------------------------------
13906# ATxmega128D4
13907#------------------------------------------------------------
13908
13909part parent "x128c3"
13910    id		= "x128d4";
13911    desc	= "ATxmega128D4";
13912    signature	= 0x1e 0x97 0x47;
13913;
13914
13915#------------------------------------------------------------
13916# ATxmega128A1
13917#------------------------------------------------------------
13918
13919part parent "x128c3"
13920    id		= "x128a1";
13921    desc	= "ATxmega128A1";
13922    signature	= 0x1e 0x97 0x4c;
13923    has_jtag	= yes;
13924
13925    memory "fuse0"
13926        size		= 1;
13927        offset		= 0x8f0020;
13928    ;
13929;
13930
13931#------------------------------------------------------------
13932# ATxmega128A1 revision D
13933#------------------------------------------------------------
13934
13935part parent "x128a1"
13936    id		= "x128a1d";
13937    desc	= "ATxmega128A1revD";
13938    signature	= 0x1e 0x97 0x41;
13939;
13940
13941#------------------------------------------------------------
13942# ATxmega128A1U
13943#------------------------------------------------------------
13944
13945part parent "x128a1"
13946    id		= "x128a1u";
13947    desc	= "ATxmega128A1U";
13948    signature	= 0x1e 0x97 0x4c;
13949    usbpid	= 0x2fed;
13950;
13951
13952#------------------------------------------------------------
13953# ATxmega128A3
13954#------------------------------------------------------------
13955
13956part parent "x128a1"
13957    id		= "x128a3";
13958    desc	= "ATxmega128A3";
13959    signature	= 0x1e 0x97 0x42;
13960;
13961
13962#------------------------------------------------------------
13963# ATxmega128A3U
13964#------------------------------------------------------------
13965
13966part parent "x128a1"
13967    id		= "x128a3u";
13968    desc	= "ATxmega128A3U";
13969    signature	= 0x1e 0x97 0x42;
13970    usbpid	= 0x2fe6;
13971;
13972
13973#------------------------------------------------------------
13974# ATxmega128A4
13975#------------------------------------------------------------
13976
13977part parent ".xmega"
13978    id		= "x128a4";
13979    desc	= "ATxmega128A4";
13980    signature	= 0x1e 0x97 0x46;
13981    has_jtag	= yes;
13982
13983    memory "eeprom"
13984        size		= 0x800;
13985        offset		= 0x8c0000;
13986        page_size	= 0x20;
13987        readsize	= 0x100;
13988    ;
13989
13990    memory "application"
13991        size		= 0x20000;
13992        offset		= 0x800000;
13993        page_size	= 0x200;
13994        readsize	= 0x100;
13995    ;
13996
13997    memory "apptable"
13998        size		= 0x1000;
13999        offset		= 0x81f000;
14000        page_size	= 0x200;
14001        readsize	= 0x100;
14002    ;
14003
14004    memory "boot"
14005        size		= 0x2000;
14006        offset		= 0x820000;
14007        page_size	= 0x200;
14008        readsize	= 0x100;
14009    ;
14010
14011    memory "flash"
14012        size		= 0x22000;
14013        offset		= 0x800000;
14014        page_size	= 0x200;
14015        readsize	= 0x100;
14016    ;
14017
14018    memory "usersig"
14019        size		= 0x200;
14020        offset		= 0x8e0400;
14021        page_size	= 0x200;
14022        readsize	= 0x100;
14023    ;
14024
14025    memory "fuse0"
14026        size		= 1;
14027        offset		= 0x8f0020;
14028    ;
14029;
14030
14031#------------------------------------------------------------
14032# ATxmega128A4U
14033#------------------------------------------------------------
14034
14035part parent ".xmega"
14036    id		= "x128a4u";
14037    desc	= "ATxmega128A4U";
14038    signature	= 0x1e 0x97 0x46;
14039    usbpid	= 0x2fde;
14040
14041    memory "eeprom"
14042        size		= 0x800;
14043        offset		= 0x8c0000;
14044        page_size	= 0x20;
14045        readsize	= 0x100;
14046    ;
14047
14048    memory "application"
14049        size		= 0x20000;
14050        offset		= 0x800000;
14051        page_size	= 0x100;
14052        readsize	= 0x100;
14053    ;
14054
14055    memory "apptable"
14056        size		= 0x1000;
14057        offset		= 0x81f000;
14058        page_size	= 0x100;
14059        readsize	= 0x100;
14060    ;
14061
14062    memory "boot"
14063        size		= 0x2000;
14064        offset		= 0x820000;
14065        page_size	= 0x100;
14066        readsize	= 0x100;
14067    ;
14068
14069    memory "flash"
14070        size		= 0x22000;
14071        offset		= 0x800000;
14072        page_size	= 0x100;
14073        readsize	= 0x100;
14074    ;
14075
14076    memory "usersig"
14077        size		= 0x100;
14078        offset		= 0x8e0400;
14079        page_size	= 0x100;
14080        readsize	= 0x100;
14081    ;
14082;
14083
14084#------------------------------------------------------------
14085# ATxmega128B1
14086#------------------------------------------------------------
14087
14088part parent ".xmega"
14089    id		= "x128b1";
14090    desc	= "ATxmega128B1";
14091    signature	= 0x1e 0x97 0x4d;
14092    usbpid	= 0x2fea;
14093    has_jtag	= yes;
14094
14095    memory "eeprom"
14096        size		= 0x800;
14097        offset		= 0x8c0000;
14098        page_size	= 0x20;
14099        readsize	= 0x100;
14100    ;
14101
14102    memory "application"
14103        size		= 0x20000;
14104        offset		= 0x800000;
14105        page_size	= 0x100;
14106        readsize	= 0x100;
14107    ;
14108
14109    memory "apptable"
14110        size		= 0x2000;
14111        offset		= 0x81e000;
14112        page_size	= 0x100;
14113        readsize	= 0x100;
14114    ;
14115
14116    memory "boot"
14117        size		= 0x2000;
14118        offset		= 0x820000;
14119        page_size	= 0x100;
14120        readsize	= 0x100;
14121    ;
14122
14123    memory "flash"
14124        size		= 0x22000;
14125        offset		= 0x800000;
14126        page_size	= 0x100;
14127        readsize	= 0x100;
14128    ;
14129
14130    memory "usersig"
14131        size		= 0x100;
14132        offset		= 0x8e0400;
14133        page_size	= 0x100;
14134        readsize	= 0x100;
14135    ;
14136
14137    memory "fuse0"
14138        size		= 1;
14139        offset		= 0x8f0020;
14140    ;
14141;
14142
14143#------------------------------------------------------------
14144# ATxmega128B3
14145#------------------------------------------------------------
14146
14147part parent "x128b1"
14148    id		= "x128b3";
14149    desc	= "ATxmega128B3";
14150    signature	= 0x1e 0x97 0x4b;
14151    usbpid	= 0x2fe0;
14152;
14153
14154#------------------------------------------------------------
14155# ATxmega192C3
14156#------------------------------------------------------------
14157
14158part parent ".xmega"
14159    id		= "x192c3";
14160    desc	= "ATxmega192C3";
14161    signature	= 0x1e 0x97 0x51;
14162    # usbpid	= 0x2f??;
14163
14164    memory "eeprom"
14165        size		= 0x800;
14166        offset		= 0x8c0000;
14167        page_size	= 0x20;
14168        readsize	= 0x100;
14169    ;
14170
14171    memory "application"
14172        size		= 0x30000;
14173        offset		= 0x800000;
14174        page_size	= 0x200;
14175        readsize	= 0x100;
14176    ;
14177
14178    memory "apptable"
14179        size		= 0x2000;
14180        offset		= 0x82e000;
14181        page_size	= 0x200;
14182        readsize	= 0x100;
14183    ;
14184
14185    memory "boot"
14186        size		= 0x2000;
14187        offset		= 0x830000;
14188        page_size	= 0x200;
14189        readsize	= 0x100;
14190    ;
14191
14192    memory "flash"
14193        size		= 0x32000;
14194        offset		= 0x800000;
14195        page_size	= 0x200;
14196        readsize	= 0x100;
14197    ;
14198
14199    memory "usersig"
14200        size		= 0x200;
14201        offset		= 0x8e0400;
14202        page_size	= 0x200;
14203        readsize	= 0x100;
14204    ;
14205;
14206
14207#------------------------------------------------------------
14208# ATxmega192D3
14209#------------------------------------------------------------
14210
14211part parent "x192c3"
14212    id		= "x192d3";
14213    desc	= "ATxmega192D3";
14214    signature	= 0x1e 0x97 0x49;
14215;
14216
14217#------------------------------------------------------------
14218# ATxmega192A1
14219#------------------------------------------------------------
14220
14221part parent "x192c3"
14222    id		= "x192a1";
14223    desc	= "ATxmega192A1";
14224    signature	= 0x1e 0x97 0x4e;
14225    has_jtag	= yes;
14226
14227    memory "fuse0"
14228        size		= 1;
14229        offset		= 0x8f0020;
14230    ;
14231;
14232
14233#------------------------------------------------------------
14234# ATxmega192A3
14235#------------------------------------------------------------
14236
14237part parent "x192a1"
14238    id		= "x192a3";
14239    desc	= "ATxmega192A3";
14240    signature	= 0x1e 0x97 0x44;
14241;
14242
14243#------------------------------------------------------------
14244# ATxmega192A3U
14245#------------------------------------------------------------
14246
14247part parent "x192a1"
14248    id		= "x192a3u";
14249    desc	= "ATxmega192A3U";
14250    signature	= 0x1e 0x97 0x44;
14251    usbpid	= 0x2fe7;
14252;
14253
14254#------------------------------------------------------------
14255# ATxmega256C3
14256#------------------------------------------------------------
14257
14258part parent ".xmega"
14259    id		= "x256c3";
14260    desc	= "ATxmega256C3";
14261    signature	= 0x1e 0x98 0x46;
14262    usbpid	= 0x2fda;
14263
14264    memory "eeprom"
14265        size		= 0x1000;
14266        offset		= 0x8c0000;
14267        page_size	= 0x20;
14268        readsize	= 0x100;
14269    ;
14270
14271    memory "application"
14272        size		= 0x40000;
14273        offset		= 0x800000;
14274        page_size	= 0x200;
14275        readsize	= 0x100;
14276    ;
14277
14278    memory "apptable"
14279        size		= 0x2000;
14280        offset		= 0x83e000;
14281        page_size	= 0x200;
14282        readsize	= 0x100;
14283    ;
14284
14285    memory "boot"
14286        size		= 0x2000;
14287        offset		= 0x840000;
14288        page_size	= 0x200;
14289        readsize	= 0x100;
14290    ;
14291
14292    memory "flash"
14293        size		= 0x42000;
14294        offset		= 0x800000;
14295        page_size	= 0x200;
14296        readsize	= 0x100;
14297    ;
14298
14299    memory "usersig"
14300        size		= 0x200;
14301        offset		= 0x8e0400;
14302        page_size	= 0x200;
14303        readsize	= 0x100;
14304    ;
14305;
14306
14307#------------------------------------------------------------
14308# ATxmega256D3
14309#------------------------------------------------------------
14310
14311part parent "x256c3"
14312    id		= "x256d3";
14313    desc	= "ATxmega256D3";
14314    signature	= 0x1e 0x98 0x44;
14315;
14316
14317#------------------------------------------------------------
14318# ATxmega256A1
14319#------------------------------------------------------------
14320
14321part parent "x256c3"
14322    id		= "x256a1";
14323    desc	= "ATxmega256A1";
14324    signature	= 0x1e 0x98 0x46;
14325    has_jtag	= yes;
14326
14327    memory "fuse0"
14328        size		= 1;
14329        offset		= 0x8f0020;
14330    ;
14331;
14332
14333#------------------------------------------------------------
14334# ATxmega256A3
14335#------------------------------------------------------------
14336
14337part parent "x256a1"
14338    id		= "x256a3";
14339    desc	= "ATxmega256A3";
14340    signature	= 0x1e 0x98 0x42;
14341;
14342
14343#------------------------------------------------------------
14344# ATxmega256A3U
14345#------------------------------------------------------------
14346
14347part parent "x256a1"
14348    id		= "x256a3u";
14349    desc	= "ATxmega256A3U";
14350    signature	= 0x1e 0x98 0x42;
14351    usbpid	= 0x2fec;
14352;
14353
14354#------------------------------------------------------------
14355# ATxmega256A3B
14356#------------------------------------------------------------
14357
14358part parent "x256a1"
14359    id		= "x256a3b";
14360    desc	= "ATxmega256A3B";
14361    signature	= 0x1e 0x98 0x43;
14362;
14363
14364#------------------------------------------------------------
14365# ATxmega256A3BU
14366#------------------------------------------------------------
14367
14368part parent "x256a1"
14369    id		= "x256a3bu";
14370    desc	= "ATxmega256A3BU";
14371    signature	= 0x1e 0x98 0x43;
14372    usbpid	= 0x2fe2;
14373;
14374
14375#------------------------------------------------------------
14376# ATxmega384C3
14377#------------------------------------------------------------
14378
14379part parent ".xmega"
14380    id		= "x384c3";
14381    desc	= "ATxmega384C3";
14382    signature	= 0x1e 0x98 0x45;
14383    usbpid	= 0x2fdb;
14384
14385    memory "eeprom"
14386        size		= 0x1000;
14387        offset		= 0x8c0000;
14388        page_size	= 0x20;
14389        readsize	= 0x100;
14390    ;
14391
14392    memory "application"
14393        size		= 0x60000;
14394        offset		= 0x800000;
14395        page_size	= 0x200;
14396        readsize	= 0x100;
14397    ;
14398
14399    memory "apptable"
14400        size		= 0x2000;
14401        offset		= 0x85e000;
14402        page_size	= 0x200;
14403        readsize	= 0x100;
14404    ;
14405
14406    memory "boot"
14407        size		= 0x2000;
14408        offset		= 0x860000;
14409        page_size	= 0x200;
14410        readsize	= 0x100;
14411    ;
14412
14413    memory "flash"
14414        size		= 0x62000;
14415        offset		= 0x800000;
14416        page_size	= 0x200;
14417        readsize	= 0x100;
14418    ;
14419
14420    memory "usersig"
14421        size		= 0x200;
14422        offset		= 0x8e0400;
14423        page_size	= 0x200;
14424        readsize	= 0x100;
14425    ;
14426;
14427
14428#------------------------------------------------------------
14429# ATxmega384D3
14430#------------------------------------------------------------
14431
14432part parent "x384c3"
14433    id		= "x384d3";
14434    desc	= "ATxmega384D3";
14435    signature	= 0x1e 0x98 0x47;
14436;
14437
14438#------------------------------------------------------------
14439# ATxmega8E5
14440#------------------------------------------------------------
14441
14442part parent ".xmega"
14443    id		= "x8e5";
14444    desc	= "ATxmega8E5";
14445    signature	= 0x1e 0x93 0x41;
14446
14447    memory "eeprom"
14448        size		= 0x0200;
14449        offset		= 0x08c0000;
14450        page_size	= 0x20;
14451        readsize	= 0x100;
14452    ;
14453
14454    memory "application"
14455        size		= 0x2000;
14456        offset		= 0x0800000;
14457        page_size	= 0x80;
14458        readsize	= 0x100;
14459    ;
14460
14461    memory "apptable"
14462        size		= 0x800;
14463        offset		= 0x00801800;
14464        page_size	= 0x80;
14465        readsize	= 0x100;
14466    ;
14467
14468    memory "boot"
14469        size		= 0x800;
14470        offset		= 0x00802000;
14471        page_size	= 0x80;
14472        readsize	= 0x100;
14473    ;
14474
14475    memory "flash"
14476        size		= 0x2800;
14477        offset		= 0x0800000;
14478        page_size	= 0x80;
14479        readsize	= 0x100;
14480    ;
14481
14482    memory "usersig"
14483        size            = 0x80;
14484        offset          = 0x8e0400;
14485        page_size       = 0x80;
14486        readsize	= 0x100;
14487    ;
14488;
14489
14490#------------------------------------------------------------
14491# ATxmega16E5
14492#------------------------------------------------------------
14493
14494part parent ".xmega"
14495    id		= "x16e5";
14496    desc	= "ATxmega16E5";
14497    signature	= 0x1e 0x94 0x45;
14498
14499    memory "eeprom"
14500        size		= 0x0200;
14501        offset		= 0x08c0000;
14502        page_size	= 0x20;
14503        readsize	= 0x100;
14504    ;
14505
14506    memory "application"
14507        size		= 0x4000;
14508        offset		= 0x0800000;
14509        page_size	= 0x80;
14510        readsize	= 0x100;
14511    ;
14512
14513    memory "apptable"
14514        size		= 0x1000;
14515        offset		= 0x00803000;
14516        page_size	= 0x80;
14517        readsize	= 0x100;
14518    ;
14519
14520    memory "boot"
14521        size		= 0x1000;
14522        offset		= 0x00804000;
14523        page_size	= 0x80;
14524        readsize	= 0x100;
14525    ;
14526
14527    memory "flash"
14528        size		= 0x5000;
14529        offset		= 0x0800000;
14530        page_size	= 0x80;
14531        readsize	= 0x100;
14532    ;
14533
14534    memory "usersig"
14535        size            = 0x80;
14536        offset          = 0x8e0400;
14537        page_size       = 0x80;
14538        readsize	= 0x100;
14539    ;
14540;
14541
14542#------------------------------------------------------------
14543# ATxmega32E5
14544#------------------------------------------------------------
14545
14546part parent ".xmega"
14547    id		= "x32e5";
14548    desc	= "ATxmega32E5";
14549    signature	= 0x1e 0x95 0x4c;
14550
14551    memory "eeprom"
14552        size		= 0x0400;
14553        offset		= 0x08c0000;
14554        page_size	= 0x20;
14555        readsize	= 0x100;
14556    ;
14557
14558    memory "application"
14559        size		= 0x8000;
14560        offset		= 0x0800000;
14561        page_size	= 0x80;
14562        readsize	= 0x100;
14563    ;
14564
14565    memory "apptable"
14566        size		= 0x1000;
14567        offset		= 0x00807000;
14568        page_size	= 0x80;
14569        readsize	= 0x100;
14570    ;
14571
14572    memory "boot"
14573        size		= 0x1000;
14574        offset		= 0x00808000;
14575        page_size	= 0x80;
14576        readsize	= 0x100;
14577    ;
14578
14579    memory "flash"
14580        size		= 0x9000;
14581        offset		= 0x0800000;
14582        page_size	= 0x80;
14583        readsize	= 0x100;
14584    ;
14585
14586    memory "usersig"
14587        size            = 0x80;
14588        offset          = 0x8e0400;
14589        page_size       = 0x80;
14590        readsize	= 0x100;
14591    ;
14592;
14593
14594#------------------------------------------------------------
14595# AVR32UC3A0512
14596#------------------------------------------------------------
14597
14598part
14599    id		= "uc3a0512";
14600    desc	= "AT32UC3A0512";
14601    signature	= 0xED 0xC0 0x3F;
14602    has_jtag	= yes;
14603    is_avr32	= yes;
14604
14605    memory "flash"
14606        paged           = yes;
14607        page_size       = 512;           # bytes
14608        readsize        = 512;           # bytes
14609        num_pages       = 1024;          # could be set dynamicly
14610        size            = 0x00080000;    # could be set dynamicly
14611        offset          = 0x80000000;
14612    ;
14613;
14614
14615part parent "uc3a0512"
14616    id		= "ucr2";
14617    desc	= "deprecated, use 'uc3a0512'";
14618;
14619
14620#------------------------------------------------------------
14621# ATtiny1634.
14622#------------------------------------------------------------
14623
14624part
14625    id              = "t1634";
14626    desc            = "ATtiny1634";
14627     has_debugwire = yes;
14628     flash_instr   = 0xB6, 0x01, 0x11;
14629     eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
14630                0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
14631                0x99, 0xF9, 0xBB, 0xAF;
14632    stk500_devcode  = 0x86;
14633    # avr910_devcode = 0x;
14634    signature       = 0x1e 0x94 0x12;
14635    pagel           = 0xB3;
14636    bs2             = 0xB1;
14637    reset	    = io;
14638    chip_erase_delay = 9000;
14639    pgm_enable       = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
14640                       "x x x x x x x x x x x x x x x x";
14641
14642    chip_erase       = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
14643                       "x x x x x x x x x x x x x x x x";
14644
14645    timeout         = 200;
14646    stabdelay       = 100;
14647    cmdexedelay     = 25;
14648    synchloops      = 32;
14649    bytedelay       = 0;
14650    pollindex       = 3;
14651    pollvalue       = 0x53;
14652    predelay        = 1;
14653    postdelay       = 1;
14654    pollmethod      = 1;
14655
14656    pp_controlstack     =
14657        0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E,
14658        0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E,
14659        0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A,
14660        0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
14661    hventerstabdelay    = 100;
14662    progmodedelay       = 0;
14663    latchcycles         = 0;
14664    togglevtg           = 1;
14665    poweroffdelay       = 15;
14666    resetdelayms        = 1;
14667    resetdelayus        = 0;
14668    hvleavestabdelay    = 15;
14669    resetdelay          = 15;
14670    chiperasepulsewidth = 0;
14671    chiperasepolltimeout = 10;
14672    programfusepulsewidth = 0;
14673    programfusepolltimeout = 5;
14674    programlockpulsewidth = 0;
14675    programlockpolltimeout = 5;
14676
14677    memory "eeprom"
14678        paged           = no;
14679        page_size       = 4;
14680        size            = 256;
14681        min_write_delay = 3600;
14682        max_write_delay = 3600;
14683        readback_p1     = 0xff;
14684        readback_p2     = 0xff;
14685        read            = " 1 0 1 0 0 0 0 0",
14686                          " 0 0 0 x x x x a8",
14687                          " a7 a6 a5 a4 a3 a2 a1 a0",
14688                          " o o o o o o o o";
14689
14690        write           = " 1 1 0 0 0 0 0 0",
14691                          " 0 0 0 x x x x a8",
14692                          " a7 a6 a5 a4 a3 a2 a1 a0",
14693                          " i i i i i i i i";
14694
14695   loadpage_lo   = "  1   1   0   0      0   0   0   1",
14696           "  0   0   0   0      0   0   0   0",
14697           "  0   0   0   0      0   0  a1  a0",
14698           "  i   i   i   i      i   i   i   i";
14699
14700   writepage   = "  1   1   0   0      0   0   1   0",
14701           "  0   0   x   x      x   x   x  a8",
14702           " a7  a6  a5  a4     a3  a2   0   0",
14703           "  x   x   x   x      x   x   x   x";
14704
14705   mode      = 0x41;
14706   delay      = 5;
14707   blocksize   = 4;
14708   readsize   = 256;
14709        ;
14710
14711    memory "flash"
14712        paged           = yes;
14713        size            = 16384;
14714        page_size       = 32;
14715        num_pages       = 512;
14716        min_write_delay = 4500;
14717        max_write_delay = 4500;
14718        readback_p1     = 0xff;
14719        readback_p2     = 0xff;
14720        read_lo         = " 0 0 1 0 0 0 0 0",
14721                          " 0 0 0 a12 a11 a10 a9 a8",
14722                          " a7 a6 a5 a4 a3 a2 a1 a0",
14723                          " o o o o o o o o";
14724
14725        read_hi          = " 0 0 1 0 1 0 0 0",
14726                           " 0 0 0 a12 a11 a10 a9 a8",
14727                           " a7 a6 a5 a4 a3 a2 a1 a0",
14728                           " o o o o o o o o";
14729
14730        loadpage_lo     = " 0 1 0 0 0 0 0 0",
14731                          " 0 0 0 x x x x x",
14732                          " x x a5 a4 a3 a2 a1 a0",
14733                          " i i i i i i i i";
14734
14735        loadpage_hi     = " 0 1 0 0 1 0 0 0",
14736                          " 0 0 0 x x x x x",
14737                          " x x a5 a4 a3 a2 a1 a0",
14738                          " i i i i i i i i";
14739
14740        writepage       = " 0 1 0 0 1 1 0 0",
14741                          " 0 0 0 a12 a11 a10 a9 a8",
14742                          " a7 a6 x x x x x x",
14743                          " x x x x x x x x";
14744
14745        mode        = 0x41;
14746        delay       = 6;
14747        blocksize   = 128;
14748        readsize    = 256;
14749
14750        ;
14751
14752    memory "lfuse"
14753        size            = 1;
14754        min_write_delay = 4500;
14755        max_write_delay = 4500;
14756        read            = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
14757                          "x x x x x x x x o o o o o o o o";
14758
14759        write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
14760                          "x x x x x x x x i i i i i i i i";
14761        ;
14762
14763    memory "hfuse"
14764        size            = 1;
14765        min_write_delay = 4500;
14766        max_write_delay = 4500;
14767        read            = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
14768                          "x x x x x x x x o o o o o o o o";
14769
14770        write           = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
14771                          "x x x x x x x x i i i i i i i i";
14772        ;
14773
14774    memory "efuse"
14775        size            = 1;
14776        min_write_delay = 4500;
14777        max_write_delay = 4500;
14778        read            = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
14779                          "x x x x x x x x o o o o o o o o";
14780
14781        write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
14782                          "x x x x x x x x x x x i i i i i";
14783        ;
14784
14785    memory "lock"
14786        size            = 1;
14787        min_write_delay = 4500;
14788        max_write_delay = 4500;
14789        read            = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
14790                          "x x x x x x x x x x x x x x o o";
14791
14792        write           = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
14793                          "x x x x x x x x 1 1 1 1 1 1 i i";
14794        ;
14795
14796    memory "calibration"
14797        size            = 1;
14798        read            = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
14799                          "0 0 0 0 0 0 0 0 o o o o o o o o";
14800        ;
14801
14802    memory "signature"
14803        size            = 3;
14804        read            = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
14805                          "x x x x x x a1 a0 o o o o o o o o";
14806        ;
14807;
14808
14809#------------------------------------------------------------
14810# Common values for reduced core tinys (4/5/9/10/20/40)
14811#------------------------------------------------------------
14812
14813part
14814    id		= ".reduced_core_tiny";
14815    desc	= "Common values for reduced core tinys";
14816    has_tpi	= yes;
14817
14818    memory "signature"
14819        size		= 3;
14820        offset		= 0x3fc0;
14821        page_size	= 16;
14822    ;
14823
14824    memory "fuse"
14825        size		= 1;
14826        offset		= 0x3f40;
14827        page_size	= 16;
14828	blocksize	= 4;
14829    ;
14830
14831    memory "calibration"
14832        size		= 1;
14833        offset		= 0x3f80;
14834        page_size	= 16;
14835    ;
14836
14837    memory "lockbits"
14838        size		= 1;
14839        offset		= 0x3f00;
14840        page_size	= 16;
14841    ;
14842;
14843
14844#------------------------------------------------------------
14845# ATtiny4
14846#------------------------------------------------------------
14847
14848part parent ".reduced_core_tiny"
14849    id		= "t4";
14850    desc	= "ATtiny4";
14851    signature	= 0x1e 0x8f 0x0a;
14852
14853    memory "flash"
14854        size		= 512;
14855        offset		= 0x4000;
14856        page_size	= 16;
14857        blocksize	= 128;
14858    ;
14859;
14860
14861#------------------------------------------------------------
14862# ATtiny5
14863#------------------------------------------------------------
14864
14865part parent "t4"
14866    id		= "t5";
14867    desc	= "ATtiny5";
14868    signature	= 0x1e 0x8f 0x09;
14869;
14870
14871#------------------------------------------------------------
14872# ATtiny9
14873#------------------------------------------------------------
14874
14875part parent ".reduced_core_tiny"
14876    id		= "t9";
14877    desc	= "ATtiny9";
14878    signature	= 0x1e 0x90 0x08;
14879
14880    memory "flash"
14881        size		= 1024;
14882        offset		= 0x4000;
14883        page_size	= 16;
14884        blocksize	= 128;
14885    ;
14886;
14887
14888#------------------------------------------------------------
14889# ATtiny10
14890#------------------------------------------------------------
14891
14892part parent "t9"
14893    id		= "t10";
14894    desc	= "ATtiny10";
14895    signature	= 0x1e 0x90 0x03;
14896;
14897
14898#------------------------------------------------------------
14899# ATtiny20
14900#------------------------------------------------------------
14901
14902part parent ".reduced_core_tiny"
14903    id          = "t20";
14904    desc        = "ATtiny20";
14905    signature   = 0x1e 0x91 0x0F;
14906
14907    memory "flash"
14908        size            = 2048;
14909        offset          = 0x4000;
14910        page_size       = 16;
14911        blocksize       = 128;
14912    ;
14913;
14914
14915#------------------------------------------------------------
14916# ATtiny40
14917#------------------------------------------------------------
14918
14919part parent ".reduced_core_tiny"
14920    id		= "t40";
14921    desc	= "ATtiny40";
14922    signature	= 0x1e 0x92 0x0E;
14923
14924    memory "flash"
14925        size		= 4096;
14926        offset		= 0x4000;
14927        page_size	= 64;
14928        blocksize	= 128;
14929    ;
14930;
14931
14932#------------------------------------------------------------
14933# ATmega406
14934#------------------------------------------------------------
14935
14936part
14937    id				= "m406";
14938    desc			= "ATMEGA406";
14939    has_jtag			= yes;
14940    signature			= 0x1e 0x95 0x07;
14941
14942    # STK500 parameters (parallel programming IO lines)
14943    pagel			= 0xa7;
14944    bs2				= 0xa0;
14945    serial			= no;
14946    parallel			= yes;
14947
14948    # STK500v2 HV programming parameters, from XML
14949    pp_controlstack		= 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
14950				  0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
14951				  0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
14952				  0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
14953
14954    # JTAG ICE mkII parameters, also from XML files
14955    allowfullpagebitstream	= no;
14956    enablepageprogramming	= yes;
14957    idr				= 0x51;
14958    rampz			= 0x00;
14959    spmcr			= 0x57;
14960    eecr			= 0x3f;
14961
14962    memory "eeprom"
14963        paged		= no;
14964        size		= 512;
14965        page_size	= 4;
14966        blocksize	= 4;
14967	readsize	= 4;
14968        num_pages	= 128;
14969    ;
14970
14971    memory "flash"
14972        paged		= yes;
14973        size		= 40960;
14974        page_size	= 128;
14975        blocksize	= 128;
14976	readsize	= 128;
14977        num_pages	= 320;
14978    ;
14979
14980    memory "hfuse"
14981        size            = 1;
14982    ;
14983
14984    memory "lfuse"
14985        size            = 1;
14986    ;
14987
14988    memory "lockbits"
14989        size		= 1;
14990    ;
14991
14992    memory "signature"
14993        size            = 3;
14994    ;
14995;
14996
14997
14998