add SHT3X support / new smaller SHT2X (V2)
[owSlave2.git] / programmer / flash / avrdude.conf
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 #
337 default_parallel   = "lpt1";
338 default_serial     = "com1";
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.
352 programmer
353   id    = "wiring";
354   desc  = "Wiring";
355   type  = "wiring";
356   connection_type = serial;
357 ;
358
359 programmer
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
385 programmer
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.
411 programmer
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.
440 programmer parent "avrftdi"
441   id         = "4232h";
442   desc       = "FT4232H based generic programmer";
443   usbpid     = 0x6011;
444 ;
445
446 programmer
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.
481 programmer
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.
508 programmer
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.
541 programmer 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
551 programmer
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
569 programmer
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
590 programmer
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
607 programmer
608   id    = "avrisp";
609   desc  = "Atmel AVR ISP";
610   type  = "stk500";
611   connection_type = serial;
612 ;
613
614 programmer
615   id    = "avrispv2";
616   desc  = "Atmel AVR ISP V2";
617   type  =  "stk500v2";
618   connection_type = serial;
619 ;
620
621 programmer
622   id    = "avrispmkII";
623   desc  = "Atmel AVR ISP mkII";
624   type  =  "stk500v2";
625   connection_type = usb;
626 ;
627
628 programmer parent "avrispmkII"
629   id    = "avrisp2";
630 ;
631
632 programmer
633   id    = "buspirate";
634   desc  = "The Bus Pirate";
635   type  = "buspirate";
636   connection_type = serial;
637 ;
638
639 programmer
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.
657 programmer
658   id    = "stk500";
659   desc  = "Atmel STK500";
660   type  = "stk500generic";
661   connection_type = serial;
662 ;
663
664 programmer
665   id    = "stk500v1";
666   desc  = "Atmel STK500 Version 1.x firmware";
667   type  = "stk500";
668   connection_type = serial;
669 ;
670
671 programmer
672   id    = "mib510";
673   desc  = "Crossbow MIB510 programming board";
674   type  = "stk500";
675   connection_type = serial;
676 ;
677
678 programmer
679   id    = "stk500v2";
680   desc  = "Atmel STK500 Version 2.x firmware";
681   type  = "stk500v2";
682   connection_type = serial;
683 ;
684
685 programmer
686   id    = "stk500pp";
687   desc  = "Atmel STK500 V2 in parallel programming mode";
688   type  = "stk500pp";
689   connection_type = serial;
690 ;
691
692 programmer
693   id    = "stk500hvsp";
694   desc  = "Atmel STK500 V2 in high-voltage serial programming mode";
695   type  = "stk500hvsp";
696   connection_type = serial;
697 ;
698
699 programmer
700   id    = "stk600";
701   desc  = "Atmel STK600";
702   type  = "stk600";
703   connection_type = usb;
704 ;
705
706 programmer
707   id    = "stk600pp";
708   desc  = "Atmel STK600 in parallel programming mode";
709   type  = "stk600pp";
710   connection_type = usb;
711 ;
712
713 programmer
714   id    = "stk600hvsp";
715   desc  = "Atmel STK600 in high-voltage serial programming mode";
716   type  = "stk600hvsp";
717   connection_type = usb;
718 ;
719
720 programmer
721   id    = "avr910";
722   desc  = "Atmel Low Cost Serial Programmer";
723   type  = "avr910";
724   connection_type = serial;
725 ;
726
727 programmer
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
738 programmer
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
750 programmer
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!
763 programmer
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
775 programmer 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
786 programmer
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.
810 programmer
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
821 programmer
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
846 programmer
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
857 programmer
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
868 programmer
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    = "butterfly";
879   desc  = "Atmel Butterfly Development Board";
880   type  = "butterfly";
881   connection_type = serial;
882 ;
883
884 programmer
885   id    = "avr109";
886   desc  = "Atmel AppNote AVR109 Boot Loader";
887   type  = "butterfly";
888   connection_type = serial;
889 ;
890
891 programmer
892   id    = "avr911";
893   desc  = "Atmel AppNote AVR911 AVROSP";
894   type  = "butterfly";
895   connection_type = serial;
896 ;
897  
898 # suggested in http://forum.mikrokopter.de/topic-post48317.html
899 programmer
900   id    = "mkbutterfly";
901   desc  = "Mikrokopter.de Butterfly";
902   type  = "butterfly_mk";
903   connection_type = serial;
904 ;
905
906 programmer parent "mkbutterfly"
907   id    = "butterfly_mk";
908 ;
909
910 programmer
911   id    = "jtagmkI";
912   desc  = "Atmel JTAG ICE (mkI)";
913   baudrate = 115200;    # default is 115200
914   type  = "jtagmki";
915   connection_type = serial;
916 ;
917
918 # easier to type
919 programmer parent "jtagmkI"
920   id    = "jtag1";
921 ;
922
923 # easier to type
924 programmer parent "jtag1"
925   id    = "jtag1slow";
926   baudrate = 19200;
927 ;
928
929 # The JTAG ICE mkII has both, serial and USB connectivity.  As it is
930 # mostly used through USB these days (AVR Studio 5 only supporting it
931 # that way), we make connection_type = usb the default.  Users are
932 # still free to use a serial port with the -P option.
933
934 programmer
935   id    = "jtagmkII";
936   desc  = "Atmel JTAG ICE mkII";
937   baudrate = 19200;    # default is 19200
938   type  = "jtagmkii";
939   connection_type = usb;
940 ;
941
942 # easier to type
943 programmer parent "jtagmkII"
944   id    = "jtag2slow";
945 ;
946
947 # JTAG ICE mkII @ 115200 Bd
948 programmer parent "jtag2slow"
949   id    = "jtag2fast";
950   baudrate = 115200;
951 ;
952
953 # make the fast one the default, people will love that
954 programmer parent "jtag2fast"
955   id    = "jtag2";
956 ;
957
958 # JTAG ICE mkII in ISP mode
959 programmer
960   id    = "jtag2isp";
961   desc  = "Atmel JTAG ICE mkII in ISP mode";
962   baudrate = 115200;
963   type  = "jtagmkii_isp";
964   connection_type = usb;
965 ;
966
967 # JTAG ICE mkII in debugWire mode
968 programmer
969   id    = "jtag2dw";
970   desc  = "Atmel JTAG ICE mkII in debugWire mode";
971   baudrate = 115200;
972   type  = "jtagmkii_dw";
973   connection_type = usb;
974 ;
975
976 # JTAG ICE mkII in AVR32 mode
977 programmer
978   id    = "jtagmkII_avr32";
979   desc  = "Atmel JTAG ICE mkII im AVR32 mode";
980   baudrate = 115200;
981   type  = "jtagmkii_avr32";
982   connection_type = usb;
983 ;
984
985 # JTAG ICE mkII in AVR32 mode
986 programmer
987   id    = "jtag2avr32";
988   desc  = "Atmel JTAG ICE mkII im AVR32 mode";
989   baudrate = 115200;
990   type  = "jtagmkii_avr32";
991   connection_type = usb;
992 ;
993
994 # JTAG ICE mkII in PDI mode
995 programmer
996   id    = "jtag2pdi";
997   desc  = "Atmel JTAG ICE mkII PDI mode";
998   baudrate = 115200;
999   type  = "jtagmkii_pdi";
1000   connection_type = usb;
1001 ;
1002
1003 # AVR Dragon in JTAG mode
1004 programmer
1005   id    = "dragon_jtag";
1006   desc  = "Atmel AVR Dragon in JTAG mode";
1007   baudrate = 115200;
1008   type  = "dragon_jtag";
1009   connection_type = usb;
1010 ;
1011
1012 # AVR Dragon in ISP mode
1013 programmer
1014   id    = "dragon_isp";
1015   desc  = "Atmel AVR Dragon in ISP mode";
1016   baudrate = 115200;
1017   type  = "dragon_isp";
1018   connection_type = usb;
1019 ;
1020
1021 # AVR Dragon in PP mode
1022 programmer
1023   id    = "dragon_pp";
1024   desc  = "Atmel AVR Dragon in PP mode";
1025   baudrate = 115200;
1026   type  = "dragon_pp";
1027   connection_type = usb;
1028 ;
1029
1030 # AVR Dragon in HVSP mode
1031 programmer
1032   id    = "dragon_hvsp";
1033   desc  = "Atmel AVR Dragon in HVSP mode";
1034   baudrate = 115200;
1035   type  = "dragon_hvsp";
1036   connection_type = usb;
1037 ;
1038
1039 # AVR Dragon in debugWire mode
1040 programmer
1041   id    = "dragon_dw";
1042   desc  = "Atmel AVR Dragon in debugWire mode";
1043   baudrate = 115200;
1044   type  = "dragon_dw";
1045   connection_type = usb;
1046 ;
1047
1048 # AVR Dragon in PDI mode
1049 programmer
1050   id    = "dragon_pdi";
1051   desc  = "Atmel AVR Dragon in PDI mode";
1052   baudrate = 115200;
1053   type  = "dragon_pdi";
1054   connection_type = usb;
1055 ;
1056
1057 programmer
1058   id    = "jtag3";
1059   desc  = "Atmel AVR JTAGICE3 in JTAG mode";
1060   type  = "jtagice3";
1061   connection_type = usb;
1062   usbpid = 0x2110, 0x2140;
1063 ;
1064
1065 programmer
1066   id    = "jtag3pdi";
1067   desc  = "Atmel AVR JTAGICE3 in PDI mode";
1068   type  = "jtagice3_pdi";
1069   connection_type = usb;
1070   usbpid = 0x2110, 0x2140;
1071 ;
1072
1073 programmer
1074   id    = "jtag3dw";
1075   desc  = "Atmel AVR JTAGICE3 in debugWIRE mode";
1076   type  = "jtagice3_dw";
1077   connection_type = usb;
1078   usbpid = 0x2110, 0x2140;
1079 ;
1080
1081 programmer
1082   id    = "jtag3isp";
1083   desc  = "Atmel AVR JTAGICE3 in ISP mode";
1084   type  = "jtagice3_isp";
1085   connection_type = usb;
1086   usbpid = 0x2110, 0x2140;
1087 ;
1088
1089 programmer
1090   id    = "xplainedpro";
1091   desc  = "Atmel AVR XplainedPro in JTAG mode";
1092   type  = "jtagice3";
1093   connection_type = usb;
1094   usbpid = 0x2111;
1095 ;
1096
1097 programmer
1098   id    = "xplainedmini";
1099   desc  = "Atmel AVR XplainedMini in ISP mode";
1100   type  = "jtagice3_isp";
1101   connection_type = usb;
1102   usbpid = 0x2145;
1103 ;
1104
1105 programmer
1106   id    = "xplainedmini_dw";
1107   desc  = "Atmel AVR XplainedMini in debugWIRE mode";
1108   type  = "jtagice3_dw";
1109   connection_type = usb;
1110   usbpid = 0x2145;
1111 ;
1112
1113 programmer
1114   id    = "atmelice";
1115   desc  = "Atmel-ICE (ARM/AVR) in JTAG mode";
1116   type  = "jtagice3";
1117   connection_type = usb;
1118   usbpid = 0x2141;
1119 ;
1120
1121 programmer
1122   id    = "atmelice_pdi";
1123   desc  = "Atmel-ICE (ARM/AVR) in PDI mode";
1124   type  = "jtagice3_pdi";
1125   connection_type = usb;
1126   usbpid = 0x2141;
1127 ;
1128
1129 programmer
1130   id    = "atmelice_dw";
1131   desc  = "Atmel-ICE (ARM/AVR) in debugWIRE mode";
1132   type  = "jtagice3_dw";
1133   connection_type = usb;
1134   usbpid = 0x2141;
1135 ;
1136
1137 programmer
1138   id    = "atmelice_isp";
1139   desc  = "Atmel-ICE (ARM/AVR) in ISP mode";
1140   type  = "jtagice3_isp";
1141   connection_type = usb;
1142   usbpid = 0x2141;
1143 ;
1144
1145
1146 programmer
1147   id    = "pavr";
1148   desc  = "Jason Kyle's pAVR Serial Programmer";
1149   type  = "avr910";
1150   connection_type = serial;
1151 ;
1152
1153 programmer
1154   id    = "pickit2";
1155   desc  = "MicroChip's PICkit2 Programmer";
1156   type  = "pickit2";
1157   connection_type = usb;
1158 ;
1159
1160 programmer
1161   id    = "flip1";
1162   desc  = "FLIP USB DFU protocol version 1 (doc7618)";
1163   type  = "flip1";
1164   connection_type = usb;
1165 ;
1166
1167 programmer
1168   id    = "flip2";
1169   desc  = "FLIP USB DFU protocol version 2 (AVR4023)";
1170   type  = "flip2";
1171   connection_type = usb;
1172 ;
1173
1174 # Parallel port programmers.
1175
1176 programmer
1177   id    = "bsd";
1178   desc  = "Brian Dean's Programmer, http://www.bsdhome.com/avrdude/";
1179   type  = "par";
1180   connection_type = parallel;
1181   vcc   = 2, 3, 4, 5;
1182   reset = 7;
1183   sck   = 8;
1184   mosi  = 9;
1185   miso  = 10;
1186 ;
1187
1188 programmer
1189   id    = "stk200";
1190   desc  = "STK200";
1191   type  = "par";
1192   connection_type = parallel;
1193   buff  = 4, 5;
1194   sck   = 6;
1195   mosi  = 7;
1196   reset = 9;
1197   miso  = 10;
1198 ;
1199
1200 # The programming dongle used by the popular Ponyprog
1201 # utility.  It is almost similar to the STK200 one,
1202 # except that there is a LED indicating that the
1203 # programming is currently in progress.
1204
1205 programmer parent "stk200"
1206   id    = "pony-stk200";
1207   desc  = "Pony Prog STK200";
1208   pgmled = 8; 
1209 ;
1210
1211 programmer
1212   id    = "dt006";
1213   desc  = "Dontronics DT006";
1214   type  = "par";
1215   connection_type = parallel;
1216   reset = 4;
1217   sck   = 5;
1218   mosi  = 2;
1219   miso  = 11;
1220 ;
1221
1222 programmer parent "dt006"
1223   id    = "bascom";
1224   desc  = "Bascom SAMPLE programming cable";
1225 ;
1226
1227 programmer
1228   id     = "alf";
1229   desc   = "Nightshade ALF-PgmAVR, http://nightshade.homeip.net/";
1230   type   = "par";
1231   connection_type = parallel;
1232   vcc    = 2, 3, 4, 5;
1233   buff   = 6;
1234   reset  = 7;
1235   sck    = 8;
1236   mosi   = 9;
1237   miso   = 10;
1238   errled = 1;
1239   rdyled = 14;
1240   pgmled = 16;
1241   vfyled = 17;
1242 ;
1243
1244 programmer
1245   id    = "sp12";
1246   desc  = "Steve Bolt's Programmer";
1247   type  = "par";
1248   connection_type = parallel;
1249   vcc   = 4,5,6,7,8;
1250   reset = 3;
1251   sck   = 2;
1252   mosi  = 9;
1253   miso  = 11;
1254 ;
1255
1256 programmer
1257   id     = "picoweb";
1258   desc   = "Picoweb Programming Cable, http://www.picoweb.net/";
1259   type   = "par";
1260   connection_type = parallel;
1261   reset  = 2;
1262   sck    = 3;
1263   mosi   = 4;
1264   miso   = 13;
1265 ;
1266
1267 programmer
1268   id    = "abcmini";
1269   desc  = "ABCmini Board, aka Dick Smith HOTCHIP";
1270   type  = "par";
1271   connection_type = parallel;
1272   reset = 4;
1273   sck   = 3;
1274   mosi  = 2;
1275   miso  = 10;
1276 ;
1277
1278 programmer
1279   id    = "futurlec";
1280   desc  = "Futurlec.com programming cable.";
1281   type  = "par";
1282   connection_type = parallel;
1283   reset = 3;
1284   sck   = 2;
1285   mosi  = 1;
1286   miso  = 10;
1287 ;
1288
1289
1290 # From the contributor of the "xil" jtag cable:
1291 # The "vcc" definition isn't really vcc (the cable gets its power from
1292 # the programming circuit) but is necessary to switch one of the
1293 # buffer lines (trying to add it to the "buff" lines doesn't work in 
1294 # avrdude versions before 5.5j).
1295 # With this, TMS connects to RESET, TDI to MOSI, TDO to MISO and TCK
1296 # to SCK (plus vcc/gnd of course)
1297 programmer
1298   id    = "xil";
1299   desc  = "Xilinx JTAG cable";
1300   type  = "par";
1301   connection_type = parallel;
1302   mosi  = 2;
1303   sck   = 3;
1304   reset = 4;
1305   buff  = 5;
1306   miso  = 13;
1307   vcc   = 6;
1308 ;
1309
1310
1311 programmer
1312   id = "dapa";
1313   desc = "Direct AVR Parallel Access cable";
1314   type = "par";
1315   connection_type = parallel;
1316   vcc   = 3;
1317   reset = 16;
1318   sck = 1;
1319   mosi = 2;
1320   miso = 11;
1321 ;
1322
1323 programmer
1324   id    = "atisp";
1325   desc  = "AT-ISP V1.1 programming cable for AVR-SDK1 from <http://micro-research.co.th/> micro-research.co.th";
1326   type  = "par";
1327   connection_type = parallel;
1328   reset = ~6;
1329   sck   = ~8;
1330   mosi  = ~7;
1331   miso  = ~10;
1332 ;
1333
1334 programmer
1335   id    = "ere-isp-avr";
1336   desc  = "ERE ISP-AVR <http://www.ere.co.th/download/sch050713.pdf>";
1337   type  = "par";
1338   connection_type = parallel;
1339   reset = ~4;
1340   sck   = 3;
1341   mosi  = 2;
1342   miso  = 10;
1343 ;
1344
1345 programmer
1346   id    = "blaster";
1347   desc  = "Altera ByteBlaster";
1348   type  = "par";
1349   connection_type = parallel;
1350   sck   = 2;
1351   miso  = 11;
1352   reset = 3;
1353   mosi  = 8;
1354   buff  = 14;
1355 ;
1356
1357 # It is almost same as pony-stk200, except vcc on pin 5 to auto
1358 # disconnect port (download on http://electropol.free.fr/spip/spip.php?article27)
1359 programmer parent "pony-stk200"
1360   id    = "frank-stk200";
1361   desc  = "Frank STK200";
1362   buff  = ; # delete buff pin assignment
1363   vcc   = 5;
1364 ;
1365
1366 # The AT98ISP Cable is a simple parallel dongle for AT89 family.
1367 # http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2877
1368 programmer
1369   id = "89isp";
1370   desc = "Atmel at89isp cable";
1371   type = "par";
1372   connection_type = parallel;
1373   reset = 17;
1374   sck = 1;
1375   mosi = 2;
1376   miso = 10;
1377 ;
1378
1379
1380 #This programmer bitbangs GPIO lines using the Linux sysfs GPIO interface
1381 #
1382 #To enable it set the configuration below to match the GPIO lines connected to the
1383 #relevant ISP header pins and uncomment the entry definition. In case you don't
1384 #have the required permissions to edit this system wide config file put the
1385 #entry in a separate <your name>.conf file and use it with -C+<your name>.conf
1386 #on the command line.
1387 #
1388 #To check if your avrdude build has support for the linuxgpio programmer compiled in,
1389 #use -c?type on the command line and look for linuxgpio in the list. If it's not available
1390 #you need pass the --enable-linuxgpio=yes option to configure and recompile avrdude.
1391 #
1392 #programmer
1393 #  id    = "linuxgpio";
1394 #  desc  = "Use the Linux sysfs interface to bitbang GPIO lines";
1395 #  type  = "linuxgpio";
1396 #  reset = ?;
1397 #  sck   = ?;
1398 #  mosi  = ?;
1399 #  miso  = ?;
1400 #;
1401
1402 # some ultra cheap programmers use bitbanging on the 
1403 # serialport.
1404 #
1405 # PC - DB9 - Pins for RS232:
1406 #
1407 # GND   5   -- |O
1408 #              |   O| <-   9   RI
1409 # DTR   4   <- |O   |
1410 #              |   O| <-   8   CTS
1411 # TXD   3   <- |O   |
1412 #              |   O| ->   7   RTS
1413 # RXD   2   -> |O   |
1414 #              |   O| <-   6   DSR
1415 # DCD   1   -> |O
1416 #
1417 # Using RXD is currently not supported.
1418 # Using RI is not supported under Win32 but is supported under Posix.
1419
1420 # serial ponyprog design (dasa2 in uisp)
1421 # reset=!txd sck=rts mosi=dtr miso=cts
1422
1423 programmer
1424   id    = "ponyser";
1425   desc  = "design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts";
1426   type  = "serbb";
1427   connection_type = serial;
1428   reset = ~3;
1429   sck   = 7;
1430   mosi  = 4;
1431   miso  = 8;
1432 ;
1433
1434 # Same as above, different name
1435 # reset=!txd sck=rts mosi=dtr miso=cts
1436
1437 programmer parent "ponyser"
1438   id    = "siprog";
1439   desc  = "Lancos SI-Prog <http://www.lancos.com/siprogsch.html>";
1440 ;
1441
1442 # unknown (dasa in uisp)
1443 # reset=rts sck=dtr mosi=txd miso=cts
1444
1445 programmer
1446   id    = "dasa";
1447   desc  = "serial port banging, reset=rts sck=dtr mosi=txd miso=cts";
1448   type  = "serbb";
1449   connection_type = serial;
1450   reset = 7;
1451   sck   = 4;
1452   mosi  = 3;
1453   miso  = 8;
1454 ;
1455
1456 # unknown (dasa3 in uisp)
1457 # reset=!dtr sck=rts mosi=txd miso=cts
1458
1459 programmer
1460   id    = "dasa3";
1461   desc  = "serial port banging, reset=!dtr sck=rts mosi=txd miso=cts";
1462   type  = "serbb";
1463   connection_type = serial;
1464   reset = ~4;
1465   sck   = 7;
1466   mosi  = 3;
1467   miso  = 8;
1468 ;
1469
1470 # C2N232i (jumper configuration "auto")
1471 # reset=dtr sck=!rts mosi=!txd miso=!cts
1472
1473 programmer
1474   id    = "c2n232i";
1475   desc  = "serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts";
1476   type  = "serbb";
1477   connection_type = serial;
1478   reset = 4;
1479   sck   = ~7;
1480   mosi  = ~3;
1481   miso  = ~8;
1482 ;
1483
1484 #
1485 # PART DEFINITIONS
1486 #
1487
1488 #------------------------------------------------------------
1489 # ATtiny11
1490 #------------------------------------------------------------
1491
1492 # This is an HVSP-only device.
1493
1494 part
1495     id                  = "t11";
1496     desc                = "ATtiny11";
1497     stk500_devcode      = 0x11;
1498     signature           = 0x1e 0x90 0x04;
1499     chip_erase_delay    = 20000;
1500
1501     timeout             = 200;
1502     hvsp_controlstack     =
1503         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00,
1504         0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
1505         0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
1506         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
1507     hventerstabdelay    = 100;
1508     progmodedelay       = 0;
1509     hvspcmdexedelay     = 0;
1510     synchcycles         = 6;
1511     latchcycles         = 1;
1512     togglevtg           = 1;
1513     poweroffdelay       = 25;
1514     resetdelayms        = 0;
1515     resetdelayus        = 50;
1516     hvleavestabdelay    = 100;
1517     resetdelay          = 25;
1518     chiperasepolltimeout = 40;
1519     chiperasetime       = 0;
1520     programfusepolltimeout = 25;
1521     programlockpolltimeout = 25;
1522
1523     memory "eeprom"
1524         size            = 64;
1525         blocksize       = 64;
1526         readsize        = 256;
1527         delay           = 5;
1528     ;
1529
1530     memory "flash"
1531         size            = 1024;
1532         blocksize       = 128;
1533         readsize        = 256;
1534         delay           = 3;
1535     ;
1536
1537     memory "signature"
1538         size            = 3;
1539     ;
1540
1541     memory "lock"
1542         size            = 1;
1543     ;
1544
1545     memory "calibration"
1546         size            = 1;
1547     ;
1548
1549     memory "fuse"
1550         size            = 1;
1551     ;
1552 ;
1553
1554 #------------------------------------------------------------
1555 # ATtiny12
1556 #------------------------------------------------------------
1557
1558 part
1559     id                  = "t12";
1560     desc                = "ATtiny12";
1561     stk500_devcode      = 0x12;
1562     avr910_devcode      = 0x55;
1563     signature           = 0x1e 0x90 0x05;
1564     chip_erase_delay    = 20000;
1565     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
1566                           "x x x x  x x x x   x x x x  x x x x";
1567
1568     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
1569                           "x x x x  x x x x   x x x x  x x x x";
1570
1571     timeout             = 200;
1572     stabdelay           = 100;
1573     cmdexedelay         = 25;
1574     synchloops          = 32;
1575     bytedelay           = 0;
1576     pollindex           = 3;
1577     pollvalue           = 0x53;
1578     predelay            = 1;
1579     postdelay           = 1;
1580     pollmethod          = 0;
1581
1582     hvsp_controlstack   =
1583         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00,
1584         0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
1585         0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
1586         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
1587     hventerstabdelay    = 100;
1588     hvspcmdexedelay     = 0;
1589     synchcycles         = 6;
1590     latchcycles         = 1;
1591     togglevtg           = 1;
1592     poweroffdelay       = 25;
1593     resetdelayms        = 0;
1594     resetdelayus        = 50;
1595     hvleavestabdelay    = 100;
1596     resetdelay          = 25;
1597     chiperasepolltimeout = 40;
1598     chiperasetime       = 0;
1599     programfusepolltimeout = 25;
1600     programlockpolltimeout = 25;
1601
1602     memory "eeprom"
1603         size            = 64;
1604         min_write_delay = 9000;
1605         max_write_delay = 20000;
1606         readback_p1     = 0xff;
1607         readback_p2     = 0xff;
1608         read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
1609                           "x  x a5 a4  a3 a2 a1 a0    o o o o  o o o o";
1610
1611         write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
1612                           "x  x a5 a4  a3 a2 a1 a0    i i i i  i i i i";
1613
1614         mode            = 0x04;
1615         delay           = 8;
1616         blocksize       = 64;
1617         readsize        = 256;
1618     ;
1619
1620     memory "flash"
1621         size            = 1024;
1622         min_write_delay = 4500;
1623         max_write_delay = 20000;
1624         readback_p1     = 0xff;
1625         readback_p2     = 0xff;
1626         read_lo         = "  0  0  1  0   0  0  0  0",
1627                           "  x  x  x  x   x  x  x a8",
1628                           " a7 a6 a5 a4  a3 a2 a1 a0",
1629                           "  o  o  o  o   o  o  o  o";
1630
1631         read_hi         = "  0  0  1  0   1  0  0  0",
1632                           "  x  x  x  x   x  x  x a8",
1633                           " a7 a6 a5 a4  a3 a2 a1 a0",
1634                           "  o  o  o  o   o  o  o  o";
1635
1636         write_lo        = "  0  1  0  0   0  0  0  0",
1637                           "  x  x  x  x   x  x  x a8",
1638                           " a7 a6 a5 a4  a3 a2 a1 a0",
1639                           "  i  i  i  i   i  i  i  i";
1640
1641         write_hi        = "  0  1  0  0   1  0  0  0",
1642                           "  x  x  x  x   x  x  x a8",
1643                           " a7 a6 a5 a4  a3 a2 a1 a0",
1644                           "  i  i  i  i   i  i  i  i";
1645
1646         mode            = 0x04;
1647         delay           = 5;
1648         blocksize       = 128;
1649         readsize        = 256;
1650     ;
1651
1652     memory "signature"
1653         size            = 3;
1654         read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
1655                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
1656     ;
1657
1658     memory "lock"
1659         size            = 1;
1660         read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
1661                           "x  x  x  x   x  x  x  x    x x x x  x o o x";
1662
1663         write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 i i 1",
1664                           "x  x  x  x   x  x  x  x    x x x x  x x x x";
1665         min_write_delay = 9000;
1666         max_write_delay = 9000;
1667     ;
1668
1669     memory "calibration"
1670         size            = 1;
1671         read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
1672                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
1673     ;
1674
1675     memory "fuse"
1676         size            = 1;
1677         read            = "0  1  0  1   0  0  0  0    x x x x  x x x x",
1678                           "x  x  x  x   x  x  x  x    o o o o  o o o o";
1679
1680         write           = "1  0  1  0   1  1  0  0    1 0 1 x  x x x x",
1681                           "x  x  x  x   x  x  x  x    i i i i  i i i i";
1682         min_write_delay = 9000;
1683         max_write_delay = 9000;
1684     ;
1685 ;
1686
1687 #------------------------------------------------------------
1688 # ATtiny13
1689 #------------------------------------------------------------
1690
1691 part
1692     id                  = "t13";
1693     desc                = "ATtiny13";
1694      has_debugwire = yes;
1695      flash_instr   = 0xB4, 0x0E, 0x1E;
1696      eeprom_instr  = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
1697                      0xBC, 0x0E, 0xB4, 0x0E, 0xBA, 0x0D, 0xBB, 0xBC,
1698                      0x99, 0xE1, 0xBB, 0xAC;
1699     stk500_devcode      = 0x14;
1700     signature           = 0x1e 0x90 0x07;
1701     chip_erase_delay    = 4000;
1702     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
1703                           "x x x x  x x x x   x x x x  x x x x";
1704
1705     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
1706                           "x x x x  x x x x   x x x x  x x x x";
1707
1708     timeout             = 200;
1709     stabdelay           = 100;
1710     cmdexedelay         = 25;
1711     synchloops          = 32;
1712     bytedelay           = 0;
1713     pollindex           = 3;
1714     pollvalue           = 0x53;
1715     predelay            = 1;
1716     postdelay           = 1;
1717     pollmethod          = 1;
1718
1719     hvsp_controlstack     =
1720         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
1721         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
1722         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
1723         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
1724     hventerstabdelay    = 100;
1725     progmodedelay       = 0;
1726     hvspcmdexedelay     = 0;
1727     synchcycles         = 6;
1728     latchcycles         = 1;
1729     togglevtg           = 1;
1730     poweroffdelay       = 25;
1731     resetdelayms        = 0;
1732     resetdelayus        = 90;
1733     hvleavestabdelay    = 100;
1734     resetdelay          = 25;
1735     chiperasepolltimeout = 40;
1736     chiperasetime       = 0;
1737     programfusepolltimeout = 25;
1738     programlockpolltimeout = 25;
1739
1740     ocdrev              = 0;
1741
1742     memory "eeprom"
1743         size            = 64;
1744         page_size       = 4;
1745         min_write_delay = 4000;
1746         max_write_delay = 4000;
1747         readback_p1     = 0xff;
1748         readback_p2     = 0xff;
1749         read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x x",
1750                           "x  x a5 a4  a3 a2 a1 a0    o o o o  o o o o";
1751
1752         write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
1753                           "x  x a5 a4  a3 a2 a1 a0    i i i i  i i i i";
1754
1755         loadpage_lo     = "  1   1   0   0      0   0   0   1",
1756                           "  0   0   0   0      0   0   0   0",
1757                           "  0   0   0   0      0   0  a1  a0",
1758                           "  i   i   i   i      i   i   i   i";
1759
1760         writepage       = "  1   1   0   0      0   0   1   0",
1761                           "  0   0   x   x      x   x   x   x",
1762                           "  x   x  a5  a4     a3  a2   0   0",
1763                           "  x   x   x   x      x   x   x   x";
1764
1765         mode            = 0x41;
1766         delay           = 5;
1767         blocksize       = 4;
1768         readsize        = 256;
1769     ;
1770
1771     memory "flash"
1772         paged           = yes;
1773         size            = 1024;
1774         page_size       = 32;
1775         num_pages       = 32;
1776         min_write_delay = 4500;
1777         max_write_delay = 4500;
1778         readback_p1     = 0xff;
1779         readback_p2     = 0xff;
1780         read_lo         = "  0  0  1  0   0  0  0  0",
1781                           "  0  0  0  0   0  0  0 a8",
1782                           " a7 a6 a5 a4  a3 a2 a1 a0",
1783                           "  o  o  o  o   o  o  o  o";
1784
1785         read_hi         = "  0  0  1  0   1  0  0  0",
1786                           "  0  0  0  0   0  0  0 a8",
1787                           " a7 a6 a5 a4  a3 a2 a1 a0",
1788                           "  o  o  o  o   o  o  o  o";
1789
1790         loadpage_lo     = "  0  1  0  0   0  0  0  0",
1791                           "  0  0  0  x   x  x  x  x",
1792                           "  x  x  x  x  a3 a2 a1 a0",
1793                           "  i  i  i  i   i  i  i  i";
1794
1795         loadpage_hi     = "  0  1  0  0   1  0  0  0",
1796                           "  0  0  0  x   x  x  x  x",
1797                           "  x  x  x  x  a3 a2 a1 a0",
1798                           "  i  i  i  i   i  i  i  i";
1799
1800         writepage       = "  0  1  0  0   1  1  0  0",
1801                           "  0  0  0  0   0  0  0 a8",
1802                           " a7 a6 a5 a4   x  x  x  x",
1803                           "  x  x  x  x   x  x  x  x";
1804
1805         mode            = 0x41;
1806         delay           = 6;
1807         blocksize       = 32;
1808         readsize        = 256;
1809     ;
1810
1811     memory "signature"
1812         size            = 3;
1813         read            = "0  0  1  1   0  0  0  0    0 0 0 x  x x x x",
1814                           "x  x  x  x   x  x a1 a0    o o o o  o o o o";
1815     ;
1816
1817     memory "lock"
1818         size            = 1;
1819         min_write_delay = 4500;
1820         max_write_delay = 4500;
1821
1822         read            = "0  1  0  1   1  0  0  0    0 0 0 0  0 0 0 0",
1823                           "x  x  x  x   x  x  x  x    x x o o  o o o o";
1824
1825         write           = "1  0  1  0   1  1  0  0    1 1 1 x  x x x x",
1826                           "x  x  x  x   x  x  x  x    1 1 i i  i i i i";
1827     ;
1828
1829     memory "calibration"
1830         size            = 2;
1831         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
1832                           "0  0  0  0   0  0  0 a0    o o o o  o o o o";
1833     ;
1834
1835     memory "lfuse"
1836         size            = 1;
1837         min_write_delay = 4500;
1838         max_write_delay = 4500;
1839
1840         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
1841                           "x x x x  x x x x  i i i i  i i i i";
1842
1843         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
1844                           "x x x x  x x x x  o o o o  o o o o";
1845       ;
1846
1847     memory "hfuse"
1848         size            = 1;
1849         min_write_delay = 4500;
1850         max_write_delay = 4500;
1851
1852         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
1853                           "x x x x  x x x x  i i i i  i i i i";
1854
1855         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
1856                           "x x x x  x x x x  o o o o  o o o o";
1857       ;
1858
1859 ;
1860
1861
1862 #------------------------------------------------------------
1863 # ATtiny15
1864 #------------------------------------------------------------
1865
1866 part
1867     id                  = "t15";
1868     desc                = "ATtiny15";
1869     stk500_devcode      = 0x13;
1870     avr910_devcode      = 0x56;
1871     signature           = 0x1e 0x90 0x06;
1872     chip_erase_delay    = 8200;
1873     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
1874                           "x x x x  x x x x   x x x x  x x x x";
1875
1876     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
1877                           "x x x x  x x x x   x x x x  x x x x";
1878
1879     timeout             = 200;
1880     stabdelay           = 100;
1881     cmdexedelay         = 25;
1882     synchloops          = 32;
1883     bytedelay           = 0;
1884     pollindex           = 3;
1885     pollvalue           = 0x53;
1886     predelay            = 1;
1887     postdelay           = 1;
1888     pollmethod          = 0;
1889
1890     hvsp_controlstack   =
1891         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00,
1892         0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
1893         0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
1894         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
1895     hventerstabdelay    = 100;
1896     hvspcmdexedelay     = 5;
1897     synchcycles         = 6;
1898     latchcycles         = 16;
1899     togglevtg           = 1;
1900     poweroffdelay       = 25;
1901     resetdelayms        = 0;
1902     resetdelayus        = 50;
1903     hvleavestabdelay    = 100;
1904     resetdelay          = 25;
1905     chiperasepolltimeout = 40;
1906     chiperasetime       = 0;
1907     programfusepolltimeout = 25;
1908     programlockpolltimeout = 25;
1909
1910     memory "eeprom"
1911         size            = 64;
1912         min_write_delay = 8200;
1913         max_write_delay = 8200;
1914         readback_p1     = 0xff;
1915         readback_p2     = 0xff;
1916         read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
1917                           "x  x a5 a4  a3 a2 a1 a0    o o o o  o o o o";
1918
1919         write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
1920                           "x  x a5 a4  a3 a2 a1 a0    i i i i  i i i i";
1921
1922         mode            = 0x04;
1923         delay           = 10;
1924         blocksize       = 64;
1925         readsize        = 256;
1926     ;
1927
1928     memory "flash"
1929         size            = 1024;
1930         min_write_delay = 4100;
1931         max_write_delay = 4100;
1932         readback_p1     = 0xff;
1933         readback_p2     = 0xff;
1934         read_lo         = "  0  0  1  0   0  0  0  0",
1935                           "  x  x  x  x   x  x  x a8",
1936                           " a7 a6 a5 a4  a3 a2 a1 a0",
1937                           "  o  o  o  o   o  o  o  o";
1938
1939         read_hi         = "  0  0  1  0   1  0  0  0",
1940                           "  x  x  x  x   x  x  x a8",
1941                           " a7 a6 a5 a4  a3 a2 a1 a0",
1942                           "  o  o  o  o   o  o  o  o";
1943
1944         write_lo        = "  0  1  0  0   0  0  0  0",
1945                           "  x  x  x  x   x  x  x a8",
1946                           " a7 a6 a5 a4  a3 a2 a1 a0",
1947                           "  i  i  i  i   i  i  i  i";
1948
1949         write_hi        = "  0  1  0  0   1  0  0  0",
1950                           "  x  x  x  x   x  x  x a8",
1951                           " a7 a6 a5 a4  a3 a2 a1 a0",
1952                           "  i  i  i  i   i  i  i  i";
1953
1954         mode            = 0x04;
1955         delay           = 5;
1956         blocksize       = 128;
1957         readsize        = 256;
1958     ;
1959
1960     memory "signature"
1961         size            = 3;
1962         read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
1963                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
1964     ;
1965
1966     memory "lock"
1967         size            = 1;
1968         read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
1969                           "x  x  x  x   x  x  x  x    x x x x  x o o x";
1970
1971         write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 i i 1",
1972                           "x  x  x  x   x  x  x  x    x x x x  x x x x";
1973         min_write_delay = 9000;
1974         max_write_delay = 9000;
1975     ;
1976
1977     memory "calibration"
1978         size            = 1;
1979         read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
1980                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
1981     ;
1982
1983     memory "fuse"
1984         size            = 1;
1985         read            = "0  1  0  1   0  0  0  0    x x x x  x x x x",
1986                           "x  x  x  x   x  x  x  x    o o o o  x x o o";
1987
1988         write           = "1  0  1  0   1  1  0  0    1 0 1 x  x x x x",
1989                           "x  x  x  x   x  x  x  x    i i i i  1 1 i i";
1990         min_write_delay = 9000;
1991         max_write_delay = 9000;
1992     ;
1993 ;
1994
1995 #------------------------------------------------------------
1996 # AT90s1200
1997 #------------------------------------------------------------
1998
1999 part
2000     id               = "1200";
2001     desc             = "AT90S1200";
2002     is_at90s1200     = yes;
2003     stk500_devcode   = 0x33;
2004     avr910_devcode   = 0x13;
2005     signature        = 0x1e 0x90 0x01;
2006     pagel            = 0xd7;
2007     bs2              = 0xa0;
2008     chip_erase_delay = 20000;
2009     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2010                        "x x x x  x x x x    x x x x  x x x x";
2011
2012     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2013                        "x x x x  x x x x    x x x x  x x x x";
2014
2015     timeout             = 200;
2016     stabdelay           = 100;
2017     cmdexedelay         = 25;
2018     synchloops          = 1;
2019     bytedelay           = 0;
2020     pollindex           = 0;
2021     pollvalue           = 0xFF;
2022     predelay            = 1;
2023     postdelay           = 1;
2024     pollmethod          = 0;
2025
2026     pp_controlstack     =
2027         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2028         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2029         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2030         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2031     hventerstabdelay    = 100;
2032     progmodedelay       = 0;
2033     latchcycles         = 0;
2034     togglevtg           = 0;
2035     poweroffdelay       = 0;
2036     resetdelayms        = 0;
2037     resetdelayus        = 0;
2038     hvleavestabdelay    = 15;
2039     chiperasepulsewidth = 15;
2040     chiperasepolltimeout = 0;
2041     programfusepulsewidth = 2;
2042     programfusepolltimeout = 0;
2043     programlockpulsewidth = 0;
2044     programlockpolltimeout = 1;
2045
2046     memory "eeprom"
2047         size            = 64;
2048         min_write_delay = 4000;
2049         max_write_delay = 9000;
2050         readback_p1     = 0x00;
2051         readback_p2     = 0xff;
2052         read            = "1 0  1  0   0  0  0  0   x x x x  x x x x", 
2053                           "x x a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2054
2055         write           = "1 1  0  0   0  0  0  0   x x x x  x x x x",
2056                           "x x a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2057
2058         mode            = 0x04;
2059         delay           = 20;
2060         blocksize       = 32;
2061         readsize        = 256;
2062       ;
2063     memory "flash"
2064         size            = 1024;
2065         min_write_delay = 4000;
2066         max_write_delay = 9000;
2067         readback_p1     = 0xff;
2068         readback_p2     = 0xff;
2069         read_lo         = "  0   0   1   0    0   0   0   0",
2070                           "  x   x   x   x    x   x   x  a8",
2071                           " a7  a6  a5  a4   a3  a2  a1  a0",
2072                           "  o   o   o   o    o   o   o   o";
2073
2074         read_hi         = "  0   0   1   0    1   0   0   0",
2075                           "  x   x   x   x    x   x   x  a8",
2076                           " a7  a6  a5  a4   a3  a2  a1  a0",
2077                           "  o   o   o   o    o   o   o   o";
2078
2079         write_lo        = "  0   1   0   0    0   0   0   0",
2080                           "  x   x   x   x    x   x   x  a8",
2081                           " a7  a6  a5  a4   a3  a2  a1  a0",
2082                           "  i   i   i   i    i   i   i   i";
2083
2084         write_hi        = "  0   1   0   0    1   0   0   0",
2085                           "  x   x   x   x    x   x   x  a8",
2086                           " a7  a6  a5  a4   a3  a2  a1  a0",
2087                           "  i   i   i   i    i   i   i   i";
2088
2089         mode            = 0x02;
2090         delay           = 15;
2091         blocksize       = 128;
2092         readsize        = 256;
2093       ;
2094     memory "signature"
2095         size            = 3;
2096         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2097                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2098       ;
2099     memory "fuse"
2100         size            = 1;
2101       ;
2102     memory "lock"
2103         size            = 1;
2104         min_write_delay = 9000;
2105         max_write_delay = 20000;
2106         write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2107                           "x x x x  x x x x   x x x x  x x x x";
2108       ;
2109   ;
2110
2111 #------------------------------------------------------------
2112 # AT90s4414
2113 #------------------------------------------------------------
2114
2115 part
2116     id               = "4414";
2117     desc             = "AT90S4414";
2118     stk500_devcode   = 0x50;
2119     avr910_devcode   = 0x28;
2120     signature        = 0x1e 0x92 0x01;
2121     chip_erase_delay = 20000;
2122     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2123                        "x x x x  x x x x    x x x x  x x x x";
2124
2125     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2126                        "x x x x  x x x x    x x x x  x x x x";
2127
2128     timeout             = 200;
2129     stabdelay           = 100;
2130     cmdexedelay         = 25;
2131     synchloops          = 32;
2132     bytedelay           = 0;
2133     pollindex           = 3;
2134     pollvalue           = 0x53;
2135     predelay            = 1;
2136     postdelay           = 1;
2137     pollmethod          = 0;
2138
2139     pp_controlstack     =
2140         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2141         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2142         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2143         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
2144     hventerstabdelay    = 100;
2145     progmodedelay       = 0;
2146     latchcycles         = 0;
2147     togglevtg           = 0;
2148     poweroffdelay       = 0;
2149     resetdelayms        = 0;
2150     resetdelayus        = 0;
2151     hvleavestabdelay    = 15;
2152     chiperasepulsewidth = 15;
2153     chiperasepolltimeout = 0;
2154     programfusepulsewidth = 2;
2155     programfusepolltimeout = 0;
2156     programlockpulsewidth = 0;
2157     programlockpolltimeout = 1;
2158
2159     memory "eeprom"
2160         size            = 256;
2161         min_write_delay = 9000;
2162         max_write_delay = 20000;
2163         readback_p1     = 0x80;
2164         readback_p2     = 0x7f;
2165         read            = " 1  0  1  0   0  0  0  0  x x x x  x x x a8", 
2166                           "a7 a6 a5 a4 a3 a2 a1 a0   o o o o  o o o o";
2167
2168         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x a8",
2169                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2170
2171         mode            = 0x04;
2172         delay           = 12;
2173         blocksize       = 64;
2174         readsize        = 256;
2175       ;
2176     memory "flash"
2177         size            = 4096;
2178         min_write_delay = 9000;
2179         max_write_delay = 20000;
2180         readback_p1     = 0x7f;
2181         readback_p2     = 0x7f;
2182         read_lo         = "  0   0   1   0    0   0   0   0",
2183                           "  x   x   x   x  a11 a10  a9  a8",
2184                           " a7  a6  a5  a4   a3  a2  a1  a0",
2185                           "  o   o   o   o    o   o   o   o";
2186
2187         read_hi         = "  0   0   1   0    1   0   0   0",
2188                           "  x   x   x   x  a11 a10  a9  a8",
2189                           " a7  a6  a5  a4   a3  a2  a1  a0",
2190                           "  o   o   o   o    o   o   o   o";
2191
2192         write_lo        = "  0   1   0   0    0   0   0   0",
2193                           "  x   x   x   x  a11 a10  a9  a8",
2194                           " a7  a6  a5  a4   a3  a2  a1  a0",
2195                           "  i   i   i   i    i   i   i   i";
2196
2197         write_hi        = "  0   1   0   0    1   0   0   0",
2198                           "  x   x   x   x  a11 a10  a9  a8",
2199                           " a7  a6  a5  a4   a3  a2  a1  a0",
2200                           "  i   i   i   i    i   i   i   i";
2201
2202         mode            = 0x04;
2203         delay           = 12;
2204         blocksize       = 64;
2205         readsize        = 256;
2206       ;
2207     memory "signature"
2208         size            = 3;
2209         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2210                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2211       ;
2212     memory "fuse"
2213         size            = 1;
2214       ;
2215     memory "lock"
2216         size            = 1;
2217         write           = "1  0  1  0   1  1  0  0   1  1  1  1   1  i  i  1",
2218                           "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  x";
2219         min_write_delay = 9000;
2220         max_write_delay = 9000;
2221       ;
2222   ;
2223
2224 #------------------------------------------------------------
2225 # AT90s2313
2226 #------------------------------------------------------------
2227
2228 part
2229     id               = "2313";
2230     desc             = "AT90S2313";
2231     stk500_devcode   = 0x40;
2232     avr910_devcode   = 0x20;
2233     signature        = 0x1e 0x91 0x01;
2234     chip_erase_delay = 20000;
2235     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2236                        "x x x x  x x x x    x x x x  x x x x";
2237
2238     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2239                        "x x x x  x x x x    x x x x  x x x x";
2240
2241     timeout             = 200;
2242     stabdelay           = 100;
2243     cmdexedelay         = 25;
2244     synchloops          = 32;
2245     bytedelay           = 0;
2246     pollindex           = 3;
2247     pollvalue           = 0x53;
2248     predelay            = 1;
2249     postdelay           = 1;
2250     pollmethod          = 0;
2251
2252     pp_controlstack     =
2253         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2254         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2255         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2256         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2257     hventerstabdelay    = 100;
2258     progmodedelay       = 0;
2259     latchcycles         = 0;
2260     togglevtg           = 0;
2261     poweroffdelay       = 0;
2262     resetdelayms        = 0;
2263     resetdelayus        = 0;
2264     hvleavestabdelay    = 15;
2265     chiperasepulsewidth = 15;
2266     chiperasepolltimeout = 0;
2267     programfusepulsewidth = 2;
2268     programfusepolltimeout = 0;
2269     programlockpulsewidth = 0;
2270     programlockpolltimeout = 1;
2271
2272     memory "eeprom"
2273         size            = 128;
2274         min_write_delay = 4000;
2275         max_write_delay = 9000;
2276         readback_p1     = 0x80;
2277         readback_p2     = 0x7f;
2278         read            = "1  0  1  0   0  0  0  0   x x x x  x x x x", 
2279                           "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2280
2281         write           = "1  1  0  0   0  0  0  0   x x x x  x x x x",
2282                           "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2283
2284         mode            = 0x04;
2285         delay           = 12;
2286         blocksize       = 64;
2287         readsize        = 256;
2288       ;
2289     memory "flash"
2290         size            = 2048;
2291         min_write_delay = 4000;
2292         max_write_delay = 9000;
2293         readback_p1     = 0x7f;
2294         readback_p2     = 0x7f;
2295         read_lo         = "  0   0   1   0    0   0   0   0",
2296                           "  x   x   x   x    x   x  a9  a8",
2297                           " a7  a6  a5  a4   a3  a2  a1  a0",
2298                           "  o   o   o   o    o   o   o   o";
2299
2300         read_hi         = "  0   0   1   0    1   0   0   0",
2301                           "  x   x   x   x    x   x  a9  a8",
2302                           " a7  a6  a5  a4   a3  a2  a1  a0",
2303                           "  o   o   o   o    o   o   o   o";
2304
2305         write_lo        = "  0   1   0   0    0   0   0   0",
2306                           "  x   x   x   x    x   x  a9  a8",
2307                           " a7  a6  a5  a4   a3  a2  a1  a0",
2308                           "  i   i   i   i    i   i   i   i";
2309
2310         write_hi        = "  0   1   0   0    1   0   0   0",
2311                           "  x   x   x   x    x   x  a9  a8",
2312                           " a7  a6  a5  a4   a3  a2  a1  a0",
2313                           "  i   i   i   i    i   i   i   i";
2314
2315         mode            = 0x04;
2316         delay           = 12;
2317         blocksize       = 128;
2318         readsize        = 256;
2319       ;
2320     memory "signature"
2321         size            = 3;
2322         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2323                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2324       ;
2325     memory "fuse"
2326         size            = 1;
2327       ;
2328     memory "lock"
2329         size            = 1;
2330         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x i i x",
2331                           "x x x x  x x x x  x x x x  x x x x";
2332         min_write_delay = 9000;
2333         max_write_delay = 9000;
2334       ;
2335   ;
2336
2337 #------------------------------------------------------------
2338 # AT90s2333
2339 #------------------------------------------------------------
2340
2341 part
2342     id               = "2333";
2343 ##### WARNING: No XML file for device 'AT90S2333'! #####
2344     desc             = "AT90S2333";
2345     stk500_devcode   = 0x42;
2346     avr910_devcode   = 0x34;
2347     signature        = 0x1e 0x91 0x05;
2348     chip_erase_delay = 20000;
2349     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2350                        "x x x x  x x x x    x x x x  x x x x";
2351
2352     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2353                        "x x x x  x x x x    x x x x  x x x x";
2354
2355     timeout             = 200;
2356     stabdelay           = 100;
2357     cmdexedelay         = 25;
2358     synchloops          = 32;
2359     bytedelay           = 0;
2360     pollindex           = 3;
2361     pollvalue           = 0x53;
2362     predelay            = 1;
2363     postdelay           = 1;
2364     pollmethod          = 0;
2365
2366     pp_controlstack     =
2367         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2368         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2369         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2370         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2371     hventerstabdelay    = 100;
2372     progmodedelay       = 0;
2373     latchcycles         = 0;
2374     togglevtg           = 0;
2375     poweroffdelay       = 0;
2376     resetdelayms        = 0;
2377     resetdelayus        = 0;
2378     hvleavestabdelay    = 15;
2379     chiperasepulsewidth = 15;
2380     chiperasepolltimeout = 0;
2381     programfusepulsewidth = 2;
2382     programfusepolltimeout = 0;
2383     programlockpulsewidth = 0;
2384     programlockpolltimeout = 1;
2385
2386     memory "eeprom"
2387         size            = 128;
2388         min_write_delay = 9000;
2389         max_write_delay = 20000;
2390         readback_p1     = 0x00;
2391         readback_p2     = 0xff;
2392         read            = "1  0  1  0   0  0  0  0   x x x x  x x x x", 
2393                           "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2394
2395         write           = "1  1  0  0   0  0  0  0   x x x x  x x x x",
2396                           "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2397
2398         mode            = 0x04;
2399         delay           = 12;
2400         blocksize       = 128;
2401         readsize        = 256;
2402       ;
2403
2404     memory "flash"
2405         size            = 2048;
2406         min_write_delay = 9000;
2407         max_write_delay = 20000;
2408         readback_p1     = 0xff;
2409         readback_p2     = 0xff;
2410         read_lo         = "  0   0   1   0    0   0   0   0",
2411                           "  x   x   x   x    x   x  a9  a8",
2412                           " a7  a6  a5  a4   a3  a2  a1  a0",
2413                           "  o   o   o   o    o   o   o   o";
2414
2415         read_hi         = "  0   0   1   0    1   0   0   0",
2416                           "  x   x   x   x    x   x  a9  a8",
2417                           " a7  a6  a5  a4   a3  a2  a1  a0",
2418                           "  o   o   o   o    o   o   o   o";
2419
2420         write_lo        = "  0   1   0   0    0   0   0   0",
2421                           "  x   x   x   x    x   x  a9  a8",
2422                           " a7  a6  a5  a4   a3  a2  a1  a0",
2423                           "  i   i   i   i    i   i   i   i";
2424
2425         write_hi        = "  0   1   0   0    1   0   0   0",
2426                           "  x   x   x   x    x   x  a9  a8",
2427                           " a7  a6  a5  a4   a3  a2  a1  a0",
2428                           "  i   i   i   i    i   i   i   i";
2429
2430         mode            = 0x04;
2431         delay           = 12;
2432         blocksize       = 128;
2433         readsize        = 256;
2434       ;
2435
2436     memory "signature"
2437         size            = 3;
2438         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2439                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2440       ;
2441     memory "fuse"
2442         size            = 1;
2443         min_write_delay = 9000;
2444         max_write_delay = 20000;
2445         pwroff_after_write = yes;
2446         read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
2447                           "x x x x  x x x x   x x o o  o o o o";
2448
2449         write           = "1 0 1 0  1 1 0 0   1 0 1 i  i i i i",
2450                           "x x x x  x x x x   x x x x  x x x x";
2451       ;
2452     memory "lock"
2453         size            = 1;
2454         min_write_delay = 9000;
2455         max_write_delay = 20000;
2456         read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2457                           "x x x x  x x x x   x x x x  x o o x";
2458
2459         write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2460                           "x x x x  x x x x   x x x x  x x x x";
2461       ;
2462   ;
2463
2464
2465 #------------------------------------------------------------
2466 # AT90s2343 (also AT90s2323 and ATtiny22)
2467 #------------------------------------------------------------
2468
2469 part
2470     id               = "2343";
2471     desc             = "AT90S2343";
2472     stk500_devcode   = 0x43;
2473     avr910_devcode   = 0x4c;
2474     signature        = 0x1e 0x91 0x03;
2475     chip_erase_delay = 18000;
2476     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2477                        "x x x x  x x x x    x x x x  x x x x";
2478
2479     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
2480                        "x x x x  x x x x    x x x x  x x x x";
2481
2482     timeout             = 200;
2483     stabdelay           = 100;
2484     cmdexedelay         = 25;
2485     synchloops          = 32;
2486     bytedelay           = 0;
2487     pollindex           = 3;
2488     pollvalue           = 0x53;
2489     predelay            = 1;
2490     postdelay           = 1;
2491     pollmethod          = 0;
2492
2493     hvsp_controlstack   =
2494         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00,
2495         0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
2496         0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
2497         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
2498     hventerstabdelay    = 100;
2499     hvspcmdexedelay     = 0;
2500     synchcycles         = 6;
2501     latchcycles         = 1;
2502     togglevtg           = 0;
2503     poweroffdelay       = 25;
2504     resetdelayms        = 0;
2505     resetdelayus        = 50;
2506     hvleavestabdelay    = 100;
2507     resetdelay          = 25;
2508     chiperasepolltimeout = 40;
2509     chiperasetime       = 0;
2510     programfusepolltimeout = 25;
2511     programlockpolltimeout = 25;
2512
2513     memory "eeprom"
2514         size            = 128;
2515         min_write_delay = 9000;
2516         max_write_delay = 20000;
2517         readback_p1     = 0x00;
2518         readback_p2     = 0xff;
2519         read            = "1  0  1  0   0  0  0  0   0 0 0 0  0 0 0 0", 
2520                           "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2521
2522         write           = "1  1  0  0   0  0  0  0   0 0 0 0  0 0 0 0",
2523                           "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2524
2525         mode            = 0x04;
2526         delay           = 12;
2527         blocksize       = 64;
2528         readsize        = 256;
2529       ;
2530     memory "flash"
2531         size            = 2048;
2532         min_write_delay = 9000;
2533         max_write_delay = 20000;
2534         readback_p1     = 0xff;
2535         readback_p2     = 0xff;
2536         read_lo         = "  0   0   1   0    0   0   0   0",
2537                           "  x   x   x   x    x   x  a9  a8",
2538                           " a7  a6  a5  a4   a3  a2  a1  a0",
2539                           "  o   o   o   o    o   o   o   o";
2540
2541         read_hi         = "  0   0   1   0    1   0   0   0",
2542                           "  x   x   x   x    x   x  a9  a8",
2543                           " a7  a6  a5  a4   a3  a2  a1  a0",
2544                           "  o   o   o   o    o   o   o   o";
2545
2546         write_lo        = "  0   1   0   0    0   0   0   0",
2547                           "  x   x   x   x    x   x  a9  a8",
2548                           " a7  a6  a5  a4   a3  a2  a1  a0",
2549                           "  i   i   i   i    i   i   i   i";
2550
2551         write_hi        = "  0   1   0   0    1   0   0   0",
2552                           "  x   x   x   x    x   x  a9  a8",
2553                           " a7  a6  a5  a4   a3  a2  a1  a0",
2554                           "  i   i   i   i    i   i   i   i";
2555
2556         mode            = 0x04;
2557         delay           = 12;
2558         blocksize       = 128;
2559         readsize        = 128;
2560       ;
2561     memory "signature"
2562         size            = 3;
2563         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2564                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2565       ;
2566     memory "fuse"
2567         size            = 1;
2568         min_write_delay = 9000;
2569         max_write_delay = 20000;
2570         read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2571                           "x x x x  x x x x   o o o x  x x x o";
2572
2573         write           = "1 0 1 0  1 1 0 0   1 0 1 1  1 1 1 i",
2574                           "x x x x  x x x x   x x x x  x x x x";
2575       ;
2576     memory "lock"
2577         size            = 1;
2578         min_write_delay = 9000;
2579         max_write_delay = 20000;
2580         read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2581                           "x x x x  x x x x   o o o x  x x x o";
2582
2583         write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2584                           "x x x x  x x x x   x x x x  x x x x";
2585       ;
2586   ;
2587
2588
2589 #------------------------------------------------------------
2590 # AT90s4433
2591 #------------------------------------------------------------
2592
2593 part
2594     id               = "4433";
2595     desc             = "AT90S4433";
2596     stk500_devcode   = 0x51;
2597     avr910_devcode   = 0x30;
2598     signature        = 0x1e 0x92 0x03;
2599     chip_erase_delay = 20000;
2600     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2601                        "x x x x  x x x x    x x x x  x x x x";
2602
2603     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2604                        "x x x x  x x x x    x x x x  x x x x";
2605
2606     timeout             = 200;
2607     stabdelay           = 100;
2608     cmdexedelay         = 25;
2609     synchloops          = 32;
2610     bytedelay           = 0;
2611     pollindex           = 3;
2612     pollvalue           = 0x53;
2613     predelay            = 1;
2614     postdelay           = 1;
2615     pollmethod          = 0;
2616
2617     pp_controlstack     =
2618         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2619         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2620         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2621         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2622     hventerstabdelay    = 100;
2623     progmodedelay       = 0;
2624     latchcycles         = 0;
2625     togglevtg           = 0;
2626     poweroffdelay       = 0;
2627     resetdelayms        = 0;
2628     resetdelayus        = 0;
2629     hvleavestabdelay    = 15;
2630     chiperasepulsewidth = 15;
2631     chiperasepolltimeout = 0;
2632     programfusepulsewidth = 2;
2633     programfusepolltimeout = 0;
2634     programlockpulsewidth = 0;
2635     programlockpolltimeout = 1;
2636
2637     memory "eeprom"
2638         size            = 256;
2639         min_write_delay = 9000;
2640         max_write_delay = 20000;
2641         readback_p1     = 0x00;
2642         readback_p2     = 0xff;
2643         read            = " 1  0  1  0   0  0  0  0   x x x x  x x x x", 
2644                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2645
2646         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x x",
2647                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2648
2649         mode            = 0x04;
2650         delay           = 12;
2651         blocksize       = 128;
2652         readsize        = 256;
2653       ;
2654     memory "flash"
2655         size            = 4096;
2656         min_write_delay = 9000;
2657         max_write_delay = 20000;
2658         readback_p1     = 0xff;
2659         readback_p2     = 0xff;
2660         read_lo         = "  0   0   1   0    0   0   0   0",
2661                           "  x   x   x   x    x a10  a9  a8",
2662                           " a7  a6  a5  a4   a3  a2  a1  a0",
2663                           "  o   o   o   o    o   o   o   o";
2664
2665         read_hi         = "  0   0   1   0    1   0   0   0",
2666                           "  x   x   x   x    x a10  a9  a8",
2667                           " a7  a6  a5  a4   a3  a2  a1  a0",
2668                           "  o   o   o   o    o   o   o   o";
2669
2670         write_lo        = "  0   1   0   0    0   0   0   0",
2671                           "  x   x   x   x    x a10  a9  a8",
2672                           " a7  a6  a5  a4   a3  a2  a1  a0",
2673                           "  i   i   i   i    i   i   i   i";
2674
2675         write_hi        = "  0   1   0   0    1   0   0   0",
2676                           "  x   x   x   x    x a10  a9  a8",
2677                           " a7  a6  a5  a4   a3  a2  a1  a0",
2678                           "  i   i   i   i    i   i   i   i";
2679
2680         mode            = 0x04;
2681         delay           = 12;
2682         blocksize       = 128;
2683         readsize        = 256;
2684       ;
2685     memory "signature"
2686         size            = 3;
2687         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2688                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2689       ;
2690     memory "fuse"
2691         size            = 1;
2692         min_write_delay = 9000;
2693         max_write_delay = 20000;
2694         pwroff_after_write = yes;
2695         read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
2696                           "x x x x  x x x x   x x o o  o o o o";
2697
2698         write           = "1 0 1 0  1 1 0 0   1 0 1 i  i i i i",
2699                           "x x x x  x x x x   x x x x  x x x x";
2700       ;
2701     memory "lock"
2702         size            = 1;
2703         min_write_delay = 9000;
2704         max_write_delay = 20000;
2705         read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2706                           "x x x x  x x x x   x x x x  x o o x";
2707
2708         write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2709                           "x x x x  x x x x   x x x x  x x x x";
2710       ;
2711   ;
2712
2713 #------------------------------------------------------------
2714 # AT90s4434
2715 #------------------------------------------------------------
2716
2717 part
2718     id               = "4434";
2719 ##### WARNING: No XML file for device 'AT90S4434'! #####
2720     desc             = "AT90S4434";
2721     stk500_devcode   = 0x52;
2722     avr910_devcode   = 0x6c;
2723     signature        = 0x1e 0x92 0x02;
2724     chip_erase_delay = 20000;
2725     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2726                        "x x x x  x x x x    x x x x  x x x x";
2727
2728     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2729                        "x x x x  x x x x    x x x x  x x x x";
2730
2731     memory "eeprom"
2732         size            = 256;
2733         min_write_delay = 9000;
2734         max_write_delay = 20000;
2735         readback_p1     = 0x00;
2736         readback_p2     = 0xff;
2737         read            = " 1  0  1  0   0  0  0  0   x x x x  x x x x", 
2738                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2739
2740         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x x",
2741                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2742       ;
2743     memory "flash"
2744         size            = 4096;
2745         min_write_delay = 9000;
2746         max_write_delay = 20000;
2747         readback_p1     = 0xff;
2748         readback_p2     = 0xff;
2749         read_lo         = "  0   0   1   0    0   0   0   0",
2750                           "  x   x   x   x    x a10  a9  a8",
2751                           " a7  a6  a5  a4   a3  a2  a1  a0",
2752                           "  o   o   o   o    o   o   o   o";
2753
2754         read_hi         = "  0   0   1   0    1   0   0   0",
2755                           "  x   x   x   x    x a10  a9  a8",
2756                           " a7  a6  a5  a4   a3  a2  a1  a0",
2757                           "  o   o   o   o    o   o   o   o";
2758
2759         write_lo        = "  0   1   0   0    0   0   0   0",
2760                           "  x   x   x   x    x a10  a9  a8",
2761                           " a7  a6  a5  a4   a3  a2  a1  a0",
2762                           "  i   i   i   i    i   i   i   i";
2763
2764         write_hi        = "  0   1   0   0    1   0   0   0",
2765                           "  x   x   x   x    x a10  a9  a8",
2766                           " a7  a6  a5  a4   a3  a2  a1  a0",
2767                           "  i   i   i   i    i   i   i   i";
2768       ;
2769     memory "signature"
2770         size            = 3;
2771         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2772                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2773       ;
2774     memory "fuse"
2775         size            = 1;
2776         min_write_delay = 9000;
2777         max_write_delay = 20000;
2778         read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
2779                           "x x x x  x x x x   x x o o  o o o o";
2780
2781         write           = "1 0 1 0  1 1 0 0   1 0 1 i  i i i i",
2782                           "x x x x  x x x x   x x x x  x x x x";
2783       ;
2784     memory "lock"
2785         size            = 1;
2786         min_write_delay = 9000;
2787         max_write_delay = 20000;
2788         read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2789                           "x x x x  x x x x   x x x x  x o o x";
2790
2791         write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2792                           "x x x x  x x x x   x x x x  x x x x";
2793       ;
2794   ;
2795
2796 #------------------------------------------------------------
2797 # AT90s8515
2798 #------------------------------------------------------------
2799
2800 part
2801     id               = "8515";
2802     desc             = "AT90S8515";
2803     stk500_devcode   = 0x60;
2804     avr910_devcode   = 0x38;
2805     signature        = 0x1e 0x93 0x01;
2806     chip_erase_delay = 20000;
2807     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2808                        "x x x x  x x x x    x x x x  x x x x";
2809
2810     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
2811                        "x x x x  x x x x    x x x x  x x x x";
2812
2813     timeout             = 200;
2814     stabdelay           = 100;
2815     cmdexedelay         = 25;
2816     synchloops          = 32;
2817     bytedelay           = 0;
2818     pollindex           = 3;
2819     pollvalue           = 0x53;
2820     predelay            = 1;
2821     postdelay           = 1;
2822     pollmethod          = 0;
2823
2824     pp_controlstack     =
2825         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2826         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2827         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2828         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2829     hventerstabdelay    = 100;
2830     progmodedelay       = 0;
2831     latchcycles         = 0;
2832     togglevtg           = 0;
2833     poweroffdelay       = 0;
2834     resetdelayms        = 0;
2835     resetdelayus        = 0;
2836     hvleavestabdelay    = 15;
2837     resetdelay          = 15;
2838     chiperasepulsewidth = 15;
2839     chiperasepolltimeout = 0;
2840     programfusepulsewidth = 2;
2841     programfusepolltimeout = 0;
2842     programlockpulsewidth = 0;
2843     programlockpolltimeout = 1;
2844
2845     memory "eeprom"
2846         size            = 512;
2847         min_write_delay = 4000;
2848         max_write_delay = 9000;
2849         readback_p1     = 0x80;
2850         readback_p2     = 0x7f;
2851         read            = " 1  0  1  0   0  0  0  0  x x x x  x x x a8", 
2852                           "a7 a6 a5 a4 a3 a2 a1 a0   o o o o  o o o o";
2853
2854         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x a8",
2855                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2856
2857         mode            = 0x04;
2858         delay           = 12;
2859         blocksize       = 128;
2860         readsize        = 256;
2861       ;
2862     memory "flash"
2863         size            = 8192;
2864         min_write_delay = 4000;
2865         max_write_delay = 9000;
2866         readback_p1     = 0x7f;
2867         readback_p2     = 0x7f;
2868         read_lo         = "  0   0   1   0    0   0   0   0",
2869                           "  x   x   x   x  a11 a10  a9  a8",
2870                           " a7  a6  a5  a4   a3  a2  a1  a0",
2871                           "  o   o   o   o    o   o   o   o";
2872
2873         read_hi         = "  0   0   1   0    1   0   0   0",
2874                           "  x   x   x   x  a11 a10  a9  a8",
2875                           " a7  a6  a5  a4   a3  a2  a1  a0",
2876                           "  o   o   o   o    o   o   o   o";
2877
2878         write_lo        = "  0   1   0   0    0   0   0   0",
2879                           "  x   x   x   x  a11 a10  a9  a8",
2880                           " a7  a6  a5  a4   a3  a2  a1  a0",
2881                           "  i   i   i   i    i   i   i   i";
2882
2883         write_hi        = "  0   1   0   0    1   0   0   0",
2884                           "  x   x   x   x  a11 a10  a9  a8",
2885                           " a7  a6  a5  a4   a3  a2  a1  a0",
2886                           "  i   i   i   i    i   i   i   i";
2887
2888         mode            = 0x04;
2889         delay           = 12;
2890         blocksize       = 128;
2891         readsize        = 256;
2892       ;
2893     memory "signature"
2894         size            = 3;
2895         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2896                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2897       ;
2898     memory "fuse"
2899         size            = 1;
2900       ;
2901     memory "lock"
2902         size            = 1;
2903         write           = "1  0  1  0   1  1  0  0   1  1  1  1   1  i  i  1",
2904                           "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  x";
2905         min_write_delay = 9000;
2906         max_write_delay = 9000;
2907       ;
2908   ;
2909
2910 #------------------------------------------------------------
2911 # AT90s8535
2912 #------------------------------------------------------------
2913
2914 part
2915     id               = "8535";
2916     desc             = "AT90S8535";
2917     stk500_devcode   = 0x61;
2918     avr910_devcode   = 0x68;
2919     signature        = 0x1e 0x93 0x03;
2920     chip_erase_delay = 20000;
2921     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2922                        "x x x x  x x x x    x x x x  x x x x";
2923
2924     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2925                        "x x x x  x x x x    x x x x  x x x x";
2926
2927     timeout             = 200;
2928     stabdelay           = 100;
2929     cmdexedelay         = 25;
2930     synchloops          = 32;
2931     bytedelay           = 0;
2932     pollindex           = 3;
2933     pollvalue           = 0x53;
2934     predelay            = 1;
2935     postdelay           = 1;
2936     pollmethod          = 0;
2937
2938     pp_controlstack     =
2939         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2940         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2941         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2942         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2943     hventerstabdelay    = 100;
2944     progmodedelay       = 0;
2945     latchcycles         = 0;
2946     togglevtg           = 0;
2947     poweroffdelay       = 0;
2948     resetdelayms        = 0;
2949     resetdelayus        = 0;
2950     hvleavestabdelay    = 15;
2951     chiperasepulsewidth = 15;
2952     chiperasepolltimeout = 0;
2953     programfusepulsewidth = 2;
2954     programfusepolltimeout = 0;
2955     programlockpulsewidth = 0;
2956     programlockpolltimeout = 1;
2957
2958     memory "eeprom"
2959         size            = 512;
2960         min_write_delay = 9000;
2961         max_write_delay = 20000;
2962         readback_p1     = 0x00;
2963         readback_p2     = 0xff;
2964         read            = " 1  0  1  0   0  0  0  0   x x x x  x x x a8", 
2965                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2966
2967         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x a8",
2968                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2969
2970         mode            = 0x04;
2971         delay           = 12;
2972         blocksize       = 128;
2973         readsize        = 256;
2974       ;
2975     memory "flash"
2976         size            = 8192;
2977         min_write_delay = 9000;
2978         max_write_delay = 20000;
2979         readback_p1     = 0xff;
2980         readback_p2     = 0xff;
2981         read_lo         = "  0   0   1   0    0   0   0   0",
2982                           "  x   x   x   x  a11 a10  a9  a8",
2983                           " a7  a6  a5  a4   a3  a2  a1  a0",
2984                           "  o   o   o   o    o   o   o   o";
2985
2986         read_hi         = "  0   0   1   0    1   0   0   0",
2987                           "  x   x   x   x  a11 a10  a9  a8",
2988                           " a7  a6  a5  a4   a3  a2  a1  a0",
2989                           "  o   o   o   o    o   o   o   o";
2990
2991         write_lo        = "  0   1   0   0    0   0   0   0",
2992                           "  x   x   x   x  a11 a10  a9  a8",
2993                           " a7  a6  a5  a4   a3  a2  a1  a0",
2994                           "  i   i   i   i    i   i   i   i";
2995
2996         write_hi        = "  0   1   0   0    1   0   0   0",
2997                           "  x   x   x   x  a11 a10  a9  a8",
2998                           " a7  a6  a5  a4   a3  a2  a1  a0",
2999                           "  i   i   i   i    i   i   i   i";
3000
3001         mode            = 0x04;
3002         delay           = 12;
3003         blocksize       = 128;
3004         readsize        = 256;
3005       ;
3006     memory "signature"
3007         size            = 3;
3008         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3009                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3010       ;
3011     memory "fuse"
3012         size            = 1;
3013         read            = "0  1  0  1   1  0  0  0   x  x  x  x   x  x  x  x",
3014                           "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  o";
3015         write           = "1  0  1  0   1  1  0  0   1  0  1  1   1  1  1  i",
3016                           "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  x";
3017         min_write_delay = 9000;
3018         max_write_delay = 9000;
3019       ;
3020     memory "lock"
3021         size            = 1;
3022         read            = "0  1  0  1   1  0  0  0   x  x  x  x   x  x  x  x",
3023                           "x  x  x  x   x  x  x  x   o  o  x  x   x  x  x  x";
3024         write           = "1  0  1  0   1  1  0  0   1  1  1  1   1  i  i  1",
3025                           "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  x";
3026         min_write_delay = 9000;
3027         max_write_delay = 9000;
3028       ;
3029   ;
3030
3031 #------------------------------------------------------------
3032 # ATmega103
3033 #------------------------------------------------------------
3034
3035 part
3036     id               = "m103";
3037     desc             = "ATmega103";
3038     stk500_devcode   = 0xB1;
3039     avr910_devcode   = 0x41;
3040     signature        = 0x1e 0x97 0x01;
3041     chip_erase_delay = 112000;
3042     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3043                        "x x x x  x x x x    x x x x  x x x x";
3044
3045     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
3046                        "x x x x  x x x x    x x x x  x x x x";
3047
3048     timeout             = 200;
3049     stabdelay           = 100;
3050     cmdexedelay         = 25;
3051     synchloops          = 32;
3052     bytedelay           = 0;
3053     pollindex           = 3;
3054     pollvalue           = 0x53;
3055     predelay            = 1;
3056     postdelay           = 1;
3057     pollmethod          = 0;
3058
3059     pp_controlstack     =
3060         0x0E, 0x1E, 0x8E, 0x9E, 0x2E, 0x3E, 0xAE, 0xBE,
3061         0x4E, 0x5E, 0xCE, 0xDE, 0x6E, 0x7E, 0xEE, 0xDE,
3062         0x66, 0x76, 0xE6, 0xF6, 0x6A, 0x7A, 0xEA, 0x7A,
3063         0x7F, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
3064     hventerstabdelay    = 100;
3065     progmodedelay       = 0;
3066     latchcycles         = 0;
3067     togglevtg           = 0;
3068     poweroffdelay       = 0;
3069     resetdelayms        = 0;
3070     resetdelayus        = 0;
3071     hvleavestabdelay    = 15;
3072     chiperasepulsewidth = 15;
3073     chiperasepolltimeout = 0;
3074     programfusepulsewidth = 2;
3075     programfusepolltimeout = 0;
3076     programlockpulsewidth = 0;
3077     programlockpolltimeout = 10;
3078
3079     memory "eeprom"
3080         size            = 4096;
3081         min_write_delay = 4000;
3082         max_write_delay = 9000;
3083         readback_p1     = 0x80;
3084         readback_p2     = 0x7f;
3085         read            = "  1   0   1   0      0   0   0   0",
3086                           "  x   x   x   x    a11 a10  a9  a8",
3087                           " a7  a6  a5  a4     a3  a2  a1  a0",
3088                           "  o   o   o   o      o   o   o   o";
3089
3090         write           = "  1   1   0   0      0   0   0   0",
3091                           "  x   x   x   x    a11 a10  a9  a8",
3092                           " a7  a6  a5  a4     a3  a2  a1  a0", 
3093                           "  i   i   i   i      i   i   i   i";
3094
3095         mode            = 0x04;
3096         delay           = 12;
3097         blocksize       = 64;
3098         readsize        = 256;
3099       ;
3100
3101     memory "flash"
3102         paged           = yes;
3103         size            = 131072;
3104         page_size       = 256;
3105         num_pages       = 512;
3106         min_write_delay = 22000;
3107         max_write_delay = 56000;
3108         readback_p1     = 0xff;
3109         readback_p2     = 0xff;
3110         read_lo         = "  0   0   1   0      0   0   0   0",
3111                           "a15 a14 a13 a12    a11 a10  a9  a8",
3112                           " a7  a6  a5  a4     a3  a2  a1  a0",
3113                           "  o   o   o   o      o   o   o   o";
3114
3115         read_hi         = "  0   0   1   0      1   0   0   0",
3116                           "a15 a14 a13 a12    a11 a10  a9  a8",
3117                           " a7  a6  a5  a4     a3  a2  a1  a0",
3118                           "  o   o   o   o      o   o   o   o";
3119
3120         loadpage_lo     = "  0   1   0   0      0   0   0   0",
3121                           "  x   x   x   x      x   x   x   x",
3122                           "  x  a6  a5  a4     a3  a2  a1  a0",
3123                           "  i   i   i   i      i   i   i   i";
3124
3125         loadpage_hi     = "  0   1   0   0      1   0   0   0",
3126                           "  x   x   x   x      x   x   x   x",
3127                           "  x  a6  a5  a4     a3  a2  a1  a0",
3128                           "  i   i   i   i      i   i   i   i";
3129
3130         writepage       = "  0   1   0   0      1   1   0   0",
3131                           "a15 a14 a13 a12    a11 a10  a9  a8",
3132                           " a7   x   x   x      x   x   x   x",
3133                           "  x   x   x   x      x   x   x   x";
3134
3135         mode            = 0x11;
3136         delay           = 70;
3137         blocksize       = 256;
3138         readsize        = 256;
3139       ;
3140
3141     memory "fuse"
3142         size            = 1;
3143         read            = "0 1 0 1  0 0 0 0  x x x x  x x x x",
3144                           "x x x x  x x x x  x x o x  o 1 o o";
3145
3146         write           = "1 0 1 0  1 1 0 0  1 0 1 1  i 1 i i",
3147                           "x x x x  x x x x  x x x x  x x x x";
3148         min_write_delay = 9000;
3149         max_write_delay = 9000;
3150       ;
3151
3152     memory "lock"
3153         size            = 1;
3154         read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
3155                           "x x x x  x x x x   x x x x  x o o x";
3156
3157         write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
3158                           "x x x x  x x x x   x x x x  x x x x";
3159         min_write_delay = 9000;
3160         max_write_delay = 9000;
3161       ;
3162
3163     memory "signature"
3164         size            = 3;
3165         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3166                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3167       ;
3168   ;
3169
3170
3171 #------------------------------------------------------------
3172 # ATmega64
3173 #------------------------------------------------------------
3174
3175 part
3176     id               = "m64";
3177     desc             = "ATmega64";
3178     has_jtag         = yes;
3179     stk500_devcode   = 0xA0;
3180     avr910_devcode   = 0x45;
3181     signature        = 0x1e 0x96 0x02;
3182     chip_erase_delay = 9000;
3183     pagel            = 0xD7;
3184     bs2              = 0xA0;
3185     reset            = dedicated;
3186     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3187                        "x x x x  x x x x    x x x x  x x x x";
3188
3189     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
3190                        "x x x x  x x x x    x x x x  x x x x";
3191
3192     timeout             = 200;
3193     stabdelay           = 100;
3194     cmdexedelay         = 25;
3195     synchloops          = 32;
3196     bytedelay           = 0;
3197     pollindex           = 3;
3198     pollvalue           = 0x53;
3199     predelay            = 1;
3200     postdelay           = 1;
3201     pollmethod          = 0;
3202
3203     pp_controlstack     =
3204         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3205         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3206         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3207         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
3208     hventerstabdelay    = 100;
3209     progmodedelay       = 0;
3210     latchcycles         = 6;
3211     togglevtg           = 0;
3212     poweroffdelay       = 0;
3213     resetdelayms        = 0;
3214     resetdelayus        = 0;
3215     hvleavestabdelay    = 15;
3216     chiperasepulsewidth = 0;
3217     chiperasepolltimeout = 10;
3218     programfusepulsewidth = 0;
3219     programfusepolltimeout = 5;
3220     programlockpulsewidth = 0;
3221     programlockpolltimeout = 5;
3222
3223     idr                 = 0x22;
3224     spmcr               = 0x68;
3225     allowfullpagebitstream = yes;
3226
3227     ocdrev              = 2;
3228
3229     memory "eeprom"
3230         paged           = no; /* leave this "no" */
3231         page_size       = 8;  /* for parallel programming */
3232         size            = 2048;
3233         min_write_delay = 9000;
3234         max_write_delay = 9000;
3235         readback_p1     = 0xff;
3236         readback_p2     = 0xff;
3237         read            = "  1   0   1   0      0   0   0   0",
3238                           "  x   x   x   x    a11 a10  a9  a8",
3239                           " a7  a6  a5  a4     a3  a2  a1  a0",
3240                           "  o   o   o   o      o   o   o   o";
3241
3242         write           = "  1   1   0   0      0   0   0   0",
3243                           "  x   x   x   x    a11 a10  a9  a8",
3244                           " a7  a6  a5  a4     a3  a2  a1  a0", 
3245                           "  i   i   i   i      i   i   i   i";
3246
3247         mode            = 0x04;
3248         delay           = 20;
3249         blocksize       = 64;
3250         readsize        = 256;
3251       ;
3252
3253     memory "flash"
3254         paged           = yes;
3255         size            = 65536;
3256         page_size       = 256;
3257         num_pages       = 256;
3258         min_write_delay = 4500;
3259         max_write_delay = 4500;
3260         readback_p1     = 0xff;
3261         readback_p2     = 0xff;
3262         read_lo         = "  0   0   1   0      0   0   0   0",
3263                           "  x a14 a13 a12    a11 a10  a9  a8",
3264                           " a7  a6  a5  a4     a3  a2  a1  a0",
3265                           "  o   o   o   o      o   o   o   o";
3266
3267         read_hi         = "  0   0   1   0      1   0   0   0",
3268                           "  x a14 a13 a12    a11 a10  a9  a8",
3269                           " a7  a6  a5  a4     a3  a2  a1  a0",
3270                           "  o   o   o   o      o   o   o   o";
3271
3272
3273         loadpage_lo     = "  0   1   0   0      0   0   0   0",
3274                           "  x   x   x   x      x   x   x   x",
3275                           "  x  a6  a5  a4     a3  a2  a1  a0",
3276                           "  i   i   i   i      i   i   i   i";
3277
3278         loadpage_hi     = "  0   1   0   0      1   0   0   0",
3279                           "  x   x   x   x      x   x   x   x",
3280                           "  x  a6  a5  a4     a3  a2  a1  a0",
3281                           "  i   i   i   i      i   i   i   i";
3282
3283         writepage       = "  0   1   0   0      1   1   0   0",
3284                           "  x a14 a13 a12    a11 a10  a9  a8",
3285                           " a7   x   x   x      x   x   x   x",
3286                           "  x   x   x   x      x   x   x   x";
3287
3288         mode            = 0x21;
3289         delay           = 6;
3290         blocksize       = 128;
3291         readsize        = 256;
3292       ;
3293
3294     memory "lfuse"
3295         size            = 1;
3296         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
3297                           "x x x x  x x x x  i i i i  i i i i";
3298
3299         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
3300                           "x x x x  x x x x  o o o o  o o o o";
3301         min_write_delay = 9000;
3302         max_write_delay = 9000;
3303       ;
3304
3305     memory "hfuse"
3306         size            = 1;
3307         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
3308                           "x x x x  x x x x  i i i i  i i i i";
3309
3310         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
3311                           "x x x x  x x x x  o o o o  o o o o";
3312         min_write_delay = 9000;
3313         max_write_delay = 9000;
3314       ;
3315
3316     memory "efuse"
3317         size            = 1;
3318         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3319                           "x x x x  x x x x  x x x x  x x i i";
3320
3321         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3322                           "x x x x  x x x x  o o o o  o o o o";
3323         min_write_delay = 9000;
3324         max_write_delay = 9000;
3325       ;
3326
3327     memory "lock"
3328         size            = 1;
3329         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3330                           "x x x x  x x x x   x x o o  o o o o";
3331
3332         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3333                           "x x x x  x x x x   1 1 i i  i i i i";
3334         min_write_delay = 9000;
3335         max_write_delay = 9000;
3336       ;
3337
3338     memory "calibration"
3339         size            = 4;
3340         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
3341                           "0 0 0 0  0 0 a1 a0  o o o o  o o o o";
3342       ;
3343
3344     memory "signature"
3345         size            = 3;
3346         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3347                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3348       ;
3349   ;
3350
3351
3352
3353
3354 #------------------------------------------------------------
3355 # ATmega128
3356 #------------------------------------------------------------
3357
3358 part
3359     id               = "m128";
3360     desc             = "ATmega128";
3361     has_jtag         = yes;
3362     stk500_devcode   = 0xB2;
3363     avr910_devcode   = 0x43;
3364     signature        = 0x1e 0x97 0x02;
3365     chip_erase_delay = 9000;
3366     pagel            = 0xD7;
3367     bs2              = 0xA0;
3368     reset            = dedicated;
3369     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3370                        "x x x x  x x x x    x x x x  x x x x";
3371
3372     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
3373                        "x x x x  x x x x    x x x x  x x x x";
3374
3375     timeout             = 200;
3376     stabdelay           = 100;
3377     cmdexedelay         = 25;
3378     synchloops          = 32;
3379     bytedelay           = 0;
3380     pollindex           = 3;
3381     pollvalue           = 0x53;
3382     predelay            = 1;
3383     postdelay           = 1;
3384     pollmethod          = 0;
3385
3386     pp_controlstack     =
3387         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3388         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3389         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3390         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
3391     hventerstabdelay    = 100;
3392     progmodedelay       = 0;
3393     latchcycles         = 6;
3394     togglevtg           = 0;
3395     poweroffdelay       = 0;
3396     resetdelayms        = 0;
3397     resetdelayus        = 0;
3398     hvleavestabdelay    = 15;
3399     chiperasepulsewidth = 0;
3400     chiperasepolltimeout = 10;
3401     programfusepulsewidth = 0;
3402     programfusepolltimeout = 5;
3403     programlockpulsewidth = 0;
3404     programlockpolltimeout = 5;
3405
3406     idr                 = 0x22;
3407     spmcr               = 0x68;
3408     rampz               = 0x3b;
3409     allowfullpagebitstream = yes;
3410
3411     ocdrev              = 1;
3412
3413     memory "eeprom"
3414         paged           = no; /* leave this "no" */
3415         page_size       = 8;  /* for parallel programming */
3416         size            = 4096;
3417         min_write_delay = 9000;
3418         max_write_delay = 9000;
3419         readback_p1     = 0xff;
3420         readback_p2     = 0xff;
3421         read            = "  1   0   1   0      0   0   0   0",
3422                           "  x   x   x   x    a11 a10  a9  a8",
3423                           " a7  a6  a5  a4     a3  a2  a1  a0",
3424                           "  o   o   o   o      o   o   o   o";
3425
3426         write           = "  1   1   0   0      0   0   0   0",
3427                           "  x   x   x   x    a11 a10  a9  a8",
3428                           " a7  a6  a5  a4     a3  a2  a1  a0", 
3429                           "  i   i   i   i      i   i   i   i";
3430
3431         mode            = 0x04;
3432         delay           = 12;
3433         blocksize       = 64;
3434         readsize        = 256;
3435       ;
3436
3437     memory "flash"
3438         paged           = yes;
3439         size            = 131072;
3440         page_size       = 256;
3441         num_pages       = 512;
3442         min_write_delay = 4500;
3443         max_write_delay = 4500;
3444         readback_p1     = 0xff;
3445         readback_p2     = 0xff;
3446         read_lo         = "  0   0   1   0      0   0   0   0",
3447                           "a15 a14 a13 a12    a11 a10  a9  a8",
3448                           " a7  a6  a5  a4     a3  a2  a1  a0",
3449                           "  o   o   o   o      o   o   o   o";
3450
3451         read_hi         = "  0   0   1   0      1   0   0   0",
3452                           "a15 a14 a13 a12    a11 a10  a9  a8",
3453                           " a7  a6  a5  a4     a3  a2  a1  a0",
3454                           "  o   o   o   o      o   o   o   o";
3455
3456         loadpage_lo     = "  0   1   0   0      0   0   0   0",
3457                           "  x   x   x   x      x   x   x   x",
3458                           "  x  a6  a5  a4     a3  a2  a1  a0",
3459                           "  i   i   i   i      i   i   i   i";
3460
3461         loadpage_hi     = "  0   1   0   0      1   0   0   0",
3462                           "  x   x   x   x      x   x   x   x",
3463                           "  x  a6  a5  a4     a3  a2  a1  a0",
3464                           "  i   i   i   i      i   i   i   i";
3465
3466         writepage       = "  0   1   0   0      1   1   0   0",
3467                           "a15 a14 a13 a12    a11 a10  a9  a8",
3468                           " a7   x   x   x      x   x   x   x",
3469                           "  x   x   x   x      x   x   x   x";
3470
3471         mode            = 0x21;
3472         delay           = 6;
3473         blocksize       = 128;
3474         readsize        = 256;
3475       ;
3476
3477     memory "lfuse"
3478         size            = 1;
3479         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
3480                           "x x x x  x x x x  i i i i  i i i i";
3481
3482         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
3483                           "x x x x  x x x x  o o o o  o o o o";
3484         min_write_delay = 9000;
3485         max_write_delay = 9000;
3486       ;
3487
3488     memory "hfuse"
3489         size            = 1;
3490         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
3491                           "x x x x  x x x x  i i i i  i i i i";
3492
3493         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
3494                           "x x x x  x x x x  o o o o  o o o o";
3495         min_write_delay = 9000;
3496         max_write_delay = 9000;
3497       ;
3498
3499     memory "efuse"
3500         size            = 1;
3501         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3502                           "x x x x  x x x x  x x x x  x x i i";
3503
3504         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3505                           "x x x x  x x x x  o o o o  o o o o";
3506         min_write_delay = 9000;
3507         max_write_delay = 9000;
3508       ;
3509
3510     memory "lock"
3511         size            = 1;
3512         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3513                           "x x x x  x x x x   x x o o  o o o o";
3514
3515         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3516                           "x x x x  x x x x   1 1 i i  i i i i";
3517         min_write_delay = 9000;
3518         max_write_delay = 9000;
3519       ;
3520
3521     memory "calibration"
3522         size            = 4;
3523         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
3524                           "0 0 0 0  0 0 a1 a0  o o o o  o o o o";
3525       ;
3526
3527     memory "signature"
3528         size            = 3;
3529         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3530                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3531       ;
3532   ;
3533
3534 #------------------------------------------------------------
3535 # AT90CAN128
3536 #------------------------------------------------------------
3537
3538 part
3539     id               = "c128";
3540     desc             = "AT90CAN128";
3541     has_jtag         = yes;
3542     stk500_devcode   = 0xB3;
3543 #    avr910_devcode   = 0x43;
3544     signature        = 0x1e 0x97 0x81;
3545     chip_erase_delay = 9000;
3546     pagel            = 0xD7;
3547     bs2              = 0xA0;
3548     reset            = dedicated;
3549     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3550                        "x x x x  x x x x    x x x x  x x x x";
3551
3552     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
3553                        "x x x x  x x x x    x x x x  x x x x";
3554
3555     timeout             = 200;
3556     stabdelay           = 100;
3557     cmdexedelay         = 25;
3558     synchloops          = 32;
3559     bytedelay           = 0;
3560     pollindex           = 3;
3561     pollvalue           = 0x53;
3562     predelay            = 1;
3563     postdelay           = 1;
3564     pollmethod          = 1;
3565
3566     pp_controlstack     =
3567         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3568         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3569         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3570         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
3571     hventerstabdelay    = 100;
3572     progmodedelay       = 0;
3573     latchcycles         = 6;
3574     togglevtg           = 0;
3575     poweroffdelay       = 0;
3576     resetdelayms        = 0;
3577     resetdelayus        = 0;
3578     hvleavestabdelay    = 15;
3579     chiperasepulsewidth = 0;
3580     chiperasepolltimeout = 10;
3581     programfusepulsewidth = 0;
3582     programfusepolltimeout = 5;
3583     programlockpulsewidth = 0;
3584     programlockpolltimeout = 5;
3585
3586     idr                 = 0x31;
3587     spmcr               = 0x57;
3588     rampz               = 0x3b;
3589     eecr                = 0x3f;
3590     allowfullpagebitstream = no;
3591
3592     ocdrev              = 3;
3593
3594     memory "eeprom"
3595         paged           = no; /* leave this "no" */
3596         page_size       = 8;  /* for parallel programming */
3597         size            = 4096;
3598         min_write_delay = 9000;
3599         max_write_delay = 9000;
3600         readback_p1     = 0xff;
3601         readback_p2     = 0xff;
3602         read            = "  1   0   1   0      0   0   0   0",
3603                           "  0   0   0   x    a11 a10  a9  a8",
3604                           " a7  a6  a5  a4     a3  a2  a1  a0",
3605                           "  o   o   o   o      o   o   o   o";
3606
3607         write           = "  1   1   0   0      0   0   0   0",
3608                           "  0   0   0   x    a11 a10  a9  a8",
3609                           " a7  a6  a5  a4     a3  a2  a1  a0", 
3610                           "  i   i   i   i      i   i   i   i";
3611
3612         loadpage_lo     = "  1   1   0   0      0   0   0   1",
3613                           "  0   0   0   0      0   0   0   0",
3614                           "  0   0   0   0      0  a2  a1  a0",
3615                           "  i   i   i   i      i   i   i   i";
3616
3617         writepage       = "  1   1   0   0      0   0   1   0",
3618                           "  0   0   x   x    a11 a10  a9  a8",
3619                           " a7  a6  a5  a4     a3   0   0   0",
3620                           "  x   x   x   x      x   x   x   x";
3621
3622
3623         mode            = 0x41;
3624         delay           = 20;
3625         blocksize       = 8;
3626         readsize        = 256;
3627       ;
3628
3629     memory "flash"
3630         paged           = yes;
3631         size            = 131072;
3632         page_size       = 256;
3633         num_pages       = 512;
3634         min_write_delay = 4500;
3635         max_write_delay = 4500;
3636         readback_p1     = 0xff;
3637         readback_p2     = 0xff;
3638         read_lo         = "  0   0   1   0      0   0   0   0",
3639                           "a15 a14 a13 a12    a11 a10  a9  a8",
3640                           " a7  a6  a5  a4     a3  a2  a1  a0",
3641                           "  o   o   o   o      o   o   o   o";
3642
3643         read_hi         = "  0   0   1   0      1   0   0   0",
3644                           "a15 a14 a13 a12    a11 a10  a9  a8",
3645                           " a7  a6  a5  a4     a3  a2  a1  a0",
3646                           "  o   o   o   o      o   o   o   o";
3647
3648         loadpage_lo     = "  0   1   0   0      0   0   0   0",
3649                           "  0   0   0   x      x   x   x   x",
3650                           "  x  a6  a5  a4     a3  a2  a1  a0",
3651                           "  i   i   i   i      i   i   i   i";
3652
3653         loadpage_hi     = "  0   1   0   0      1   0   0   0",
3654                           "  0   0   0   x      x   x   x   x",
3655                           "  x  a6  a5  a4     a3  a2  a1  a0",
3656                           "  i   i   i   i      i   i   i   i";
3657
3658         writepage       = "  0   1   0   0      1   1   0   0",
3659                           "a15 a14 a13 a12    a11 a10  a9  a8",
3660                           " a7   x   x   x      x   x   x   x",
3661                           "  x   x   x   x      x   x   x   x";
3662
3663         mode            = 0x41;
3664         delay           = 6;
3665         blocksize       = 256;
3666         readsize        = 256;
3667       ;
3668
3669     memory "lfuse"
3670         size            = 1;
3671         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
3672                           "x x x x  x x x x  i i i i  i i i i";
3673
3674         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
3675                           "x x x x  x x x x  o o o o  o o o o";
3676         min_write_delay = 9000;
3677         max_write_delay = 9000;
3678       ;
3679
3680     memory "hfuse"
3681         size            = 1;
3682         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
3683                           "x x x x  x x x x  i i i i  i i i i";
3684
3685         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
3686                           "x x x x  x x x x  o o o o  o o o o";
3687         min_write_delay = 9000;
3688         max_write_delay = 9000;
3689       ;
3690
3691     memory "efuse"
3692         size            = 1;
3693         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3694                           "x x x x  x x x x  x x x x  i i i i";
3695
3696         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3697                           "x x x x  x x x x  o o o o  o o o o";
3698         min_write_delay = 9000;
3699         max_write_delay = 9000;
3700       ;
3701
3702     memory "lock"
3703         size            = 1;
3704         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3705                           "x x x x  x x x x   x x o o  o o o o";
3706
3707         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3708                           "x x x x  x x x x   1 1 i i  i i i i";
3709         min_write_delay = 9000;
3710         max_write_delay = 9000;
3711       ;
3712
3713     memory "calibration"
3714         size            = 1;
3715         read            = "0 0 1 1  1 0 0 0  0 0 0 x  x x x x",
3716                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
3717       ;
3718
3719     memory "signature"
3720         size            = 3;
3721         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3722                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3723       ;
3724   ;
3725
3726 #------------------------------------------------------------
3727 # AT90CAN64
3728 #------------------------------------------------------------
3729
3730 part
3731     id               = "c64";
3732     desc             = "AT90CAN64";
3733     has_jtag         = yes;
3734     stk500_devcode   = 0xB3;
3735 #    avr910_devcode   = 0x43;
3736     signature        = 0x1e 0x96 0x81;
3737     chip_erase_delay = 9000;
3738     pagel            = 0xD7;
3739     bs2              = 0xA0;
3740     reset            = dedicated;
3741     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3742                        "x x x x  x x x x    x x x x  x x x x";
3743
3744     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
3745                        "x x x x  x x x x    x x x x  x x x x";
3746
3747     timeout             = 200;
3748     stabdelay           = 100;
3749     cmdexedelay         = 25;
3750     synchloops          = 32;
3751     bytedelay           = 0;
3752     pollindex           = 3;
3753     pollvalue           = 0x53;
3754     predelay            = 1;
3755     postdelay           = 1;
3756     pollmethod          = 1;
3757
3758     pp_controlstack     =
3759         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3760         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3761         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3762         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
3763     hventerstabdelay    = 100;
3764     progmodedelay       = 0;
3765     latchcycles         = 6;
3766     togglevtg           = 0;
3767     poweroffdelay       = 0;
3768     resetdelayms        = 0;
3769     resetdelayus        = 0;
3770     hvleavestabdelay    = 15;
3771     chiperasepulsewidth = 0;
3772     chiperasepolltimeout = 10;
3773     programfusepulsewidth = 0;
3774     programfusepolltimeout = 5;
3775     programlockpulsewidth = 0;
3776     programlockpolltimeout = 5;
3777
3778     idr                 = 0x31;
3779     spmcr               = 0x57;
3780     rampz               = 0x3b;
3781     eecr                = 0x3f;
3782     allowfullpagebitstream = no;
3783
3784     ocdrev              = 3;
3785
3786     memory "eeprom"
3787         paged           = no; /* leave this "no" */
3788         page_size       = 8;  /* for parallel programming */
3789         size            = 2048;
3790         min_write_delay = 9000;
3791         max_write_delay = 9000;
3792         readback_p1     = 0xff;
3793         readback_p2     = 0xff;
3794         read            = "  1   0   1   0      0   0   0   0",
3795                           "  0   0   0   x      x a10  a9  a8",
3796                           " a7  a6  a5  a4     a3  a2  a1  a0",
3797                           "  o   o   o   o      o   o   o   o";
3798
3799         write           = "  1   1   0   0      0   0   0   0",
3800                           "  0   0   0   x      x a10  a9  a8",
3801                           " a7  a6  a5  a4     a3  a2  a1  a0",
3802                           "  i   i   i   i      i   i   i   i";
3803
3804         loadpage_lo     = "  1   1   0   0      0   0   0   1",
3805                           "  0   0   0   0      0   0   0   0",
3806                           "  0   0   0   0      0  a2  a1  a0",
3807                           "  i   i   i   i      i   i   i   i";
3808
3809         writepage       = "  1   1   0   0      0   0   1   0",
3810                           "  0   0   x   x      x a10  a9  a8",
3811                           " a7  a6  a5  a4     a3   0   0   0",
3812                           "  x   x   x   x      x   x   x   x";
3813
3814
3815         mode            = 0x41;
3816         delay           = 20;
3817         blocksize       = 8;
3818         readsize        = 256;
3819       ;
3820
3821     memory "flash"
3822         paged           = yes;
3823         size            = 65536;
3824         page_size       = 256;
3825         num_pages       = 256;
3826         min_write_delay = 4500;
3827         max_write_delay = 4500;
3828         readback_p1     = 0xff;
3829         readback_p2     = 0xff;
3830         read_lo         = "  0   0   1   0      0   0   0   0",
3831                           "a15 a14 a13 a12    a11 a10  a9  a8",
3832                           " a7  a6  a5  a4     a3  a2  a1  a0",
3833                           "  o   o   o   o      o   o   o   o";
3834
3835         read_hi         = "  0   0   1   0      1   0   0   0",
3836                           "a15 a14 a13 a12    a11 a10  a9  a8",
3837                           " a7  a6  a5  a4     a3  a2  a1  a0",
3838                           "  o   o   o   o      o   o   o   o";
3839
3840         loadpage_lo     = "  0   1   0   0      0   0   0   0",
3841                           "  0   0   0   x      x   x   x   x",
3842                           "  x  a6  a5  a4     a3  a2  a1  a0",
3843                           "  i   i   i   i      i   i   i   i";
3844
3845         loadpage_hi     = "  0   1   0   0      1   0   0   0",
3846                           "  0   0   0   x      x   x   x   x",
3847                           "  x  a6  a5  a4     a3  a2  a1  a0",
3848                           "  i   i   i   i      i   i   i   i";
3849
3850         writepage       = "  0   1   0   0      1   1   0   0",
3851                           "a15 a14 a13 a12    a11 a10  a9  a8",
3852                           " a7   x   x   x      x   x   x   x",
3853                           "  x   x   x   x      x   x   x   x";
3854
3855         mode            = 0x41;
3856         delay           = 6;
3857         blocksize       = 256;
3858         readsize        = 256;
3859       ;
3860
3861     memory "lfuse"
3862         size            = 1;
3863         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
3864                           "x x x x  x x x x  i i i i  i i i i";
3865
3866         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
3867                           "x x x x  x x x x  o o o o  o o o o";
3868         min_write_delay = 9000;
3869         max_write_delay = 9000;
3870       ;
3871
3872     memory "hfuse"
3873         size            = 1;
3874         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
3875                           "x x x x  x x x x  i i i i  i i i i";
3876
3877         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
3878                           "x x x x  x x x x  o o o o  o o o o";
3879         min_write_delay = 9000;
3880         max_write_delay = 9000;
3881       ;
3882
3883     memory "efuse"
3884         size            = 1;
3885         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3886                           "x x x x  x x x x  x x x x  i i i i";
3887
3888         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3889                           "x x x x  x x x x  o o o o  o o o o";
3890         min_write_delay = 9000;
3891         max_write_delay = 9000;
3892       ;
3893
3894     memory "lock"
3895         size            = 1;
3896         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3897                           "x x x x  x x x x   x x o o  o o o o";
3898
3899         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3900                           "x x x x  x x x x   1 1 i i  i i i i";
3901         min_write_delay = 9000;
3902         max_write_delay = 9000;
3903       ;
3904
3905     memory "calibration"
3906         size            = 1;
3907         read            = "0 0 1 1  1 0 0 0  0 0 0 x  x x x x",
3908                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
3909       ;
3910
3911     memory "signature"
3912         size            = 3;
3913         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3914                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3915       ;
3916   ;
3917
3918 #------------------------------------------------------------
3919 # AT90CAN32
3920 #------------------------------------------------------------
3921
3922 part
3923     id               = "c32";
3924     desc             = "AT90CAN32";
3925     has_jtag         = yes;
3926     stk500_devcode   = 0xB3;
3927 #    avr910_devcode   = 0x43;
3928     signature        = 0x1e 0x95 0x81;
3929     chip_erase_delay = 9000;
3930     pagel            = 0xD7;
3931     bs2              = 0xA0;
3932     reset            = dedicated;
3933     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3934                        "x x x x  x x x x    x x x x  x x x x";
3935
3936     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
3937                        "x x x x  x x x x    x x x x  x x x x";
3938
3939     timeout             = 200;
3940     stabdelay           = 100;
3941     cmdexedelay         = 25;
3942     synchloops          = 32;
3943     bytedelay           = 0;
3944     pollindex           = 3;
3945     pollvalue           = 0x53;
3946     predelay            = 1;
3947     postdelay           = 1;
3948     pollmethod          = 1;
3949
3950     pp_controlstack     =
3951         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3952         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3953         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3954         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
3955     hventerstabdelay    = 100;
3956     progmodedelay       = 0;
3957     latchcycles         = 6;
3958     togglevtg           = 0;
3959     poweroffdelay       = 0;
3960     resetdelayms        = 0;
3961     resetdelayus        = 0;
3962     hvleavestabdelay    = 15;
3963     chiperasepulsewidth = 0;
3964     chiperasepolltimeout = 10;
3965     programfusepulsewidth = 0;
3966     programfusepolltimeout = 5;
3967     programlockpulsewidth = 0;
3968     programlockpolltimeout = 5;
3969
3970     idr                 = 0x31;
3971     spmcr               = 0x57;
3972     rampz               = 0x3b;
3973     eecr                = 0x3f;
3974     allowfullpagebitstream = no;
3975
3976     ocdrev              = 3;
3977
3978     memory "eeprom"
3979         paged           = no; /* leave this "no" */
3980         page_size       = 8;  /* for parallel programming */
3981         size            = 1024;
3982         min_write_delay = 9000;
3983         max_write_delay = 9000;
3984         readback_p1     = 0xff;
3985         readback_p2     = 0xff;
3986         read            = "  1   0   1   0      0   0   0   0",
3987                           "  0   0   0   x      x   x  a9  a8",
3988                           " a7  a6  a5  a4     a3  a2  a1  a0",
3989                           "  o   o   o   o      o   o   o   o";
3990
3991         write           = "  1   1   0   0      0   0   0   0",
3992                           "  0   0   0   x      x   x  a9  a8",
3993                           " a7  a6  a5  a4     a3  a2  a1  a0",
3994                           "  i   i   i   i      i   i   i   i";
3995
3996         loadpage_lo     = "  1   1   0   0      0   0   0   1",
3997                           "  0   0   0   0      0   0   0   0",
3998                           "  0   0   0   0      0  a2  a1  a0",
3999                           "  i   i   i   i      i   i   i   i";
4000
4001         writepage       = "  1   1   0   0      0   0   1   0",
4002                           "  0   0   x   x      x   x  a9  a8",
4003                           " a7  a6  a5  a4     a3   0   0   0",
4004                           "  x   x   x   x      x   x   x   x";
4005
4006
4007         mode            = 0x41;
4008         delay           = 20;
4009         blocksize       = 8;
4010         readsize        = 256;
4011       ;
4012
4013     memory "flash"
4014         paged           = yes;
4015         size            = 32768;
4016         page_size       = 256;
4017         num_pages       = 128;
4018         min_write_delay = 4500;
4019         max_write_delay = 4500;
4020         readback_p1     = 0xff;
4021         readback_p2     = 0xff;
4022         read_lo         = "  0   0   1   0      0   0   0   0",
4023                           "a15 a14 a13 a12    a11 a10  a9  a8",
4024                           " a7  a6  a5  a4     a3  a2  a1  a0",
4025                           "  o   o   o   o      o   o   o   o";
4026
4027         read_hi         = "  0   0   1   0      1   0   0   0",
4028                           "a15 a14 a13 a12    a11 a10  a9  a8",
4029                           " a7  a6  a5  a4     a3  a2  a1  a0",
4030                           "  o   o   o   o      o   o   o   o";
4031
4032         loadpage_lo     = "  0   1   0   0      0   0   0   0",
4033                           "  0   0   0   x      x   x   x   x",
4034                           "  x  a6  a5  a4     a3  a2  a1  a0",
4035                           "  i   i   i   i      i   i   i   i";
4036
4037         loadpage_hi     = "  0   1   0   0      1   0   0   0",
4038                           "  0   0   0   x      x   x   x   x",
4039                           "  x  a6  a5  a4     a3  a2  a1  a0",
4040                           "  i   i   i   i      i   i   i   i";
4041
4042         writepage       = "  0   1   0   0      1   1   0   0",
4043                           "a15 a14 a13 a12    a11 a10  a9  a8",
4044                           " a7   x   x   x      x   x   x   x",
4045                           "  x   x   x   x      x   x   x   x";
4046
4047         mode            = 0x41;
4048         delay           = 6;
4049         blocksize       = 256;
4050         readsize        = 256;
4051       ;
4052
4053     memory "lfuse"
4054         size            = 1;
4055         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
4056                           "x x x x  x x x x  i i i i  i i i i";
4057
4058         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
4059                           "x x x x  x x x x  o o o o  o o o o";
4060         min_write_delay = 9000;
4061         max_write_delay = 9000;
4062       ;
4063
4064     memory "hfuse"
4065         size            = 1;
4066         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
4067                           "x x x x  x x x x  i i i i  i i i i";
4068
4069         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
4070                           "x x x x  x x x x  o o o o  o o o o";
4071         min_write_delay = 9000;
4072         max_write_delay = 9000;
4073       ;
4074
4075     memory "efuse"
4076         size            = 1;
4077         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4078                           "x x x x  x x x x  x x x x  i i i i";
4079
4080         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4081                           "x x x x  x x x x  o o o o  o o o o";
4082         min_write_delay = 9000;
4083         max_write_delay = 9000;
4084       ;
4085
4086     memory "lock"
4087         size            = 1;
4088         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4089                           "x x x x  x x x x   x x o o  o o o o";
4090
4091         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4092                           "x x x x  x x x x   1 1 i i  i i i i";
4093         min_write_delay = 9000;
4094         max_write_delay = 9000;
4095       ;
4096
4097     memory "calibration"
4098         size            = 1;
4099         read            = "0 0 1 1  1 0 0 0  0 0 0 x  x x x x",
4100                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
4101       ;
4102
4103     memory "signature"
4104         size            = 3;
4105         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4106                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4107       ;
4108   ;
4109
4110
4111 #------------------------------------------------------------
4112 # ATmega16
4113 #------------------------------------------------------------
4114
4115 part
4116     id               = "m16";
4117     desc             = "ATmega16";
4118     has_jtag         = yes;
4119     stk500_devcode   = 0x82;
4120     avr910_devcode   = 0x74;
4121     signature        = 0x1e 0x94 0x03;
4122     pagel            = 0xd7;
4123     bs2              = 0xa0;
4124     chip_erase_delay = 9000;
4125     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4126                        "x x x x  x x x x    x x x x  x x x x";
4127
4128     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4129                        "x x x x  x x x x    x x x x  x x x x";
4130
4131     timeout             = 200;
4132     stabdelay           = 100;
4133     cmdexedelay         = 25;
4134     synchloops          = 32;
4135     bytedelay           = 0;
4136     pollindex           = 3;
4137     pollvalue           = 0x53;
4138     predelay            = 1;
4139     postdelay           = 1;
4140     pollmethod          = 0;
4141
4142     pp_controlstack     =
4143         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4144         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4145         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4146         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
4147     hventerstabdelay    = 100;
4148     progmodedelay       = 100;
4149     latchcycles         = 6;
4150     togglevtg           = 0;
4151     poweroffdelay       = 0;
4152     resetdelayms        = 0;
4153     resetdelayus        = 0;
4154     hvleavestabdelay    = 15;
4155     resetdelay          = 15;
4156     chiperasepulsewidth = 0;
4157     chiperasepolltimeout = 10;
4158     programfusepulsewidth = 0;
4159     programfusepolltimeout = 5;
4160     programlockpulsewidth = 0;
4161     programlockpolltimeout = 5;
4162
4163     idr                 = 0x31;
4164     spmcr               = 0x57;
4165     allowfullpagebitstream = yes;
4166
4167     ocdrev              = 2;
4168
4169     memory "eeprom"
4170         paged           = no; /* leave this "no" */
4171         page_size       = 4;  /* for parallel programming */
4172         size            = 512;
4173         min_write_delay = 9000;
4174         max_write_delay = 9000;
4175         readback_p1     = 0xff;
4176         readback_p2     = 0xff;
4177         read            = "  1   0   1   0      0   0   0   0",
4178                           "  0   0   x   x      x   x  a9  a8",
4179                           " a7  a6  a5  a4     a3  a2  a1  a0",
4180                           "  o   o   o   o      o   o   o   o";
4181
4182         write           = "  1   1   0   0      0   0   0   0",
4183                           "  0   0   x   x      x   x  a9  a8",
4184                           " a7  a6  a5  a4     a3  a2  a1  a0", 
4185                           "  i   i   i   i      i   i   i   i";
4186
4187         loadpage_lo     = "  1   1   0   0      0   0   0   1",
4188                           "  0   0   0   0      0   0   0   0",
4189                           "  0   0   0   0      0   0  a1  a0",
4190                           "  i   i   i   i      i   i   i   i";
4191
4192         writepage       = "  1   1   0   0      0   0   1   0",
4193                           "  0   0   x   x      x   x  a9  a8",
4194                           " a7  a6  a5  a4     a3  a2   0   0",
4195                           "  x   x   x   x      x   x   x   x";
4196
4197         mode            = 0x04;
4198         delay           = 10;
4199         blocksize       = 128;
4200         readsize        = 256;
4201       ;
4202
4203     memory "flash"
4204         paged           = yes;
4205         size            = 16384;
4206         page_size       = 128;
4207         num_pages       = 128;
4208         min_write_delay = 4500;
4209         max_write_delay = 4500;
4210         readback_p1     = 0xff;
4211         readback_p2     = 0xff;
4212         read_lo         = "  0   0   1   0      0   0   0   0",
4213                           "  0   0 a13 a12    a11 a10  a9  a8",
4214                           " a7  a6  a5  a4     a3  a2  a1  a0",
4215                           "  o   o   o   o      o   o   o   o";
4216
4217         read_hi         = "  0   0   1   0      1   0   0   0",
4218                           "  0   0 a13 a12    a11 a10  a9  a8",
4219                           " a7  a6  a5  a4     a3  a2  a1  a0",
4220                           "  o   o   o   o      o   o   o   o";
4221
4222         loadpage_lo     = "  0   1   0   0      0   0   0   0",
4223                           "  0   0   x   x      x   x   x   x",
4224                           "  x   x  a5  a4     a3  a2  a1  a0",
4225                           "  i   i   i   i      i   i   i   i";
4226
4227         loadpage_hi     = "  0   1   0   0      1   0   0   0",
4228                           "  0   0   x   x      x   x   x   x",
4229                           "  x   x  a5  a4     a3  a2  a1  a0",
4230                           "  i   i   i   i      i   i   i   i";
4231
4232         writepage       = "  0   1   0   0      1   1   0   0",
4233                           "  0   0 a13 a12    a11 a10  a9  a8",
4234                           " a7  a6   x   x      x   x   x   x",
4235                           "  x   x   x   x      x   x   x   x";
4236
4237         mode            = 0x21;
4238         delay           = 6;
4239         blocksize       = 128;
4240         readsize        = 256;
4241       ;
4242
4243     memory "lock"
4244         size            = 1;
4245         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4246                           "x x x x  x x x x   x x o o  o o o o";
4247
4248         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4249                           "x x x x  x x x x   1 1 i i  i i i i";
4250         min_write_delay = 9000;
4251         max_write_delay = 9000;
4252       ;
4253
4254     memory "lfuse"
4255         size            = 1;
4256         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4257                           "x x x x  x x x x   o o o o  o o o o";
4258
4259         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4260                           "x x x x  x x x x   i i i i  i i i i";
4261         min_write_delay = 9000;
4262         max_write_delay = 9000;
4263       ;
4264
4265     memory "hfuse"
4266         size            = 1;
4267         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4268                           "x x x x  x x x x   o o o o  o o o o";
4269
4270         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4271                           "x x x x  x x x x   i i i i  i i i i";
4272         min_write_delay = 9000;
4273         max_write_delay = 9000;
4274       ;
4275     memory "signature"
4276         size            = 3;
4277         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4278                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4279       ;
4280     memory "calibration"
4281         size            = 4;
4282
4283         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4284                           "0 0 0 0  0 0 a1 a0 o o o o  o o o o";
4285         ;
4286   ;
4287
4288
4289 #------------------------------------------------------------
4290 # ATmega164P
4291 #------------------------------------------------------------
4292
4293 # close to ATmega16
4294
4295 part parent "m16"
4296     id               = "m164p";
4297     desc             = "ATmega164P";
4298     signature        = 0x1e 0x94 0x0a;
4299
4300     progmodedelay       = 0;
4301     latchcycles         = 5;
4302     togglevtg           = 1;
4303     poweroffdelay       = 15;
4304     resetdelayms        = 1;
4305     allowfullpagebitstream = no;
4306     chip_erase_delay = 55000;
4307
4308     ocdrev              = 3;
4309   ;
4310
4311
4312 #------------------------------------------------------------
4313 # ATmega324P
4314 #------------------------------------------------------------
4315
4316 # similar to ATmega164P
4317
4318 part
4319     id               = "m324p";
4320     desc             = "ATmega324P";
4321     has_jtag         = yes;
4322     stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4323     avr910_devcode   = 0x74;
4324     signature        = 0x1e 0x95 0x08;
4325     pagel            = 0xd7;
4326     bs2              = 0xa0;
4327     chip_erase_delay = 55000;
4328     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4329                        "x x x x  x x x x    x x x x  x x x x";
4330
4331     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4332                        "x x x x  x x x x    x x x x  x x x x";
4333
4334     timeout             = 200;
4335     stabdelay           = 100;
4336     cmdexedelay         = 25;
4337     synchloops          = 32;
4338     bytedelay           = 0;
4339     pollindex           = 3;
4340     pollvalue           = 0x53;
4341     predelay            = 1;
4342     postdelay           = 1;
4343     pollmethod          = 0;
4344
4345     pp_controlstack     =
4346         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4347         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4348         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4349         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
4350     hventerstabdelay    = 100;
4351     progmodedelay       = 0;
4352     latchcycles         = 5;
4353     togglevtg           = 1;
4354     poweroffdelay       = 15;
4355     resetdelayms        = 1;
4356     resetdelayus        = 0;
4357     hvleavestabdelay    = 15;
4358     chiperasepulsewidth = 0;
4359     chiperasepolltimeout = 10;
4360     programfusepulsewidth = 0;
4361     programfusepolltimeout = 5;
4362     programlockpulsewidth = 0;
4363     programlockpolltimeout = 5;
4364
4365     idr                 = 0x31;
4366     spmcr               = 0x57;
4367     allowfullpagebitstream = no;
4368
4369     ocdrev              = 3;
4370
4371     memory "eeprom"
4372         paged           = no; /* leave this "no" */
4373         page_size       = 4;  /* for parallel programming */
4374         size            = 1024;
4375         min_write_delay = 9000;
4376         max_write_delay = 9000;
4377         readback_p1     = 0xff;
4378         readback_p2     = 0xff;
4379         read            = "  1   0   1   0      0   0   0   0",
4380                           "  0   0   x   x      x a10  a9  a8",
4381                           " a7  a6  a5  a4     a3  a2  a1  a0",
4382                           "  o   o   o   o      o   o   o   o";
4383
4384         write           = "  1   1   0   0      0   0   0   0",
4385                           "  0   0   x   x      x a10  a9  a8",
4386                           " a7  a6  a5  a4     a3  a2  a1  a0", 
4387                           "  i   i   i   i      i   i   i   i";
4388
4389         loadpage_lo     = "  1   1   0   0      0   0   0   1",
4390                           "  0   0   0   0      0   0   0   0",
4391                           "  0   0   0   0      0   0  a1  a0",
4392                           "  i   i   i   i      i   i   i   i";
4393
4394         writepage       = "  1   1   0   0      0   0   1   0",
4395                           "  0   0   x   x      x a10  a9  a8",
4396                           " a7  a6  a5  a4     a3  a2   0   0",
4397                           "  x   x   x   x      x   x   x   x";
4398
4399         mode            = 0x41;
4400         delay           = 10;
4401         blocksize       = 128;
4402         readsize        = 256;
4403       ;
4404
4405     memory "flash"
4406         paged           = yes;
4407         size            = 32768;
4408         page_size       = 128;
4409         num_pages       = 256;
4410         min_write_delay = 4500;
4411         max_write_delay = 4500;
4412         readback_p1     = 0xff;
4413         readback_p2     = 0xff;
4414         read_lo         = "  0   0   1   0      0   0   0   0",
4415                           "  0 a14 a13 a12    a11 a10  a9  a8",
4416                           " a7  a6  a5  a4     a3  a2  a1  a0",
4417                           "  o   o   o   o      o   o   o   o";
4418
4419         read_hi         = "  0   0   1   0      1   0   0   0",
4420                           "  0 a14 a13 a12    a11 a10  a9  a8",
4421                           " a7  a6  a5  a4     a3  a2  a1  a0",
4422                           "  o   o   o   o      o   o   o   o";
4423
4424         loadpage_lo     = "  0   1   0   0      0   0   0   0",
4425                           "  0   0   x   x      x   x   x   x",
4426                           "  x   x  a5  a4     a3  a2  a1  a0",
4427                           "  i   i   i   i      i   i   i   i";
4428
4429         loadpage_hi     = "  0   1   0   0      1   0   0   0",
4430                           "  0   0   x   x      x   x   x   x",
4431                           "  x   x  a5  a4     a3  a2  a1  a0",
4432                           "  i   i   i   i      i   i   i   i";
4433
4434         writepage       = "  0   1   0   0      1   1   0   0",
4435                           "  0 a14 a13 a12    a11 a10  a9  a8",
4436                           " a7  a6   x   x      x   x   x   x",
4437                           "  x   x   x   x      x   x   x   x";
4438
4439         mode            = 0x21;
4440         delay           = 6;
4441         blocksize       = 256;
4442         readsize        = 256;
4443       ;
4444
4445     memory "lock"
4446         size            = 1;
4447         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4448                           "x x x x  x x x x   x x o o  o o o o";
4449
4450         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4451                           "x x x x  x x x x   1 1 i i  i i i i";
4452         min_write_delay = 9000;
4453         max_write_delay = 9000;
4454       ;
4455
4456     memory "lfuse"
4457         size            = 1;
4458         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4459                           "x x x x  x x x x   o o o o  o o o o";
4460
4461         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4462                           "x x x x  x x x x   i i i i  i i i i";
4463         min_write_delay = 9000;
4464         max_write_delay = 9000;
4465       ;
4466
4467     memory "hfuse"
4468         size            = 1;
4469         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4470                           "x x x x  x x x x   o o o o  o o o o";
4471
4472         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4473                           "x x x x  x x x x   i i i i  i i i i";
4474         min_write_delay = 9000;
4475         max_write_delay = 9000;
4476       ;
4477
4478     memory "efuse"
4479         size            = 1;
4480
4481         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4482                           "x x x x  x x x x  o o o o  o o o o";
4483
4484         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4485                           "x x x x  x x x x  1 1 1 1  1 i i i";
4486         min_write_delay = 9000;
4487         max_write_delay = 9000;
4488       ;
4489
4490     memory "signature"
4491         size            = 3;
4492         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4493                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4494       ;
4495
4496     memory "calibration"
4497         size            = 1;
4498
4499         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4500                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
4501         ;
4502   ;
4503
4504
4505 #------------------------------------------------------------
4506 # ATmega324PA
4507 #------------------------------------------------------------
4508
4509 # similar to ATmega324P
4510
4511 part parent "m324p"
4512     id               = "m324pa";
4513     desc             = "ATmega324PA";
4514     signature        = 0x1e 0x95 0x11;
4515
4516     ocdrev              = 3;
4517   ;
4518
4519
4520 #------------------------------------------------------------
4521 # ATmega644
4522 #------------------------------------------------------------
4523
4524 # similar to ATmega164
4525
4526 part
4527     id               = "m644";
4528     desc             = "ATmega644";
4529     has_jtag         = yes;
4530     stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4531     avr910_devcode   = 0x74;
4532     signature        = 0x1e 0x96 0x09;
4533     pagel            = 0xd7;
4534     bs2              = 0xa0;
4535     chip_erase_delay = 55000;
4536     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4537                        "x x x x  x x x x    x x x x  x x x x";
4538
4539     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4540                        "x x x x  x x x x    x x x x  x x x x";
4541
4542     timeout             = 200;
4543     stabdelay           = 100;
4544     cmdexedelay         = 25;
4545     synchloops          = 32;
4546     bytedelay           = 0;
4547     pollindex           = 3;
4548     pollvalue           = 0x53;
4549     predelay            = 1;
4550     postdelay           = 1;
4551     pollmethod          = 0;
4552
4553     pp_controlstack     =
4554         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4555         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4556         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4557         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
4558     hventerstabdelay    = 100;
4559     progmodedelay       = 0;
4560     latchcycles         = 6;
4561     togglevtg           = 0;
4562     poweroffdelay       = 0;
4563     resetdelayms        = 0;
4564     resetdelayus        = 0;
4565     hvleavestabdelay    = 15;
4566     chiperasepulsewidth = 0;
4567     chiperasepolltimeout = 10;
4568     programfusepulsewidth = 0;
4569     programfusepolltimeout = 5;
4570     programlockpulsewidth = 0;
4571     programlockpolltimeout = 5;
4572
4573     idr                 = 0x31;
4574     spmcr               = 0x57;
4575     allowfullpagebitstream = no;
4576
4577     ocdrev              = 3;
4578
4579     memory "eeprom"
4580         paged           = no; /* leave this "no" */
4581         page_size       = 8;  /* for parallel programming */
4582         size            = 2048;
4583         min_write_delay = 9000;
4584         max_write_delay = 9000;
4585         readback_p1     = 0xff;
4586         readback_p2     = 0xff;
4587         read            = "  1   0   1   0      0   0   0   0",
4588                           "  0   0   x   x    a11 a10  a9  a8",
4589                           " a7  a6  a5  a4     a3  a2  a1  a0",
4590                           "  o   o   o   o      o   o   o   o";
4591
4592         write           = "  1   1   0   0      0   0   0   0",
4593                           "  0   0   x   x    a11 a10  a9  a8",
4594                           " a7  a6  a5  a4     a3  a2  a1  a0", 
4595                           "  i   i   i   i      i   i   i   i";
4596
4597         loadpage_lo     = "  1   1   0   0      0   0   0   1",
4598                           "  0   0   0   0      0   0   0   0",
4599                           "  0   0   0   0      0  a2  a1  a0",
4600                           "  i   i   i   i      i   i   i   i";
4601
4602         writepage       = "  1   1   0   0      0   0   1   0",
4603                           "  0   0   x   x    a11 a10  a9  a8",
4604                           " a7  a6  a5  a4     a3   0   0   0",
4605                           "  x   x   x   x      x   x   x   x";
4606
4607         mode            = 0x41;
4608         delay           = 10;
4609         blocksize       = 128;
4610         readsize        = 256;
4611       ;
4612
4613     memory "flash"
4614         paged           = yes;
4615         size            = 65536;
4616         page_size       = 256;
4617         num_pages       = 256;
4618         min_write_delay = 4500;
4619         max_write_delay = 4500;
4620         readback_p1     = 0xff;
4621         readback_p2     = 0xff;
4622         read_lo         = "  0   0   1   0      0   0   0   0",
4623                           "a15 a14 a13 a12    a11 a10  a9  a8",
4624                           " a7  a6  a5  a4     a3  a2  a1  a0",
4625                           "  o   o   o   o      o   o   o   o";
4626
4627         read_hi         = "  0   0   1   0      1   0   0   0",
4628                           "a15 a14 a13 a12    a11 a10  a9  a8",
4629                           " a7  a6  a5  a4     a3  a2  a1  a0",
4630                           "  o   o   o   o      o   o   o   o";
4631
4632         loadpage_lo     = "  0   1   0   0      0   0   0   0",
4633                           "  0   0   x   x      x   x   x   x",
4634                           "  x  a6  a5  a4     a3  a2  a1  a0",
4635                           "  i   i   i   i      i   i   i   i";
4636
4637         loadpage_hi     = "  0   1   0   0      1   0   0   0",
4638                           "  0   0   x   x      x   x   x   x",
4639                           "  x  a6  a5  a4     a3  a2  a1  a0",
4640                           "  i   i   i   i      i   i   i   i";
4641
4642         writepage       = "  0   1   0   0      1   1   0   0",
4643                           "a15 a14 a13 a12    a11 a10  a9  a8",
4644                           " a7   x   x   x      x   x   x   x",
4645                           "  x   x   x   x      x   x   x   x";
4646
4647         mode            = 0x21;
4648         delay           = 6;
4649         blocksize       = 256;
4650         readsize        = 256;
4651       ;
4652
4653     memory "lock"
4654         size            = 1;
4655         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4656                           "x x x x  x x x x   x x o o  o o o o";
4657
4658         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4659                           "x x x x  x x x x   1 1 i i  i i i i";
4660         min_write_delay = 9000;
4661         max_write_delay = 9000;
4662       ;
4663
4664     memory "lfuse"
4665         size            = 1;
4666         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4667                           "x x x x  x x x x   o o o o  o o o o";
4668
4669         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4670                           "x x x x  x x x x   i i i i  i i i i";
4671         min_write_delay = 9000;
4672         max_write_delay = 9000;
4673       ;
4674
4675     memory "hfuse"
4676         size            = 1;
4677         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4678                           "x x x x  x x x x   o o o o  o o o o";
4679
4680         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4681                           "x x x x  x x x x   i i i i  i i i i";
4682         min_write_delay = 9000;
4683         max_write_delay = 9000;
4684       ;
4685
4686     memory "efuse"
4687         size            = 1;
4688
4689         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4690                           "x x x x  x x x x  o o o o  o o o o";
4691
4692         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4693                           "x x x x  x x x x  1 1 1 1  1 i i i";
4694         min_write_delay = 9000;
4695         max_write_delay = 9000;
4696       ;
4697
4698     memory "signature"
4699         size            = 3;
4700         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4701                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4702       ;
4703
4704     memory "calibration"
4705         size            = 1;
4706
4707         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4708                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
4709         ;
4710   ;
4711
4712 #------------------------------------------------------------
4713 # ATmega644P
4714 #------------------------------------------------------------
4715
4716 # similar to ATmega164p
4717
4718 part parent "m644"
4719     id               = "m644p";
4720     desc             = "ATmega644P";
4721     signature        = 0x1e 0x96 0x0a;
4722
4723     ocdrev              = 3;
4724   ;
4725
4726
4727
4728 #------------------------------------------------------------
4729 # ATmega1284
4730 #------------------------------------------------------------
4731
4732 # similar to ATmega164
4733
4734 part
4735     id               = "m1284";
4736     desc             = "ATmega1284";
4737     has_jtag         = yes;
4738     stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4739     avr910_devcode   = 0x74;
4740     signature        = 0x1e 0x97 0x06;
4741     pagel            = 0xd7;
4742     bs2              = 0xa0;
4743     chip_erase_delay = 55000;
4744     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4745                        "x x x x  x x x x    x x x x  x x x x";
4746
4747     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4748                        "x x x x  x x x x    x x x x  x x x x";
4749
4750     timeout             = 200;
4751     stabdelay           = 100;
4752     cmdexedelay         = 25;
4753     synchloops          = 32;
4754     bytedelay           = 0;
4755     pollindex           = 3;
4756     pollvalue           = 0x53;
4757     predelay            = 1;
4758     postdelay           = 1;
4759     pollmethod          = 1;
4760
4761     pp_controlstack     =
4762         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4763         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4764         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4765         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
4766     hventerstabdelay    = 100;
4767     progmodedelay       = 0;
4768     latchcycles         = 6;
4769     togglevtg           = 1;
4770     poweroffdelay       = 15;
4771     resetdelayms        = 1;
4772     resetdelayus        = 0;
4773     hvleavestabdelay    = 15;
4774     chiperasepulsewidth = 0;
4775     chiperasepolltimeout = 10;
4776     programfusepulsewidth = 0;
4777     programfusepolltimeout = 5;
4778     programlockpulsewidth = 0;
4779     programlockpolltimeout = 5;
4780
4781     idr                 = 0x31;
4782     spmcr               = 0x57;
4783     allowfullpagebitstream = no;
4784
4785     ocdrev              = 3;
4786
4787     memory "eeprom"
4788         paged           = no; /* leave this "no" */
4789         page_size       = 8;  /* for parallel programming */
4790         size            = 4096;
4791         min_write_delay = 9000;
4792         max_write_delay = 9000;
4793         readback_p1     = 0xff;
4794         readback_p2     = 0xff;
4795         read            = "  1   0   1   0      0   0   0   0",
4796                           "  0   0   x   x    a11 a10  a9  a8",
4797                           " a7  a6  a5  a4     a3  a2  a1  a0",
4798                           "  o   o   o   o      o   o   o   o";
4799
4800         write           = "  1   1   0   0      0   0   0   0",
4801                           "  0   0   x   x    a11 a10  a9  a8",
4802                           " a7  a6  a5  a4     a3  a2  a1  a0", 
4803                           "  i   i   i   i      i   i   i   i";
4804
4805         loadpage_lo     = "  1   1   0   0      0   0   0   1",
4806                           "  0   0   0   0      0   0   0   0",
4807                           "  0   0   0   0      0  a2  a1  a0",
4808                           "  i   i   i   i      i   i   i   i";
4809
4810         writepage       = "  1   1   0   0      0   0   1   0",
4811                           "  0   0   x   x    a11 a10  a9  a8",
4812                           " a7  a6  a5  a4     a3   0   0   0",
4813                           "  x   x   x   x      x   x   x   x";
4814
4815         mode            = 0x41;
4816         delay           = 10;
4817         blocksize       = 128;
4818         readsize        = 256;
4819       ;
4820
4821     memory "flash"
4822         paged           = yes;
4823         size            = 131072;
4824         page_size       = 256;
4825         num_pages       = 512;
4826         min_write_delay = 4500;
4827         max_write_delay = 4500;
4828         readback_p1     = 0xff;
4829         readback_p2     = 0xff;
4830         read_lo         = "  0   0   1   0      0   0   0   0",
4831                           "a15 a14 a13 a12    a11 a10  a9  a8",
4832                           " a7  a6  a5  a4     a3  a2  a1  a0",
4833                           "  o   o   o   o      o   o   o   o";
4834
4835         read_hi         = "  0   0   1   0      1   0   0   0",
4836                           "a15 a14 a13 a12    a11 a10  a9  a8",
4837                           " a7  a6  a5  a4     a3  a2  a1  a0",
4838                           "  o   o   o   o      o   o   o   o";
4839
4840         loadpage_lo     = "  0   1   0   0      0   0   0   0",
4841                           "  0   0   x   x      x   x   x   x",
4842                           "  x  a6  a5  a4     a3  a2  a1  a0",
4843                           "  i   i   i   i      i   i   i   i";
4844
4845         loadpage_hi     = "  0   1   0   0      1   0   0   0",
4846                           "  0   0   x   x      x   x   x   x",
4847                           "  x  a6  a5  a4     a3  a2  a1  a0",
4848                           "  i   i   i   i      i   i   i   i";
4849
4850         writepage       = "  0   1   0   0      1   1   0   0",
4851                           "a15 a14 a13 a12    a11 a10  a9  a8",
4852                           " a7   x   x   x      x   x   x   x",
4853                           "  x   x   x   x      x   x   x   x";
4854
4855         mode            = 0x41;
4856         delay           = 10;
4857         blocksize       = 256;
4858         readsize        = 256;
4859       ;
4860
4861     memory "lock"
4862         size            = 1;
4863         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4864                           "x x x x  x x x x   x x o o  o o o o";
4865
4866         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4867                           "x x x x  x x x x   1 1 i i  i i i i";
4868         min_write_delay = 9000;
4869         max_write_delay = 9000;
4870       ;
4871
4872     memory "lfuse"
4873         size            = 1;
4874         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4875                           "x x x x  x x x x   o o o o  o o o o";
4876
4877         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4878                           "x x x x  x x x x   i i i i  i i i i";
4879         min_write_delay = 9000;
4880         max_write_delay = 9000;
4881       ;
4882
4883     memory "hfuse"
4884         size            = 1;
4885         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4886                           "x x x x  x x x x   o o o o  o o o o";
4887
4888         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4889                           "x x x x  x x x x   i i i i  i i i i";
4890         min_write_delay = 9000;
4891         max_write_delay = 9000;
4892       ;
4893
4894     memory "efuse"
4895         size            = 1;
4896
4897         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4898                           "x x x x  x x x x  o o o o  o o o o";
4899
4900         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4901                           "x x x x  x x x x  1 1 1 1  1 i i i";
4902         min_write_delay = 9000;
4903         max_write_delay = 9000;
4904       ;
4905
4906     memory "signature"
4907         size            = 3;
4908         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4909                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4910       ;
4911
4912     memory "calibration"
4913         size            = 1;
4914
4915         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4916                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
4917         ;
4918   ;
4919
4920
4921
4922 #------------------------------------------------------------
4923 # ATmega1284P
4924 #------------------------------------------------------------
4925
4926 # similar to ATmega164p
4927
4928 part
4929     id               = "m1284p";
4930     desc             = "ATmega1284P";
4931     has_jtag         = yes;
4932     stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4933     avr910_devcode   = 0x74;
4934     signature        = 0x1e 0x97 0x05;
4935     pagel            = 0xd7;
4936     bs2              = 0xa0;
4937     chip_erase_delay = 55000;
4938     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4939                        "x x x x  x x x x    x x x x  x x x x";
4940
4941     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4942                        "x x x x  x x x x    x x x x  x x x x";
4943
4944     timeout             = 200;
4945     stabdelay           = 100;
4946     cmdexedelay         = 25;
4947     synchloops          = 32;
4948     bytedelay           = 0;
4949     pollindex           = 3;
4950     pollvalue           = 0x53;
4951     predelay            = 1;
4952     postdelay           = 1;
4953     pollmethod          = 1;
4954
4955     pp_controlstack     =
4956         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4957         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4958         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4959         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
4960     hventerstabdelay    = 100;
4961     progmodedelay       = 0;
4962     latchcycles         = 6;
4963     togglevtg           = 1;
4964     poweroffdelay       = 15;
4965     resetdelayms        = 1;
4966     resetdelayus        = 0;
4967     hvleavestabdelay    = 15;
4968     chiperasepulsewidth = 0;
4969     chiperasepolltimeout = 10;
4970     programfusepulsewidth = 0;
4971     programfusepolltimeout = 5;
4972     programlockpulsewidth = 0;
4973     programlockpolltimeout = 5;
4974
4975     idr                 = 0x31;
4976     spmcr               = 0x57;
4977     allowfullpagebitstream = no;
4978
4979     ocdrev              = 3;
4980
4981     memory "eeprom"
4982         paged           = no; /* leave this "no" */
4983         page_size       = 8;  /* for parallel programming */
4984         size            = 4096;
4985         min_write_delay = 9000;
4986         max_write_delay = 9000;
4987         readback_p1     = 0xff;
4988         readback_p2     = 0xff;
4989         read            = "  1   0   1   0      0   0   0   0",
4990                           "  0   0   x   x    a11 a10  a9  a8",
4991                           " a7  a6  a5  a4     a3  a2  a1  a0",
4992                           "  o   o   o   o      o   o   o   o";
4993
4994         write           = "  1   1   0   0      0   0   0   0",
4995                           "  0   0   x   x    a11 a10  a9  a8",
4996                           " a7  a6  a5  a4     a3  a2  a1  a0", 
4997                           "  i   i   i   i      i   i   i   i";
4998
4999         loadpage_lo     = "  1   1   0   0      0   0   0   1",
5000                           "  0   0   0   0      0   0   0   0",
5001                           "  0   0   0   0      0  a2  a1  a0",
5002                           "  i   i   i   i      i   i   i   i";
5003
5004         writepage       = "  1   1   0   0      0   0   1   0",
5005                           "  0   0   x   x    a11 a10  a9  a8",
5006                           " a7  a6  a5  a4     a3   0   0   0",
5007                           "  x   x   x   x      x   x   x   x";
5008
5009         mode            = 0x41;
5010         delay           = 10;
5011         blocksize       = 128;
5012         readsize        = 256;
5013       ;
5014
5015     memory "flash"
5016         paged           = yes;
5017         size            = 131072;
5018         page_size       = 256;
5019         num_pages       = 512;
5020         min_write_delay = 4500;
5021         max_write_delay = 4500;
5022         readback_p1     = 0xff;
5023         readback_p2     = 0xff;
5024         read_lo         = "  0   0   1   0      0   0   0   0",
5025                           "a15 a14 a13 a12    a11 a10  a9  a8",
5026                           " a7  a6  a5  a4     a3  a2  a1  a0",
5027                           "  o   o   o   o      o   o   o   o";
5028
5029         read_hi         = "  0   0   1   0      1   0   0   0",
5030                           "a15 a14 a13 a12    a11 a10  a9  a8",
5031                           " a7  a6  a5  a4     a3  a2  a1  a0",
5032                           "  o   o   o   o      o   o   o   o";
5033
5034         loadpage_lo     = "  0   1   0   0      0   0   0   0",
5035                           "  0   0   x   x      x   x   x   x",
5036                           "  x  a6  a5  a4     a3  a2  a1  a0",
5037                           "  i   i   i   i      i   i   i   i";
5038
5039         loadpage_hi     = "  0   1   0   0      1   0   0   0",
5040                           "  0   0   x   x      x   x   x   x",
5041                           "  x  a6  a5  a4     a3  a2  a1  a0",
5042                           "  i   i   i   i      i   i   i   i";
5043
5044         writepage       = "  0   1   0   0      1   1   0   0",
5045                           "a15 a14 a13 a12    a11 a10  a9  a8",
5046                           " a7   x   x   x      x   x   x   x",
5047                           "  x   x   x   x      x   x   x   x";
5048
5049         mode            = 0x41;
5050         delay           = 10;
5051         blocksize       = 256;
5052         readsize        = 256;
5053       ;
5054
5055     memory "lock"
5056         size            = 1;
5057         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5058                           "x x x x  x x x x   x x o o  o o o o";
5059
5060         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5061                           "x x x x  x x x x   1 1 i i  i i i i";
5062         min_write_delay = 9000;
5063         max_write_delay = 9000;
5064       ;
5065
5066     memory "lfuse"
5067         size            = 1;
5068         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5069                           "x x x x  x x x x   o o o o  o o o o";
5070
5071         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5072                           "x x x x  x x x x   i i i i  i i i i";
5073         min_write_delay = 9000;
5074         max_write_delay = 9000;
5075       ;
5076
5077     memory "hfuse"
5078         size            = 1;
5079         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5080                           "x x x x  x x x x   o o o o  o o o o";
5081
5082         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5083                           "x x x x  x x x x   i i i i  i i i i";
5084         min_write_delay = 9000;
5085         max_write_delay = 9000;
5086       ;
5087
5088     memory "efuse"
5089         size            = 1;
5090
5091         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
5092                           "x x x x  x x x x  o o o o  o o o o";
5093
5094         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
5095                           "x x x x  x x x x  1 1 1 1  1 i i i";
5096         min_write_delay = 9000;
5097         max_write_delay = 9000;
5098       ;
5099
5100     memory "signature"
5101         size            = 3;
5102         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
5103                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5104       ;
5105
5106     memory "calibration"
5107         size            = 1;
5108
5109         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
5110                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
5111         ;
5112   ;
5113
5114
5115
5116 #------------------------------------------------------------
5117 # ATmega162
5118 #------------------------------------------------------------
5119
5120 part
5121     id               = "m162";
5122     desc             = "ATmega162";
5123     has_jtag         = yes;
5124     stk500_devcode   = 0x83;
5125     avr910_devcode   = 0x63;
5126     signature        = 0x1e 0x94 0x04;
5127     chip_erase_delay = 9000;
5128     pagel            = 0xd7;
5129     bs2              = 0xa0;
5130
5131     idr              = 0x04;
5132     spmcr            = 0x57;
5133     allowfullpagebitstream = yes;
5134
5135     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5136                        "x x x x  x x x x    x x x x  x x x x";
5137
5138     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
5139                        "x x x x  x x x x    x x x x  x x x x";
5140
5141     ocdrev              = 2;
5142
5143     memory "flash"
5144         paged           = yes;
5145         size            = 16384;
5146         page_size       = 128;
5147         num_pages       = 128;
5148         min_write_delay = 4500;
5149         max_write_delay = 4500;
5150         readback_p1     = 0xff;
5151         readback_p2     = 0xff;
5152
5153         read_lo         = "  0   0   1   0      0   0   0   0",
5154                           "  0   0 a13 a12    a11 a10  a9  a8",
5155                           " a7  a6  a5  a4     a3  a2  a1  a0",
5156                           "  o   o   o   o      o   o   o   o";
5157
5158         read_hi         = "  0   0   1   0      1   0   0   0",
5159                           "  0   0 a13 a12    a11 a10  a9  a8",
5160                           " a7  a6  a5  a4     a3  a2  a1  a0",
5161                           "  o   o   o   o      o   o   o   o";
5162
5163         loadpage_lo     = "  0   1   0   0      0   0   0   0",
5164                           "  0   0   x   x      x   x   x   x",
5165                           "  x   x  a5  a4     a3  a2  a1  a0",
5166                           "  i   i   i   i      i   i   i   i";
5167
5168         loadpage_hi     = "  0   1   0   0      1   0   0   0",
5169                           "  0   0   x   x      x   x   x   x",
5170                           "  x   x  a5  a4     a3  a2  a1  a0",
5171                           "  i   i   i   i      i   i   i   i";
5172
5173         writepage       = "  0   1   0   0      1   1   0   0",
5174                           "  0   0 a13 a12    a11 a10  a9  a8",
5175                           " a7  a6   x   x      x   x   x   x",
5176                           "  x   x   x   x      x   x   x   x";
5177        mode        = 0x41;
5178     delay       = 10;
5179     blocksize   = 128;
5180     readsize    = 256;  
5181
5182         ;
5183
5184     timeout             = 200;
5185     stabdelay           = 100;
5186     cmdexedelay         = 25;
5187     synchloops          = 32;
5188     bytedelay           = 0;
5189     pollindex           = 3;
5190     pollvalue           = 0x53;
5191     predelay            = 1;
5192     postdelay           = 1;
5193     pollmethod          = 0;
5194
5195     pp_controlstack     =
5196         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5197         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5198         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5199         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5200     hventerstabdelay    = 100;
5201     progmodedelay       = 0;
5202     latchcycles         = 6;
5203     togglevtg           = 0;
5204     poweroffdelay       = 0;
5205     resetdelayms        = 0;
5206     resetdelayus        = 0;
5207     hvleavestabdelay    = 15;
5208     chiperasepulsewidth = 0;
5209     chiperasepolltimeout = 10;
5210     programfusepulsewidth = 0;
5211     programfusepolltimeout = 5;
5212     programlockpulsewidth = 0;
5213     programlockpolltimeout = 5;
5214
5215     memory "eeprom"
5216         paged           = no; /* leave this "no" */
5217         page_size       = 4;  /* for parallel programming */
5218         size            = 512;
5219         min_write_delay = 9000;
5220         max_write_delay = 9000;
5221         readback_p1     = 0xff;
5222         readback_p2     = 0xff;
5223
5224                 read            = "  1   0   1   0      0   0   0   0",
5225                           "  0   0   x   x      x   x  a9  a8",
5226                           " a7  a6  a5  a4     a3  a2  a1  a0",
5227                           "  o   o   o   o      o   o   o   o";
5228
5229                 write           = "  1   1   0   0      0   0   0   0",
5230                           "  0   0   x   x      x   x  a9  a8",
5231                           " a7  a6  a5  a4     a3  a2  a1  a0",
5232                           "  i   i   i   i      i   i   i   i";
5233
5234         loadpage_lo     = "  1   1   0   0      0   0   0   1",
5235                           "  0   0   0   0      0   0   0   0",
5236                           "  0   0   0   0      0   0  a1  a0",
5237                           "  i   i   i   i      i   i   i   i";
5238
5239         writepage       = "  1   1   0   0      0   0   1   0",
5240                           "  0   0   x   x      x   x  a9  a8",
5241                           " a7  a6  a5  a4     a3  a2   0   0",
5242                           "  x   x   x   x      x   x   x   x";
5243
5244         mode            = 0x41;
5245         delay           = 20;
5246         blocksize       = 4;
5247         readsize        = 256;
5248         ;
5249
5250     memory "lfuse"
5251         size            = 1;
5252         min_write_delay = 16000;
5253         max_write_delay = 16000;
5254         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5255                           "x x x x  x x x x   o o o o  o o o o";
5256
5257         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5258                           "x x x x  x x x x   i i i i  i i i i";
5259         ;
5260
5261     memory "hfuse"
5262         size            = 1;
5263         min_write_delay = 16000;
5264         max_write_delay = 16000;
5265
5266         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5267                           "x x x x  x x x x   o o o o  o o o o";
5268
5269         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5270                           "x x x x  x x x x   i i i i  i i i i";
5271         ;
5272
5273     memory "efuse"
5274         size            = 1;
5275         min_write_delay = 16000;
5276         max_write_delay = 16000;
5277
5278         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
5279                           "x x x x  x x x x  o o o o  o o o o";
5280
5281         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
5282                           "x x x x  x x x x  1 1 1 1  1 i i i";
5283       ;
5284
5285     memory "lock"
5286         size            = 1;
5287         min_write_delay = 16000;
5288         max_write_delay = 16000;
5289
5290         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5291                           "x x x x  x x x x   x x o o  o o o o";
5292
5293         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5294                           "x x x x  x x x x   1 1 i i  i i i i";
5295         ;
5296
5297     memory "signature"
5298         size            = 3;
5299
5300         read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
5301                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5302         ;
5303
5304     memory "calibration"
5305         size            = 1;
5306
5307         read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
5308                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
5309         ;
5310 ;
5311
5312
5313
5314 #------------------------------------------------------------
5315 # ATmega163
5316 #------------------------------------------------------------
5317
5318 part
5319     id               = "m163";
5320     desc             = "ATmega163";
5321     stk500_devcode   = 0x81;
5322     avr910_devcode   = 0x64;
5323     signature        = 0x1e 0x94 0x02;
5324     chip_erase_delay = 32000;
5325     pagel            = 0xd7;
5326     bs2              = 0xa0;
5327     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5328                        "x x x x  x x x x    x x x x  x x x x";
5329
5330     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5331                        "x x x x  x x x x    x x x x  x x x x";
5332
5333     timeout             = 200;
5334     stabdelay           = 100;
5335     cmdexedelay         = 25;
5336     synchloops          = 32;
5337     bytedelay           = 0;
5338     pollindex           = 3;
5339     pollvalue           = 0x53;
5340     predelay            = 1;
5341     postdelay           = 1;
5342     pollmethod          = 0;
5343
5344     pp_controlstack     =
5345         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5346         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5347         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5348         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5349     hventerstabdelay    = 100;
5350     progmodedelay       = 0;
5351     latchcycles         = 0;
5352     togglevtg           = 0;
5353     poweroffdelay       = 0;
5354     resetdelayms        = 0;
5355     resetdelayus        = 0;
5356     hvleavestabdelay    = 15;
5357     chiperasepulsewidth = 0;
5358     chiperasepolltimeout = 30;
5359     programfusepulsewidth = 0;
5360     programfusepolltimeout = 2;
5361     programlockpulsewidth = 0;
5362     programlockpolltimeout = 2;
5363
5364
5365    memory "eeprom"
5366         size            = 512;
5367         min_write_delay = 4000;
5368         max_write_delay = 4000;
5369         readback_p1     = 0xff;
5370         readback_p2     = 0xff;
5371         read            = "  1   0   1   0      0   0   0   0",
5372                           "  x   x   x   x      x   x   x  a8",
5373                           " a7  a6  a5  a4     a3  a2  a1  a0",
5374                           "  o   o   o   o      o   o   o   o";
5375
5376         write           = "  1   1   0   0      0   0   0   0",
5377                           "  x   x   x   x      x   x   x  a8",
5378                           " a7  a6  a5  a4     a3  a2  a1  a0",
5379                           "  i   i   i   i      i   i   i   i";
5380         mode            = 0x41;
5381         delay           = 20;
5382         blocksize       = 4;
5383         readsize        = 256;
5384       ;
5385
5386     memory "flash"
5387         paged           = yes;
5388         size            = 16384;
5389         page_size       = 128;
5390         num_pages       = 128;
5391         min_write_delay = 16000;
5392         max_write_delay = 16000;
5393         readback_p1     = 0xff;
5394         readback_p2     = 0xff;
5395         read_lo         = "  0   0   1   0      0   0   0   0",
5396                           "  x   x   x a12    a11 a10  a9  a8",
5397                           " a7  a6  a5  a4     a3  a2  a1  a0",
5398                           "  o   o   o   o      o   o   o   o";
5399
5400         read_hi         = "  0   0   1   0      1   0   0   0",
5401                           "  x   x   x a12    a11 a10  a9  a8",
5402                           " a7  a6  a5  a4     a3  a2  a1  a0",
5403                           "  o   o   o   o      o   o   o   o";
5404
5405         loadpage_lo     = "  0   1   0   0      0   0   0   0",
5406                           "  x   x   x   x      x   x   x   x",
5407                           "  x   x  a5  a4     a3  a2  a1  a0",
5408                           "  i   i   i   i      i   i   i   i";
5409
5410         loadpage_hi     = "  0   1   0   0      1   0   0   0",
5411                           "  x   x   x   x      x   x   x   x",
5412                           "  x   x  a5  a4     a3  a2  a1  a0",
5413                           "  i   i   i   i      i   i   i   i";
5414
5415         writepage       = "  0   1   0   0      1   1   0   0",
5416                           "  x   x   x a12    a11 a10  a9  a8",
5417                           " a7  a6   x   x      x   x   x   x",
5418                           "  x   x   x   x      x   x   x   x";
5419
5420         mode            = 0x11;
5421         delay           = 20;
5422         blocksize       = 128;
5423         readsize        = 256;
5424       ;
5425
5426     memory "lfuse"
5427         size            = 1;
5428         min_write_delay = 2000;
5429         max_write_delay = 2000;
5430         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5431                           "x x x x  x x x x   o o x x  o o o o";
5432
5433         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5434                           "x x x x  x x x x   i i 1 1  i i i i";
5435       ;
5436
5437     memory "hfuse"
5438         size            = 1;
5439         min_write_delay = 2000;
5440         max_write_delay = 2000;
5441         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5442                           "x x x x  x x x x   x x x x  1 o o o";
5443
5444         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5445                           "x x x x  x x x x   1 1 1 1  1 i i i";
5446       ;
5447
5448     memory "lock"
5449         size            = 1;
5450         min_write_delay = 2000;
5451         max_write_delay = 2000;
5452         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5453                           "x x x x  0 x x x   x x o o  o o o o";
5454
5455         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5456                           "x x x x  x x x x   1 1 i i  i i i i";
5457       ;
5458
5459     memory "signature"
5460         size            = 3;
5461         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
5462                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5463       ;
5464
5465     memory "calibration"
5466         size            = 1;
5467         read            = "0 0 1 1  1 0 0 0   x x x x  x x x x",
5468                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
5469       ;
5470   ;
5471
5472 #------------------------------------------------------------
5473 # ATmega169
5474 #------------------------------------------------------------
5475
5476 part
5477     id               = "m169";
5478     desc             = "ATmega169";
5479     has_jtag         = yes;
5480     stk500_devcode   = 0x85;
5481     avr910_devcode   = 0x78;
5482     signature        = 0x1e 0x94 0x05;
5483     chip_erase_delay = 9000;
5484     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5485                        "x x x x  x x x x    x x x x  x x x x";
5486
5487     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5488                        "x x x x  x x x x    x x x x  x x x x";
5489     timeout             = 200;
5490     stabdelay           = 100;
5491     cmdexedelay         = 25;
5492     synchloops          = 32;
5493     bytedelay           = 0;
5494     pollindex           = 3;
5495     pollvalue           = 0x53;
5496     predelay            = 1;
5497     postdelay           = 1;
5498     pollmethod          = 1;
5499
5500     pp_controlstack     =
5501         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5502         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5503         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5504         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5505     hventerstabdelay    = 100;
5506     progmodedelay       = 0;
5507     latchcycles         = 5;
5508     togglevtg           = 1;
5509     poweroffdelay       = 15;
5510     resetdelayms        = 1;
5511     resetdelayus        = 0;
5512     hvleavestabdelay    = 15;
5513     chiperasepulsewidth = 0;
5514     chiperasepolltimeout = 10;
5515     programfusepulsewidth = 0;
5516     programfusepolltimeout = 5;
5517     programlockpulsewidth = 0;
5518     programlockpolltimeout = 5;
5519
5520     idr                 = 0x31;
5521     spmcr               = 0x57;
5522
5523     ocdrev              = 2;
5524
5525    memory "eeprom"
5526         paged           = no; /* leave this "no" */
5527         page_size       = 4;  /* for parallel programming */
5528         size            = 512;
5529         min_write_delay = 9000;
5530         max_write_delay = 9000;
5531         readback_p1     = 0xff;
5532         readback_p2     = 0xff;
5533         read            = "  1   0   1   0      0   0   0   0",
5534                           "  x   x   x   x      x   x   x  a8",
5535                           " a7  a6  a5  a4     a3  a2  a1  a0",
5536                           "  o   o   o   o      o   o   o   o";
5537
5538         write           = "  1   1   0   0      0   0   0   0",
5539                           "  x   x   x   x      x   x   x  a8",
5540                           " a7  a6  a5  a4     a3  a2  a1  a0", 
5541                           "  i   i   i   i      i   i   i   i";
5542
5543         loadpage_lo     = "  1   1   0   0      0   0   0   1",
5544                           "  0   0   0   0      0   0   0   0",
5545                           "  0   0   0   0      0   0  a1  a0",
5546                           "  i   i   i   i      i   i   i   i";
5547
5548         writepage       = "  1   1   0   0      0   0   1   0",
5549                           "  0   0   x   x      x   x   x  a8",
5550                           " a7  a6  a5  a4     a3  a2   0   0",
5551                           "  x   x   x   x      x   x   x   x";
5552
5553         mode            = 0x41;
5554         delay           = 20;
5555         blocksize       = 4;
5556         readsize        = 256;
5557       ;
5558
5559     memory "flash"
5560         paged           = yes;
5561         size            = 16384;
5562         page_size       = 128;
5563         num_pages       = 128;
5564         min_write_delay = 4500;
5565         max_write_delay = 4500;
5566         readback_p1     = 0xff;
5567         readback_p2     = 0xff;
5568         read_lo         = "  0   0   1   0      0   0   0   0",
5569                           "  x   x   x a12    a11 a10  a9  a8",
5570                           " a7  a6  a5  a4     a3  a2  a1  a0",
5571                           "  o   o   o   o      o   o   o   o";
5572
5573         read_hi         = "  0   0   1   0      1   0   0   0",
5574                           "  x   x   x a12    a11 a10  a9  a8",
5575                           " a7  a6  a5  a4     a3  a2  a1  a0",
5576                           "  o   o   o   o      o   o   o   o";
5577
5578         loadpage_lo     = "  0   1   0   0      0   0   0   0",
5579                           "  x   x   x   x      x   x   x   x",
5580                           "  x   x  a5  a4     a3  a2  a1  a0",
5581                           "  i   i   i   i      i   i   i   i";
5582
5583         loadpage_hi     = "  0   1   0   0      1   0   0   0",
5584                           "  x   x   x   x      x   x   x   x",
5585                           "  x   x  a5  a4     a3  a2  a1  a0",
5586                           "  i   i   i   i      i   i   i   i";
5587
5588         writepage       = "  0   1   0   0      1   1   0   0",
5589                           "  x   x   x a12    a11 a10  a9  a8",
5590                           " a7  a6   x   x      x   x   x   x",
5591                           "  x   x   x   x      x   x   x   x";
5592
5593         mode            = 0x41;
5594         delay           = 6;
5595         blocksize       = 128;
5596         readsize        = 256;
5597       ;
5598
5599     memory "lfuse"
5600         size            = 1;
5601         min_write_delay = 2000;
5602         max_write_delay = 2000;
5603         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5604                           "x x x x  x x x x   o o o o  o o o o";
5605
5606         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5607                           "x x x x  x x x x   i i i i  i i i i";
5608       ;
5609
5610     memory "hfuse"
5611         size            = 1;
5612         min_write_delay = 2000;
5613         max_write_delay = 2000;
5614         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5615                           "x x x x  x x x x   o o o o  o o o o";
5616
5617         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5618                           "x x x x  x x x x   i i i i  i i i i";
5619       ;
5620
5621     memory "efuse"
5622         size            = 1;
5623         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
5624                           "x x x x  x x x x  x x x x  i i i i";
5625
5626         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
5627                           "x x x x  x x x x  o o o o  o o o o";
5628       ;
5629
5630     memory "lock"
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  0 0 0 0",
5635                           "x x x x  x x x x   x x o o  o o o o";
5636
5637         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5638                           "x x x x  x x x x   1 1 i i  i i i i";
5639       ;
5640
5641     memory "signature"
5642         size            = 3;
5643         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
5644                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5645       ;
5646
5647     memory "calibration"
5648         size            = 1;
5649         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
5650                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
5651       ;
5652   ;
5653
5654 #------------------------------------------------------------
5655 # ATmega329
5656 #------------------------------------------------------------
5657
5658 part
5659     id               = "m329";
5660     desc             = "ATmega329";
5661     has_jtag         = yes;
5662 #    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
5663 #    avr910_devcode   = 0x?;  # try the ATmega169 one:
5664     avr910_devcode   = 0x75;
5665     signature        = 0x1e 0x95 0x03;
5666     chip_erase_delay = 9000;
5667     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5668                        "x x x x  x x x x    x x x x  x x x x";
5669
5670     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5671                        "x x x x  x x x x    x x x x  x x x x";
5672     timeout             = 200;
5673     stabdelay           = 100;
5674     cmdexedelay         = 25;
5675     synchloops          = 32;
5676     bytedelay           = 0;
5677     pollindex           = 3;
5678     pollvalue           = 0x53;
5679     predelay            = 1;
5680     postdelay           = 1;
5681     pollmethod          = 1;
5682
5683     pp_controlstack     =
5684         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5685         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5686         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5687         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5688     hventerstabdelay    = 100;
5689     progmodedelay       = 0;
5690     latchcycles         = 5;
5691     togglevtg           = 1;
5692     poweroffdelay       = 15;
5693     resetdelayms        = 1;
5694     resetdelayus        = 0;
5695     hvleavestabdelay    = 15;
5696     chiperasepulsewidth = 0;
5697     chiperasepolltimeout = 10;
5698     programfusepulsewidth = 0;
5699     programfusepolltimeout = 5;
5700     programlockpulsewidth = 0;
5701     programlockpolltimeout = 5;
5702
5703     idr                 = 0x31;
5704     spmcr               = 0x57;
5705
5706     ocdrev              = 3;
5707
5708    memory "eeprom"
5709         paged           = no; /* leave this "no" */
5710         page_size       = 4;  /* for parallel programming */
5711         size            = 1024;
5712         min_write_delay = 9000;
5713         max_write_delay = 9000;
5714         readback_p1     = 0xff;
5715         readback_p2     = 0xff;
5716         read            = "  1   0   1   0      0   0   0   0",
5717                           "  x   x   x   x      x   x  a9  a8",
5718                           " a7  a6  a5  a4     a3  a2  a1  a0",
5719                           "  o   o   o   o      o   o   o   o";
5720
5721         write           = "  1   1   0   0      0   0   0   0",
5722                           "  x   x   x   x      x   x  a9  a8",
5723                           " a7  a6  a5  a4     a3  a2  a1  a0",
5724                           "  i   i   i   i      i   i   i   i";
5725
5726         loadpage_lo     = "  1   1   0   0      0   0   0   1",
5727                           "  0   0   0   0      0   0   0   0",
5728                           "  0   0   0   0      0   0  a1  a0",
5729                           "  i   i   i   i      i   i   i   i";
5730
5731         writepage       = "  1   1   0   0      0   0   1   0",
5732                           "  0   0   x   x      x   x  a9  a8",
5733                           " a7  a6  a5  a4     a3  a2   0   0",
5734                           "  x   x   x   x      x   x   x   x";
5735
5736         mode            = 0x41;
5737         delay           = 20;
5738         blocksize       = 8;
5739         readsize        = 256;
5740       ;
5741
5742     memory "flash"
5743         paged           = yes;
5744         size            = 32768;
5745         page_size       = 128;
5746         num_pages       = 256;
5747         min_write_delay = 4500;
5748         max_write_delay = 4500;
5749         readback_p1     = 0xff;
5750         readback_p2     = 0xff;
5751         read_lo         = "  0   0   1   0      0   0   0   0",
5752                           "  x a14 a13 a12    a11 a10  a9  a8",
5753                           " a7  a6  a5  a4     a3  a2  a1  a0",
5754                           "  o   o   o   o      o   o   o   o";
5755
5756         read_hi         = "  0   0   1   0      1   0   0   0",
5757                           "  x a14 a13 a12    a11 a10  a9  a8",
5758                           " a7  a6  a5  a4     a3  a2  a1  a0",
5759                           "  o   o   o   o      o   o   o   o";
5760
5761         loadpage_lo     = "  0   1   0   0      0   0   0   0",
5762                           "  x   x   x   x      x   x   x   x",
5763                           "  x   x  a5  a4     a3  a2  a1  a0",
5764                           "  i   i   i   i      i   i   i   i";
5765
5766         loadpage_hi     = "  0   1   0   0      1   0   0   0",
5767                           "  x   x   x   x      x   x   x   x",
5768                           "  x   x  a5  a4     a3  a2  a1  a0",
5769                           "  i   i   i   i      i   i   i   i";
5770
5771         writepage       = "  0   1   0   0      1   1   0   0",
5772                           "  x   x   x a12    a11 a10  a9  a8",
5773                           " a7  a6   x   x      x   x   x   x",
5774                           "  x   x   x   x      x   x   x   x";
5775
5776         mode            = 0x41;
5777         delay           = 6;
5778         blocksize       = 256;
5779         readsize        = 256;
5780       ;
5781
5782     memory "lfuse"
5783         size            = 1;
5784         min_write_delay = 4500;
5785         max_write_delay = 4500;
5786         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5787                           "x x x x  x x x x   o o o o  o o o o";
5788
5789         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5790                           "x x x x  x x x x   i i i i  i i i i";
5791       ;
5792
5793     memory "hfuse"
5794         size            = 1;
5795         min_write_delay = 4500;
5796         max_write_delay = 4500;
5797         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5798                           "x x x x  x x x x   o o o o  o o o o";
5799
5800         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5801                           "x x x x  x x x x   i i i i  i i i i";
5802       ;
5803
5804     memory "efuse"
5805         size            = 1;
5806         min_write_delay = 4500;
5807         max_write_delay = 4500;
5808         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
5809                           "x x x x  x x x x   o o o o  o o o o";
5810
5811         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
5812                           "x x x x  x x x x   x x x x  x i i i";
5813       ;
5814
5815     memory "lock"
5816         size            = 1;
5817         min_write_delay = 4500;
5818         max_write_delay = 4500;
5819         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5820                           "x x x x  x x x x   x x o o  o o o o";
5821
5822         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5823                           "x x x x  x x x x   1 1 i i  i i i i";
5824       ;
5825
5826     memory "signature"
5827         size            = 3;
5828         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
5829                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5830       ;
5831
5832     memory "calibration"
5833         size            = 1;
5834         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
5835                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
5836       ;
5837   ;
5838
5839 #------------------------------------------------------------
5840 # ATmega329P
5841 #------------------------------------------------------------
5842 # Identical to ATmega329 except of the signature
5843
5844 part parent "m329"
5845     id               = "m329p";
5846     desc             = "ATmega329P";
5847     signature        = 0x1e 0x95 0x0b;
5848
5849     ocdrev              = 3;
5850   ;
5851
5852 #------------------------------------------------------------
5853 # ATmega3290
5854 #------------------------------------------------------------
5855
5856 # identical to ATmega329
5857
5858 part parent "m329"
5859     id               = "m3290";
5860     desc             = "ATmega3290";
5861     signature        = 0x1e 0x95 0x04;
5862
5863     ocdrev              = 3;
5864   ;
5865
5866 #------------------------------------------------------------
5867 # ATmega3290P
5868 #------------------------------------------------------------
5869
5870 # identical to ATmega3290 except of the signature
5871
5872 part parent "m3290"
5873     id               = "m3290p";
5874     desc             = "ATmega3290P";
5875     signature        = 0x1e 0x95 0x0c;
5876
5877     ocdrev              = 3;
5878   ;
5879
5880 #------------------------------------------------------------
5881 # ATmega649
5882 #------------------------------------------------------------
5883
5884 part
5885     id               = "m649";
5886     desc             = "ATmega649";
5887     has_jtag         = yes;
5888 #    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
5889 #    avr910_devcode   = 0x?;  # try the ATmega169 one:
5890     avr910_devcode   = 0x75;
5891     signature        = 0x1e 0x96 0x03;
5892     chip_erase_delay = 9000;
5893     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5894                        "x x x x  x x x x    x x x x  x x x x";
5895
5896     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5897                        "x x x x  x x x x    x x x x  x x x x";
5898     timeout             = 200;
5899     stabdelay           = 100;
5900     cmdexedelay         = 25;
5901     synchloops          = 32;
5902     bytedelay           = 0;
5903     pollindex           = 3;
5904     pollvalue           = 0x53;
5905     predelay            = 1;
5906     postdelay           = 1;
5907     pollmethod          = 1;
5908
5909     pp_controlstack     =
5910         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5911         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5912         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5913         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5914     hventerstabdelay    = 100;
5915     progmodedelay       = 0;
5916     latchcycles         = 5;
5917     togglevtg           = 1;
5918     poweroffdelay       = 15;
5919     resetdelayms        = 1;
5920     resetdelayus        = 0;
5921     hvleavestabdelay    = 15;
5922     chiperasepulsewidth = 0;
5923     chiperasepolltimeout = 10;
5924     programfusepulsewidth = 0;
5925     programfusepolltimeout = 5;
5926     programlockpulsewidth = 0;
5927     programlockpolltimeout = 5;
5928
5929     idr                 = 0x31;
5930     spmcr               = 0x57;
5931
5932     ocdrev              = 3;
5933
5934    memory "eeprom"
5935         paged           = no; /* leave this "no" */
5936         page_size       = 8;  /* for parallel programming */
5937         size            = 2048;
5938         min_write_delay = 9000;
5939         max_write_delay = 9000;
5940         readback_p1     = 0xff;
5941         readback_p2     = 0xff;
5942         read            = "  1   0   1   0      0   0   0   0",
5943                           "  x   x   x   x      x a10  a9  a8",
5944                           " a7  a6  a5  a4     a3  a2  a1  a0",
5945                           "  o   o   o   o      o   o   o   o";
5946
5947         write           = "  1   1   0   0      0   0   0   0",
5948                           "  x   x   x   x      x a10  a9  a8",
5949                           " a7  a6  a5  a4     a3  a2  a1  a0",
5950                           "  i   i   i   i      i   i   i   i";
5951
5952         loadpage_lo     = "  1   1   0   0      0   0   0   1",
5953                           "  0   0   0   0      0   0   0   0",
5954                           "  0   0   0   0      0  a2  a1  a0",
5955                           "  i   i   i   i      i   i   i   i";
5956
5957         writepage       = "  1   1   0   0      0   0   1   0",
5958                           "  0   0   x   x      x a10  a9  a8",
5959                           " a7  a6  a5  a4     a3   0   0   0",
5960                           "  x   x   x   x      x   x   x   x";
5961
5962         mode            = 0x41;
5963         delay           = 20;
5964         blocksize       = 8;
5965         readsize        = 256;
5966       ;
5967
5968     memory "flash"
5969         paged           = yes;
5970         size            = 65536;
5971         page_size       = 256;
5972         num_pages       = 256;
5973         min_write_delay = 4500;
5974         max_write_delay = 4500;
5975         readback_p1     = 0xff;
5976         readback_p2     = 0xff;
5977         read_lo         = "  0   0   1   0      0   0   0   0",
5978                           "a15 a14 a13 a12    a11 a10  a9  a8",
5979                           " a7  a6  a5  a4     a3  a2  a1  a0",
5980                           "  o   o   o   o      o   o   o   o";
5981
5982         read_hi         = "  0   0   1   0      1   0   0   0",
5983                           "a15 a14 a13 a12    a11 a10  a9  a8",
5984                           " a7  a6  a5  a4     a3  a2  a1  a0",
5985                           "  o   o   o   o      o   o   o   o";
5986
5987         loadpage_lo     = "  0   1   0   0      0   0   0   0",
5988                           "  x   x   x   x      x   x   x   x",
5989                           "  x  a6  a5  a4     a3  a2  a1  a0",
5990                           "  i   i   i   i      i   i   i   i";
5991
5992         loadpage_hi     = "  0   1   0   0      1   0   0   0",
5993                           "  x   x   x   x      x   x   x   x",
5994                           "  x  a6  a5  a4     a3  a2  a1  a0",
5995                           "  i   i   i   i      i   i   i   i";
5996
5997         writepage       = "  0   1   0   0      1   1   0   0",
5998                           "  x   x   x a12    a11 a10  a9  a8",
5999                           " a7   x   x   x      x   x   x   x",
6000                           "  x   x   x   x      x   x   x   x";
6001
6002         mode            = 0x41;
6003         delay           = 6;
6004         blocksize       = 256;
6005         readsize        = 256;
6006       ;
6007
6008     memory "lfuse"
6009         size            = 1;
6010         min_write_delay = 4500;
6011         max_write_delay = 4500;
6012         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6013                           "x x x x  x x x x   o o o o  o o o o";
6014
6015         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6016                           "x x x x  x x x x   i i i i  i i i i";
6017       ;
6018
6019     memory "hfuse"
6020         size            = 1;
6021         min_write_delay = 4500;
6022         max_write_delay = 4500;
6023         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6024                           "x x x x  x x x x   o o o o  o o o o";
6025
6026         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6027                           "x x x x  x x x x   i i i i  i i i i";
6028       ;
6029
6030     memory "efuse"
6031         size            = 1;
6032         min_write_delay = 4500;
6033         max_write_delay = 4500;
6034         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
6035                           "x x x x  x x x x   o o o o  o o o o";
6036
6037         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
6038                           "x x x x  x x x x   x x x x  x i i i";
6039       ;
6040
6041     memory "lock"
6042         size            = 1;
6043         min_write_delay = 4500;
6044         max_write_delay = 4500;
6045         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6046                           "x x x x  x x x x   x x o o  o o o o";
6047
6048         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6049                           "x x x x  x x x x   1 1 i i  i i i i";
6050       ;
6051
6052     memory "signature"
6053         size            = 3;
6054         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
6055                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6056       ;
6057
6058     memory "calibration"
6059         size            = 1;
6060         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
6061                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
6062       ;
6063   ;
6064
6065 #------------------------------------------------------------
6066 # ATmega6490
6067 #------------------------------------------------------------
6068
6069 # identical to ATmega649
6070
6071 part parent "m649"
6072     id               = "m6490";
6073     desc             = "ATmega6490";
6074     signature        = 0x1e 0x96 0x04;
6075
6076     ocdrev              = 3;
6077   ;
6078
6079 #------------------------------------------------------------
6080 # ATmega32
6081 #------------------------------------------------------------
6082
6083 part
6084     id               = "m32";
6085     desc             = "ATmega32";
6086     has_jtag         = yes;
6087     stk500_devcode   = 0x91;
6088     avr910_devcode   = 0x72;
6089     signature        = 0x1e 0x95 0x02;
6090     chip_erase_delay = 9000;
6091     pagel            = 0xd7;
6092     bs2              = 0xa0;
6093     reset            = dedicated;
6094     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6095                        "x x x x  x x x x    x x x x  x x x x";
6096
6097     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
6098                        "x x x x  x x x x    x x x x  x x x x";
6099     timeout             = 200;
6100     stabdelay           = 100;
6101     cmdexedelay         = 25;
6102     synchloops          = 32;
6103     bytedelay           = 0;
6104     pollindex           = 3;
6105     pollvalue           = 0x53;
6106     predelay            = 1;
6107     postdelay           = 1;
6108     pollmethod          = 0;
6109
6110     pp_controlstack     =
6111         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6112         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6113         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6114         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6115     hventerstabdelay    = 100;
6116     progmodedelay       = 0;
6117     latchcycles         = 6;
6118     togglevtg           = 0;
6119     poweroffdelay       = 0;
6120     resetdelayms        = 0;
6121     resetdelayus        = 0;
6122     hvleavestabdelay    = 15;
6123     chiperasepulsewidth = 0;
6124     chiperasepolltimeout = 10;
6125     programfusepulsewidth = 0;
6126     programfusepolltimeout = 5;
6127     programlockpulsewidth = 0;
6128     programlockpolltimeout = 5;
6129
6130     idr                 = 0x31;
6131     spmcr               = 0x57;
6132     allowfullpagebitstream = yes;
6133
6134     ocdrev              = 2;
6135
6136    memory "eeprom"
6137         paged           = no;   /* leave this "no" */
6138         page_size       = 4;    /* for parallel programming */
6139         size            = 1024;
6140         min_write_delay = 9000;
6141         max_write_delay = 9000;
6142         readback_p1     = 0xff;
6143         readback_p2     = 0xff;
6144         read            = "  1   0   1   0      0   0   0   0",
6145                           "  0   0   x   x      x   x  a9  a8",
6146                           " a7  a6  a5  a4     a3  a2  a1  a0",
6147                           "  o   o   o   o      o   o   o   o";
6148
6149         write           = "  1   1   0   0      0   0   0   0",
6150                           "  0   0   x   x      x   x  a9  a8",
6151                           " a7  a6  a5  a4     a3  a2  a1  a0",
6152                           "  i   i   i   i      i   i   i   i";
6153
6154         loadpage_lo     = "  1   1   0   0      0   0   0   1",
6155                           "  0   0   0   0      0   0   0   0",
6156                           "  0   0   0   0      0   0  a1  a0",
6157                           "  i   i   i   i      i   i   i   i";
6158
6159         writepage       = "  1   1   0   0      0   0   1   0",
6160                           "  0   0   x   x      x   x  a9  a8",
6161                           " a7  a6  a5  a4     a3  a2   0   0",
6162                           "  x   x   x   x      x   x   x   x";
6163
6164         mode            = 0x04;
6165         delay           = 10;
6166         blocksize       = 64;
6167         readsize        = 256;
6168       ;
6169
6170     memory "flash"
6171         paged           = yes;
6172         size            = 32768;
6173         page_size       = 128;
6174         num_pages       = 256;
6175         min_write_delay = 4500;
6176         max_write_delay = 4500;
6177         readback_p1     = 0xff;
6178         readback_p2     = 0xff;
6179         read_lo         = "  0   0   1   0      0   0   0   0",
6180                           "  0   0 a13 a12    a11 a10  a9  a8",
6181                           " a7  a6  a5  a4     a3  a2  a1  a0",
6182                           "  o   o   o   o      o   o   o   o";
6183
6184         read_hi         = "  0   0   1   0      1   0   0   0",
6185                           "  0   0 a13 a12    a11 a10  a9  a8",
6186                           " a7  a6  a5  a4     a3  a2  a1  a0",
6187                           "  o   o   o   o      o   o   o   o";
6188
6189         loadpage_lo     = "  0   1   0   0      0   0   0   0",
6190                           "  0   0   x   x      x   x   x   x",
6191                           "  x   x  a5  a4     a3  a2  a1  a0",
6192                           "  i   i   i   i      i   i   i   i";
6193
6194         loadpage_hi     = "  0   1   0   0      1   0   0   0",
6195                           "  0   0   x   x      x   x   x   x",
6196                           "  x   x  a5  a4     a3  a2  a1  a0",
6197                           "  i   i   i   i      i   i   i   i";
6198
6199         writepage       = "  0   1   0   0      1   1   0   0",
6200                           "  0   0 a13 a12    a11 a10  a9  a8",
6201                           " a7  a6   x   x      x   x   x   x",
6202                           "  x   x   x   x      x   x   x   x";
6203
6204         mode            = 0x21;
6205         delay           = 6;
6206         blocksize       = 64;
6207         readsize        = 256;
6208       ;
6209
6210     memory "lfuse"
6211         size            = 1;
6212         min_write_delay = 2000;
6213         max_write_delay = 2000;
6214         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6215                           "x x x x  x x x x   o o o o  o o o o";
6216
6217         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6218                           "x x x x  x x x x   i i i i  i i i i";
6219       ;
6220
6221     memory "hfuse"
6222         size            = 1;
6223         min_write_delay = 2000;
6224         max_write_delay = 2000;
6225         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6226                           "x x x x  x x x x   o o o o  o o o o";
6227
6228         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6229                           "x x x x  x x x x   i i i i  i i i i";
6230       ;
6231
6232     memory "lock"
6233         size            = 1;
6234         min_write_delay = 2000;
6235         max_write_delay = 2000;
6236         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6237                           "x x x x  x x x x   x x o o  o o o o";
6238
6239         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6240                           "x x x x  x x x x   1 1 i i  i i i i";
6241       ;
6242
6243     memory "signature"
6244         size            = 3;
6245         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x x",
6246                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o o";
6247       ;
6248
6249     memory "calibration"
6250         size            = 4;
6251         read            = "0 0 1 1  1 0 0 0    0 0 x x  x x x x",
6252                           "0 0 0 0  0 0 a1 a0  o o o o  o o o o";
6253       ;
6254   ;
6255
6256 #------------------------------------------------------------
6257 # ATmega161
6258 #------------------------------------------------------------
6259
6260 part
6261     id               = "m161";
6262     desc             = "ATmega161";
6263     stk500_devcode   = 0x80;
6264     avr910_devcode   = 0x60;
6265     signature        = 0x1e 0x94 0x01;
6266     chip_erase_delay = 28000;
6267     pagel            = 0xd7;
6268     bs2              = 0xa0;
6269     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6270                        "x x x x  x x x x    x x x x  x x x x";
6271
6272     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
6273                        "x x x x  x x x x    x x x x  x x x x";
6274     timeout             = 200;
6275     stabdelay           = 100;
6276     cmdexedelay         = 25;
6277     synchloops          = 32;
6278     bytedelay           = 0;
6279     pollindex           = 3;
6280     pollvalue           = 0x53;
6281     predelay            = 1;
6282     postdelay           = 1;
6283     pollmethod          = 0;
6284
6285     pp_controlstack     =
6286         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6287         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6288         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6289         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6290     hventerstabdelay    = 100;
6291     progmodedelay       = 0;
6292     latchcycles         = 0;
6293     togglevtg           = 0;
6294     poweroffdelay       = 0;
6295     resetdelayms        = 0;
6296     resetdelayus        = 0;
6297     hvleavestabdelay    = 15;
6298     chiperasepulsewidth = 0;
6299     chiperasepolltimeout = 30;
6300     programfusepulsewidth = 0;
6301     programfusepolltimeout = 2;
6302     programlockpulsewidth = 0;
6303     programlockpolltimeout = 2;
6304
6305    memory "eeprom"
6306         size            = 512;
6307         min_write_delay = 3400;
6308         max_write_delay = 3400;
6309         readback_p1     = 0xff;
6310         readback_p2     = 0xff;
6311         read            = "  1   0   1   0      0   0   0   0",
6312                           "  x   x   x   x      x   x   x  a8",
6313                           " a7  a6  a5  a4     a3  a2  a1  a0",
6314                           "  o   o   o   o      o   o   o   o";
6315
6316         write           = "  1   1   0   0      0   0   0   0",
6317                           "  x   x   x   x      x   x   x  a8",
6318                           " a7  a6  a5  a4     a3  a2  a1  a0",
6319                           "  i   i   i   i      i   i   i   i";
6320
6321         mode            = 0x04;
6322         delay           = 5;
6323         blocksize       = 128;
6324         readsize        = 256;
6325       ;
6326
6327     memory "flash"
6328         paged           = yes;
6329         size            = 16384;
6330         page_size       = 128;
6331         num_pages       = 128;
6332         min_write_delay = 14000;
6333         max_write_delay = 14000;
6334         readback_p1     = 0xff;
6335         readback_p2     = 0xff;
6336         read_lo         = "  0   0   1   0      0   0   0   0",
6337                           "  x   x   x a12    a11 a10  a9  a8",
6338                           " a7  a6  a5  a4     a3  a2  a1  a0",
6339                           "  o   o   o   o      o   o   o   o";
6340
6341         read_hi         = "  0   0   1   0      1   0   0   0",
6342                           "  x   x   x a12    a11 a10  a9  a8",
6343                           " a7  a6  a5  a4     a3  a2  a1  a0",
6344                           "  o   o   o   o      o   o   o   o";
6345
6346         loadpage_lo     = "  0   1   0   0      0   0   0   0",
6347                           "  x   x   x   x      x   x   x   x",
6348                           "  x   x  a5  a4     a3  a2  a1  a0",
6349                           "  i   i   i   i      i   i   i   i";
6350
6351         loadpage_hi     = "  0   1   0   0      1   0   0   0",
6352                           "  x   x   x   x      x   x   x   x",
6353                           "  x   x  a5  a4     a3  a2  a1  a0",
6354                           "  i   i   i   i      i   i   i   i";
6355
6356         writepage       = "  0   1   0   0      1   1   0   0",
6357                           "  x   x   x a12    a11 a10  a9  a8",
6358                           " a7  a6   x   x      x   x   x   x",
6359                           "  x   x   x   x      x   x   x   x";
6360
6361         mode            = 0x21;
6362         delay           = 16;
6363         blocksize       = 128;
6364         readsize        = 256;
6365       ;
6366
6367     memory "fuse"
6368         size            = 1;
6369         min_write_delay = 2000;
6370         max_write_delay = 2000;
6371         read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
6372                           "x x x x  x x x x   x o x o  o o o o";
6373
6374         write           = "1 0 1 0  1 1 0 0   1 0 1 x  x x x x",
6375                           "x x x x  x x x x   1 i 1 i  i i i i";
6376       ;
6377
6378     memory "lock"
6379         size            = 1;
6380         min_write_delay = 2000;
6381         max_write_delay = 2000;
6382         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6383                           "x x x x  x x x x   x x o o  o o o o";
6384
6385         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6386                           "x x x x  x x x x   1 1 i i  i i i i";
6387       ;
6388     memory "signature"
6389         size            = 3;
6390         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
6391                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6392       ;
6393   ;
6394
6395
6396 #------------------------------------------------------------
6397 # ATmega8
6398 #------------------------------------------------------------
6399
6400 part
6401     id               = "m8";
6402     desc             = "ATmega8";
6403     stk500_devcode   = 0x70;
6404     avr910_devcode   = 0x76;
6405     signature        = 0x1e 0x93 0x07;
6406     pagel            = 0xd7;
6407     bs2              = 0xc2;
6408     chip_erase_delay = 10000;
6409     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6410                        "x x x x  x x x x    x x x x  x x x x";
6411
6412     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
6413                        "x x x x  x x x x    x x x x  x x x x";
6414
6415     timeout             = 200;
6416     stabdelay           = 100;
6417     cmdexedelay         = 25;
6418     synchloops          = 32;
6419     bytedelay           = 0;
6420     pollindex           = 3;
6421     pollvalue           = 0x53;
6422     predelay            = 1;
6423     postdelay           = 1;
6424     pollmethod          = 0;
6425
6426     pp_controlstack     =
6427         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6428         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6429         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6430         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6431     hventerstabdelay    = 100;
6432     progmodedelay       = 0;
6433     latchcycles         = 5;
6434     togglevtg           = 1;
6435     poweroffdelay       = 15;
6436     resetdelayms        = 2;
6437     resetdelayus        = 0;
6438     hvleavestabdelay    = 15;
6439     resetdelay          = 15;
6440     chiperasepulsewidth = 0;
6441     chiperasepolltimeout = 10;
6442     programfusepulsewidth = 0;
6443     programfusepolltimeout = 5;
6444     programlockpulsewidth = 0;
6445     programlockpolltimeout = 5;
6446
6447     memory "eeprom"
6448         size            = 512;
6449         page_size       = 4;
6450         min_write_delay = 9000;
6451         max_write_delay = 9000;
6452         readback_p1     = 0xff;
6453         readback_p2     = 0xff;
6454         read            = "  1   0   1   0      0   0   0   0",
6455                           "  0   0   x   x      x   x   x  a8",
6456                           " a7  a6  a5  a4     a3  a2  a1  a0",
6457                           "  o   o   o   o      o   o   o   o";
6458
6459         write           = "  1   1   0   0      0   0   0   0",
6460                           "  0   0   x   x      x   x   x  a8",
6461                           " a7  a6  a5  a4     a3  a2  a1  a0", 
6462                           "  i   i   i   i      i   i   i   i";
6463
6464         mode            = 0x04;
6465         delay           = 20;
6466         blocksize       = 128;
6467         readsize        = 256;
6468       ;
6469     memory "flash"
6470         paged           = yes;
6471         size            = 8192;
6472         page_size       = 64;
6473         num_pages       = 128;
6474         min_write_delay = 4500;
6475         max_write_delay = 4500;
6476         readback_p1     = 0xff;
6477         readback_p2     = 0x00;
6478         read_lo         = "  0   0   1   0    0   0   0   0",
6479                           "  0   0   0   0  a11 a10  a9  a8",
6480                           " a7  a6  a5  a4   a3  a2  a1  a0",
6481                           "  o   o   o   o    o   o   o   o";
6482
6483         read_hi         = "  0   0   1   0    1   0   0   0",
6484                           "  0   0   0   0  a11 a10  a9  a8",
6485                           " a7  a6  a5  a4   a3  a2  a1  a0",
6486                           "  o   o   o   o    o   o   o   o";
6487
6488         loadpage_lo     = "  0   1   0   0      0   0   0   0",
6489                           "  0   0   0   0      x   x   x   x",
6490                           "  x   x   x  a4     a3  a2  a1  a0",
6491                           "  i   i   i   i      i   i   i   i";
6492
6493         loadpage_hi     = "  0   1   0   0      1   0   0   0",
6494                           "  0   0   0   0      x   x   x   x",
6495                           "  x   x   x  a4     a3  a2  a1  a0",
6496                           "  i   i   i   i      i   i   i   i";
6497
6498         writepage       = "  0   1   0   0      1   1   0   0",
6499                           "  0   0   0   0    a11 a10  a9  a8",
6500                           " a7  a6  a5   x      x   x   x   x",
6501                           "  x   x   x   x      x   x   x   x";
6502
6503         mode            = 0x21;
6504         delay           = 10;
6505         blocksize       = 64;
6506         readsize        = 256;
6507       ;
6508
6509     memory "lfuse"
6510         size            = 1;
6511         min_write_delay = 2000;
6512         max_write_delay = 2000;
6513         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6514                           "x x x x  x x x x   o o o o  o o o o";
6515
6516         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6517                           "x x x x  x x x x   i i i i  i i i i";
6518       ;
6519
6520     memory "hfuse"
6521         size            = 1;
6522         min_write_delay = 2000;
6523         max_write_delay = 2000;
6524         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6525                           "x x x x  x x x x   o o o o  o o o o";
6526
6527         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6528                           "x x x x  x x x x   i i i i  i i i i";
6529       ;
6530
6531     memory "lock"
6532         size            = 1;
6533         min_write_delay = 2000;
6534         max_write_delay = 2000;
6535         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6536                           "x x x x  x x x x   x x o o  o o o o";
6537
6538         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6539                           "x x x x  x x x x   1 1 i i  i i i i";
6540       ;
6541
6542     memory "calibration"
6543         size            = 4;
6544         read            = "0  0  1  1   1  0  0  0   0  0  x  x   x  x  x  x",
6545                           "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
6546       ;
6547
6548     memory "signature"
6549         size            = 3;
6550         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
6551                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6552       ;
6553   ;
6554
6555
6556
6557 #------------------------------------------------------------
6558 # ATmega8515
6559 #------------------------------------------------------------
6560
6561 part
6562     id               = "m8515";
6563     desc             = "ATmega8515";
6564     stk500_devcode   = 0x63;
6565     avr910_devcode   = 0x3A;
6566     signature        = 0x1e 0x93 0x06;
6567     chip_erase_delay = 9000;
6568     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6569                        "x x x x  x x x x    x x x x  x x x x";
6570
6571     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
6572                        "x x x x  x x x x    x x x x  x x x x";
6573
6574     timeout             = 200;
6575     stabdelay           = 100;
6576     cmdexedelay         = 25;
6577     synchloops          = 32;
6578     bytedelay           = 0;
6579     pollindex           = 3;
6580     pollvalue           = 0x53;
6581     predelay            = 1;
6582     postdelay           = 1;
6583     pollmethod          = 0;
6584
6585     pp_controlstack     =
6586         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6587         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6588         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6589         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6590     hventerstabdelay    = 100;
6591     progmodedelay       = 0;
6592     latchcycles         = 6;
6593     togglevtg           = 0;
6594     poweroffdelay       = 0;
6595     resetdelayms        = 0;
6596     resetdelayus        = 0;
6597     hvleavestabdelay    = 15;
6598     chiperasepulsewidth = 0;
6599     chiperasepolltimeout = 10;
6600     programfusepulsewidth = 0;
6601     programfusepolltimeout = 5;
6602     programlockpulsewidth = 0;
6603     programlockpolltimeout = 5;
6604
6605     memory "eeprom"
6606         size            = 512;
6607         min_write_delay = 9000;
6608         max_write_delay = 9000;
6609         readback_p1     = 0xff;
6610         readback_p2     = 0xff;
6611  read            = "  1   0   1   0      0   0   0   0",
6612                           "  0   0   x   x      x   x   x  a8",
6613                           " a7  a6  a5  a4     a3  a2  a1  a0",
6614                           "  o   o   o   o      o   o   o   o";
6615
6616  write           = "  1   1   0   0      0   0   0   0",
6617                           "  0   0   x   x      x   x   x  a8",
6618                           " a7  a6  a5  a4     a3  a2  a1  a0",
6619                           "  i   i   i   i      i   i   i   i";
6620
6621         mode            = 0x04;
6622         delay           = 20;
6623         blocksize       = 128;
6624         readsize        = 256;
6625       ;
6626     memory "flash"
6627         paged           = yes;
6628         size            = 8192;
6629         page_size       = 64;
6630         num_pages       = 128;
6631         min_write_delay = 4500;
6632         max_write_delay = 4500;
6633         readback_p1     = 0xff;
6634         readback_p2     = 0xff;
6635         read_lo         = "  0   0   1   0    0   0   0   0",
6636                           "  0   0   0   0  a11 a10  a9  a8",
6637                           " a7  a6  a5  a4   a3  a2  a1  a0",
6638                           "  o   o   o   o    o   o   o   o";
6639
6640         read_hi         = "  0   0   1   0    1   0   0   0",
6641                           "  0   0   0   0  a11 a10  a9  a8",
6642                           " a7  a6  a5  a4   a3  a2  a1  a0",
6643                           "  o   o   o   o    o   o   o   o";
6644
6645         loadpage_lo     = "  0   1   0   0      0   0   0   0",
6646                           "  0   0   0   0      x   x   x   x",
6647                           "  x   x   x  a4     a3  a2  a1  a0",
6648                           "  i   i   i   i      i   i   i   i";
6649
6650         loadpage_hi     = "  0   1   0   0      1   0   0   0",
6651                           "  0   0   0   0      x   x   x   x",
6652                           "  x   x   x  a4     a3  a2  a1  a0",
6653                           "  i   i   i   i      i   i   i   i";
6654
6655         writepage       = "  0   1   0   0      1   1   0   0",
6656                           "  0   0   0   0    a11 a10  a9  a8",
6657                           " a7  a6  a5   x      x   x   x   x",
6658                           "  x   x   x   x      x   x   x   x";
6659
6660         mode            = 0x21;
6661         delay           = 6;
6662         blocksize       = 64;
6663         readsize        = 256;
6664       ;
6665
6666     memory "lfuse"
6667         size            = 1;
6668         min_write_delay = 4500;
6669         max_write_delay = 4500;
6670         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6671                           "x x x x  x x x x   o o o o  o o o o";
6672
6673         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6674                           "x x x x  x x x x   i i i i  i i i i";
6675       ;
6676
6677     memory "hfuse"
6678         size            = 1;
6679         min_write_delay = 4500;
6680         max_write_delay = 4500;
6681         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6682                           "x x x x  x x x x   o o o o  o o o o";
6683
6684         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6685                           "x x x x  x x x x   i i i i  i i i i";
6686       ;
6687
6688     memory "lock"
6689         size            = 1;
6690         min_write_delay = 4500;
6691         max_write_delay = 4500;
6692         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6693                           "x x x x  x x x x   x x o o  o o o o";
6694
6695         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6696                           "x x x x  x x x x   1 1 i i  i i i i";
6697       ;
6698
6699     memory "calibration"
6700         size            = 4;
6701         read            = "0 0 1 1  1 0 0 0     0 0 x x  x x x x",
6702                           "0 0 0 0  0 0 a1 a0   o o o o  o o o o";
6703       ;
6704
6705     memory "signature"
6706         size            = 3;
6707         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
6708                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6709       ;
6710   ;
6711
6712
6713
6714
6715 #------------------------------------------------------------
6716 # ATmega8535
6717 #------------------------------------------------------------
6718
6719 part
6720     id               = "m8535";
6721     desc             = "ATmega8535";
6722     stk500_devcode   = 0x64;
6723     avr910_devcode   = 0x69;
6724     signature        = 0x1e 0x93 0x08;
6725     pagel            = 0xd7;
6726     bs2              = 0xa0;
6727     chip_erase_delay = 9000;
6728     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6729                        "x x x x  x x x x    x x x x  x x x x";
6730
6731     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
6732                        "x x x x  x x x x    x x x x  x x x x";
6733
6734     timeout             = 200;
6735     stabdelay           = 100;
6736     cmdexedelay         = 25;
6737     synchloops          = 32;
6738     bytedelay           = 0;
6739     pollindex           = 3;
6740     pollvalue           = 0x53;
6741     predelay            = 1;
6742     postdelay           = 1;
6743     pollmethod          = 0;
6744
6745     pp_controlstack     =
6746         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6747         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6748         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6749         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6750     hventerstabdelay    = 100;
6751     progmodedelay       = 0;
6752     latchcycles         = 6;
6753     togglevtg           = 0;
6754     poweroffdelay       = 0;
6755     resetdelayms        = 0;
6756     resetdelayus        = 0;
6757     hvleavestabdelay    = 15;
6758     chiperasepulsewidth = 0;
6759     chiperasepolltimeout = 10;
6760     programfusepulsewidth = 0;
6761     programfusepolltimeout = 5;
6762     programlockpulsewidth = 0;
6763     programlockpolltimeout = 5;
6764
6765     memory "eeprom"
6766         size            = 512;
6767         min_write_delay = 9000;
6768         max_write_delay = 9000;
6769         readback_p1     = 0xff;
6770         readback_p2     = 0xff;
6771         read            = "  1   0   1   0      0   0   0   0",
6772                           "  0   0   x   x      x   x   x  a8",
6773                           " a7  a6  a5  a4     a3  a2  a1  a0",
6774                           "  o   o   o   o      o   o   o   o";
6775
6776         write           = "  1   1   0   0      0   0   0   0",
6777                           "  0   0   x   x      x   x   x  a8",
6778                           " a7  a6  a5  a4     a3  a2  a1  a0",
6779                           "  i   i   i   i      i   i   i   i";
6780
6781         mode            = 0x04;
6782         delay           = 20;
6783         blocksize       = 128;
6784         readsize        = 256;
6785       ;
6786     memory "flash"
6787         paged           = yes;
6788         size            = 8192;
6789         page_size       = 64;
6790         num_pages       = 128;
6791         min_write_delay = 4500;
6792         max_write_delay = 4500;
6793         readback_p1     = 0xff;
6794         readback_p2     = 0xff;
6795         read_lo         = "  0   0   1   0    0   0   0   0",
6796                           "  0   0   0   0  a11 a10  a9  a8",
6797                           " a7  a6  a5  a4   a3  a2  a1  a0",
6798                           "  o   o   o   o    o   o   o   o";
6799
6800         read_hi         = "  0   0   1   0    1   0   0   0",
6801                           "  0   0   0   0  a11 a10  a9  a8",
6802                           " a7  a6  a5  a4   a3  a2  a1  a0",
6803                           "  o   o   o   o    o   o   o   o";
6804
6805         loadpage_lo     = "  0   1   0   0      0   0   0   0",
6806                           "  0   0   0   0      x   x   x   x",
6807                           "  x   x   x  a4     a3  a2  a1  a0",
6808                           "  i   i   i   i      i   i   i   i";
6809
6810         loadpage_hi     = "  0   1   0   0      1   0   0   0",
6811                           "  0   0   0   0      x   x   x   x",
6812                           "  x   x   x  a4     a3  a2  a1  a0",
6813                           "  i   i   i   i      i   i   i   i";
6814
6815         writepage       = "  0   1   0   0      1   1   0   0",
6816                           "  0   0   0   0    a11 a10  a9  a8",
6817                           " a7  a6  a5   x      x   x   x   x",
6818                           "  x   x   x   x      x   x   x   x";
6819
6820         mode            = 0x21;
6821         delay           = 6;
6822         blocksize       = 64;
6823         readsize        = 256;
6824       ;
6825
6826     memory "lfuse"
6827         size            = 1;
6828         min_write_delay = 2000;
6829         max_write_delay = 2000;
6830         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6831                           "x x x x  x x x x   o o o o  o o o o";
6832
6833         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6834                           "x x x x  x x x x   i i i i  i i i i";
6835       ;
6836
6837     memory "hfuse"
6838         size            = 1;
6839         min_write_delay = 2000;
6840         max_write_delay = 2000;
6841         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6842                           "x x x x  x x x x   o o o o  o o o o";
6843
6844         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6845                           "x x x x  x x x x   i i i i  i i i i";
6846       ;
6847
6848     memory "lock"
6849         size            = 1;
6850         min_write_delay = 2000;
6851         max_write_delay = 2000;
6852         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6853                           "x x x x  x x x x   x x o o  o o o o";
6854
6855         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6856                           "x x x x  x x x x   1 1 i i  i i i i";
6857       ;
6858
6859     memory "calibration"
6860         size            = 4;
6861         read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
6862                           "0 0 0 0  0 0 a1 a0 o o o o  o o o o";
6863       ;
6864
6865     memory "signature"
6866         size            = 3;
6867         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
6868                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6869       ;
6870   ;
6871
6872
6873 #------------------------------------------------------------
6874 # ATtiny26
6875 #------------------------------------------------------------
6876
6877 part
6878     id                  = "t26";
6879     desc                = "ATtiny26";
6880     stk500_devcode      = 0x21;
6881     avr910_devcode      = 0x5e;
6882     signature           = 0x1e 0x91 0x09;
6883     pagel               = 0xb3;
6884     bs2                 = 0xb2;
6885     chip_erase_delay    = 9000;
6886     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
6887                           "x x x x  x x x x   x x x x  x x x x";
6888
6889     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
6890                           "x x x x  x x x x   x x x x  x x x x";
6891
6892     timeout             = 200;
6893     stabdelay           = 100;
6894     cmdexedelay         = 25;
6895     synchloops          = 32;
6896     bytedelay           = 0;
6897     pollindex           = 3;
6898     pollvalue           = 0x53;
6899     predelay            = 1;
6900     postdelay           = 1;
6901     pollmethod          = 0;
6902
6903     pp_controlstack     =
6904         0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC,
6905         0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC,
6906         0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C,
6907         0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
6908     hventerstabdelay    = 100;
6909     progmodedelay       = 0;
6910     latchcycles         = 5;
6911     togglevtg           = 1;
6912     poweroffdelay       = 15;
6913     resetdelayms        = 2;
6914     resetdelayus        = 0;
6915     hvleavestabdelay    = 15;
6916     chiperasepulsewidth = 0;
6917     chiperasepolltimeout = 10;
6918     programfusepulsewidth = 0;
6919     programfusepolltimeout = 5;
6920     programlockpulsewidth = 0;
6921     programlockpolltimeout = 5;
6922
6923     memory "eeprom"
6924         size            = 128;
6925         min_write_delay = 9000;
6926         max_write_delay = 9000;
6927         readback_p1     = 0xff;
6928         readback_p2     = 0xff;
6929         read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
6930                           "x a6 a5 a4  a3 a2 a1 a0    o o o o  o o o o";
6931
6932         write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
6933                           "x a6 a5 a4  a3 a2 a1 a0    i i i i  i i i i";
6934
6935         mode            = 0x04;
6936         delay           = 10;
6937         blocksize       = 64;
6938         readsize        = 256;
6939     ;
6940
6941     memory "flash"
6942         paged           = yes;
6943         size            = 2048;
6944         page_size       = 32;
6945         num_pages       = 64;
6946         min_write_delay = 4500;
6947         max_write_delay = 4500;
6948         readback_p1     = 0xff;
6949         readback_p2     = 0xff;
6950         read_lo         = "  0  0  1  0   0  0  0  0",
6951                           "  x  x  x  x   x  x a9 a8",
6952                           " a7 a6 a5 a4  a3 a2 a1 a0",
6953                           "  o  o  o  o   o  o  o  o";
6954
6955         read_hi         = "  0  0  1  0   1  0  0  0",
6956                           "  x  x  x  x   x  x a9 a8",
6957                           " a7 a6 a5 a4  a3 a2 a1 a0",
6958                           "  o  o  o  o   o  o  o  o";
6959
6960         loadpage_lo     = "  0  1  0  0   0  0  0  0",
6961                           "  x  x  x  x   x  x  x  x",
6962                           "  x  x  x  x  a3 a2 a1 a0",
6963                           "  i  i  i  i   i  i  i  i";
6964
6965         loadpage_hi     = "  0  1  0  0   1  0  0  0",
6966                           "  x  x  x  x   x  x  x  x",
6967                           "  x  x  x  x  a3 a2 a1 a0",
6968                           "  i  i  i  i   i  i  i  i";
6969
6970         writepage       = "  0  1  0  0   1  1  0  0",
6971                           "  x  x  x  x   x  x a9 a8",
6972                           " a7 a6 a5 a4   x  x  x  x",
6973                           "  x  x  x  x   x  x  x  x";
6974
6975         mode            = 0x21;
6976         delay           = 6;
6977         blocksize       = 16;
6978         readsize        = 256;
6979     ;
6980
6981     memory "signature"
6982         size            = 3;
6983         read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
6984                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
6985     ;
6986
6987     memory "lock"
6988         size            = 1;
6989         read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
6990                           "x  x  x  x   x  x  x  x    x x x x  x x o o";
6991
6992         write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
6993                           "x  x  x  x   x  x  x  x    x x x x  x x x x";
6994         min_write_delay = 9000;
6995         max_write_delay = 9000;
6996     ;
6997
6998     memory "lfuse"
6999         size            = 1;
7000         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
7001                           "x x x x  x x x x  i i i i  i i i i";
7002
7003         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
7004                           "x x x x  x x x x  o o o o  o o o o";
7005         min_write_delay = 9000;
7006         max_write_delay = 9000;
7007       ;
7008
7009     memory "hfuse"
7010         size            = 1;
7011         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
7012                           "x x x x  x x x x  x x x i  i i i i";
7013
7014         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
7015                           "x x x x  x x x x  o o o o  o o o o";
7016         min_write_delay = 9000;
7017         max_write_delay = 9000;
7018       ;
7019
7020     memory "calibration"
7021         size            = 4;
7022         read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
7023                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7024     ;
7025
7026 ;
7027
7028
7029 #------------------------------------------------------------
7030 # ATtiny261
7031 #------------------------------------------------------------
7032 # Close to ATtiny26
7033
7034 part
7035     id                  = "t261";
7036     desc                = "ATtiny261";
7037      has_debugwire = yes;
7038      flash_instr   = 0xB4, 0x00, 0x10;
7039      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
7040                      0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC,
7041                      0x99, 0xE1, 0xBB, 0xAC;
7042 #    stk500_devcode      = 0x21;
7043 #    avr910_devcode      = 0x5e;
7044     signature           = 0x1e 0x91 0x0c;
7045     pagel               = 0xb3;
7046     bs2                 = 0xb2;
7047     chip_erase_delay    = 4000;
7048
7049     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
7050                           "x x x x  x x x x   x x x x  x x x x";
7051
7052     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
7053                           "x x x x  x x x x   x x x x  x x x x";
7054
7055     timeout             = 200;
7056     stabdelay           = 100;
7057     cmdexedelay         = 25;
7058     synchloops          = 32;
7059     bytedelay           = 0;
7060     pollindex           = 3;
7061     pollvalue           = 0x53;
7062     predelay            = 1;
7063     postdelay           = 1;
7064     pollmethod          = 0;
7065
7066     pp_controlstack     =
7067         0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC,
7068         0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC,
7069         0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C,
7070         0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
7071     hventerstabdelay    = 100;
7072     progmodedelay       = 0;
7073     latchcycles         = 5;
7074     togglevtg           = 1;
7075     poweroffdelay       = 15;
7076     resetdelayms        = 2;
7077     resetdelayus        = 0;
7078     hvleavestabdelay    = 15;
7079     chiperasepulsewidth = 0;
7080     chiperasepolltimeout = 10;
7081     programfusepulsewidth = 0;
7082     programfusepolltimeout = 5;
7083     programlockpulsewidth = 0;
7084     programlockpolltimeout = 5;
7085
7086     ocdrev              = 1;
7087
7088     memory "eeprom"
7089         paged           = no;
7090         size            = 128;
7091         page_size       = 4;
7092         num_pages       = 32;
7093         min_write_delay = 4000;
7094         max_write_delay = 4000;
7095         readback_p1     = 0xff;
7096         readback_p2     = 0xff;
7097
7098         read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
7099                           "x a6 a5 a4  a3 a2 a1 a0    o o o o  o o o o";
7100
7101         write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
7102                           "x a6 a5 a4  a3 a2 a1 a0    i i i i  i i i i";
7103
7104         loadpage_lo     = "  1   1   0   0      0   0   0   1",
7105                           "  0   0   0   0      0   0   0   0",
7106                           "  0   0   0   0      0   0  a1  a0",
7107                           "  i   i   i   i      i   i   i   i";
7108
7109         writepage       = "  1   1   0   0      0   0   1   0",
7110                           "  0   0   x   x      x   x   x   x",
7111                           "  x  a6  a5  a4     a3  a2   0   0",
7112                           "  x   x   x   x      x   x   x   x";
7113
7114         mode            = 0x41;
7115         delay           = 10;
7116         blocksize       = 4;
7117         readsize        = 256;
7118     ;
7119
7120     memory "flash"
7121         paged           = yes;
7122         size            = 2048;
7123         page_size       = 32;
7124         num_pages       = 64;
7125         min_write_delay = 4500;
7126         max_write_delay = 4500;
7127         readback_p1     = 0xff;
7128         readback_p2     = 0xff;
7129
7130         read_lo         = "  0  0  1  0   0  0  0  0",
7131                           "  x  x  x  x   x  x a9 a8",
7132                           " a7 a6 a5 a4  a3 a2 a1 a0",
7133                           "  o  o  o  o   o  o  o  o";
7134
7135         read_hi         = "  0  0  1  0   1  0  0  0",
7136                           "  x  x  x  x   x  x a9 a8",
7137                           " a7 a6 a5 a4  a3 a2 a1 a0",
7138                           "  o  o  o  o   o  o  o  o";
7139
7140         loadpage_lo     = "  0  1  0  0   0  0  0  0",
7141                           "  x  x  x  x   x  x  x  x",
7142                           "  x  x  x  x  a3 a2 a1 a0",
7143                           "  i  i  i  i   i  i  i  i";
7144
7145         loadpage_hi     = "  0  1  0  0   1  0  0  0",
7146                           "  x  x  x  x   x  x  x  x",
7147                           "  x  x  x  x  a3 a2 a1 a0",
7148                           "  i  i  i  i   i  i  i  i";
7149
7150         writepage       = "  0  1  0  0   1  1  0  0",
7151                           "  x  x  x  x   x  x a9 a8",
7152                           " a7 a6 a5 a4   x  x  x  x",
7153                           "  x  x  x  x   x  x  x  x";
7154
7155         mode            = 0x41;
7156         delay           = 6;
7157         blocksize       = 32;
7158         readsize        = 256;
7159     ;
7160
7161     memory "signature"
7162         size            = 3;
7163         read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
7164                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7165     ;
7166
7167     memory "lock"
7168         size            = 1;
7169         read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
7170                           "x  x  x  x   x  x  x  x    x x x x  x x o o";
7171
7172         write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
7173                           "x  x  x  x   x  x  x  x    x x x x  x x x x";
7174         min_write_delay = 4500;
7175         max_write_delay = 4500;
7176     ;
7177
7178     memory "lfuse"
7179         size            = 1;
7180         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
7181                           "x x x x  x x x x  i i i i  i i i i";
7182
7183         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
7184                           "x x x x  x x x x  o o o o  o o o o";
7185         min_write_delay = 4500;
7186         max_write_delay = 4500;
7187       ;
7188
7189     memory "hfuse"
7190         size            = 1;
7191         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
7192                           "x x x x  x x x x  i i i i  i i i i";
7193
7194         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
7195                           "x x x x  x x x x  o o o o  o o o o";
7196         min_write_delay = 4500;
7197         max_write_delay = 4500;
7198       ;
7199
7200     memory "efuse"
7201         size            = 1;
7202         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
7203                           "x x x x  x x x x   x x x x  x x x i";
7204
7205         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
7206                           "x x x x  x x x x   o o o o  o o o o";
7207         min_write_delay = 4500;
7208         max_write_delay = 4500;
7209       ;
7210
7211     memory "calibration"
7212         size            = 1;
7213         read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
7214                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
7215     ;
7216
7217 ;
7218
7219
7220 #------------------------------------------------------------
7221 # ATtiny461
7222 #------------------------------------------------------------
7223 # Close to ATtiny261
7224
7225 part
7226     id                  = "t461";
7227     desc                = "ATtiny461";
7228      has_debugwire = yes;
7229      flash_instr   = 0xB4, 0x00, 0x10;
7230      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
7231                      0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC,
7232                      0x99, 0xE1, 0xBB, 0xAC;
7233 #    stk500_devcode      = 0x21;
7234 #    avr910_devcode      = 0x5e;
7235     signature           = 0x1e 0x92 0x08;
7236     pagel               = 0xb3;
7237     bs2                 = 0xb2;
7238     chip_erase_delay    = 4000;
7239
7240     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
7241                           "x x x x  x x x x   x x x x  x x x x";
7242
7243     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
7244                           "x x x x  x x x x   x x x x  x x x x";
7245
7246     timeout             = 200;
7247     stabdelay           = 100;
7248     cmdexedelay         = 25;
7249     synchloops          = 32;
7250     bytedelay           = 0;
7251     pollindex           = 3;
7252     pollvalue           = 0x53;
7253     predelay            = 1;
7254     postdelay           = 1;
7255     pollmethod          = 0;
7256
7257     pp_controlstack     =
7258         0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC,
7259         0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC,
7260         0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C,
7261         0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
7262     hventerstabdelay    = 100;
7263     progmodedelay       = 0;
7264     latchcycles         = 5;
7265     togglevtg           = 1;
7266     poweroffdelay       = 15;
7267     resetdelayms        = 2;
7268     resetdelayus        = 0;
7269     hvleavestabdelay    = 15;
7270     chiperasepulsewidth = 0;
7271     chiperasepolltimeout = 10;
7272     programfusepulsewidth = 0;
7273     programfusepolltimeout = 5;
7274     programlockpulsewidth = 0;
7275     programlockpolltimeout = 5;
7276
7277     ocdrev              = 1;
7278
7279     memory "eeprom"
7280         paged           = no;
7281         size            = 256;
7282         page_size       = 4;
7283         num_pages       = 64;
7284         min_write_delay = 4000;
7285         max_write_delay = 4000;
7286         readback_p1     = 0xff;
7287         readback_p2     = 0xff;
7288
7289         read            = " 1  0  1  0   0  0  0  0    x x x x  x x x x",
7290                           "a7 a6 a5 a4  a3 a2 a1 a0    o o o o  o o o o";
7291
7292         write           = " 1  1  0  0   0  0  0  0    x x x x  x x x x",
7293                           "a7 a6 a5 a4  a3 a2 a1 a0    i i i i  i i i i";
7294
7295         loadpage_lo     = "  1   1   0   0      0   0   0   1",
7296                           "  0   0   0   0      0   0   0   0",
7297                           "  0   0   0   0      0   0  a1  a0",
7298                           "  i   i   i   i      i   i   i   i";
7299
7300         writepage       = "  1   1   0   0      0   0   1   0",
7301                           "  0   0   x   x      x   x   x   x",
7302                           " a7  a6  a5  a4     a3  a2   0   0",
7303                           "  x   x   x   x      x   x   x   x";
7304
7305         mode            = 0x41;
7306         delay           = 10;
7307         blocksize       = 4;
7308         readsize        = 256;
7309     ;
7310
7311     memory "flash"
7312         paged           = yes;
7313         size            = 4096;
7314         page_size       = 64;
7315         num_pages       = 64;
7316         min_write_delay = 4500;
7317         max_write_delay = 4500;
7318         readback_p1     = 0xff;
7319         readback_p2     = 0xff;
7320
7321         read_lo         = "  0  0  1  0   0   0  0  0",
7322                           "  x  x  x  x   x a10 a9 a8",
7323                           " a7 a6 a5 a4  a3  a2 a1 a0",
7324                           "  o  o  o  o   o   o  o  o";
7325
7326         read_hi         = "  0  0  1  0   1   0  0  0",
7327                           "  x  x  x  x   x a10 a9 a8",
7328                           " a7 a6 a5 a4  a3  a2 a1 a0",
7329                           "  o  o  o  o   o   o  o  o";
7330
7331         loadpage_lo     = "  0  1  0  0   0  0  0  0",
7332                           "  x  x  x  x   x  x  x  x",
7333                           "  x  x  x a4  a3 a2 a1 a0",
7334                           "  i  i  i  i   i  i  i  i";
7335
7336         loadpage_hi     = "  0  1  0  0   1  0  0  0",
7337                           "  x  x  x  x   x  x  x  x",
7338                           "  x  x  x a4  a3 a2 a1 a0",
7339                           "  i  i  i  i   i  i  i  i";
7340
7341         writepage       = "  0  1  0  0   1   1  0  0",
7342                           "  x  x  x  x   x a10 a9 a8",
7343                           " a7 a6 a5  x   x   x  x  x",
7344                           "  x  x  x  x   x   x  x  x";
7345
7346         mode            = 0x41;
7347         delay           = 6;
7348         blocksize       = 64;
7349         readsize        = 256;
7350     ;
7351
7352     memory "signature"
7353         size            = 3;
7354         read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
7355                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7356     ;
7357
7358     memory "lock"
7359         size            = 1;
7360         read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
7361                           "x  x  x  x   x  x  x  x    x x x x  x x o o";
7362
7363         write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
7364                           "x  x  x  x   x  x  x  x    x x x x  x x x x";
7365         min_write_delay = 4500;
7366         max_write_delay = 4500;
7367     ;
7368
7369     memory "lfuse"
7370         size            = 1;
7371         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
7372                           "x x x x  x x x x  i i i i  i i i i";
7373
7374         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
7375                           "x x x x  x x x x  o o o o  o o o o";
7376         min_write_delay = 4500;
7377         max_write_delay = 4500;
7378       ;
7379
7380     memory "hfuse"
7381         size            = 1;
7382         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
7383                           "x x x x  x x x x  i i i i  i i i i";
7384
7385         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
7386                           "x x x x  x x x x  o o o o  o o o o";
7387         min_write_delay = 4500;
7388         max_write_delay = 4500;
7389       ;
7390
7391     memory "efuse"
7392         size            = 1;
7393         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
7394                           "x x x x  x x x x   x x x x  x x x i";
7395
7396         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
7397                           "x x x x  x x x x   o o o o  o o o o";
7398         min_write_delay = 4500;
7399         max_write_delay = 4500;
7400       ;
7401
7402     memory "calibration"
7403         size            = 1;
7404         read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
7405                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
7406     ;
7407
7408 ;
7409
7410
7411 #------------------------------------------------------------
7412 # ATtiny861
7413 #------------------------------------------------------------
7414 # Close to ATtiny461
7415
7416 part
7417     id                  = "t861";
7418     desc                = "ATtiny861";
7419      has_debugwire = yes;
7420      flash_instr   = 0xB4, 0x00, 0x10;
7421      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
7422                      0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC,
7423                      0x99, 0xE1, 0xBB, 0xAC;
7424 #    stk500_devcode      = 0x21;
7425 #    avr910_devcode      = 0x5e;
7426     signature           = 0x1e 0x93 0x0d;
7427     pagel               = 0xb3;
7428     bs2                 = 0xb2;
7429     chip_erase_delay    = 4000;
7430
7431     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
7432                           "x x x x  x x x x   x x x x  x x x x";
7433
7434     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
7435                           "x x x x  x x x x   x x x x  x x x x";
7436
7437     timeout             = 200;
7438     stabdelay           = 100;
7439     cmdexedelay         = 25;
7440     synchloops          = 32;
7441     bytedelay           = 0;
7442     pollindex           = 3;
7443     pollvalue           = 0x53;
7444     predelay            = 1;
7445     postdelay           = 1;
7446     pollmethod          = 0;
7447
7448     pp_controlstack     =
7449         0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC,
7450         0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC,
7451         0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C,
7452         0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
7453     hventerstabdelay    = 100;
7454     progmodedelay       = 0;
7455     latchcycles         = 5;
7456     togglevtg           = 1;
7457     poweroffdelay       = 15;
7458     resetdelayms        = 2;
7459     resetdelayus        = 0;
7460     hvleavestabdelay    = 15;
7461     chiperasepulsewidth = 0;
7462     chiperasepolltimeout = 10;
7463     programfusepulsewidth = 0;
7464     programfusepolltimeout = 5;
7465     programlockpulsewidth = 0;
7466     programlockpolltimeout = 5;
7467
7468     ocdrev              = 1;
7469
7470     memory "eeprom"
7471         paged           = no;
7472         size            = 512;
7473         num_pages       = 128;
7474         page_size       = 4;
7475         min_write_delay = 4000;
7476         max_write_delay = 4000;
7477         readback_p1     = 0xff;
7478         readback_p2     = 0xff;
7479
7480         read            = " 1  0  1  0   0  0  0  0    x x x x  x x x a8",
7481                           "a7 a6 a5 a4  a3 a2 a1 a0    o o o o  o o o  o";
7482
7483         write           = " 1  1  0  0   0  0  0  0    x x x x  x x x a8",
7484                           "a7 a6 a5 a4  a3 a2 a1 a0    i i i i  i i i  i";
7485
7486         loadpage_lo     = "  1   1   0   0      0   0   0   1",
7487                           "  0   0   0   0      0   0   0   0",
7488                           "  0   0   0   0      0   0  a1  a0",
7489                           "  i   i   i   i      i   i   i   i";
7490
7491         writepage       = "  1   1   0   0      0   0   1   0",
7492                           "  0   0   x   x      x   x   x  a8",
7493                           " a7  a6  a5  a4     a3  a2   0   0",
7494                           "  x   x   x   x      x   x   x   x";
7495
7496         mode            = 0x41;
7497         delay           = 10;
7498         blocksize       = 4;
7499         readsize        = 256;
7500     ;
7501
7502     memory "flash"
7503         paged           = yes;
7504         size            = 8192;
7505         page_size       = 64;
7506         num_pages       = 128;
7507         min_write_delay = 4500;
7508         max_write_delay = 4500;
7509         readback_p1     = 0xff;
7510         readback_p2     = 0xff;
7511
7512         read_lo         = "  0  0  1  0   0   0  0  0",
7513                           "  x  x  x  x a11 a10 a9 a8",
7514                           " a7 a6 a5 a4  a3  a2 a1 a0",
7515                           "  o  o  o  o   o   o  o  o";
7516
7517         read_hi         = "  0  0  1  0   1   0  0  0",
7518                           "  x  x  x  x a11 a10 a9 a8",
7519                           " a7 a6 a5 a4  a3  a2 a1 a0",
7520                           "  o  o  o  o   o   o  o  o";
7521
7522         loadpage_lo     = "  0  1  0  0   0  0  0  0",
7523                           "  x  x  x  x   x  x  x  x",
7524                           "  x  x  x a4  a3 a2 a1 a0",
7525                           "  i  i  i  i   i  i  i  i";
7526
7527         loadpage_hi     = "  0  1  0  0   1  0  0  0",
7528                           "  x  x  x  x   x  x  x  x",
7529                           "  x  x  x a4  a3 a2 a1 a0",
7530                           "  i  i  i  i   i  i  i  i";
7531
7532         writepage       = "  0  1  0  0   1   1  0  0",
7533                           "  x  x  x  x a11 a10 a9 a8",
7534                           " a7 a6 a5  x   x   x  x  x",
7535                           "  x  x  x  x   x   x  x  x";
7536
7537         mode            = 0x41;
7538         delay           = 6;
7539         blocksize       = 64;
7540         readsize        = 256;
7541     ;
7542
7543     memory "signature"
7544         size            = 3;
7545         read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
7546                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7547     ;
7548
7549     memory "lock"
7550         size            = 1;
7551         read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
7552                           "x  x  x  x   x  x  x  x    x x x x  x x o o";
7553
7554         write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
7555                           "x  x  x  x   x  x  x  x    x x x x  x x x x";
7556         min_write_delay = 4500;
7557         max_write_delay = 4500;
7558     ;
7559
7560     memory "lfuse"
7561         size            = 1;
7562         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
7563                           "x x x x  x x x x  i i i i  i i i i";
7564
7565         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
7566                           "x x x x  x x x x  o o o o  o o o o";
7567         min_write_delay = 4500;
7568         max_write_delay = 4500;
7569       ;
7570
7571     memory "hfuse"
7572         size            = 1;
7573         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
7574                           "x x x x  x x x x  i i i i  i i i i";
7575
7576         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
7577                           "x x x x  x x x x  o o o o  o o o o";
7578         min_write_delay = 4500;
7579         max_write_delay = 4500;
7580       ;
7581
7582     memory "efuse"
7583         size            = 1;
7584         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
7585                           "x x x x  x x x x   x x x x  x x x i";
7586
7587         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
7588                           "x x x x  x x x x   o o o o  o o o o";
7589         min_write_delay = 4500;
7590         max_write_delay = 4500;
7591       ;
7592
7593     memory "calibration"
7594         size            = 1;
7595         read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
7596                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
7597     ;
7598
7599 ;
7600
7601
7602 #------------------------------------------------------------
7603 # ATtiny28
7604 #------------------------------------------------------------
7605
7606 # This is an HVPP-only device.
7607
7608 part
7609     id                  = "t28";
7610     desc                = "ATtiny28";
7611     stk500_devcode      = 0x22;
7612     avr910_devcode      = 0x5c;
7613     signature           = 0x1e 0x91 0x07;
7614
7615     pp_controlstack     =
7616         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
7617         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
7618         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
7619         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
7620     hventerstabdelay    = 100;
7621     progmodedelay       = 0;
7622     latchcycles         = 0;
7623     togglevtg           = 0;
7624     poweroffdelay       = 0;
7625     resetdelayms        = 0;
7626     resetdelayus        = 0;
7627     hvleavestabdelay    = 15;
7628     resetdelay          = 15;
7629     chiperasepulsewidth = 0;
7630     chiperasepolltimeout = 10;
7631     programfusepulsewidth = 0;
7632     programfusepolltimeout = 5;
7633     programlockpulsewidth = 0;
7634     programlockpolltimeout = 5;
7635
7636     memory "flash"
7637         size            = 2048;
7638         page_size       = 2;
7639         readsize        = 256;
7640         delay           = 5;
7641     ;
7642
7643     memory "signature"
7644         size            = 3;
7645     ;
7646
7647     memory "lock"
7648         size            = 1;
7649     ;
7650
7651     memory "calibration"
7652         size            = 1;
7653     ;
7654
7655     memory "fuse"
7656         size            = 1;
7657     ;
7658 ;
7659
7660
7661
7662 #------------------------------------------------------------
7663 # ATmega48
7664 #------------------------------------------------------------
7665
7666 part
7667     id               = "m48";
7668     desc             = "ATmega48";
7669      has_debugwire = yes;
7670      flash_instr   = 0xB6, 0x01, 0x11;
7671      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
7672                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
7673                      0x99, 0xF9, 0xBB, 0xAF;
7674     stk500_devcode   = 0x59;
7675 #    avr910_devcode   = 0x;
7676     signature        = 0x1e 0x92 0x05;
7677     pagel            = 0xd7;
7678     bs2              = 0xc2;
7679     chip_erase_delay = 45000;
7680     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
7681                        "x x x x  x x x x    x x x x  x x x x";
7682
7683     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
7684                        "x x x x  x x x x    x x x x  x x x x";
7685
7686     timeout             = 200;
7687     stabdelay           = 100;
7688     cmdexedelay         = 25;
7689     synchloops          = 32;
7690     bytedelay           = 0;
7691     pollindex           = 3;
7692     pollvalue           = 0x53;
7693     predelay            = 1;
7694     postdelay           = 1;
7695     pollmethod          = 1;
7696
7697     pp_controlstack     =
7698         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
7699         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
7700         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
7701         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
7702     hventerstabdelay    = 100;
7703     progmodedelay       = 0;
7704     latchcycles         = 5;
7705     togglevtg           = 1;
7706     poweroffdelay       = 15;
7707     resetdelayms        = 1;
7708     resetdelayus        = 0;
7709     hvleavestabdelay    = 15;
7710     resetdelay          = 15;
7711     chiperasepulsewidth = 0;
7712     chiperasepolltimeout = 10;
7713     programfusepulsewidth = 0;
7714     programfusepolltimeout = 5;
7715     programlockpulsewidth = 0;
7716     programlockpolltimeout = 5;
7717
7718     ocdrev              = 1;
7719
7720     memory "eeprom"
7721         paged           = no;
7722         page_size       = 4;
7723         size            = 256;
7724         min_write_delay = 3600;
7725         max_write_delay = 3600;
7726         readback_p1     = 0xff;
7727         readback_p2     = 0xff;
7728         read            = "  1   0   1   0      0   0   0   0",
7729                           "  0   0   0   x      x   x   x   x",
7730                           " a7  a6  a5  a4     a3  a2  a1  a0",
7731                           "  o   o   o   o      o   o   o   o";
7732
7733         write           = "  1   1   0   0      0   0   0   0",
7734                           "  0   0   0   x      x   x   x   x",
7735                           " a7  a6  a5  a4     a3  a2  a1  a0", 
7736                           "  i   i   i   i      i   i   i   i";
7737
7738         loadpage_lo     = "  1   1   0   0      0   0   0   1",
7739                           "  0   0   0   0      0   0   0   0",
7740                           "  0   0   0   0      0   0  a1  a0",
7741                           "  i   i   i   i      i   i   i   i";
7742
7743         writepage       = "  1   1   0   0      0   0   1   0",
7744                           "  0   0   x   x      x   x   x   x",
7745                           " a7  a6  a5  a4     a3  a2   0   0",
7746                           "  x   x   x   x      x   x   x   x";
7747
7748         mode            = 0x41;
7749         delay           = 20;
7750         blocksize       = 4;
7751         readsize        = 256;
7752       ;
7753     memory "flash"
7754         paged           = yes;
7755         size            = 4096;
7756         page_size       = 64;
7757         num_pages       = 64;
7758         min_write_delay = 4500;
7759         max_write_delay = 4500;
7760         readback_p1     = 0x00;
7761         readback_p2     = 0x00;
7762         read_lo         = "  0   0   1   0    0   0   0   0",
7763                           "  0   0   0   0    0 a10  a9  a8",
7764                           " a7  a6  a5  a4   a3  a2  a1  a0",
7765                           "  o   o   o   o    o   o   o   o";
7766
7767         read_hi         = "  0   0   1   0    1   0   0   0",
7768                           "  0   0   0   0    0 a10  a9  a8",
7769                           " a7  a6  a5  a4   a3  a2  a1  a0",
7770                           "  o   o   o   o    o   o   o   o";
7771
7772         loadpage_lo     = "  0   1   0   0      0   0   0   0",
7773                           "  0   0   0   x      x   x   x   x",
7774                           "  x   x   x  a4     a3  a2  a1  a0",
7775                           "  i   i   i   i      i   i   i   i";
7776
7777         loadpage_hi     = "  0   1   0   0      1   0   0   0",
7778                           "  0   0   0   x      x   x   x   x",
7779                           "  x   x   x  a4     a3  a2  a1  a0",
7780                           "  i   i   i   i      i   i   i   i";
7781
7782         writepage       = "  0   1   0   0      1   1   0   0",
7783                           "  0   0   0   0      0 a10  a9  a8",
7784                           " a7  a6  a5   x      x   x   x   x",
7785                           "  x   x   x   x      x   x   x   x";
7786
7787         mode            = 0x41;
7788         delay           = 6;
7789         blocksize       = 64;
7790         readsize        = 256;
7791       ;
7792
7793     memory "lfuse"
7794         size            = 1;
7795         min_write_delay = 4500;
7796         max_write_delay = 4500;
7797         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
7798                           "x x x x  x x x x   o o o o  o o o o";
7799
7800         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
7801                           "x x x x  x x x x   i i i i  i i i i";
7802       ;
7803
7804     memory "hfuse"
7805         size            = 1;
7806         min_write_delay = 4500;
7807         max_write_delay = 4500;
7808         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
7809                           "x x x x  x x x x   o o o o  o o o o";
7810
7811         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
7812                           "x x x x  x x x x   i i i i  i i i i";
7813       ;
7814
7815     memory "efuse"
7816         size            = 1;
7817         min_write_delay = 4500;
7818         max_write_delay = 4500;
7819         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
7820                           "x x x x  x x x x   o o o o  o o o o";
7821
7822         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
7823                           "x x x x  x x x x   x x x x  x x x i";
7824       ;
7825
7826     memory "lock"
7827         size            = 1;
7828         min_write_delay = 4500;
7829         max_write_delay = 4500;
7830         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
7831                           "x x x x  x x x x   x x o o  o o o o";
7832
7833         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
7834                           "x x x x  x x x x   1 1 i i  i i i i";
7835       ;
7836
7837     memory "calibration"
7838         size            = 1;
7839         read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
7840                           "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
7841       ;
7842
7843     memory "signature"
7844         size            = 3;
7845         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
7846                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
7847       ;
7848   ;
7849
7850 #------------------------------------------------------------
7851 # ATmega48P
7852 #------------------------------------------------------------
7853
7854 part parent "m48"
7855     id               = "m48p";
7856     desc             = "ATmega48P";
7857     signature        = 0x1e 0x92 0x0a;
7858
7859     ocdrev              = 1;
7860   ;
7861
7862 #------------------------------------------------------------
7863 # ATmega48PB
7864 #------------------------------------------------------------
7865
7866 part parent "m48"
7867     id               = "m48pb";
7868     desc             = "ATmega48PB";
7869     signature        = 0x1e 0x92 0x10;
7870
7871     ocdrev              = 1;
7872   ;
7873
7874 #------------------------------------------------------------
7875 # ATmega88
7876 #------------------------------------------------------------
7877
7878 part
7879     id               = "m88";
7880     desc             = "ATmega88";
7881      has_debugwire = yes;
7882      flash_instr   = 0xB6, 0x01, 0x11;
7883      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
7884                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
7885                      0x99, 0xF9, 0xBB, 0xAF;
7886     stk500_devcode   = 0x73;
7887 #    avr910_devcode   = 0x;
7888     signature        = 0x1e 0x93 0x0a;
7889     pagel            = 0xd7;
7890     bs2              = 0xc2;
7891     chip_erase_delay = 9000;
7892     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
7893                        "x x x x  x x x x    x x x x  x x x x";
7894
7895     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
7896                        "x x x x  x x x x    x x x x  x x x x";
7897
7898     timeout             = 200;
7899     stabdelay           = 100;
7900     cmdexedelay         = 25;
7901     synchloops          = 32;
7902     bytedelay           = 0;
7903     pollindex           = 3;
7904     pollvalue           = 0x53;
7905     predelay            = 1;
7906     postdelay           = 1;
7907     pollmethod          = 1;
7908
7909     pp_controlstack     =
7910         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
7911         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
7912         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
7913         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
7914     hventerstabdelay    = 100;
7915     progmodedelay       = 0;
7916     latchcycles         = 5;
7917     togglevtg           = 1;
7918     poweroffdelay       = 15;
7919     resetdelayms        = 1;
7920     resetdelayus        = 0;
7921     hvleavestabdelay    = 15;
7922     resetdelay          = 15;
7923     chiperasepulsewidth = 0;
7924     chiperasepolltimeout = 10;
7925     programfusepulsewidth = 0;
7926     programfusepolltimeout = 5;
7927     programlockpulsewidth = 0;
7928     programlockpolltimeout = 5;
7929
7930     ocdrev              = 1;
7931
7932     memory "eeprom"
7933         paged           = no;
7934         page_size       = 4;
7935         size            = 512;
7936         min_write_delay = 3600;
7937         max_write_delay = 3600;
7938         readback_p1     = 0xff;
7939         readback_p2     = 0xff;
7940         read            = "  1   0   1   0      0   0   0   0",
7941                           "  0   0   0   x      x   x   x  a8",
7942                           " a7  a6  a5  a4     a3  a2  a1  a0",
7943                           "  o   o   o   o      o   o   o   o";
7944
7945         write           = "  1   1   0   0      0   0   0   0",
7946                           "  0   0   0   x      x   x   x  a8",
7947                           " a7  a6  a5  a4     a3  a2  a1  a0", 
7948                           "  i   i   i   i      i   i   i   i";
7949
7950         loadpage_lo     = "  1   1   0   0      0   0   0   1",
7951                           "  0   0   0   0      0   0   0   0",
7952                           "  0   0   0   0      0   0  a1  a0",
7953                           "  i   i   i   i      i   i   i   i";
7954
7955         writepage       = "  1   1   0   0      0   0   1   0",
7956                           "  0   0   x   x      x   x   x  a8",
7957                           " a7  a6  a5  a4     a3  a2   0   0",
7958                           "  x   x   x   x      x   x   x   x";
7959
7960         mode            = 0x41;
7961         delay           = 20;
7962         blocksize       = 4;
7963         readsize        = 256;
7964       ;
7965     memory "flash"
7966         paged           = yes;
7967         size            = 8192;
7968         page_size       = 64;
7969         num_pages       = 128;
7970         min_write_delay = 4500;
7971         max_write_delay = 4500;
7972         readback_p1     = 0xff;
7973         readback_p2     = 0xff;
7974         read_lo         = "  0   0   1   0    0   0   0   0",
7975                           "  0   0   0   0  a11 a10  a9  a8",
7976                           " a7  a6  a5  a4   a3  a2  a1  a0",
7977                           "  o   o   o   o    o   o   o   o";
7978
7979         read_hi         = "  0   0   1   0    1   0   0   0",
7980                           "  0   0   0   0  a11 a10  a9  a8",
7981                           " a7  a6  a5  a4   a3  a2  a1  a0",
7982                           "  o   o   o   o    o   o   o   o";
7983
7984         loadpage_lo     = "  0   1   0   0      0   0   0   0",
7985                           "  0   0   0   x      x   x   x   x",
7986                           "  x   x   x  a4     a3  a2  a1  a0",
7987                           "  i   i   i   i      i   i   i   i";
7988
7989         loadpage_hi     = "  0   1   0   0      1   0   0   0",
7990                           "  0   0   0   x      x   x   x   x",
7991                           "  x   x   x  a4     a3  a2  a1  a0",
7992                           "  i   i   i   i      i   i   i   i";
7993
7994         writepage       = "  0   1   0   0      1   1   0   0",
7995                           "  0   0   0   0    a11 a10  a9  a8",
7996                           " a7  a6  a5   x      x   x   x   x",
7997                           "  x   x   x   x      x   x   x   x";
7998
7999         mode            = 0x41;
8000         delay           = 6;
8001         blocksize       = 64;
8002         readsize        = 256;
8003       ;
8004
8005     memory "lfuse"
8006         size            = 1;
8007         min_write_delay = 4500;
8008         max_write_delay = 4500;
8009         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
8010                           "x x x x  x x x x   o o o o  o o o o";
8011
8012         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
8013                           "x x x x  x x x x   i i i i  i i i i";
8014       ;
8015
8016     memory "hfuse"
8017         size            = 1;
8018         min_write_delay = 4500;
8019         max_write_delay = 4500;
8020         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
8021                           "x x x x  x x x x   o o o o  o o o o";
8022
8023         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
8024                           "x x x x  x x x x   i i i i  i i i i";
8025       ;
8026
8027     memory "efuse"
8028         size            = 1;
8029         min_write_delay = 4500;
8030         max_write_delay = 4500;
8031         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
8032                           "x x x x  x x x x   o o o o  o o o o";
8033
8034         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
8035                           "x x x x  x x x x   x x x x  x i i i";
8036       ;
8037
8038     memory "lock"
8039         size            = 1;
8040         min_write_delay = 4500;
8041         max_write_delay = 4500;
8042         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
8043                           "x x x x  x x x x   x x o o  o o o o";
8044
8045         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
8046                           "x x x x  x x x x   1 1 i i  i i i i";
8047       ;
8048
8049     memory "calibration"
8050         size            = 1;
8051         read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
8052                           "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
8053       ;
8054
8055     memory "signature"
8056         size            = 3;
8057         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
8058                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
8059       ;
8060   ;
8061
8062 #------------------------------------------------------------
8063 # ATmega88P
8064 #------------------------------------------------------------
8065
8066 part parent "m88"
8067     id               = "m88p";
8068     desc             = "ATmega88P";
8069     signature        = 0x1e 0x93 0x0f;
8070
8071     ocdrev              = 1;
8072   ;
8073
8074 #------------------------------------------------------------
8075 # ATmega88PB
8076 #------------------------------------------------------------
8077
8078 part parent "m88"
8079     id               = "m88pb";
8080     desc             = "ATmega88PB";
8081     signature        = 0x1e 0x93 0x16;
8082
8083     ocdrev              = 1;
8084   ;
8085
8086 #------------------------------------------------------------
8087 # ATmega168
8088 #------------------------------------------------------------
8089
8090 part
8091     id              = "m168";
8092     desc            = "ATmega168";
8093      has_debugwire = yes;
8094      flash_instr   = 0xB6, 0x01, 0x11;
8095      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
8096                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
8097                      0x99, 0xF9, 0xBB, 0xAF;
8098     stk500_devcode  = 0x86;
8099     # avr910_devcode = 0x;
8100     signature       = 0x1e 0x94 0x06;
8101     pagel           = 0xd7;
8102     bs2             = 0xc2;
8103     chip_erase_delay = 9000;
8104     pgm_enable       = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
8105                        "x x x x x x x x x x x x x x x x";
8106
8107     chip_erase       = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
8108                        "x x x x x x x x x x x x x x x x";
8109
8110     timeout         = 200;
8111     stabdelay       = 100;
8112     cmdexedelay     = 25;
8113     synchloops      = 32;
8114     bytedelay       = 0;
8115     pollindex       = 3;
8116     pollvalue       = 0x53;
8117     predelay        = 1;
8118     postdelay       = 1;
8119     pollmethod      = 1;
8120
8121     pp_controlstack     =
8122         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
8123         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
8124         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
8125         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8126     hventerstabdelay    = 100;
8127     progmodedelay       = 0;
8128     latchcycles         = 5;
8129     togglevtg           = 1;
8130     poweroffdelay       = 15;
8131     resetdelayms        = 1;
8132     resetdelayus        = 0;
8133     hvleavestabdelay    = 15;
8134     resetdelay          = 15;
8135     chiperasepulsewidth = 0;
8136     chiperasepolltimeout = 10;
8137     programfusepulsewidth = 0;
8138     programfusepolltimeout = 5;
8139     programlockpulsewidth = 0;
8140     programlockpolltimeout = 5;
8141
8142     ocdrev              = 1;
8143
8144     memory "eeprom"
8145         paged           = no;
8146         page_size       = 4;
8147         size            = 512;
8148         min_write_delay = 3600;
8149         max_write_delay = 3600;
8150         readback_p1     = 0xff;
8151         readback_p2     = 0xff;
8152         read            = " 1 0 1 0 0 0 0 0",
8153                           " 0 0 0 x x x x a8",
8154                           " a7 a6 a5 a4 a3 a2 a1 a0",
8155                           " o o o o o o o o";
8156     
8157         write           = " 1 1 0 0 0 0 0 0",
8158                           " 0 0 0 x x x x a8",
8159                           " a7 a6 a5 a4 a3 a2 a1 a0",
8160                           " i i i i i i i i";
8161
8162         loadpage_lo     = "  1   1   0   0      0   0   0   1",
8163                           "  0   0   0   0      0   0   0   0",
8164                           "  0   0   0   0      0   0  a1  a0",
8165                           "  i   i   i   i      i   i   i   i";
8166
8167         writepage       = "  1   1   0   0      0   0   1   0",
8168                           "  0   0   x   x      x   x   x  a8",
8169                           " a7  a6  a5  a4     a3  a2   0   0",
8170                           "  x   x   x   x      x   x   x   x";
8171
8172         mode            = 0x41;
8173         delay           = 20;
8174         blocksize       = 4;
8175         readsize        = 256;
8176         ;
8177
8178     memory "flash"
8179         paged           = yes;
8180         size            = 16384;
8181         page_size       = 128;
8182         num_pages       = 128;
8183         min_write_delay = 4500;
8184         max_write_delay = 4500;
8185         readback_p1     = 0xff;
8186         readback_p2     = 0xff;
8187         read_lo         = " 0 0 1 0 0 0 0 0",
8188                           " 0 0 0 a12 a11 a10 a9 a8",
8189                           " a7 a6 a5 a4 a3 a2 a1 a0",
8190                           " o o o o o o o o";
8191         
8192         read_hi          = " 0 0 1 0 1 0 0 0",
8193                            " 0 0 0 a12 a11 a10 a9 a8",
8194                            " a7 a6 a5 a4 a3 a2 a1 a0",
8195                            " o o o o o o o o";
8196         
8197         loadpage_lo     = " 0 1 0 0 0 0 0 0",
8198                           " 0 0 0 x x x x x",
8199                           " x x a5 a4 a3 a2 a1 a0",
8200                           " i i i i i i i i";
8201         
8202         loadpage_hi     = " 0 1 0 0 1 0 0 0",
8203                           " 0 0 0 x x x x x",
8204                           " x x a5 a4 a3 a2 a1 a0",
8205                           " i i i i i i i i";
8206         
8207         writepage       = " 0 1 0 0 1 1 0 0",
8208                           " 0 0 0 a12 a11 a10 a9 a8",
8209                           " a7 a6 x x x x x x",
8210                           " x x x x x x x x";
8211
8212         mode        = 0x41;
8213         delay       = 6;
8214         blocksize   = 128;
8215         readsize    = 256;
8216
8217         ;
8218         
8219     memory "lfuse"
8220         size            = 1;
8221         min_write_delay = 4500;
8222         max_write_delay = 4500;
8223         read            = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
8224                           "x x x x x x x x o o o o o o o o";
8225         
8226         write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
8227                           "x x x x x x x x i i i i i i i i";
8228         ;
8229     
8230     memory "hfuse"
8231         size            = 1;
8232         min_write_delay = 4500;
8233         max_write_delay = 4500;
8234         read            = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
8235                           "x x x x x x x x o o o o o o o o";
8236         
8237         write           = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
8238                           "x x x x x x x x i i i i i i i i";
8239         ;
8240     
8241     memory "efuse"
8242         size            = 1;
8243         min_write_delay = 4500;
8244         max_write_delay = 4500;
8245         read            = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
8246                           "x x x x x x x x o o o o o o o o";
8247         
8248         write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
8249                           "x x x x x x x x x x x x x i i i";
8250         ;
8251     
8252     memory "lock"
8253         size            = 1;
8254         min_write_delay = 4500;
8255         max_write_delay = 4500;
8256         read            = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
8257                           "x x x x x x x x x x o o o o o o";
8258         
8259         write           = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
8260                           "x x x x x x x x 1 1 i i i i i i";
8261         ;
8262     
8263     memory "calibration"
8264         size            = 1;
8265         read            = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
8266                           "0 0 0 0 0 0 0 0 o o o o o o o o";
8267         ;
8268     
8269     memory "signature"
8270         size            = 3;
8271         read            = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
8272                           "x x x x x x a1 a0 o o o o o o o o";
8273         ;
8274 ;
8275
8276 #------------------------------------------------------------
8277 # ATmega168P
8278 #------------------------------------------------------------
8279
8280 part parent "m168"
8281     id              = "m168p";
8282     desc            = "ATmega168P";
8283     signature       = 0x1e 0x94 0x0b;
8284
8285     ocdrev              = 1;
8286 ;
8287
8288 #------------------------------------------------------------
8289 # ATmega168PB
8290 #------------------------------------------------------------
8291
8292 part parent "m168"
8293     id              = "m168pb";
8294     desc            = "ATmega168PB";
8295     signature       = 0x1e 0x94 0x15;
8296
8297     ocdrev              = 1;
8298 ;
8299
8300 #------------------------------------------------------------
8301 # ATtiny88
8302 #------------------------------------------------------------
8303
8304 part
8305     id               = "t88";
8306     desc             = "ATtiny88";
8307      has_debugwire = yes;
8308      flash_instr   = 0xB6, 0x01, 0x11;
8309      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
8310                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
8311                      0x99, 0xF9, 0xBB, 0xAF;
8312     stk500_devcode   = 0x73;
8313 #    avr910_devcode   = 0x;
8314     signature        = 0x1e 0x93 0x11;
8315     pagel            = 0xd7;
8316     bs2              = 0xc2;
8317     chip_erase_delay = 9000;
8318     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
8319                        "x x x x  x x x x    x x x x  x x x x";
8320
8321     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
8322                        "x x x x  x x x x    x x x x  x x x x";
8323
8324     timeout             = 200;
8325     stabdelay           = 100;
8326     cmdexedelay         = 25;
8327     synchloops          = 32;
8328     bytedelay           = 0;
8329     pollindex           = 3;
8330     pollvalue           = 0x53;
8331     predelay            = 1;
8332     postdelay           = 1;
8333     pollmethod          = 1;
8334
8335     pp_controlstack     =
8336         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
8337         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
8338         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
8339         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8340     hventerstabdelay    = 100;
8341     progmodedelay       = 0;
8342     latchcycles         = 5;
8343     togglevtg           = 1;
8344     poweroffdelay       = 15;
8345     resetdelayms        = 1;
8346     resetdelayus        = 0;
8347     hvleavestabdelay    = 15;
8348     resetdelay          = 15;
8349     chiperasepulsewidth = 0;
8350     chiperasepolltimeout = 10;
8351     programfusepulsewidth = 0;
8352     programfusepolltimeout = 5;
8353     programlockpulsewidth = 0;
8354     programlockpolltimeout = 5;
8355
8356     ocdrev              = 1;
8357
8358     memory "eeprom"
8359         paged           = no;
8360         page_size       = 4;
8361         size            = 64;
8362         min_write_delay = 3600;
8363         max_write_delay = 3600;
8364         readback_p1     = 0xff;
8365         readback_p2     = 0xff;
8366         read            = "  1   0   1   0      0   0   0   0",
8367                           "  0   0   0   x      x   x   x   x",
8368                           "  x  a6  a5  a4     a3  a2  a1  a0",
8369                           "  o   o   o   o      o   o   o   o";
8370
8371         write           = "  1   1   0   0      0   0   0   0",
8372                           "  0   0   0   x      x   x   x   x",
8373                           "  x  a6  a5  a4     a3  a2  a1  a0",
8374                           "  i   i   i   i      i   i   i   i";
8375
8376         loadpage_lo     = "  1   1   0   0      0   0   0   1",
8377                           "  0   0   0   0      0   0   0   0",
8378                           "  0   0   0   0      0   0  a1  a0",
8379                           "  i   i   i   i      i   i   i   i";
8380
8381         writepage       = "  1   1   0   0      0   0   1   0",
8382                           "  0   0   x   x      x   x   x   x",
8383                           "  x  a6  a5  a4     a3  a2   0   0",
8384                           "  x   x   x   x      x   x   x   x";
8385
8386         mode            = 0x41;
8387         delay           = 20;
8388         blocksize       = 4;
8389         readsize        = 64;
8390       ;
8391     memory "flash"
8392         paged           = yes;
8393         size            = 8192;
8394         page_size       = 64;
8395         num_pages       = 128;
8396         min_write_delay = 4500;
8397         max_write_delay = 4500;
8398         readback_p1     = 0xff;
8399         readback_p2     = 0xff;
8400         read_lo         = "  0   0   1   0    0   0   0   0",
8401                           "  0   0   0   0  a11 a10  a9  a8",
8402                           " a7  a6  a5  a4   a3  a2  a1  a0",
8403                           "  o   o   o   o    o   o   o   o";
8404
8405         read_hi         = "  0   0   1   0    1   0   0   0",
8406                           "  0   0   0   0  a11 a10  a9  a8",
8407                           " a7  a6  a5  a4   a3  a2  a1  a0",
8408                           "  o   o   o   o    o   o   o   o";
8409
8410         loadpage_lo     = "  0   1   0   0      0   0   0   0",
8411                           "  0   0   0   x      x   x   x   x",
8412                           "  x   x   x  a4     a3  a2  a1  a0",
8413                           "  i   i   i   i      i   i   i   i";
8414
8415         loadpage_hi     = "  0   1   0   0      1   0   0   0",
8416                           "  0   0   0   x      x   x   x   x",
8417                           "  x   x   x  a4     a3  a2  a1  a0",
8418                           "  i   i   i   i      i   i   i   i";
8419
8420         writepage       = "  0   1   0   0      1   1   0   0",
8421                           "  0   0   0   0    a11 a10  a9  a8",
8422                           " a7  a6  a5   x      x   x   x   x",
8423                           "  x   x   x   x      x   x   x   x";
8424
8425         mode            = 0x41;
8426         delay           = 6;
8427         blocksize       = 64;
8428         readsize        = 256;
8429       ;
8430
8431     memory "lfuse"
8432         size            = 1;
8433         min_write_delay = 4500;
8434         max_write_delay = 4500;
8435         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
8436                           "x x x x  x x x x   o o o o  o o o o";
8437
8438         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
8439                           "x x x x  x x x x   i i i i  i i i i";
8440       ;
8441
8442     memory "hfuse"
8443         size            = 1;
8444         min_write_delay = 4500;
8445         max_write_delay = 4500;
8446         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
8447                           "x x x x  x x x x   o o o o  o o o o";
8448
8449         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
8450                           "x x x x  x x x x   i i i i  i i i i";
8451       ;
8452
8453     memory "efuse"
8454         size            = 1;
8455         min_write_delay = 4500;
8456         max_write_delay = 4500;
8457         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
8458                           "x x x x  x x x x   o o o o  o o o o";
8459
8460         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
8461                           "x x x x  x x x x   x x x x  x x x i";
8462       ;
8463
8464     memory "lock"
8465         size            = 1;
8466         min_write_delay = 4500;
8467         max_write_delay = 4500;
8468         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
8469                           "x x x x  x x x x   x x o o  o o o o";
8470
8471         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
8472                           "x x x x  x x x x   1 1 i i  i i i i";
8473       ;
8474
8475     memory "calibration"
8476         size            = 1;
8477         read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
8478                           "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
8479       ;
8480
8481     memory "signature"
8482         size            = 3;
8483         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
8484                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
8485       ;
8486   ;
8487
8488 #------------------------------------------------------------
8489 # ATmega328
8490 #------------------------------------------------------------
8491
8492 part
8493     id                  = "m328";
8494     desc                = "ATmega328";
8495     has_debugwire       = yes;
8496     flash_instr         = 0xB6, 0x01, 0x11;
8497     eeprom_instr        = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
8498                           0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
8499                           0x99, 0xF9, 0xBB, 0xAF;
8500     stk500_devcode      = 0x86;
8501     # avr910_devcode    = 0x;
8502     signature           = 0x1e 0x95 0x14;
8503     pagel               = 0xd7;
8504     bs2                 = 0xc2;
8505     chip_erase_delay    = 9000;
8506     pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
8507                  "x x x x x x x x x x x x x x x x";
8508
8509     chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
8510                  "x x x x x x x x x x x x x x x x";
8511
8512     timeout     = 200;
8513     stabdelay   = 100;
8514     cmdexedelay = 25;
8515     synchloops  = 32;
8516     bytedelay   = 0;
8517     pollindex   = 3;
8518     pollvalue   = 0x53;
8519     predelay    = 1;
8520     postdelay   = 1;
8521     pollmethod  = 1;
8522
8523     pp_controlstack =
8524         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
8525         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
8526         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
8527         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8528     hventerstabdelay    = 100;
8529     progmodedelay       = 0;
8530     latchcycles         = 5;
8531     togglevtg           = 1;
8532     poweroffdelay       = 15;
8533     resetdelayms        = 1;
8534     resetdelayus        = 0;
8535     hvleavestabdelay    = 15;
8536     resetdelay          = 15;
8537     chiperasepulsewidth = 0;
8538     chiperasepolltimeout = 10;
8539     programfusepulsewidth = 0;
8540     programfusepolltimeout = 5;
8541     programlockpulsewidth = 0;
8542     programlockpolltimeout = 5;
8543
8544     ocdrev              = 1;
8545
8546     memory "eeprom"
8547         paged           = no;
8548         page_size       = 4;
8549         size            = 1024;
8550         min_write_delay = 3600;
8551         max_write_delay = 3600;
8552         readback_p1     = 0xff;
8553         readback_p2     = 0xff;
8554         read = " 1 0 1 0 0 0 0 0",
8555                " 0 0 0 x x x a9 a8",
8556                " a7 a6 a5 a4 a3 a2 a1 a0",
8557                " o o o o o o o o";
8558
8559         write = " 1 1 0 0 0 0 0 0",
8560                 " 0 0 0 x x x a9 a8",
8561                 " a7 a6 a5 a4 a3 a2 a1 a0",
8562                 " i i i i i i i i";
8563
8564         loadpage_lo = " 1 1 0 0 0 0 0 1",
8565                       " 0 0 0 0 0 0 0 0",
8566                       " 0 0 0 0 0 0 a1 a0",
8567                       " i i i i i i i i";
8568
8569         writepage = " 1 1 0 0 0 0 1 0",
8570                     " 0 0 x x x x a9 a8",
8571                     " a7 a6 a5 a4 a3 a2 0 0",
8572                     " x x x x x x x x";
8573
8574         mode            = 0x41;
8575         delay           = 20;
8576         blocksize       = 4;
8577         readsize        = 256;
8578     ;
8579
8580     memory "flash"
8581         paged           = yes;
8582         size            = 32768;
8583         page_size       = 128;
8584         num_pages       = 256;
8585         min_write_delay = 4500;
8586         max_write_delay = 4500;
8587         readback_p1     = 0xff;
8588         readback_p2     = 0xff;
8589         read_lo = " 0 0 1 0 0 0 0 0",
8590                   " 0 0 a13 a12 a11 a10 a9 a8",
8591                   " a7 a6 a5 a4 a3 a2 a1 a0",
8592                   " o o o o o o o o";
8593
8594         read_hi = " 0 0 1 0 1 0 0 0",
8595                   " 0 0 a13 a12 a11 a10 a9 a8",
8596                   " a7 a6 a5 a4 a3 a2 a1 a0",
8597                   " o o o o o o o o";
8598
8599         loadpage_lo = " 0 1 0 0 0 0 0 0",
8600                       " 0 0 0 x x x x x",
8601                       " x x a5 a4 a3 a2 a1 a0",
8602                       " i i i i i i i i";
8603
8604         loadpage_hi = " 0 1 0 0 1 0 0 0",
8605                       " 0 0 0 x x x x x",
8606                       " x x a5 a4 a3 a2 a1 a0",
8607                       " i i i i i i i i";
8608
8609         writepage = " 0 1 0 0 1 1 0 0",
8610                     " 0 0 a13 a12 a11 a10 a9 a8",
8611                     " a7 a6 x x x x x x",
8612                     " x x x x x x x x";
8613
8614         mode            = 0x41;
8615         delay           = 6;
8616         blocksize       = 128;
8617         readsize        = 256;
8618
8619     ;
8620
8621     memory "lfuse"
8622         size = 1;
8623         min_write_delay = 4500;
8624         max_write_delay = 4500;
8625         read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
8626                "x x x x x x x x o o o o o o o o";
8627
8628         write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
8629                 "x x x x x x x x i i i i i i i i";
8630     ;
8631
8632     memory "hfuse"
8633         size = 1;
8634         min_write_delay = 4500;
8635         max_write_delay = 4500;
8636         read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
8637                "x x x x x x x x o o o o o o o o";
8638
8639         write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
8640                 "x x x x x x x x i i i i i i i i";
8641     ;
8642
8643     memory "efuse"
8644         size = 1;
8645         min_write_delay = 4500;
8646         max_write_delay = 4500;
8647         read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
8648                "x x x x x x x x o o o o o o o o";
8649
8650         write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
8651                 "x x x x x x x x x x x x x i i i";
8652     ;
8653
8654     memory "lock"
8655         size = 1;
8656         min_write_delay = 4500;
8657         max_write_delay = 4500;
8658         read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
8659                "x x x x x x x x x x o o o o o o";
8660
8661         write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
8662                 "x x x x x x x x 1 1 i i i i i i";
8663     ;
8664
8665     memory "calibration"
8666         size = 1;
8667         read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
8668                "0 0 0 0 0 0 0 0 o o o o o o o o";
8669     ;
8670
8671     memory "signature"
8672         size = 3;
8673         read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
8674                "x x x x x x a1 a0 o o o o o o o o";
8675     ;
8676 ;
8677
8678 part parent "m328"
8679     id                  = "m328p";
8680     desc                = "ATmega328P";
8681     signature           = 0x1e 0x95 0x0F;
8682
8683     ocdrev              = 1;
8684 ;
8685
8686 #------------------------------------------------------------
8687 # ATmega32m1
8688 #------------------------------------------------------------
8689
8690 part parent "m328"
8691     id              = "m32m1";
8692     desc            = "ATmega32M1";
8693     # stk500_devcode    = 0x;
8694     # avr910_devcode    = 0x;
8695     signature       = 0x1e 0x95 0x84;
8696     bs2             = 0xe2;
8697
8698     memory "efuse"
8699         read            = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
8700                           "x x x x x x x x o o o o o o o o";
8701         write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
8702                           "x x x x x x x x x x i i i i i i";
8703     ;
8704 ;
8705
8706 #------------------------------------------------------------
8707 # ATtiny2313
8708 #------------------------------------------------------------
8709
8710 part
8711      id            = "t2313";
8712      desc          = "ATtiny2313";
8713      has_debugwire = yes;
8714      flash_instr   = 0xB2, 0x0F, 0x1F;
8715      eeprom_instr  = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
8716                      0xBA, 0x0F, 0xB2, 0x0F, 0xBA, 0x0D, 0xBB, 0xBC,
8717                      0x99, 0xE1, 0xBB, 0xAC;
8718      stk500_devcode   = 0x23;
8719 ##   Use the ATtiny26 devcode:
8720      avr910_devcode   = 0x5e;
8721      signature        = 0x1e 0x91 0x0a;
8722      pagel            = 0xD4;
8723      bs2              = 0xD6;
8724      reset            = io;
8725      chip_erase_delay = 9000;
8726
8727      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
8728                         "x x x x  x x x x    x x x x  x x x x";
8729
8730      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
8731                         "x x x x  x x x x    x x x x  x x x x";
8732
8733     timeout             = 200;
8734     stabdelay           = 100;
8735     cmdexedelay         = 25;
8736     synchloops          = 32;
8737     bytedelay           = 0;
8738     pollindex           = 3;
8739     pollvalue           = 0x53;
8740     predelay            = 1;
8741     postdelay           = 1;
8742     pollmethod          = 1;
8743
8744     pp_controlstack     =
8745         0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E,
8746         0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E,
8747         0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A,
8748         0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8749     hventerstabdelay    = 100;
8750     progmodedelay       = 0;
8751     latchcycles         = 5;
8752     togglevtg           = 1;
8753     poweroffdelay       = 15;
8754     resetdelayms        = 1;
8755     resetdelayus        = 0;
8756     hvleavestabdelay    = 15;
8757     chiperasepulsewidth = 0;
8758     chiperasepolltimeout = 10;
8759     programfusepulsewidth = 0;
8760     programfusepolltimeout = 5;
8761     programlockpulsewidth = 0;
8762     programlockpolltimeout = 5;
8763
8764     ocdrev              = 0;
8765
8766      memory "eeprom"
8767          size            = 128;
8768         paged           = no;
8769         page_size       = 4;
8770          min_write_delay = 4000;
8771          max_write_delay = 4500;
8772          readback_p1     = 0xff;
8773          readback_p2     = 0xff;
8774          read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x x",
8775                            "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
8776
8777          write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x x",
8778                            "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
8779
8780         loadpage_lo     = "  1   1   0   0      0   0   0   1",
8781                           "  0   0   0   0      0   0   0   0",
8782                           "  0   0   0   0      0   0  a1  a0",
8783                           "  i   i   i   i      i   i   i   i";
8784
8785         writepage       = "  1   1   0   0      0   0   1   0",
8786                           "  0   0   x   x      x   x   x   x",
8787                           "  x  a6  a5  a4     a3  a2   0   0",
8788                           "  x   x   x   x      x   x   x   x";
8789
8790         mode            = 0x41;
8791         delay           = 6;
8792         blocksize       = 4;
8793         readsize        = 256;
8794        ;
8795      memory "flash"
8796          paged           = yes;
8797          size            = 2048;
8798          page_size       = 32;
8799          num_pages       = 64;
8800          min_write_delay = 4500;
8801          max_write_delay = 4500;
8802          readback_p1     = 0xff;
8803          readback_p2     = 0xff;
8804          read_lo         = "  0   0   1   0    0   0   0   0",
8805                            "  0   0   0   0    0   0  a9  a8",
8806                            " a7  a6  a5  a4   a3  a2  a1  a0",
8807                            "  o   o   o   o    o   o   o   o";
8808
8809          read_hi         = "  0   0   1   0    1   0   0   0",
8810                            "  0   0   0   0    0   0  a9  a8",
8811                            " a7  a6  a5  a4   a3  a2  a1  a0",
8812                            "  o   o   o   o    o   o   o   o";
8813
8814 # The information in the data sheet of April/2004 is wrong, this works:
8815          loadpage_lo     = "  0   1   0   0    0   0   0   0",
8816                            "  0   0   0   x    x   x   x   x",
8817                            "  x   x   x   x   a3  a2  a1  a0",
8818                            "  i   i   i   i    i   i   i   i";
8819
8820 # The information in the data sheet of April/2004 is wrong, this works:
8821          loadpage_hi     = "  0   1   0   0    1   0   0   0",
8822                            "  0   0   0   x    x   x   x   x",
8823                            "  x   x   x   x   a3  a2  a1  a0",
8824                            "  i   i   i   i    i   i   i   i";
8825
8826 # The information in the data sheet of April/2004 is wrong, this works:
8827          writepage       = "  0  1  0  0   1  1  0  0",
8828                            "  0  0  0  0   0  0 a9 a8",
8829                            " a7 a6 a5 a4   x  x  x  x",
8830                            "  x  x  x  x   x  x  x  x";
8831
8832         mode            = 0x41;
8833         delay           = 6;
8834         blocksize       = 32;
8835         readsize        = 256;
8836        ;
8837 #   ATtiny2313 has Signature Bytes: 0x1E 0x91 0x0A.
8838      memory "signature"
8839          size            = 3;
8840          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
8841                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
8842        ;
8843      memory "lock"
8844          size            = 1;
8845          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
8846                            "x x x x  x x x x  1 1 i i  i i i i";
8847          read           = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
8848                           "x x x x  x x x x  x x o o  o o o o";
8849         min_write_delay = 9000;
8850         max_write_delay = 9000;
8851        ;
8852
8853      memory "lfuse"
8854          size            = 1;
8855          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
8856                            "x x x x  x x x x  i i i i  i i i i";
8857
8858          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
8859                            "x x x x  x x x x  o o o o  o o o o";
8860         min_write_delay = 9000;
8861         max_write_delay = 9000;
8862        ;
8863
8864      memory "hfuse"
8865          size            = 1;
8866          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
8867                            "x x x x  x x x x  i i i i  i i i i";
8868
8869          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
8870                            "x x x x  x x x x  o o o o  o o o o";
8871         min_write_delay = 9000;
8872         max_write_delay = 9000;
8873        ;
8874
8875      memory "efuse"
8876          size            = 1;
8877          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
8878                            "x x x x  x x x x  x x x x  x x x i";
8879
8880          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
8881                            "x x x x  x x x x  o o o o  o o o o";
8882         min_write_delay = 9000;
8883         max_write_delay = 9000;
8884      ;
8885 # The Tiny2313 has calibration data for both 4 MHz and 8 MHz.
8886 # The information in the data sheet of April/2004 is wrong, this works:
8887
8888      memory "calibration"
8889          size            = 2;
8890          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
8891                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
8892      ;
8893   ;
8894
8895 #------------------------------------------------------------
8896 # ATtiny4313
8897 #------------------------------------------------------------
8898
8899 part
8900      id            = "t4313";
8901      desc          = "ATtiny4313";
8902      has_debugwire = yes;
8903      flash_instr   = 0xB2, 0x0F, 0x1F;
8904      eeprom_instr  = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
8905                      0xBA, 0x0F, 0xB2, 0x0F, 0xBA, 0x0D, 0xBB, 0xBC,
8906                      0x99, 0xE1, 0xBB, 0xAC;
8907      stk500_devcode   = 0x23;
8908 ##   Use the ATtiny26 devcode:
8909      avr910_devcode   = 0x5e;
8910      signature        = 0x1e 0x92 0x0d;
8911      pagel            = 0xD4;
8912      bs2              = 0xD6;
8913      reset            = io;
8914      chip_erase_delay = 9000;
8915
8916      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
8917                         "x x x x  x x x x    x x x x  x x x x";
8918
8919      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
8920                         "x x x x  x x x x    x x x x  x x x x";
8921
8922     timeout             = 200;
8923     stabdelay           = 100;
8924     cmdexedelay         = 25;
8925     synchloops          = 32;
8926     bytedelay           = 0;
8927     pollindex           = 3;
8928     pollvalue           = 0x53;
8929     predelay            = 1;
8930     postdelay           = 1;
8931     pollmethod          = 1;
8932
8933     pp_controlstack     =
8934         0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E,
8935         0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E,
8936         0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A,
8937         0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8938     hventerstabdelay    = 100;
8939     progmodedelay       = 0;
8940     latchcycles         = 5;
8941     togglevtg           = 1;
8942     poweroffdelay       = 15;
8943     resetdelayms        = 1;
8944     resetdelayus        = 0;
8945     hvleavestabdelay    = 15;
8946     chiperasepulsewidth = 0;
8947     chiperasepolltimeout = 10;
8948     programfusepulsewidth = 0;
8949     programfusepolltimeout = 5;
8950     programlockpulsewidth = 0;
8951     programlockpolltimeout = 5;
8952
8953     ocdrev              = 0;
8954
8955      memory "eeprom"
8956          size            = 256;
8957         paged           = no;
8958         page_size       = 4;
8959          min_write_delay = 4000;
8960          max_write_delay = 4500;
8961          readback_p1     = 0xff;
8962          readback_p2     = 0xff;
8963          read            = "1   0  1  0   0  0  0  0   0 0 0 x  x x x x",
8964                            "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
8965
8966          write           = "1   1  0  0   0  0  0  0   0 0 0 x  x x x x",
8967                            "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
8968
8969         loadpage_lo     = "  1   1   0   0      0   0   0   1",
8970                           "  0   0   0   0      0   0   0   0",
8971                           "  0   0   0   0      0   0  a1  a0",
8972                           "  i   i   i   i      i   i   i   i";
8973
8974         writepage       = "  1   1   0   0      0   0   1   0",
8975                           "  0   0   x   x      x   x   x   x",
8976                           " a7  a6  a5  a4     a3  a2   0   0",
8977                           "  x   x   x   x      x   x   x   x";
8978
8979         mode            = 0x41;
8980         delay           = 6;
8981         blocksize       = 4;
8982         readsize        = 256;
8983        ;
8984      memory "flash"
8985          paged           = yes;
8986          size            = 4096;
8987          page_size       = 64;
8988          num_pages       = 64;
8989          min_write_delay = 4500;
8990          max_write_delay = 4500;
8991          readback_p1     = 0xff;
8992          readback_p2     = 0xff;
8993          read_lo         = "  0   0   1   0    0   0   0   0",
8994                            "  0   0   0   0    0 a10  a9  a8",
8995                            " a7  a6  a5  a4   a3  a2  a1  a0",
8996                            "  o   o   o   o    o   o   o   o";
8997
8998          read_hi         = "  0   0   1   0    1   0   0   0",
8999                            "  0   0   0   0    0 a10  a9  a8",
9000                            " a7  a6  a5  a4   a3  a2  a1  a0",
9001                            "  o   o   o   o    o   o   o   o";
9002
9003          loadpage_lo     = "  0   1   0   0    0   0   0   0",
9004                            "  0   0   0   x    x   x   x   x",
9005                            "  x   x   x  a4   a3  a2  a1  a0",
9006                            "  i   i   i   i    i   i   i   i";
9007
9008          loadpage_hi     = "  0   1   0   0    1   0   0   0",
9009                            "  0   0   0   x    x   x   x   x",
9010                            "  x   x   x  a4   a3  a2  a1  a0",
9011                            "  i   i   i   i    i   i   i   i";
9012
9013          writepage       = "  0  1  0  0   1   1  0  0",
9014                            "  0  0  0  0   0 a10 a9 a8",
9015                            " a7 a6 a5  x   x   x  x  x",
9016                            "  x  x  x  x   x   x  x  x";
9017
9018         mode            = 0x41;
9019         delay           = 6;
9020         blocksize       = 32;
9021         readsize        = 256;
9022        ;
9023 #   ATtiny4313 has Signature Bytes: 0x1E 0x92 0x0D.
9024      memory "signature"
9025          size            = 3;
9026          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
9027                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9028        ;
9029      memory "lock"
9030          size            = 1;
9031          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9032                            "x x x x  x x x x  1 1 i i  i i i i";
9033          read           = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9034                           "x x x x  x x x x  x x o o  o o o o";
9035         min_write_delay = 9000;
9036         max_write_delay = 9000;
9037        ;
9038
9039      memory "lfuse"
9040          size            = 1;
9041          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9042                            "x x x x  x x x x  i i i i  i i i i";
9043
9044          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9045                            "x x x x  x x x x  o o o o  o o o o";
9046         min_write_delay = 9000;
9047         max_write_delay = 9000;
9048        ;
9049
9050      memory "hfuse"
9051          size            = 1;
9052          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9053                            "x x x x  x x x x  i i i i  i i i i";
9054
9055          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9056                            "x x x x  x x x x  o o o o  o o o o";
9057         min_write_delay = 9000;
9058         max_write_delay = 9000;
9059        ;
9060
9061      memory "efuse"
9062          size            = 1;
9063          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9064                            "x x x x  x x x x  x x x x  x x x i";
9065
9066          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9067                            "x x x x  x x x x  o o o o  o o o o";
9068         min_write_delay = 9000;
9069         max_write_delay = 9000;
9070      ;
9071
9072      memory "calibration"
9073          size            = 2;
9074          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9075                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
9076      ;
9077   ;
9078
9079 #------------------------------------------------------------
9080 # AT90PWM2
9081 #------------------------------------------------------------
9082
9083 part
9084      id            = "pwm2";
9085      desc          = "AT90PWM2";
9086      has_debugwire = yes;
9087      flash_instr   = 0xB6, 0x01, 0x11;
9088      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
9089                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
9090                      0x99, 0xF9, 0xBB, 0xAF;
9091      stk500_devcode   = 0x65;
9092 ##  avr910_devcode   = ?;
9093      signature        = 0x1e 0x93 0x81;
9094      pagel            = 0xD8;
9095      bs2              = 0xE2;
9096      reset            = io;
9097      chip_erase_delay = 9000;
9098
9099      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9100                         "x x x x  x x x x    x x x x  x x x x";
9101
9102      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
9103                         "x x x x  x x x x    x x x x  x x x x";
9104
9105     timeout             = 200;
9106     stabdelay           = 100;
9107     cmdexedelay         = 25;
9108     synchloops          = 32;
9109     bytedelay           = 0;
9110     pollindex           = 3;
9111     pollvalue           = 0x53;
9112     predelay            = 1;
9113     postdelay           = 1;
9114     pollmethod          = 1;
9115
9116     pp_controlstack     =
9117         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
9118         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
9119         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
9120         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
9121     hventerstabdelay    = 100;
9122     progmodedelay       = 0;
9123     latchcycles         = 5;
9124     togglevtg           = 1;
9125     poweroffdelay       = 15;
9126     resetdelayms        = 1;
9127     resetdelayus        = 0;
9128     hvleavestabdelay    = 15;
9129     chiperasepulsewidth = 0;
9130     chiperasepolltimeout = 10;
9131     programfusepulsewidth = 0;
9132     programfusepolltimeout = 5;
9133     programlockpulsewidth = 0;
9134     programlockpolltimeout = 5;
9135
9136      memory "eeprom"
9137          size            = 512;
9138         paged           = no;
9139         page_size       = 4;
9140          min_write_delay = 4000;
9141          max_write_delay = 4500;
9142          readback_p1     = 0xff;
9143          readback_p2     = 0xff;
9144          read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x a8",
9145                            "a7 a6 a5 a4  a3 a2 a1 a0  o o o o  o o o o";
9146
9147          write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x a8",
9148                            "a7 a6 a5 a4  a3 a2 a1 a0  i i i i  i i i i";
9149
9150         loadpage_lo     = "  1   1   0   0      0   0   0   1",
9151                           "  0   0   0   0      0   0   0   0",
9152                           "  0   0   0   0      0   0  a1  a0",
9153                           "  i   i   i   i      i   i   i   i";
9154
9155         writepage       = "  1   1   0   0      0   0   1   0",
9156                           "  0   0   x   x      x   x   x   x",
9157                           " a7  a6  a5  a4     a3  a2   0   0",
9158                           "  x   x   x   x      x   x   x   x";
9159
9160         mode            = 0x41;
9161         delay           = 6;
9162         blocksize       = 4;
9163         readsize        = 256;
9164        ;
9165      memory "flash"
9166          paged           = yes;
9167          size            = 8192;
9168          page_size       = 64;
9169          num_pages       = 128;
9170          min_write_delay = 4500;
9171          max_write_delay = 4500;
9172          readback_p1     = 0xff;
9173          readback_p2     = 0xff;
9174          read_lo         = "  0   0   1   0    0   0   0   0",
9175                            "  0   0   0   0   a11 a10 a9  a8",
9176                            " a7  a6  a5  a4   a3  a2  a1  a0",
9177                            "  o   o   o   o    o   o   o   o";
9178
9179          read_hi         = "  0   0   1   0    1   0   0   0",
9180                            "  0   0   0   0   a11 a10 a9  a8",
9181                            " a7  a6  a5  a4   a3  a2  a1  a0",
9182                            "  o   o   o   o    o   o   o   o";
9183
9184          loadpage_lo     = "  0   1   0   0    0   0   0   0",
9185                            "  0   0   0   x    x   x   x   x",
9186                            "  x   x   x  a4   a3  a2  a1  a0",
9187                            "  i   i   i   i    i   i   i   i";
9188
9189          loadpage_hi     = "  0   1   0   0    1   0   0   0",
9190                            "  0   0   0   x    x   x   x   x",
9191                            "  x   x   x  a4   a3  a2  a1  a0",
9192                            "  i   i   i   i    i   i   i   i";
9193
9194          writepage       = "  0  1  0  0   1   1   0   0",
9195                            "  0  0  0  0   a11 a10 a9  a8",
9196                            " a7 a6 a5  x   x   x   x   x",
9197                            "  x  x  x  x   x   x   x   x";
9198
9199         mode            = 0x41;
9200         delay           = 6;
9201         blocksize       = 64;
9202         readsize        = 256;
9203        ;
9204 #   AT90PWM2 has Signature Bytes: 0x1E 0x93 0x81.
9205      memory "signature"
9206          size            = 3;
9207          read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
9208                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9209        ;
9210      memory "lock"
9211          size            = 1;
9212          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9213                            "x x x x  x x x x  1 1 i i  i i i i";
9214
9215          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9216                            "x x x x  x x x x  x x o o  o o o o";
9217         min_write_delay = 9000;
9218         max_write_delay = 9000;
9219        ;
9220
9221      memory "lfuse"
9222          size            = 1;
9223          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9224                            "x x x x  x x x x  i i i i  i i i i";
9225
9226          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9227                            "x x x x  x x x x  o o o o  o o o o";
9228         min_write_delay = 9000;
9229         max_write_delay = 9000;
9230        ;
9231
9232      memory "hfuse"
9233          size            = 1;
9234          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9235                            "x x x x  x x x x  i i i i  i i i i";
9236
9237          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9238                            "x x x x  x x x x  o o o o  o o o o";
9239         min_write_delay = 9000;
9240         max_write_delay = 9000;
9241        ;
9242
9243      memory "efuse"
9244          size            = 1;
9245          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9246                            "x x x x  x x x x  i i i i  i i i i";
9247
9248          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9249                            "x x x x  x x x x  o o o o  o o o o";
9250         min_write_delay = 9000;
9251         max_write_delay = 9000;
9252      ;
9253
9254      memory "calibration"
9255          size            = 1;
9256          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9257                            "0  0  0  0   0  0  0  0    o o o o  o o o o";
9258      ;
9259   ;
9260
9261 #------------------------------------------------------------
9262 # AT90PWM3
9263 #------------------------------------------------------------
9264
9265 # Completely identical to AT90PWM2 (including the signature!)
9266
9267 part parent "pwm2"
9268      id            = "pwm3";
9269      desc          = "AT90PWM3";
9270   ;
9271
9272 #------------------------------------------------------------
9273 # AT90PWM2B
9274 #------------------------------------------------------------
9275 # Same as AT90PWM2 but different signature.
9276
9277 part parent "pwm2"
9278      id            = "pwm2b";
9279      desc          = "AT90PWM2B";
9280      signature     = 0x1e 0x93 0x83;
9281
9282     ocdrev              = 1;
9283   ;
9284
9285 #------------------------------------------------------------
9286 # AT90PWM3B
9287 #------------------------------------------------------------
9288
9289 # Completely identical to AT90PWM2B (including the signature!)
9290
9291 part parent "pwm2b"
9292      id            = "pwm3b";
9293      desc          = "AT90PWM3B";
9294
9295     ocdrev              = 1;
9296   ;
9297
9298 #------------------------------------------------------------
9299 # AT90PWM316
9300 #------------------------------------------------------------
9301
9302 # Similar to AT90PWM3B, but with 16 kiB flash, 512 B EEPROM, and 1024 B SRAM.
9303
9304 part parent "pwm3b"
9305      id            = "pwm316";
9306      desc          = "AT90PWM316";
9307      signature     = 0x1e 0x94 0x83;
9308
9309     ocdrev              = 1;
9310
9311     memory "flash"
9312         paged           = yes;
9313         size            = 16384;
9314         page_size       = 128;
9315         num_pages       = 128;
9316         min_write_delay = 4500;
9317         max_write_delay = 4500;
9318         readback_p1     = 0xff;
9319         readback_p2     = 0xff;
9320         read_lo         = "  0   0   1   0      0   0   0   0",
9321                           "  0   0 a13 a12    a11 a10  a9  a8",
9322                           " a7  a6  a5  a4     a3  a2  a1  a0",
9323                           "  o   o   o   o      o   o   o   o";
9324
9325         read_hi         = "  0   0   1   0      1   0   0   0",
9326                           "  0   0 a13 a12    a11 a10  a9  a8",
9327                           " a7  a6  a5  a4     a3  a2  a1  a0",
9328                           "  o   o   o   o      o   o   o   o";
9329
9330         loadpage_lo     = "  0   1   0   0      0   0   0   0",
9331                           "  0   0   x   x      x   x   x   x",
9332                           "  x   x  a5  a4     a3  a2  a1  a0",
9333                           "  i   i   i   i      i   i   i   i";
9334
9335         loadpage_hi     = "  0   1   0   0      1   0   0   0",
9336                           "  0   0   x   x      x   x   x   x",
9337                           "  x   x  a5  a4     a3  a2  a1  a0",
9338                           "  i   i   i   i      i   i   i   i";
9339
9340         writepage       = "  0   1   0   0      1   1   0   0",
9341                           "  0   0 a13 a12    a11 a10  a9  a8",
9342                           " a7  a6   x   x      x   x   x   x",
9343                           "  x   x   x   x      x   x   x   x";
9344
9345         mode            = 0x21;
9346         delay           = 6;
9347         blocksize       = 128;
9348         readsize        = 256;
9349       ;
9350   ;
9351
9352 #------------------------------------------------------------
9353 # AT90PWM216
9354 #------------------------------------------------------------
9355 # Completely identical to AT90PWM316 (including the signature!)
9356
9357 part parent "pwm316"
9358      id = "pwm216";
9359      desc = "AT90PWM216";
9360   ; 
9361
9362 #------------------------------------------------------------
9363 # ATtiny25
9364 #------------------------------------------------------------
9365
9366 part
9367      id            = "t25";
9368      desc          = "ATtiny25";
9369      has_debugwire = yes;
9370      flash_instr   = 0xB4, 0x02, 0x12;
9371      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
9372                      0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC,
9373                      0x99, 0xE1, 0xBB, 0xAC;
9374 ## no STK500 devcode in XML file, use the ATtiny45 one
9375      stk500_devcode   = 0x14;
9376 ##  avr910_devcode   = ?;
9377 ##  Try the AT90S2313 devcode:
9378      avr910_devcode   = 0x20;
9379      signature        = 0x1e 0x91 0x08;
9380      reset            = io;
9381      chip_erase_delay = 4500;
9382
9383      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9384                         "x x x x  x x x x    x x x x  x x x x";
9385
9386      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
9387                         "x x x x  x x x x    x x x x  x x x x";
9388
9389     timeout             = 200;
9390     stabdelay           = 100;
9391     cmdexedelay         = 25;
9392     synchloops          = 32;
9393     bytedelay           = 0;
9394     pollindex           = 3;
9395     pollvalue           = 0x53;
9396     predelay            = 1;
9397     postdelay           = 1;
9398     pollmethod          = 1;
9399
9400     hvsp_controlstack   =
9401         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
9402         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
9403         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
9404         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
9405     hventerstabdelay    = 100;
9406     hvspcmdexedelay     = 0;
9407     synchcycles         = 6;
9408     latchcycles         = 1;
9409     togglevtg           = 1;
9410     poweroffdelay       = 25;
9411     resetdelayms        = 1;
9412     resetdelayus        = 0;
9413     hvleavestabdelay    = 100;
9414     resetdelay          = 25;
9415     chiperasepolltimeout = 40;
9416     chiperasetime       = 0;
9417     programfusepolltimeout = 25;
9418     programlockpolltimeout = 25;
9419
9420     ocdrev              = 1;
9421
9422      memory "eeprom"
9423          size            = 128;
9424         paged           = no;
9425         page_size       = 4;
9426          min_write_delay = 4000;
9427          max_write_delay = 4500;
9428          readback_p1     = 0xff;
9429          readback_p2     = 0xff;
9430          read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x x",
9431                            "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
9432
9433          write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x x",
9434                            "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
9435
9436         loadpage_lo     = "  1   1   0   0      0   0   0   1",
9437                           "  0   0   0   0      0   0   0   0",
9438                           "  0   0   0   0      0   0  a1  a0",
9439                           "  i   i   i   i      i   i   i   i";
9440
9441         writepage       = "  1   1   0   0      0   0   1   0",
9442                           "  0   0   x   x      x   x   x   x",
9443                           "  x  a6  a5  a4     a3  a2   0   0",
9444                           "  x   x   x   x      x   x   x   x";
9445
9446         mode            = 0x41;
9447         delay           = 6;
9448         blocksize       = 4;
9449         readsize        = 256;
9450        ;
9451      memory "flash"
9452          paged           = yes;
9453          size            = 2048;
9454          page_size       = 32;
9455          num_pages       = 64;
9456          min_write_delay = 4500;
9457          max_write_delay = 4500;
9458          readback_p1     = 0xff;
9459          readback_p2     = 0xff;
9460          read_lo         = "  0   0   1   0    0   0   0   0",
9461                            "  0   0   0   0    0   0  a9  a8",
9462                            " a7  a6  a5  a4   a3  a2  a1  a0",
9463                            "  o   o   o   o    o   o   o   o";
9464
9465          read_hi         = "  0   0   1   0    1   0   0   0",
9466                            "  0   0   0   0    0   0  a9  a8",
9467                            " a7  a6  a5  a4   a3  a2  a1  a0",
9468                            "  o   o   o   o    o   o   o   o";
9469
9470          loadpage_lo     = "  0   1   0   0    0   0   0   0",
9471                            "  0   0   0   x    x   x   x   x",
9472                            "  x   x   x   x   a3  a2  a1  a0",
9473                            "  i   i   i   i    i   i   i   i";
9474
9475          loadpage_hi     = "  0   1   0   0    1   0   0   0",
9476                            "  0   0   0   x    x   x   x   x",
9477                            "  x   x   x   x   a3  a2  a1  a0",
9478                            "  i   i   i   i    i   i   i   i";
9479
9480          writepage       = "  0  1  0  0   1  1  0  0",
9481                            "  0  0  0  0   0  0 a9 a8",
9482                            " a7 a6 a5 a4   x  x  x  x",
9483                            "  x  x  x  x   x  x  x  x";
9484
9485         mode            = 0x41;
9486         delay           = 6;
9487         blocksize       = 32;
9488         readsize        = 256;
9489        ;
9490 #   ATtiny25 has Signature Bytes: 0x1E 0x91 0x08.
9491      memory "signature"
9492          size            = 3;
9493          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
9494                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9495        ;
9496      memory "lock"
9497          size            = 1;
9498          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9499                            "x x x x  x x x x  1 1 i i  i i i i";
9500          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9501                            "0 0 0 0  0 0 0 0  o o o o  o o o o";
9502         min_write_delay = 9000;
9503         max_write_delay = 9000;
9504        ;
9505
9506      memory "lfuse"
9507          size            = 1;
9508          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9509                            "x x x x  x x x x  i i i i  i i i i";
9510
9511          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9512                            "x x x x  x x x x  o o o o  o o o o";
9513         min_write_delay = 9000;
9514         max_write_delay = 9000;
9515        ;
9516
9517      memory "hfuse"
9518          size            = 1;
9519          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9520                            "x x x x  x x x x  i i i i  i i i i";
9521
9522          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9523                            "x x x x  x x x x  o o o o  o o o o";
9524         min_write_delay = 9000;
9525         max_write_delay = 9000;
9526        ;
9527
9528      memory "efuse"
9529          size            = 1;
9530          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9531                            "x x x x  x x x x  x x x x  x x x i";
9532
9533          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9534                            "x x x x  x x x x  o o o o  o o o o";
9535         min_write_delay = 9000;
9536         max_write_delay = 9000;
9537      ;
9538
9539      memory "calibration"
9540          size            = 1;
9541          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9542                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
9543      ;
9544   ;
9545
9546 #------------------------------------------------------------
9547 # ATtiny45
9548 #------------------------------------------------------------
9549
9550 part
9551      id            = "t45";
9552      desc          = "ATtiny45";
9553      has_debugwire = yes;
9554      flash_instr   = 0xB4, 0x02, 0x12;
9555      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
9556                      0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC,
9557                      0x99, 0xE1, 0xBB, 0xAC;
9558      stk500_devcode   = 0x14;
9559 ##  avr910_devcode   = ?;
9560 ##  Try the AT90S2313 devcode:
9561      avr910_devcode   = 0x20;
9562      signature        = 0x1e 0x92 0x06;
9563      reset            = io;
9564      chip_erase_delay = 4500;
9565
9566      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9567                         "x x x x  x x x x    x x x x  x x x x";
9568
9569      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
9570                         "x x x x  x x x x    x x x x  x x x x";
9571
9572     timeout             = 200;
9573     stabdelay           = 100;
9574     cmdexedelay         = 25;
9575     synchloops          = 32;
9576     bytedelay           = 0;
9577     pollindex           = 3;
9578     pollvalue           = 0x53;
9579     predelay            = 1;
9580     postdelay           = 1;
9581     pollmethod          = 1;
9582
9583     hvsp_controlstack     =
9584         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
9585         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
9586         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
9587         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
9588     hventerstabdelay    = 100;
9589     progmodedelay       = 0;
9590     hvspcmdexedelay     = 0;
9591     synchcycles         = 6;
9592     latchcycles         = 1;
9593     togglevtg           = 1;
9594     poweroffdelay       = 25;
9595     resetdelayms        = 1;
9596     resetdelayus        = 0;
9597     hvleavestabdelay    = 100;
9598     resetdelay          = 25;
9599     chiperasepolltimeout = 40;
9600     chiperasetime       = 0;
9601     programfusepolltimeout = 25;
9602     programlockpolltimeout = 25;
9603
9604     ocdrev              = 1;
9605
9606      memory "eeprom"
9607          size            = 256;
9608          page_size       = 4;
9609          min_write_delay = 4000;
9610          max_write_delay = 4500;
9611          readback_p1     = 0xff;
9612          readback_p2     = 0xff;
9613          read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x x",
9614                            "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
9615
9616          write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
9617                            "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
9618
9619         loadpage_lo     = "  1   1   0   0      0   0   0   1",
9620                           "  0   0   0   0      0   0   0   0",
9621                           "  0   0   0   0      0   0  a1  a0",
9622                           "  i   i   i   i      i   i   i   i";
9623
9624         writepage       = "  1   1   0   0      0   0   1   0",
9625                           "  0   0   x   x      x   x   x   x",
9626                           " a7  a6  a5  a4     a3  a2   0   0",
9627                           "  x   x   x   x      x   x   x   x";
9628
9629         mode            = 0x41;
9630         delay           = 6;
9631         blocksize       = 4;
9632         readsize        = 256;
9633        ;
9634      memory "flash"
9635          paged           = yes;
9636          size            = 4096;
9637          page_size       = 64;
9638          num_pages       = 64;
9639          min_write_delay = 4500;
9640          max_write_delay = 4500;
9641          readback_p1     = 0xff;
9642          readback_p2     = 0xff;
9643          read_lo         = "  0   0   1   0    0   0   0   0",
9644                            "  0   0   0   0    0  a10 a9  a8",
9645                            " a7  a6  a5  a4   a3  a2  a1  a0",
9646                            "  o   o   o   o    o   o   o   o";
9647
9648          read_hi         = "  0   0   1   0    1   0   0   0",
9649                            "  0   0   0   0    0  a10 a9  a8",
9650                            " a7  a6  a5  a4   a3  a2  a1  a0",
9651                            "  o   o   o   o    o   o   o   o";
9652
9653          loadpage_lo     = "  0   1   0   0    0   0   0   0",
9654                            "  0   0   0   x    x   x   x   x",
9655                            "  x   x   x  a4   a3  a2  a1  a0",
9656                            "  i   i   i   i    i   i   i   i";
9657
9658          loadpage_hi     = "  0   1   0   0    1   0   0   0",
9659                            "  0   0   0   x    x   x   x   x",
9660                            "  x   x   x  a4   a3  a2  a1  a0",
9661                            "  i   i   i   i    i   i   i   i";
9662
9663          writepage       = "  0  1  0  0   1  1  0  0",
9664                            "  0  0  0  0   0 a10 a9 a8",
9665                            " a7 a6 a5  x   x  x  x  x",
9666                            "  x  x  x  x   x  x  x  x";
9667
9668         mode            = 0x41;
9669         delay           = 6;
9670         blocksize       = 32;
9671         readsize        = 256;
9672        ;
9673 #   ATtiny45 has Signature Bytes: 0x1E 0x92 0x08. (Data sheet 2586C-AVR-06/05 (doc2586.pdf) indicates otherwise!)
9674      memory "signature"
9675          size            = 3;
9676          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
9677                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9678        ;
9679      memory "lock"
9680          size            = 1;
9681          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9682                            "x x x x  x x x x  1 1 i i  i i i i";
9683          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9684                            "0 0 0 0  0 0 0 0  o o o o  o o o o";
9685         min_write_delay = 9000;
9686         max_write_delay = 9000;
9687        ;
9688
9689      memory "lfuse"
9690          size            = 1;
9691          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9692                            "x x x x  x x x x  i i i i  i i i i";
9693
9694          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9695                            "x x x x  x x x x  o o o o  o o o o";
9696         min_write_delay = 9000;
9697         max_write_delay = 9000;
9698        ;
9699
9700      memory "hfuse"
9701          size            = 1;
9702          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9703                            "x x x x  x x x x  i i i i  i i i i";
9704
9705          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9706                            "x x x x  x x x x  o o o o  o o o o";
9707         min_write_delay = 9000;
9708         max_write_delay = 9000;
9709        ;
9710
9711      memory "efuse"
9712          size            = 1;
9713          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9714                            "x x x x  x x x x  x x x x  x x x i";
9715
9716          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9717                            "x x x x  x x x x  o o o o  o o o o";
9718         min_write_delay = 9000;
9719         max_write_delay = 9000;
9720      ;
9721
9722      memory "calibration"
9723          size            = 1;
9724          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9725                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
9726      ;
9727   ;
9728
9729 #------------------------------------------------------------
9730 # ATtiny85
9731 #------------------------------------------------------------
9732
9733 part
9734      id            = "t85";
9735      desc          = "ATtiny85";
9736      has_debugwire = yes;
9737      flash_instr   = 0xB4, 0x02, 0x12;
9738      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
9739                      0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC,
9740                      0x99, 0xE1, 0xBB, 0xAC;
9741 ## no STK500 devcode in XML file, use the ATtiny45 one
9742      stk500_devcode   = 0x14;
9743 ##  avr910_devcode   = ?;
9744 ##  Try the AT90S2313 devcode:
9745      avr910_devcode   = 0x20;
9746      signature        = 0x1e 0x93 0x0b;
9747      reset            = io;
9748      chip_erase_delay = 4500;
9749
9750      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9751                         "x x x x  x x x x    x x x x  x x x x";
9752
9753      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
9754                         "x x x x  x x x x    x x x x  x x x x";
9755
9756     timeout             = 200;
9757     stabdelay           = 100;
9758     cmdexedelay         = 25;
9759     synchloops          = 32;
9760     bytedelay           = 0;
9761     pollindex           = 3;
9762     pollvalue           = 0x53;
9763     predelay            = 1;
9764     postdelay           = 1;
9765     pollmethod          = 1;
9766
9767     hvsp_controlstack   =
9768         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
9769         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
9770         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
9771         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
9772     hventerstabdelay    = 100;
9773     hvspcmdexedelay     = 0;
9774     synchcycles         = 6;
9775     latchcycles         = 1;
9776     togglevtg           = 1;
9777     poweroffdelay       = 25;
9778     resetdelayms        = 1;
9779     resetdelayus        = 0;
9780     hvleavestabdelay    = 100;
9781     resetdelay          = 25;
9782     chiperasepolltimeout = 40;
9783     chiperasetime       = 0;
9784     programfusepolltimeout = 25;
9785     programlockpolltimeout = 25;
9786
9787     ocdrev              = 1;
9788
9789      memory "eeprom"
9790          size            = 512;
9791         paged           = no;
9792         page_size       = 4;
9793          min_write_delay = 4000;
9794          max_write_delay = 4500;
9795          readback_p1     = 0xff;
9796          readback_p2     = 0xff;
9797          read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x a8",
9798                            "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
9799
9800          write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x a8",
9801                            "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
9802
9803         loadpage_lo     = "  1   1   0   0      0   0   0   1",
9804                           "  0   0   0   0      0   0   0   0",
9805                           "  0   0   0   0      0   0  a1  a0",
9806                           "  i   i   i   i      i   i   i   i";
9807
9808         writepage       = "  1   1   0   0      0   0   1   0",
9809                           "  0   0   x   x      x   x   x  a8",
9810                           " a7  a6  a5  a4     a3  a2   0   0",
9811                           "  x   x   x   x      x   x   x   x";
9812
9813         mode            = 0x41;
9814         delay           = 6;
9815         blocksize       = 4;
9816         readsize        = 256;
9817        ;
9818      memory "flash"
9819          paged           = yes;
9820          size            = 8192;
9821          page_size       = 64;
9822          num_pages       = 128;
9823          min_write_delay = 4500;
9824          max_write_delay = 4500;
9825          readback_p1     = 0xff;
9826          readback_p2     = 0xff;
9827          read_lo         = "  0   0   1   0    0   0   0   0",
9828                            "  0   0   0   0  a11 a10  a9  a8",
9829                            " a7  a6  a5  a4   a3  a2  a1  a0",
9830                            "  o   o   o   o    o   o   o   o";
9831
9832          read_hi         = "  0   0   1   0    1   0   0   0",
9833                            "  0   0   0   0  a11 a10  a9  a8",
9834                            " a7  a6  a5  a4   a3  a2  a1  a0",
9835                            "  o   o   o   o    o   o   o   o";
9836
9837          loadpage_lo     = "  0   1   0   0    0   0   0   0",
9838                            "  0   0   0   x    x   x   x   x",
9839                            "  x   x   x  a4   a3  a2  a1  a0",
9840                            "  i   i   i   i    i   i   i   i";
9841
9842          loadpage_hi     = "  0   1   0   0    1   0   0   0",
9843                            "  0   0   0   x    x   x   x   x",
9844                            "  x   x   x  a4   a3  a2  a1  a0",
9845                            "  i   i   i   i    i   i   i   i";
9846
9847          writepage       = "  0  1  0  0   1   1   0  0",
9848                            "  0  0  0  0  a11 a10 a9 a8",
9849                            " a7 a6 a5  x   x  x  x  x",
9850                            "  x  x  x  x   x  x  x  x";
9851
9852         mode            = 0x41;
9853         delay           = 6;
9854         blocksize       = 32;
9855         readsize        = 256;
9856        ;
9857 #   ATtiny85 has Signature Bytes: 0x1E 0x93 0x08.
9858      memory "signature"
9859          size            = 3;
9860          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
9861                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9862        ;
9863      memory "lock"
9864          size            = 1;
9865          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9866                            "x x x x  x x x x  1 1 i i  i i i i";
9867          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9868                            "0 0 0 0  0 0 0 0  o o o o  o o o o";
9869         min_write_delay = 9000;
9870         max_write_delay = 9000;
9871        ;
9872
9873      memory "lfuse"
9874          size            = 1;
9875          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9876                            "x x x x  x x x x  i i i i  i i i i";
9877
9878          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9879                            "x x x x  x x x x  o o o o  o o o o";
9880         min_write_delay = 9000;
9881         max_write_delay = 9000;
9882        ;
9883
9884      memory "hfuse"
9885          size            = 1;
9886          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9887                            "x x x x  x x x x  i i i i  i i i i";
9888
9889          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9890                            "x x x x  x x x x  o o o o  o o o o";
9891         min_write_delay = 9000;
9892         max_write_delay = 9000;
9893        ;
9894
9895      memory "efuse"
9896          size            = 1;
9897          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9898                            "x x x x  x x x x  x x x x  x x x i";
9899
9900          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9901                            "x x x x  x x x x  o o o o  o o o o";
9902         min_write_delay = 9000;
9903         max_write_delay = 9000;
9904      ;
9905
9906      memory "calibration"
9907          size            = 1;
9908          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9909                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
9910      ;
9911   ;
9912
9913 #------------------------------------------------------------
9914 # ATmega640
9915 #------------------------------------------------------------
9916 # Almost same as ATmega1280, except for different memory sizes
9917
9918 part
9919     id               = "m640";
9920     desc             = "ATmega640";
9921     signature        = 0x1e 0x96 0x08;
9922     has_jtag         = yes;
9923 #    stk500_devcode   = 0xB2;
9924 #    avr910_devcode   = 0x43;
9925     chip_erase_delay = 9000;
9926     pagel            = 0xD7;
9927     bs2              = 0xA0;
9928     reset            = dedicated;
9929     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9930                        "x x x x  x x x x    x x x x  x x x x";
9931
9932     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
9933                        "x x x x  x x x x    x x x x  x x x x";
9934
9935     timeout             = 200;
9936     stabdelay           = 100;
9937     cmdexedelay         = 25;
9938     synchloops          = 32;
9939     bytedelay           = 0;
9940     pollindex           = 3;
9941     pollvalue           = 0x53;
9942     predelay            = 1;
9943     postdelay           = 1;
9944     pollmethod          = 1;
9945
9946     pp_controlstack     =
9947         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
9948         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
9949         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
9950         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
9951     hventerstabdelay    = 100;
9952     progmodedelay       = 0;
9953     latchcycles         = 5;
9954     togglevtg           = 1;
9955     poweroffdelay       = 15;
9956     resetdelayms        = 1;
9957     resetdelayus        = 0;
9958     hvleavestabdelay    = 15;
9959     chiperasepulsewidth = 0;
9960     chiperasepolltimeout = 10;
9961     programfusepulsewidth = 0;
9962     programfusepolltimeout = 5;
9963     programlockpulsewidth = 0;
9964     programlockpolltimeout = 5;
9965
9966     idr                 = 0x31;
9967     spmcr               = 0x57;
9968     rampz               = 0x3b;
9969     allowfullpagebitstream = no;
9970
9971     ocdrev              = 3;
9972
9973     memory "eeprom"
9974         paged           = no; /* leave this "no" */
9975         page_size       = 8;  /* for parallel programming */
9976         size            = 4096;
9977         min_write_delay = 9000;
9978         max_write_delay = 9000;
9979         readback_p1     = 0x00;
9980         readback_p2     = 0x00;
9981         read            = "  1   0   1   0      0   0   0   0",
9982                           "  x   x   x   x    a11 a10  a9  a8",
9983                           " a7  a6  a5  a4     a3  a2  a1  a0",
9984                           "  o   o   o   o      o   o   o   o";
9985
9986         write           = "  1   1   0   0      0   0   0   0",
9987                           "  x   x   x   x    a11 a10  a9  a8",
9988                           " a7  a6  a5  a4     a3  a2  a1  a0", 
9989                           "  i   i   i   i      i   i   i   i";
9990
9991         loadpage_lo     = "  1   1   0   0      0   0   0   1",
9992                           "  0   0   0   0      0   0   0   0",
9993                           "  0   0   0   0      0  a2  a1  a0",
9994                           "  i   i   i   i      i   i   i   i";
9995
9996         writepage       = "  1   1   0   0      0   0   1   0",
9997                           "  0   0   x   x    a11 a10  a9  a8",
9998                           " a7  a6  a5  a4     a3   0   0   0",
9999                           "  x   x   x   x      x   x   x   x";
10000
10001         mode            = 0x41;
10002         delay           = 10;
10003         blocksize       = 8;
10004         readsize        = 256;
10005       ;
10006
10007     memory "flash"
10008         paged           = yes;
10009         size            = 65536;
10010         page_size       = 256;
10011         num_pages       = 256;
10012         min_write_delay = 4500;
10013         max_write_delay = 4500;
10014         readback_p1     = 0x00;
10015         readback_p2     = 0x00;
10016         read_lo         = "  0   0   1   0      0   0   0   0",
10017                           "  0 a14 a13 a12    a11 a10  a9  a8",
10018                           " a7  a6  a5  a4     a3  a2  a1  a0",
10019                           "  o   o   o   o      o   o   o   o";
10020
10021         read_hi         = "  0   0   1   0      1   0   0   0",
10022                           "  0 a14 a13 a12    a11 a10  a9  a8",
10023                           " a7  a6  a5  a4     a3  a2  a1  a0",
10024                           "  o   o   o   o      o   o   o   o";
10025
10026         loadpage_lo     = "  0   1   0   0      0   0   0   0",
10027                           "  x   x   x   x      x   x   x   x",
10028                           "  x  a6  a5  a4     a3  a2  a1  a0",
10029                           "  i   i   i   i      i   i   i   i";
10030
10031         loadpage_hi     = "  0   1   0   0      1   0   0   0",
10032                           "  x   x   x   x      x   x   x   x",
10033                           "  x  a6  a5  a4     a3  a2  a1  a0",
10034                           "  i   i   i   i      i   i   i   i";
10035
10036         writepage       = "  0   1   0   0      1   1   0   0",
10037                           "  0 a14 a13 a12    a11 a10  a9  a8",
10038                           " a7   x   x   x      x   x   x   x",
10039                           "  x   x   x   x      x   x   x   x";
10040
10041         mode            = 0x41;
10042         delay           = 10;
10043         blocksize       = 256;
10044         readsize        = 256;
10045       ;
10046
10047     memory "lfuse"
10048         size            = 1;
10049         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10050                           "x x x x  x x x x  i i i i  i i i i";
10051
10052         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10053                           "x x x x  x x x x  o o o o  o o o o";
10054         min_write_delay = 9000;
10055         max_write_delay = 9000;
10056       ;
10057
10058     memory "hfuse"
10059         size            = 1;
10060         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10061                           "x x x x  x x x x  i i i i  i i i i";
10062
10063         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10064                           "x x x x  x x x x  o o o o  o o o o";
10065         min_write_delay = 9000;
10066         max_write_delay = 9000;
10067       ;
10068
10069     memory "efuse"
10070         size            = 1;
10071         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10072                           "x x x x  x x x x  x x x x  x i i i";
10073
10074         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10075                           "x x x x  x x x x  o o o o  o o o o";
10076         min_write_delay = 9000;
10077         max_write_delay = 9000;
10078       ;
10079
10080     memory "lock"
10081         size            = 1;
10082         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
10083                           "x x x x  x x x x   x x o o  o o o o";
10084
10085         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
10086                           "x x x x  x x x x   1 1 i i  i i i i";
10087         min_write_delay = 9000;
10088         max_write_delay = 9000;
10089       ;
10090
10091     memory "calibration"
10092         size            = 1;
10093         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
10094                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
10095       ;
10096
10097     memory "signature"
10098         size            = 3;
10099         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
10100                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10101       ;
10102   ;
10103
10104 #------------------------------------------------------------
10105 # ATmega1280
10106 #------------------------------------------------------------
10107
10108 part
10109     id               = "m1280";
10110     desc             = "ATmega1280";
10111     signature        = 0x1e 0x97 0x03;
10112     has_jtag         = yes;
10113 #    stk500_devcode   = 0xB2;
10114 #    avr910_devcode   = 0x43;
10115     chip_erase_delay = 9000;
10116     pagel            = 0xD7;
10117     bs2              = 0xA0;
10118     reset            = dedicated;
10119     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10120                        "x x x x  x x x x    x x x x  x x x x";
10121
10122     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
10123                        "x x x x  x x x x    x x x x  x x x x";
10124
10125     timeout             = 200;
10126     stabdelay           = 100;
10127     cmdexedelay         = 25;
10128     synchloops          = 32;
10129     bytedelay           = 0;
10130     pollindex           = 3;
10131     pollvalue           = 0x53;
10132     predelay            = 1;
10133     postdelay           = 1;
10134     pollmethod          = 1;
10135
10136     pp_controlstack     =
10137         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
10138         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
10139         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
10140         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
10141     hventerstabdelay    = 100;
10142     progmodedelay       = 0;
10143     latchcycles         = 5;
10144     togglevtg           = 1;
10145     poweroffdelay       = 15;
10146     resetdelayms        = 1;
10147     resetdelayus        = 0;
10148     hvleavestabdelay    = 15;
10149     chiperasepulsewidth = 0;
10150     chiperasepolltimeout = 10;
10151     programfusepulsewidth = 0;
10152     programfusepolltimeout = 5;
10153     programlockpulsewidth = 0;
10154     programlockpolltimeout = 5;
10155
10156     idr                 = 0x31;
10157     spmcr               = 0x57;
10158     rampz               = 0x3b;
10159     allowfullpagebitstream = no;
10160
10161     ocdrev              = 3;
10162
10163     memory "eeprom"
10164         paged           = no; /* leave this "no" */
10165         page_size       = 8;  /* for parallel programming */
10166         size            = 4096;
10167         min_write_delay = 9000;
10168         max_write_delay = 9000;
10169         readback_p1     = 0x00;
10170         readback_p2     = 0x00;
10171         read            = "  1   0   1   0      0   0   0   0",
10172                           "  x   x   x   x    a11 a10  a9  a8",
10173                           " a7  a6  a5  a4     a3  a2  a1  a0",
10174                           "  o   o   o   o      o   o   o   o";
10175
10176         write           = "  1   1   0   0      0   0   0   0",
10177                           "  x   x   x   x    a11 a10  a9  a8",
10178                           " a7  a6  a5  a4     a3  a2  a1  a0", 
10179                           "  i   i   i   i      i   i   i   i";
10180
10181         loadpage_lo     = "  1   1   0   0      0   0   0   1",
10182                           "  0   0   0   0      0   0   0   0",
10183                           "  0   0   0   0      0  a2  a1  a0",
10184                           "  i   i   i   i      i   i   i   i";
10185
10186         writepage       = "  1   1   0   0      0   0   1   0",
10187                           "  0   0   x   x    a11 a10  a9  a8",
10188                           " a7  a6  a5  a4     a3   0   0   0",
10189                           "  x   x   x   x      x   x   x   x";
10190
10191         mode            = 0x41;
10192         delay           = 10;
10193         blocksize       = 8;
10194         readsize        = 256;
10195       ;
10196
10197     memory "flash"
10198         paged           = yes;
10199         size            = 131072;
10200         page_size       = 256;
10201         num_pages       = 512;
10202         min_write_delay = 4500;
10203         max_write_delay = 4500;
10204         readback_p1     = 0x00;
10205         readback_p2     = 0x00;
10206         read_lo         = "  0   0   1   0      0   0   0   0",
10207                           "a15 a14 a13 a12    a11 a10  a9  a8",
10208                           " a7  a6  a5  a4     a3  a2  a1  a0",
10209                           "  o   o   o   o      o   o   o   o";
10210
10211         read_hi         = "  0   0   1   0      1   0   0   0",
10212                           "a15 a14 a13 a12    a11 a10  a9  a8",
10213                           " a7  a6  a5  a4     a3  a2  a1  a0",
10214                           "  o   o   o   o      o   o   o   o";
10215
10216         loadpage_lo     = "  0   1   0   0      0   0   0   0",
10217                           "  x   x   x   x      x   x   x   x",
10218                           "  x  a6  a5  a4     a3  a2  a1  a0",
10219                           "  i   i   i   i      i   i   i   i";
10220
10221         loadpage_hi     = "  0   1   0   0      1   0   0   0",
10222                           "  x   x   x   x      x   x   x   x",
10223                           "  x  a6  a5  a4     a3  a2  a1  a0",
10224                           "  i   i   i   i      i   i   i   i";
10225
10226         writepage       = "  0   1   0   0      1   1   0   0",
10227                           "a15 a14 a13 a12    a11 a10  a9  a8",
10228                           " a7   x   x   x      x   x   x   x",
10229                           "  x   x   x   x      x   x   x   x";
10230
10231         mode            = 0x41;
10232         delay           = 10;
10233         blocksize       = 256;
10234         readsize        = 256;
10235       ;
10236
10237     memory "lfuse"
10238         size            = 1;
10239         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10240                           "x x x x  x x x x  i i i i  i i i i";
10241
10242         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10243                           "x x x x  x x x x  o o o o  o o o o";
10244         min_write_delay = 9000;
10245         max_write_delay = 9000;
10246       ;
10247
10248     memory "hfuse"
10249         size            = 1;
10250         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10251                           "x x x x  x x x x  i i i i  i i i i";
10252
10253         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10254                           "x x x x  x x x x  o o o o  o o o o";
10255         min_write_delay = 9000;
10256         max_write_delay = 9000;
10257       ;
10258
10259     memory "efuse"
10260         size            = 1;
10261         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10262                           "x x x x  x x x x  x x x x  x i i i";
10263
10264         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10265                           "x x x x  x x x x  o o o o  o o o o";
10266         min_write_delay = 9000;
10267         max_write_delay = 9000;
10268       ;
10269
10270     memory "lock"
10271         size            = 1;
10272         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
10273                           "x x x x  x x x x   x x o o  o o o o";
10274
10275         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
10276                           "x x x x  x x x x   1 1 i i  i i i i";
10277         min_write_delay = 9000;
10278         max_write_delay = 9000;
10279       ;
10280
10281     memory "calibration"
10282         size            = 1;
10283         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
10284                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
10285       ;
10286
10287     memory "signature"
10288         size            = 3;
10289         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
10290                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10291       ;
10292   ;
10293
10294 #------------------------------------------------------------
10295 # ATmega1281
10296 #------------------------------------------------------------
10297 # Identical to ATmega1280
10298
10299 part parent "m1280"
10300     id               = "m1281";
10301     desc             = "ATmega1281";
10302     signature        = 0x1e 0x97 0x04;
10303
10304     ocdrev              = 3;
10305   ;
10306
10307 #------------------------------------------------------------
10308 # ATmega2560
10309 #------------------------------------------------------------
10310
10311 part
10312     id               = "m2560";
10313     desc             = "ATmega2560";
10314     signature        = 0x1e 0x98 0x01;
10315     has_jtag         = yes;
10316     stk500_devcode   = 0xB2;
10317 #    avr910_devcode   = 0x43;
10318     chip_erase_delay = 9000;
10319     pagel            = 0xD7;
10320     bs2              = 0xA0;
10321     reset            = dedicated;
10322     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10323                        "x x x x  x x x x    x x x x  x x x x";
10324
10325     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
10326                        "x x x x  x x x x    x x x x  x x x x";
10327
10328     timeout             = 200;
10329     stabdelay           = 100;
10330     cmdexedelay         = 25;
10331     synchloops          = 32;
10332     bytedelay           = 0;
10333     pollindex           = 3;
10334     pollvalue           = 0x53;
10335     predelay            = 1;
10336     postdelay           = 1;
10337     pollmethod          = 1;
10338
10339     pp_controlstack     =
10340         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
10341         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
10342         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
10343         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
10344     hventerstabdelay    = 100;
10345     progmodedelay       = 0;
10346     latchcycles         = 5;
10347     togglevtg           = 1;
10348     poweroffdelay       = 15;
10349     resetdelayms        = 1;
10350     resetdelayus        = 0;
10351     hvleavestabdelay    = 15;
10352     chiperasepulsewidth = 0;
10353     chiperasepolltimeout = 10;
10354     programfusepulsewidth = 0;
10355     programfusepolltimeout = 5;
10356     programlockpulsewidth = 0;
10357     programlockpolltimeout = 5;
10358
10359     idr                 = 0x31;
10360     spmcr               = 0x57;
10361     rampz               = 0x3b;
10362     allowfullpagebitstream = no;
10363
10364     ocdrev              = 4;
10365
10366     memory "eeprom"
10367         paged           = no; /* leave this "no" */
10368         page_size       = 8;  /* for parallel programming */
10369         size            = 4096;
10370         min_write_delay = 9000;
10371         max_write_delay = 9000;
10372         readback_p1     = 0x00;
10373         readback_p2     = 0x00;
10374         read            = "  1   0   1   0      0   0   0   0",
10375                           "  x   x   x   x    a11 a10  a9  a8",
10376                           " a7  a6  a5  a4     a3  a2  a1  a0",
10377                           "  o   o   o   o      o   o   o   o";
10378
10379         write           = "  1   1   0   0      0   0   0   0",
10380                           "  x   x   x   x    a11 a10  a9  a8",
10381                           " a7  a6  a5  a4     a3  a2  a1  a0", 
10382                           "  i   i   i   i      i   i   i   i";
10383
10384         loadpage_lo     = "  1   1   0   0      0   0   0   1",
10385                           "  0   0   0   0      0   0   0   0",
10386                           "  0   0   0   0      0  a2  a1  a0",
10387                           "  i   i   i   i      i   i   i   i";
10388
10389         writepage       = "  1   1   0   0      0   0   1   0",
10390                           "  0   0   x   x    a11 a10  a9  a8",
10391                           " a7  a6  a5  a4     a3   0   0   0",
10392                           "  x   x   x   x      x   x   x   x";
10393
10394         mode            = 0x41;
10395         delay           = 10;
10396         blocksize       = 8;
10397         readsize        = 256;
10398       ;
10399
10400     memory "flash"
10401         paged           = yes;
10402         size            = 262144;
10403         page_size       = 256;
10404         num_pages       = 1024;
10405         min_write_delay = 4500;
10406         max_write_delay = 4500;
10407         readback_p1     = 0x00;
10408         readback_p2     = 0x00;
10409         read_lo         = "  0   0   1   0      0   0   0   0",
10410                           "a15 a14 a13 a12    a11 a10  a9  a8",
10411                           " a7  a6  a5  a4     a3  a2  a1  a0",
10412                           "  o   o   o   o      o   o   o   o";
10413
10414         read_hi         = "  0   0   1   0      1   0   0   0",
10415                           "a15 a14 a13 a12    a11 a10  a9  a8",
10416                           " a7  a6  a5  a4     a3  a2  a1  a0",
10417                           "  o   o   o   o      o   o   o   o";
10418
10419         loadpage_lo     = "  0   1   0   0      0   0   0   0",
10420                           "  x   x   x   x      x   x   x   x",
10421                           "  x  a6  a5  a4     a3  a2  a1  a0",
10422                           "  i   i   i   i      i   i   i   i";
10423
10424         loadpage_hi     = "  0   1   0   0      1   0   0   0",
10425                           "  x   x   x   x      x   x   x   x",
10426                           "  x  a6  a5  a4     a3  a2  a1  a0",
10427                           "  i   i   i   i      i   i   i   i";
10428
10429         writepage       = "  0   1   0   0      1   1   0   0",
10430                           "a15 a14 a13 a12    a11 a10  a9  a8",
10431                           " a7   x   x   x      x   x   x   x",
10432                           "  x   x   x   x      x   x   x   x";
10433
10434         load_ext_addr   = "  0   1   0   0      1   1   0   1",
10435                           "  0   0   0   0      0   0   0   0",
10436                           "  0   0   0   0      0   0   0 a16",
10437                           "  0   0   0   0      0   0   0   0";
10438
10439         mode            = 0x41;
10440         delay           = 10;
10441         blocksize       = 256;
10442         readsize        = 256;
10443       ;
10444
10445     memory "lfuse"
10446         size            = 1;
10447         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10448                           "x x x x  x x x x  i i i i  i i i i";
10449
10450         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10451                           "x x x x  x x x x  o o o o  o o o o";
10452         min_write_delay = 9000;
10453         max_write_delay = 9000;
10454       ;
10455
10456     memory "hfuse"
10457         size            = 1;
10458         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10459                           "x x x x  x x x x  i i i i  i i i i";
10460
10461         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10462                           "x x x x  x x x x  o o o o  o o o o";
10463         min_write_delay = 9000;
10464         max_write_delay = 9000;
10465       ;
10466
10467     memory "efuse"
10468         size            = 1;
10469         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10470                           "x x x x  x x x x  x x x x  x i i i";
10471
10472         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10473                           "x x x x  x x x x  o o o o  o o o o";
10474         min_write_delay = 9000;
10475         max_write_delay = 9000;
10476       ;
10477
10478     memory "lock"
10479         size            = 1;
10480         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
10481                           "x x x x  x x x x   x x o o  o o o o";
10482
10483         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
10484                           "x x x x  x x x x   1 1 i i  i i i i";
10485         min_write_delay = 9000;
10486         max_write_delay = 9000;
10487       ;
10488
10489     memory "calibration"
10490         size            = 1;
10491         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
10492                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
10493       ;
10494
10495     memory "signature"
10496         size            = 3;
10497         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
10498                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10499       ;
10500   ;
10501
10502 #------------------------------------------------------------
10503 # ATmega2561
10504 #------------------------------------------------------------
10505
10506 part parent "m2560"
10507     id               = "m2561";
10508     desc             = "ATmega2561";
10509     signature        = 0x1e 0x98 0x02;
10510
10511     ocdrev              = 4;
10512   ;
10513
10514 #------------------------------------------------------------
10515 # ATmega128RFA1
10516 #------------------------------------------------------------
10517 # Identical to ATmega2561 but half the ROM
10518
10519 part parent "m2561"
10520     id               = "m128rfa1";
10521     desc             = "ATmega128RFA1";
10522     signature        = 0x1e 0xa7 0x01;
10523     chip_erase_delay = 55000;
10524     bs2              = 0xE2;
10525
10526     ocdrev              = 3;
10527
10528     memory "flash"
10529         paged           = yes;
10530         size            = 131072;
10531         page_size       = 256;
10532         num_pages       = 512;
10533         min_write_delay = 50000;
10534         max_write_delay = 50000;
10535         readback_p1     = 0x00;
10536         readback_p2     = 0x00;
10537         read_lo         = "  0   0   1   0      0   0   0   0",
10538                           "a15 a14 a13 a12    a11 a10  a9  a8",
10539                           " a7  a6  a5  a4     a3  a2  a1  a0",
10540                           "  o   o   o   o      o   o   o   o";
10541
10542         read_hi         = "  0   0   1   0      1   0   0   0",
10543                           "a15 a14 a13 a12    a11 a10  a9  a8",
10544                           " a7  a6  a5  a4     a3  a2  a1  a0",
10545                           "  o   o   o   o      o   o   o   o";
10546
10547         loadpage_lo     = "  0   1   0   0      0   0   0   0",
10548                           "  x   x   x   x      x   x   x   x",
10549                           "  x  a6  a5  a4     a3  a2  a1  a0",
10550                           "  i   i   i   i      i   i   i   i";
10551
10552         loadpage_hi     = "  0   1   0   0      1   0   0   0",
10553                           "  x   x   x   x      x   x   x   x",
10554                           "  x  a6  a5  a4     a3  a2  a1  a0",
10555                           "  i   i   i   i      i   i   i   i";
10556
10557         writepage       = "  0   1   0   0      1   1   0   0",
10558                           "a15 a14 a13 a12    a11 a10  a9  a8",
10559                           " a7   x   x   x      x   x   x   x",
10560                           "  x   x   x   x      x   x   x   x";
10561
10562         mode            = 0x41;
10563         delay           = 20;
10564         blocksize       = 256;
10565         readsize        = 256;
10566       ;
10567   ;
10568
10569 #------------------------------------------------------------
10570 # ATmega256RFR2
10571 #------------------------------------------------------------
10572
10573 part parent "m2561"
10574     id               = "m256rfr2";
10575     desc             = "ATmega256RFR2";
10576     signature        = 0x1e 0xa8 0x02;
10577     chip_erase_delay = 18500;
10578     bs2              = 0xE2;
10579
10580     memory "eeprom"
10581         paged           = no; /* leave this "no" */
10582         page_size       = 8;  /* for parallel programming */
10583         size            = 8192;
10584         min_write_delay = 13000;
10585         max_write_delay = 13000;
10586         readback_p1     = 0x00;
10587         readback_p2     = 0x00;
10588         read            = "  1   0   1   0      0   0   0   0",
10589                           "  x   x   x a12    a11 a10  a9  a8",
10590                           " a7  a6  a5  a4     a3  a2  a1  a0",
10591                           "  o   o   o   o      o   o   o   o";
10592
10593         write           = "  1   1   0   0      0   0   0   0",
10594                           "  x   x   x a12    a11 a10  a9  a8",
10595                           " a7  a6  a5  a4     a3  a2  a1  a0",
10596                           "  i   i   i   i      i   i   i   i";
10597
10598         loadpage_lo     = "  1   1   0   0      0   0   0   1",
10599                           "  0   0   0   0      0   0   0   0",
10600                           "  0   0   0   0      0  a2  a1  a0",
10601                           "  i   i   i   i      i   i   i   i";
10602
10603         writepage       = "  1   1   0   0      0   0   1   0",
10604                           "  0   0   x a12    a11 a10  a9  a8",
10605                           " a7  a6  a5  a4     a3   0   0   0",
10606                           "  x   x   x   x      x   x   x   x";
10607
10608         mode            = 0x41;
10609         delay           = 10;
10610         blocksize       = 8;
10611         readsize        = 256;
10612       ;
10613
10614
10615     ocdrev              = 4;
10616   ;
10617
10618 #------------------------------------------------------------
10619 # ATmega128RFR2
10620 #------------------------------------------------------------
10621
10622 part parent "m128rfa1"
10623     id               = "m128rfr2";
10624     desc             = "ATmega128RFR2";
10625     signature        = 0x1e 0xa7 0x02;
10626
10627
10628     ocdrev              = 3;
10629   ;
10630
10631 #------------------------------------------------------------
10632 # ATmega64RFR2
10633 #------------------------------------------------------------
10634
10635 part parent "m128rfa1"
10636     id               = "m64rfr2";
10637     desc             = "ATmega64RFR2";
10638     signature        = 0x1e 0xa6 0x02;
10639
10640
10641     ocdrev              = 3;
10642
10643     memory "flash"
10644         paged           = yes;
10645         size            = 65536;
10646         page_size       = 256;
10647         num_pages       = 256;
10648         min_write_delay = 50000;
10649         max_write_delay = 50000;
10650         readback_p1     = 0x00;
10651         readback_p2     = 0x00;
10652         read_lo         = "  0   0   1   0      0   0   0   0",
10653                           "  0 a14 a13 a12    a11 a10  a9  a8",
10654                           " a7  a6  a5  a4     a3  a2  a1  a0",
10655                           "  o   o   o   o      o   o   o   o";
10656
10657         read_hi         = "  0   0   1   0      1   0   0   0",
10658                           "  0 a14 a13 a12    a11 a10  a9  a8",
10659                           " a7  a6  a5  a4     a3  a2  a1  a0",
10660                           "  o   o   o   o      o   o   o   o";
10661
10662         loadpage_lo     = "  0   1   0   0      0   0   0   0",
10663                           "  x   x   x   x      x   x   x   x",
10664                           "  x  a6  a5  a4     a3  a2  a1  a0",
10665                           "  i   i   i   i      i   i   i   i";
10666
10667         loadpage_hi     = "  0   1   0   0      1   0   0   0",
10668                           "  x   x   x   x      x   x   x   x",
10669                           "  x  a6  a5  a4     a3  a2  a1  a0",
10670                           "  i   i   i   i      i   i   i   i";
10671
10672         writepage       = "  0   1   0   0      1   1   0   0",
10673                           "  0 a14 a13 a12    a11 a10  a9  a8",
10674                           " a7   x   x   x      x   x   x   x",
10675                           "  x   x   x   x      x   x   x   x";
10676
10677         mode            = 0x41;
10678         delay           = 20;
10679         blocksize       = 256;
10680         readsize        = 256;
10681       ;
10682
10683     memory "eeprom"
10684         paged           = no; /* leave this "no" */
10685         page_size       = 8;  /* for parallel programming */
10686         size            = 2048;
10687         min_write_delay = 13000;
10688         max_write_delay = 13000;
10689         readback_p1     = 0x00;
10690         readback_p2     = 0x00;
10691         read            = "  1   0   1   0      0   0   0   0",
10692                           "  x   x   x   x      x a10  a9  a8",
10693                           " a7  a6  a5  a4     a3  a2  a1  a0",
10694                           "  o   o   o   o      o   o   o   o";
10695
10696         write           = "  1   1   0   0      0   0   0   0",
10697                           "  x   x   x   x      x a10  a9  a8",
10698                           " a7  a6  a5  a4     a3  a2  a1  a0",
10699                           "  i   i   i   i      i   i   i   i";
10700
10701         loadpage_lo     = "  1   1   0   0      0   0   0   1",
10702                           "  0   0   0   0      0   0   0   0",
10703                           "  0   0   0   0      0  a2  a1  a0",
10704                           "  i   i   i   i      i   i   i   i";
10705
10706         writepage       = "  1   1   0   0      0   0   1   0",
10707                           "  0   0   x   x      x a10  a9  a8",
10708                           " a7  a6  a5  a4     a3   0   0   0",
10709                           "  x   x   x   x      x   x   x   x";
10710
10711         mode            = 0x41;
10712         delay           = 10;
10713         blocksize       = 8;
10714         readsize        = 256;
10715       ;
10716
10717
10718   ;
10719
10720 #------------------------------------------------------------
10721 # ATmega2564RFR2
10722 #------------------------------------------------------------
10723
10724 part parent "m256rfr2"
10725     id               = "m2564rfr2";
10726     desc             = "ATmega2564RFR2";
10727     signature        = 0x1e 0xa8 0x03;
10728   ;
10729
10730 #------------------------------------------------------------
10731 # ATmega1284RFR2
10732 #------------------------------------------------------------
10733
10734 part parent "m128rfr2"
10735     id               = "m1284rfr2";
10736     desc             = "ATmega1284RFR2";
10737     signature        = 0x1e 0xa7 0x03;
10738   ;
10739
10740 #------------------------------------------------------------
10741 # ATmega644RFR2
10742 #------------------------------------------------------------
10743
10744 part parent "m64rfr2"
10745     id               = "m644rfr2";
10746     desc             = "ATmega644RFR2";
10747     signature        = 0x1e 0xa6 0x03;
10748   ;
10749
10750 #------------------------------------------------------------
10751 # ATtiny24
10752 #------------------------------------------------------------
10753
10754 part
10755      id            = "t24";
10756      desc          = "ATtiny24";
10757      has_debugwire = yes;
10758      flash_instr   = 0xB4, 0x07, 0x17;
10759      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
10760                      0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
10761                      0x99, 0xE1, 0xBB, 0xAC;
10762 ## no STK500 devcode in XML file, use the ATtiny45 one
10763      stk500_devcode   = 0x14;
10764 ##  avr910_devcode   = ?;
10765 ##  Try the AT90S2313 devcode:
10766      avr910_devcode   = 0x20;
10767      signature        = 0x1e 0x91 0x0b;
10768      reset            = io;
10769      chip_erase_delay = 4500;
10770
10771      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10772                         "x x x x  x x x x    x x x x  x x x x";
10773
10774      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
10775                         "x x x x  x x x x    x x x x  x x x x";
10776
10777     timeout             = 200;
10778     stabdelay           = 100;
10779     cmdexedelay         = 25;
10780     synchloops          = 32;
10781     bytedelay           = 0;
10782     pollindex           = 3;
10783     pollvalue           = 0x53;
10784     predelay            = 1;
10785     postdelay           = 1;
10786     pollmethod          = 1;
10787
10788     hvsp_controlstack   =
10789         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
10790         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
10791         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
10792         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F;
10793     hventerstabdelay    = 100;
10794     hvspcmdexedelay     = 0;
10795     synchcycles         = 6;
10796     latchcycles         = 1;
10797     togglevtg           = 1;
10798     poweroffdelay       = 25;
10799     resetdelayms        = 0;
10800     resetdelayus        = 70;
10801     hvleavestabdelay    = 100;
10802     resetdelay          = 25;
10803     chiperasepolltimeout = 40;
10804     chiperasetime       = 0;
10805     programfusepolltimeout = 25;
10806     programlockpolltimeout = 25;
10807
10808     ocdrev              = 1;
10809
10810      memory "eeprom"
10811          size            = 128;
10812         paged           = no;
10813         page_size       = 4;
10814          min_write_delay = 4000;
10815          max_write_delay = 4500;
10816          readback_p1     = 0xff;
10817          readback_p2     = 0xff;
10818          read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x x",
10819                            "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
10820
10821          write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x x",
10822                            "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
10823
10824         loadpage_lo     = "  1   1   0   0      0   0   0   1",
10825                           "  0   0   0   0      0   0   0   0",
10826                           "  0   0   0   0      0   0  a1  a0",
10827                           "  i   i   i   i      i   i   i   i";
10828
10829         writepage       = "  1   1   0   0      0   0   1   0",
10830                           "  0   0   x   x      x   x   x   x",
10831                           "  x  a6  a5  a4     a3  a2   0   0",
10832                           "  x   x   x   x      x   x   x   x";
10833
10834         mode            = 0x41;
10835         delay           = 6;
10836         blocksize       = 4;
10837         readsize        = 256;
10838        ;
10839      memory "flash"
10840          paged           = yes;
10841          size            = 2048;
10842          page_size       = 32;
10843          num_pages       = 64;
10844          min_write_delay = 4500;
10845          max_write_delay = 4500;
10846          readback_p1     = 0xff;
10847          readback_p2     = 0xff;
10848          read_lo         = "  0   0   1   0    0   0   0   0",
10849                            "  0   0   0   0    0   0  a9  a8",
10850                            " a7  a6  a5  a4   a3  a2  a1  a0",
10851                            "  o   o   o   o    o   o   o   o";
10852
10853          read_hi         = "  0   0   1   0    1   0   0   0",
10854                            "  0   0   0   0    0   0  a9  a8",
10855                            " a7  a6  a5  a4   a3  a2  a1  a0",
10856                            "  o   o   o   o    o   o   o   o";
10857
10858          loadpage_lo     = "  0   1   0   0    0   0   0   0",
10859                            "  0   0   0   x    x   x   x   x",
10860                            "  x   x   x   x   a3  a2  a1  a0",
10861                            "  i   i   i   i    i   i   i   i";
10862
10863          loadpage_hi     = "  0   1   0   0    1   0   0   0",
10864                            "  0   0   0   x    x   x   x   x",
10865                            "  x   x   x   x   a3  a2  a1  a0",
10866                            "  i   i   i   i    i   i   i   i";
10867
10868          writepage       = "  0  1  0  0   1  1  0  0",
10869                            "  0  0  0  0   0  0 a9 a8",
10870                            " a7 a6 a5 a4   x  x  x  x",
10871                            "  x  x  x  x   x  x  x  x";
10872
10873         mode            = 0x41;
10874         delay           = 6;
10875         blocksize       = 32;
10876         readsize        = 256;
10877        ;
10878 #   ATtiny24 has Signature Bytes: 0x1E 0x91 0x0B.
10879      memory "signature"
10880          size            = 3;
10881          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
10882                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10883        ;
10884      memory "lock"
10885          size            = 1;
10886          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
10887                            "x x x x  x x x x  x x x x  x x i i";
10888          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
10889                            "0 0 0 0  0 0 0 0  o o o o  o o o o";
10890         min_write_delay = 9000;
10891         max_write_delay = 9000;
10892        ;
10893
10894      memory "lfuse"
10895          size            = 1;
10896          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10897                            "x x x x  x x x x  i i i i  i i i i";
10898
10899          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10900                            "x x x x  x x x x  o o o o  o o o o";
10901         min_write_delay = 9000;
10902         max_write_delay = 9000;
10903        ;
10904
10905      memory "hfuse"
10906          size            = 1;
10907          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10908                            "x x x x  x x x x  i i i i  i i i i";
10909
10910          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10911                            "x x x x  x x x x  o o o o  o o o o";
10912         min_write_delay = 9000;
10913         max_write_delay = 9000;
10914        ;
10915
10916      memory "efuse"
10917          size            = 1;
10918          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10919                            "x x x x  x x x x  x x x x  x x x i";
10920
10921          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10922                            "x x x x  x x x x  o o o o  o o o o";
10923         min_write_delay = 9000;
10924         max_write_delay = 9000;
10925      ;
10926
10927      memory "calibration"
10928          size            = 1;
10929          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
10930                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
10931      ;
10932   ;
10933
10934 #------------------------------------------------------------
10935 # ATtiny44
10936 #------------------------------------------------------------
10937
10938 part
10939      id            = "t44";
10940      desc          = "ATtiny44";
10941      has_debugwire = yes;
10942      flash_instr   = 0xB4, 0x07, 0x17;
10943      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
10944                      0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
10945                      0x99, 0xE1, 0xBB, 0xAC;
10946 ## no STK500 devcode in XML file, use the ATtiny45 one
10947      stk500_devcode   = 0x14;
10948 ##  avr910_devcode   = ?;
10949 ##  Try the AT90S2313 devcode:
10950      avr910_devcode   = 0x20;
10951      signature        = 0x1e 0x92 0x07;
10952      reset            = io;
10953      chip_erase_delay = 4500;
10954
10955      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10956                         "x x x x  x x x x    x x x x  x x x x";
10957
10958      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
10959                         "x x x x  x x x x    x x x x  x x x x";
10960
10961     timeout             = 200;
10962     stabdelay           = 100;
10963     cmdexedelay         = 25;
10964     synchloops          = 32;
10965     bytedelay           = 0;
10966     pollindex           = 3;
10967     pollvalue           = 0x53;
10968     predelay            = 1;
10969     postdelay           = 1;
10970     pollmethod          = 1;
10971
10972     hvsp_controlstack   =
10973         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
10974         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
10975         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
10976         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F;
10977     hventerstabdelay    = 100;
10978     hvspcmdexedelay     = 0;
10979     synchcycles         = 6;
10980     latchcycles         = 1;
10981     togglevtg           = 1;
10982     poweroffdelay       = 25;
10983     resetdelayms        = 0;
10984     resetdelayus        = 70;
10985     hvleavestabdelay    = 100;
10986     resetdelay          = 25;
10987     chiperasepolltimeout = 40;
10988     chiperasetime       = 0;
10989     programfusepolltimeout = 25;
10990     programlockpolltimeout = 25;
10991
10992     ocdrev              = 1;
10993
10994      memory "eeprom"
10995          size            = 256;
10996         paged           = no;
10997         page_size       = 4;
10998          min_write_delay = 4000;
10999          max_write_delay = 4500;
11000          readback_p1     = 0xff;
11001          readback_p2     = 0xff;
11002          read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x x",
11003                            "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
11004
11005          write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
11006                            "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
11007
11008         loadpage_lo     = "  1   1   0   0      0   0   0   1",
11009                           "  0   0   0   0      0   0   0   0",
11010                           "  0   0   0   0      0   0  a1  a0",
11011                           "  i   i   i   i      i   i   i   i";
11012
11013         writepage       = "  1   1   0   0      0   0   1   0",
11014                           "  0   0   x   x      x   x   x   x",
11015                           "  x  a6  a5  a4     a3  a2   0   0",
11016                           "  x   x   x   x      x   x   x   x";
11017
11018         mode            = 0x41;
11019         delay           = 6;
11020         blocksize       = 4;
11021         readsize        = 256;
11022        ;
11023      memory "flash"
11024          paged           = yes;
11025          size            = 4096;
11026          page_size       = 64;
11027          num_pages       = 64;
11028          min_write_delay = 4500;
11029          max_write_delay = 4500;
11030          readback_p1     = 0xff;
11031          readback_p2     = 0xff;
11032          read_lo         = "  0   0   1   0    0   0   0   0",
11033                            "  0   0   0   0    0  a10 a9  a8",
11034                            " a7  a6  a5  a4   a3  a2  a1  a0",
11035                            "  o   o   o   o    o   o   o   o";
11036
11037          read_hi         = "  0   0   1   0    1   0   0   0",
11038                            "  0   0   0   0    0  a10 a9  a8",
11039                            " a7  a6  a5  a4   a3  a2  a1  a0",
11040                            "  o   o   o   o    o   o   o   o";
11041
11042          loadpage_lo     = "  0   1   0   0    0   0   0   0",
11043                            "  0   0   0   x    x   x   x   x",
11044                            "  x   x   x  a4   a3  a2  a1  a0",
11045                            "  i   i   i   i    i   i   i   i";
11046
11047          loadpage_hi     = "  0   1   0   0    1   0   0   0",
11048                            "  0   0   0   x    x   x   x   x",
11049                            "  x   x   x  a4   a3  a2  a1  a0",
11050                            "  i   i   i   i    i   i   i   i";
11051
11052          writepage       = "  0  1  0  0   1  1  0  0",
11053                            "  0  0  0  0   0 a10 a9 a8",
11054                            " a7 a6 a5  x   x  x  x  x",
11055                            "  x  x  x  x   x  x  x  x";
11056
11057         mode            = 0x41;
11058         delay           = 6;
11059         blocksize       = 32;
11060         readsize        = 256;
11061        ;
11062 #   ATtiny44 has Signature Bytes: 0x1E 0x92 0x07.
11063      memory "signature"
11064          size            = 3;
11065          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
11066                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11067        ;
11068      memory "lock"
11069          size            = 1;
11070          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
11071                            "x x x x  x x x x  x x x x  x x i i";
11072          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
11073                            "0 0 0 0  0 0 0 0  o o o o  o o o o";
11074         min_write_delay = 9000;
11075         max_write_delay = 9000;
11076        ;
11077
11078      memory "lfuse"
11079          size            = 1;
11080          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11081                            "x x x x  x x x x  i i i i  i i i i";
11082
11083          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11084                            "x x x x  x x x x  o o o o  o o o o";
11085         min_write_delay = 9000;
11086         max_write_delay = 9000;
11087        ;
11088
11089      memory "hfuse"
11090          size            = 1;
11091          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11092                            "x x x x  x x x x  i i i i  i i i i";
11093
11094          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11095                            "x x x x  x x x x  o o o o  o o o o";
11096         min_write_delay = 9000;
11097         max_write_delay = 9000;
11098        ;
11099
11100      memory "efuse"
11101          size            = 1;
11102          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11103                            "x x x x  x x x x  x x x x  x x x i";
11104
11105          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11106                            "x x x x  x x x x  o o o o  o o o o";
11107         min_write_delay = 9000;
11108         max_write_delay = 9000;
11109      ;
11110
11111      memory "calibration"
11112          size            = 1;
11113          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
11114                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
11115      ;
11116   ;
11117
11118 #------------------------------------------------------------
11119 # ATtiny84
11120 #------------------------------------------------------------
11121
11122 part
11123      id            = "t84";
11124      desc          = "ATtiny84";
11125      has_debugwire = yes;
11126      flash_instr   = 0xB4, 0x07, 0x17;
11127      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
11128                      0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
11129                      0x99, 0xE1, 0xBB, 0xAC;
11130 ## no STK500 devcode in XML file, use the ATtiny45 one
11131      stk500_devcode   = 0x14;
11132 ##  avr910_devcode   = ?;
11133 ##  Try the AT90S2313 devcode:
11134      avr910_devcode   = 0x20;
11135      signature        = 0x1e 0x93 0x0c;
11136      reset            = io;
11137      chip_erase_delay = 4500;
11138
11139      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11140                         "x x x x  x x x x    x x x x  x x x x";
11141
11142      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
11143                         "x x x x  x x x x    x x x x  x x x x";
11144
11145     timeout             = 200;
11146     stabdelay           = 100;
11147     cmdexedelay         = 25;
11148     synchloops          = 32;
11149     bytedelay           = 0;
11150     pollindex           = 3;
11151     pollvalue           = 0x53;
11152     predelay            = 1;
11153     postdelay           = 1;
11154     pollmethod          = 1;
11155
11156     hvsp_controlstack   =
11157         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
11158         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
11159         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
11160         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F;
11161     hventerstabdelay    = 100;
11162     hvspcmdexedelay     = 0;
11163     synchcycles         = 6;
11164     latchcycles         = 1;
11165     togglevtg           = 1;
11166     poweroffdelay       = 25;
11167     resetdelayms        = 0;
11168     resetdelayus        = 70;
11169     hvleavestabdelay    = 100;
11170     resetdelay          = 25;
11171     chiperasepolltimeout = 40;
11172     chiperasetime       = 0;
11173     programfusepolltimeout = 25;
11174     programlockpolltimeout = 25;
11175
11176     ocdrev              = 1;
11177
11178      memory "eeprom"
11179          size            = 512;
11180         paged           = no;
11181         page_size       = 4;
11182          min_write_delay = 4000;
11183          max_write_delay = 4500;
11184          readback_p1     = 0xff;
11185          readback_p2     = 0xff;
11186          read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x a8",
11187                            "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
11188
11189          write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x a8",
11190                            "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
11191
11192         loadpage_lo     = "  1   1   0   0      0   0   0   1",
11193                           "  0   0   0   0      0   0   0   0",
11194                           "  0   0   0   0      0   0  a1  a0",
11195                           "  i   i   i   i      i   i   i   i";
11196
11197         writepage       = "  1   1   0   0      0   0   1   0",
11198                           "  0   0   x   x      x   x   x   x",
11199                           "  x  a6  a5  a4     a3  a2   0   0",
11200                           "  x   x   x   x      x   x   x   x";
11201
11202         mode            = 0x41;
11203         delay           = 6;
11204         blocksize       = 4;
11205         readsize        = 256;
11206        ;
11207      memory "flash"
11208          paged           = yes;
11209          size            = 8192;
11210          page_size       = 64;
11211          num_pages       = 128;
11212          min_write_delay = 4500;
11213          max_write_delay = 4500;
11214          readback_p1     = 0xff;
11215          readback_p2     = 0xff;
11216          read_lo         = "  0   0   1   0    0   0   0   0",
11217                            "  0   0   0   0  a11 a10  a9  a8",
11218                            " a7  a6  a5  a4   a3  a2  a1  a0",
11219                            "  o   o   o   o    o   o   o   o";
11220
11221          read_hi         = "  0   0   1   0    1   0   0   0",
11222                            "  0   0   0   0  a11 a10  a9  a8",
11223                            " a7  a6  a5  a4   a3  a2  a1  a0",
11224                            "  o   o   o   o    o   o   o   o";
11225
11226          loadpage_lo     = "  0   1   0   0    0   0   0   0",
11227                            "  0   0   0   x    x   x   x   x",
11228                            "  x   x   x  a4   a3  a2  a1  a0",
11229                            "  i   i   i   i    i   i   i   i";
11230
11231          loadpage_hi     = "  0   1   0   0    1   0   0   0",
11232                            "  0   0   0   x    x   x   x   x",
11233                            "  x   x   x  a4   a3  a2  a1  a0",
11234                            "  i   i   i   i    i   i   i   i";
11235
11236          writepage       = "  0  1  0  0   1   1   0  0",
11237                            "  0  0  0  0  a11 a10 a9 a8",
11238                            " a7 a6 a5  x   x  x  x  x",
11239                            "  x  x  x  x   x  x  x  x";
11240
11241         mode            = 0x41;
11242         delay           = 6;
11243         blocksize       = 32;
11244         readsize        = 256;
11245        ;
11246 #   ATtiny84 has Signature Bytes: 0x1E 0x93 0x0C.
11247      memory "signature"
11248          size            = 3;
11249          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
11250                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11251        ;
11252
11253      memory "lock"
11254          size            = 1;
11255          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
11256                            "x x x x  x x x x  x x x x  x x i i";
11257          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
11258                            "0 0 0 0  0 0 0 0  o o o o  o o o o";
11259         min_write_delay = 9000;
11260         max_write_delay = 9000;
11261        ;
11262
11263      memory "lfuse"
11264          size            = 1;
11265          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11266                            "x x x x  x x x x  i i i i  i i i i";
11267
11268          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11269                            "x x x x  x x x x  o o o o  o o o o";
11270         min_write_delay = 9000;
11271         max_write_delay = 9000;
11272        ;
11273
11274      memory "hfuse"
11275          size            = 1;
11276          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11277                            "x x x x  x x x x  i i i i  i i i i";
11278
11279          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11280                            "x x x x  x x x x  o o o o  o o o o";
11281         min_write_delay = 9000;
11282         max_write_delay = 9000;
11283        ;
11284
11285      memory "efuse"
11286          size            = 1;
11287          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11288                            "x x x x  x x x x  x x x x  x x x i";
11289
11290          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11291                            "x x x x  x x x x  o o o o  o o o o";
11292         min_write_delay = 9000;
11293         max_write_delay = 9000;
11294      ;
11295
11296      memory "calibration"
11297          size            = 1;
11298          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
11299                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
11300      ;
11301   ;
11302
11303 #------------------------------------------------------------
11304 # ATtiny43U
11305 #------------------------------------------------------------
11306
11307 part
11308     id            = "t43u";
11309     desc          = "ATtiny43u";
11310     has_debugwire = yes;
11311     flash_instr   = 0xB4, 0x07, 0x17;
11312     eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
11313                          0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
11314                          0x99, 0xE1, 0xBB, 0xAC;
11315     stk500_devcode   = 0x14;
11316 ##  avr910_devcode   = ?;
11317 ##  Try the AT90S2313 devcode:
11318     avr910_devcode   = 0x20;
11319     signature        = 0x1e 0x92 0x0C;
11320     reset            = io;
11321     chip_erase_delay = 1000;
11322
11323     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11324                         "x x x x  x x x x    x x x x  x x x x";
11325
11326     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
11327                         "x x x x  x x x x    x x x x  x x x x";
11328
11329     timeout                     = 200;
11330     stabdelay           = 100;
11331     cmdexedelay         = 25;
11332     synchloops          = 32;
11333     bytedelay           = 0;
11334     pollindex           = 3;
11335     pollvalue           = 0x53;
11336     predelay            = 1;
11337     postdelay           = 1;
11338     pollmethod          = 1;
11339         pp_controlstack = 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, 0x4E, 0x5E,
11340                                          0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, 0x06, 0x16, 0x46, 0x56,
11341                                          0x0A, 0x1A, 0x4A, 0x5A, 0x1E, 0x7C, 0x00, 0x01, 0x00, 0x00,
11342                                          0x00, 0x00;
11343     hventerstabdelay    = 100;
11344     progmodedelay       = 0;
11345     hvspcmdexedelay     = 0;
11346     latchcycles         = 5;
11347     togglevtg           = 1;
11348     poweroffdelay       = 20;
11349     resetdelayms        = 1;
11350     resetdelayus        = 0;
11351     hvleavestabdelay    = 15;
11352     resetdelay          = 15;
11353     chiperasepulsewidth = 0;
11354     chiperasepolltimeout = 10;
11355     programfusepulsewidth = 0;
11356     programfusepolltimeout = 5;
11357     programlockpulsewidth = 0;
11358     programlockpolltimeout = 5;
11359     memory "eeprom"
11360                 size            = 64;
11361                 paged                   = yes;
11362                 page_size       = 4;
11363                 num_pages               = 16;
11364                 min_write_delay = 4000;
11365                 max_write_delay = 4500;
11366                 readback_p1     = 0xff;
11367                 readback_p2     = 0xff;
11368                 read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x x",
11369                                    "0  0 a4  a3 a2 a1 a0   o o o o  o o o o";
11370
11371                 write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
11372                                    "0  0 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
11373
11374                 loadpage_lo     = "  1   1   0   0      0   0   0   1",
11375                                   "  0   0   0   0      0   0   0   0",
11376                                   "  0   0   0   0      0   0  a1  a0",
11377                                   "  i   i   i   i      i   i   i   i";
11378
11379                 writepage       = "  1   1   0   0      0   0   1   0",
11380                                   "  0   0   x   x      x   x   x   x",
11381                                   "  0   0  a5  a4     a3  a2   0   0",
11382                                   "  x   x   x   x      x   x   x   x";
11383
11384                 mode            = 0x41;
11385                 delay           = 5;
11386                 blocksize       = 4;
11387                 readsize        = 256;
11388         ;
11389     memory "flash"
11390         paged           = yes;
11391         size            = 4096;
11392         page_size       = 64;
11393         num_pages       = 64;
11394         min_write_delay = 4500;
11395         max_write_delay = 4500;
11396         readback_p1     = 0xff;
11397         readback_p2     = 0xff;
11398
11399         read_lo         = "  0   0   1   0    0   0   0   0",
11400                           "  0   0   0   0    0  a10 a9  a8",
11401                           " a7  a6  a5  a4   a3  a2  a1  a0",
11402                           "  o   o   o   o    o   o   o   o";
11403
11404         read_hi         = "  0   0   1   0    1   0   0   0",
11405                           "  0   0   0   0    0  a10 a9  a8",
11406                           " a7  a6  a5  a4   a3  a2  a1  a0",
11407                           "  o   o   o   o    o   o   o   o";
11408
11409         loadpage_lo     = "  0   1   0   0    0   0   0   0",
11410                           "  0   0   0   x    x   x   x   x",
11411                           "  x   x   x  a4   a3  a2  a1  a0",
11412                           "  i   i   i   i    i   i   i   i";
11413
11414         loadpage_hi     = "  0   1   0   0    1   0   0   0",
11415                           "  0   0   0   x    x   x   x   x",
11416                           "  x   x   x  a4   a3  a2  a1  a0",
11417                           "  i   i   i   i    i   i   i   i";
11418
11419         writepage       = "  0  1  0  0   1  1  0  0",
11420                           "  0  0  0  0   0 a10 a9 a8",
11421                           " a7 a6 a5  x   x  x  x  x",
11422                           "  x  x  x  x   x  x  x  x";
11423
11424                 mode            = 0x41;
11425                 delay           = 10;
11426                 blocksize       = 64;
11427                 readsize        = 256;
11428        ;
11429     memory "signature"
11430         size            = 3;
11431         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
11432                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11433     ;
11434     memory "lock"
11435         size            = 1;
11436         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
11437                           "x x x x  x x x x  1 1 i i  i i i i";
11438         min_write_delay = 4500;
11439         max_write_delay = 4500;
11440     ;
11441
11442     memory "lfuse"
11443         size            = 1;
11444         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11445                           "x x x x  x x x x  i i i i  i i i i";
11446
11447         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11448                           "x x x x  x x x x  o o o o  o o o o";
11449         min_write_delay = 4500;
11450         max_write_delay = 4500;
11451         ;
11452
11453     memory "hfuse"
11454         size            = 1;
11455         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11456                           "x x x x  x x x x  i i i i  i i i i";
11457
11458         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11459                           "x x x x  x x x x  o o o o  o o o o";
11460         min_write_delay = 4500;
11461         max_write_delay = 4500;
11462         ;
11463
11464     memory "efuse"
11465         size            = 1;
11466         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11467                           "x x x x  x x x x  x x x x  x x x i";
11468
11469         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11470                           "x x x x  x x x x  o o o o  o o o o";
11471         min_write_delay = 4500;
11472         max_write_delay = 4500;
11473     ;
11474
11475     memory "calibration"
11476         size            = 2;
11477         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
11478                           "0  0  0  0   0  0  0  a0   o o o o  o o o o";
11479     ;
11480 ;
11481
11482 #------------------------------------------------------------
11483 # ATmega32u4
11484 #------------------------------------------------------------
11485
11486 part
11487     id               = "m32u4";
11488     desc             = "ATmega32U4";
11489     signature        = 0x1e 0x95 0x87;
11490     usbpid           = 0x2ff4;
11491     has_jtag         = yes;
11492 #    stk500_devcode   = 0xB2;
11493 #    avr910_devcode   = 0x43;
11494     chip_erase_delay = 9000;
11495     pagel            = 0xD7;
11496     bs2              = 0xA0;
11497     reset            = dedicated;
11498     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11499                        "x x x x  x x x x    x x x x  x x x x";
11500
11501     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
11502                        "x x x x  x x x x    x x x x  x x x x";
11503
11504     timeout             = 200;
11505     stabdelay           = 100;
11506     cmdexedelay         = 25;
11507     synchloops          = 32;
11508     bytedelay           = 0;
11509     pollindex           = 3;
11510     pollvalue           = 0x53;
11511     predelay            = 1;
11512     postdelay           = 1;
11513     pollmethod          = 1;
11514
11515     pp_controlstack     =
11516         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
11517         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
11518         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
11519         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
11520     hventerstabdelay    = 100;
11521     progmodedelay       = 0;
11522     latchcycles         = 5;
11523     togglevtg           = 1;
11524     poweroffdelay       = 15;
11525     resetdelayms        = 1;
11526     resetdelayus        = 0;
11527     hvleavestabdelay    = 15;
11528     chiperasepulsewidth = 0;
11529     chiperasepolltimeout = 10;
11530     programfusepulsewidth = 0;
11531     programfusepolltimeout = 5;
11532     programlockpulsewidth = 0;
11533     programlockpolltimeout = 5;
11534
11535     idr                 = 0x31;
11536     spmcr               = 0x57;
11537     rampz               = 0x3b;
11538     allowfullpagebitstream = no;
11539
11540     ocdrev              = 3;
11541
11542     memory "eeprom"
11543         paged           = no; /* leave this "no" */
11544         page_size       = 4;  /* for parallel programming */
11545         size            = 1024;
11546         min_write_delay = 9000;
11547         max_write_delay = 9000;
11548         readback_p1     = 0x00;
11549         readback_p2     = 0x00;
11550         read            = "  1   0   1   0      0   0   0   0",
11551                           "  x   x   x   x      x a10  a9  a8",
11552                           " a7  a6  a5  a4     a3  a2  a1  a0",
11553                           "  o   o   o   o      o   o   o   o";
11554
11555         write           = "  1   1   0   0      0   0   0   0",
11556                           "  x   x   x   x      x a10  a9  a8",
11557                           " a7  a6  a5  a4     a3  a2  a1  a0", 
11558                           "  i   i   i   i      i   i   i   i";
11559
11560         loadpage_lo     = "  1   1   0   0      0   0   0   1",
11561                           "  0   0   0   0      0   0   0   0",
11562                           "  0   0   0   0      0  a2  a1  a0",
11563                           "  i   i   i   i      i   i   i   i";
11564
11565         writepage       = "  1   1   0   0      0   0   1   0",
11566                           "  0   0   x   x      x a10  a9  a8",
11567                           " a7  a6  a5  a4     a3   0   0   0",
11568                           "  x   x   x   x      x   x   x   x";
11569
11570         mode            = 0x41;
11571         delay           = 20;
11572         blocksize       = 4;
11573         readsize        = 256;
11574       ;
11575
11576     memory "flash"
11577         paged           = yes;
11578         size            = 32768;
11579         page_size       = 128;
11580         num_pages       = 256;
11581         min_write_delay = 4500;
11582         max_write_delay = 4500;
11583         readback_p1     = 0x00;
11584         readback_p2     = 0x00;
11585         read_lo         = "  0   0   1   0      0   0   0   0",
11586                           "  0 a14 a13 a12    a11 a10  a9  a8",
11587                           " a7  a6  a5  a4     a3  a2  a1  a0",
11588                           "  o   o   o   o      o   o   o   o";
11589
11590         read_hi         = "  0   0   1   0      1   0   0   0",
11591                           "  0 a14 a13 a12    a11 a10  a9  a8",
11592                           " a7  a6  a5  a4     a3  a2  a1  a0",
11593                           "  o   o   o   o      o   o   o   o";
11594
11595         loadpage_lo     = "  0   1   0   0      0   0   0   0",
11596                           "  x   x   x   x      x   x   x   x",
11597                           "  x   x  a5  a4     a3  a2  a1  a0",
11598                           "  i   i   i   i      i   i   i   i";
11599
11600         loadpage_hi     = "  0   1   0   0      1   0   0   0",
11601                           "  x   x   x   x      x   x   x   x",
11602                           "  x   x  a5  a4     a3  a2  a1  a0",
11603                           "  i   i   i   i      i   i   i   i";
11604
11605         writepage       = "  0   1   0   0      1   1   0   0",
11606                           " a15 a14 a13 a12    a11 a10  a9  a8",
11607                           " a7  a6   x   x      x   x   x   x",
11608                           "  x   x   x   x      x   x   x   x";
11609
11610         mode            = 0x41;
11611         delay           = 6;
11612         blocksize       = 128;
11613         readsize        = 256;
11614       ;
11615
11616     memory "lfuse"
11617         size            = 1;
11618         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11619                           "x x x x  x x x x  i i i i  i i i i";
11620
11621         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11622                           "x x x x  x x x x  o o o o  o o o o";
11623         min_write_delay = 9000;
11624         max_write_delay = 9000;
11625       ;
11626
11627     memory "hfuse"
11628         size            = 1;
11629         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11630                           "x x x x  x x x x  i i i i  i i i i";
11631
11632         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11633                           "x x x x  x x x x  o o o o  o o o o";
11634         min_write_delay = 9000;
11635         max_write_delay = 9000;
11636       ;
11637
11638     memory "efuse"
11639         size            = 1;
11640         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11641                           "x x x x  x x x x  x x x x  i i i i";
11642
11643         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11644                           "x x x x  x x x x  o o o o  o o o o";
11645         min_write_delay = 9000;
11646         max_write_delay = 9000;
11647       ;
11648
11649     memory "lock"
11650         size            = 1;
11651         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
11652                           "x x x x  x x x x   x x o o  o o o o";
11653
11654         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
11655                           "x x x x  x x x x   1 1 i i  i i i i";
11656         min_write_delay = 9000;
11657         max_write_delay = 9000;
11658       ;
11659
11660     memory "calibration"
11661         size            = 1;
11662         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
11663                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
11664       ;
11665
11666     memory "signature"
11667         size            = 3;
11668         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
11669                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11670       ;
11671   ;
11672
11673 #------------------------------------------------------------
11674 # AT90USB646
11675 #------------------------------------------------------------
11676
11677 part
11678     id               = "usb646";
11679     desc             = "AT90USB646";
11680     signature        = 0x1e 0x96 0x82;
11681     usbpid           = 0x2ff9;
11682     has_jtag         = yes;
11683 #    stk500_devcode   = 0xB2;
11684 #    avr910_devcode   = 0x43;
11685     chip_erase_delay = 9000;
11686     pagel            = 0xD7;
11687     bs2              = 0xA0;
11688     reset            = dedicated;
11689     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11690                        "x x x x  x x x x    x x x x  x x x x";
11691
11692     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
11693                        "x x x x  x x x x    x x x x  x x x x";
11694
11695     timeout             = 200;
11696     stabdelay           = 100;
11697     cmdexedelay         = 25;
11698     synchloops          = 32;
11699     bytedelay           = 0;
11700     pollindex           = 3;
11701     pollvalue           = 0x53;
11702     predelay            = 1;
11703     postdelay           = 1;
11704     pollmethod          = 1;
11705
11706     pp_controlstack     =
11707         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
11708         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
11709         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
11710         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
11711     hventerstabdelay    = 100;
11712     progmodedelay       = 0;
11713     latchcycles         = 5;
11714     togglevtg           = 1;
11715     poweroffdelay       = 15;
11716     resetdelayms        = 1;
11717     resetdelayus        = 0;
11718     hvleavestabdelay    = 15;
11719     chiperasepulsewidth = 0;
11720     chiperasepolltimeout = 10;
11721     programfusepulsewidth = 0;
11722     programfusepolltimeout = 5;
11723     programlockpulsewidth = 0;
11724     programlockpolltimeout = 5;
11725
11726     idr                 = 0x31;
11727     spmcr               = 0x57;
11728     rampz               = 0x3b;
11729     allowfullpagebitstream = no;
11730
11731     ocdrev              = 3;
11732
11733     memory "eeprom"
11734         paged           = no; /* leave this "no" */
11735         page_size       = 8;  /* for parallel programming */
11736         size            = 2048;
11737         min_write_delay = 9000;
11738         max_write_delay = 9000;
11739         readback_p1     = 0x00;
11740         readback_p2     = 0x00;
11741         read            = "  1   0   1   0      0   0   0   0",
11742                           "  x   x   x   x      x a10  a9  a8",
11743                           " a7  a6  a5  a4     a3  a2  a1  a0",
11744                           "  o   o   o   o      o   o   o   o";
11745
11746         write           = "  1   1   0   0      0   0   0   0",
11747                           "  x   x   x   x      x a10  a9  a8",
11748                           " a7  a6  a5  a4     a3  a2  a1  a0", 
11749                           "  i   i   i   i      i   i   i   i";
11750
11751         loadpage_lo     = "  1   1   0   0      0   0   0   1",
11752                           "  0   0   0   0      0   0   0   0",
11753                           "  0   0   0   0      0  a2  a1  a0",
11754                           "  i   i   i   i      i   i   i   i";
11755
11756         writepage       = "  1   1   0   0      0   0   1   0",
11757                           "  0   0   x   x      x a10  a9  a8",
11758                           " a7  a6  a5  a4     a3   0   0   0",
11759                           "  x   x   x   x      x   x   x   x";
11760
11761         mode            = 0x41;
11762         delay           = 10;
11763         blocksize       = 8;
11764         readsize        = 256;
11765       ;
11766
11767     memory "flash"
11768         paged           = yes;
11769         size            = 65536;
11770         page_size       = 256;
11771         num_pages       = 256;
11772         min_write_delay = 4500;
11773         max_write_delay = 4500;
11774         readback_p1     = 0x00;
11775         readback_p2     = 0x00;
11776         read_lo         = "  0   0   1   0      0   0   0   0",
11777                           "  0 a14 a13 a12    a11 a10  a9  a8",
11778                           " a7  a6  a5  a4     a3  a2  a1  a0",
11779                           "  o   o   o   o      o   o   o   o";
11780
11781         read_hi         = "  0   0   1   0      1   0   0   0",
11782                           "  0 a14 a13 a12    a11 a10  a9  a8",
11783                           " a7  a6  a5  a4     a3  a2  a1  a0",
11784                           "  o   o   o   o      o   o   o   o";
11785
11786         loadpage_lo     = "  0   1   0   0      0   0   0   0",
11787                           "  x   x   x   x      x   x   x   x",
11788                           "  x  a6  a5  a4     a3  a2  a1  a0",
11789                           "  i   i   i   i      i   i   i   i";
11790
11791         loadpage_hi     = "  0   1   0   0      1   0   0   0",
11792                           "  x   x   x   x      x   x   x   x",
11793                           "  x  a6  a5  a4     a3  a2  a1  a0",
11794                           "  i   i   i   i      i   i   i   i";
11795
11796         writepage       = "  0   1   0   0      1   1   0   0",
11797                           "  0 a14 a13 a12    a11 a10  a9  a8",
11798                           " a7   x   x   x      x   x   x   x",
11799                           "  x   x   x   x      x   x   x   x";
11800
11801         mode            = 0x41;
11802         delay           = 6;
11803         blocksize       = 256;
11804         readsize        = 256;
11805       ;
11806
11807     memory "lfuse"
11808         size            = 1;
11809         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11810                           "x x x x  x x x x  i i i i  i i i i";
11811
11812         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11813                           "x x x x  x x x x  o o o o  o o o o";
11814         min_write_delay = 9000;
11815         max_write_delay = 9000;
11816       ;
11817
11818     memory "hfuse"
11819         size            = 1;
11820         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11821                           "x x x x  x x x x  i i i i  i i i i";
11822
11823         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11824                           "x x x x  x x x x  o o o o  o o o o";
11825         min_write_delay = 9000;
11826         max_write_delay = 9000;
11827       ;
11828
11829     memory "efuse"
11830         size            = 1;
11831         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11832                           "x x x x  x x x x  x x x x  i i i i";
11833
11834         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11835                           "x x x x  x x x x  o o o o  o o o o";
11836         min_write_delay = 9000;
11837         max_write_delay = 9000;
11838       ;
11839
11840     memory "lock"
11841         size            = 1;
11842         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
11843                           "x x x x  x x x x   x x o o  o o o o";
11844
11845         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
11846                           "x x x x  x x x x   1 1 i i  i i i i";
11847         min_write_delay = 9000;
11848         max_write_delay = 9000;
11849       ;
11850
11851     memory "calibration"
11852         size            = 1;
11853         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
11854                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
11855       ;
11856
11857     memory "signature"
11858         size            = 3;
11859         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
11860                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11861       ;
11862   ;
11863
11864 #------------------------------------------------------------
11865 # AT90USB647
11866 #------------------------------------------------------------
11867 # identical to AT90USB646
11868
11869 part parent "usb646"
11870     id               = "usb647";
11871     desc             = "AT90USB647";
11872     signature        = 0x1e 0x96 0x82;
11873
11874     ocdrev              = 3;
11875   ;
11876
11877 #------------------------------------------------------------
11878 # AT90USB1286
11879 #------------------------------------------------------------
11880
11881 part
11882     id               = "usb1286";
11883     desc             = "AT90USB1286";
11884     signature        = 0x1e 0x97 0x82;
11885     usbpid           = 0x2ffb;
11886     has_jtag         = yes;
11887 #    stk500_devcode   = 0xB2;
11888 #    avr910_devcode   = 0x43;
11889     chip_erase_delay = 9000;
11890     pagel            = 0xD7;
11891     bs2              = 0xA0;
11892     reset            = dedicated;
11893     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11894                        "x x x x  x x x x    x x x x  x x x x";
11895
11896     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
11897                        "x x x x  x x x x    x x x x  x x x x";
11898
11899     timeout             = 200;
11900     stabdelay           = 100;
11901     cmdexedelay         = 25;
11902     synchloops          = 32;
11903     bytedelay           = 0;
11904     pollindex           = 3;
11905     pollvalue           = 0x53;
11906     predelay            = 1;
11907     postdelay           = 1;
11908     pollmethod          = 1;
11909
11910     pp_controlstack     =
11911         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
11912         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
11913         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
11914         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
11915     hventerstabdelay    = 100;
11916     progmodedelay       = 0;
11917     latchcycles         = 5;
11918     togglevtg           = 1;
11919     poweroffdelay       = 15;
11920     resetdelayms        = 1;
11921     resetdelayus        = 0;
11922     hvleavestabdelay    = 15;
11923     chiperasepulsewidth = 0;
11924     chiperasepolltimeout = 10;
11925     programfusepulsewidth = 0;
11926     programfusepolltimeout = 5;
11927     programlockpulsewidth = 0;
11928     programlockpolltimeout = 5;
11929
11930     idr                 = 0x31;
11931     spmcr               = 0x57;
11932     rampz               = 0x3b;
11933     allowfullpagebitstream = no;
11934
11935     ocdrev              = 3;
11936
11937     memory "eeprom"
11938         paged           = no; /* leave this "no" */
11939         page_size       = 8;  /* for parallel programming */
11940         size            = 4096;
11941         min_write_delay = 9000;
11942         max_write_delay = 9000;
11943         readback_p1     = 0x00;
11944         readback_p2     = 0x00;
11945         read            = "  1   0   1   0      0   0   0   0",
11946                           "  x   x   x   x    a11 a10  a9  a8",
11947                           " a7  a6  a5  a4     a3  a2  a1  a0",
11948                           "  o   o   o   o      o   o   o   o";
11949
11950         write           = "  1   1   0   0      0   0   0   0",
11951                           "  x   x   x   x    a11 a10  a9  a8",
11952                           " a7  a6  a5  a4     a3  a2  a1  a0", 
11953                           "  i   i   i   i      i   i   i   i";
11954
11955         loadpage_lo     = "  1   1   0   0      0   0   0   1",
11956                           "  0   0   0   0      0   0   0   0",
11957                           "  0   0   0   0      0  a2  a1  a0",
11958                           "  i   i   i   i      i   i   i   i";
11959
11960         writepage       = "  1   1   0   0      0   0   1   0",
11961                           "  0   0   x   x      x a10  a9  a8",
11962                           " a7  a6  a5  a4     a3   0   0   0",
11963                           "  x   x   x   x      x   x   x   x";
11964
11965         mode            = 0x41;
11966         delay           = 10;
11967         blocksize       = 8;
11968         readsize        = 256;
11969       ;
11970
11971     memory "flash"
11972         paged           = yes;
11973         size            = 131072;
11974         page_size       = 256;
11975         num_pages       = 512;
11976         min_write_delay = 4500;
11977         max_write_delay = 4500;
11978         readback_p1     = 0x00;
11979         readback_p2     = 0x00;
11980         read_lo         = "  0   0   1   0      0   0   0   0",
11981                           "a15 a14 a13 a12    a11 a10  a9  a8",
11982                           " a7  a6  a5  a4     a3  a2  a1  a0",
11983                           "  o   o   o   o      o   o   o   o";
11984
11985         read_hi         = "  0   0   1   0      1   0   0   0",
11986                           "a15 a14 a13 a12    a11 a10  a9  a8",
11987                           " a7  a6  a5  a4     a3  a2  a1  a0",
11988                           "  o   o   o   o      o   o   o   o";
11989
11990         loadpage_lo     = "  0   1   0   0      0   0   0   0",
11991                           "  x   x   x   x      x   x   x   x",
11992                           "  x  a6  a5  a4     a3  a2  a1  a0",
11993                           "  i   i   i   i      i   i   i   i";
11994
11995         loadpage_hi     = "  0   1   0   0      1   0   0   0",
11996                           "  x   x   x   x      x   x   x   x",
11997                           "  x  a6  a5  a4     a3  a2  a1  a0",
11998                           "  i   i   i   i      i   i   i   i";
11999
12000         writepage       = "  0   1   0   0      1   1   0   0",
12001                           "a15 a14 a13 a12    a11 a10  a9  a8",
12002                           " a7   x   x   x      x   x   x   x",
12003                           "  x   x   x   x      x   x   x   x";
12004
12005         mode            = 0x41;
12006         delay           = 6;
12007         blocksize       = 256;
12008         readsize        = 256;
12009       ;
12010
12011     memory "lfuse"
12012         size            = 1;
12013         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12014                           "x x x x  x x x x  i i i i  i i i i";
12015
12016         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12017                           "x x x x  x x x x  o o o o  o o o o";
12018         min_write_delay = 9000;
12019         max_write_delay = 9000;
12020       ;
12021
12022     memory "hfuse"
12023         size            = 1;
12024         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12025                           "x x x x  x x x x  i i i i  i i i i";
12026
12027         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12028                           "x x x x  x x x x  o o o o  o o o o";
12029         min_write_delay = 9000;
12030         max_write_delay = 9000;
12031       ;
12032
12033     memory "efuse"
12034         size            = 1;
12035         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12036                           "x x x x  x x x x  x x x x  i i i i";
12037
12038         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12039                           "x x x x  x x x x  o o o o  o o o o";
12040         min_write_delay = 9000;
12041         max_write_delay = 9000;
12042       ;
12043
12044     memory "lock"
12045         size            = 1;
12046         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12047                           "x x x x  x x x x   x x o o  o o o o";
12048
12049         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12050                           "x x x x  x x x x   1 1 i i  i i i i";
12051         min_write_delay = 9000;
12052         max_write_delay = 9000;
12053       ;
12054
12055     memory "calibration"
12056         size            = 1;
12057         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
12058                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
12059       ;
12060
12061     memory "signature"
12062         size            = 3;
12063         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
12064                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12065       ;
12066   ;
12067
12068 #------------------------------------------------------------
12069 # AT90USB1287
12070 #------------------------------------------------------------
12071 # identical to AT90USB1286
12072
12073 part parent "usb1286"
12074     id               = "usb1287";
12075     desc             = "AT90USB1287";
12076     signature        = 0x1e 0x97 0x82;
12077
12078     ocdrev              = 3;
12079   ;
12080
12081 #------------------------------------------------------------
12082 # AT90USB162
12083 #------------------------------------------------------------
12084
12085 part
12086     id               = "usb162";
12087     desc             = "AT90USB162";
12088     has_jtag         = no;
12089     has_debugwire    = yes;
12090     signature        = 0x1e 0x94 0x82;
12091     usbpid           = 0x2ffa;
12092     chip_erase_delay = 9000;
12093     reset            = io;
12094     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12095                        "x x x x  x x x x    x x x x  x x x x";
12096     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12097                        "x x x x  x x x x    x x x x  x x x x";
12098     pagel            = 0xD7;
12099     bs2              = 0xC6;
12100
12101     timeout             = 200;
12102     stabdelay           = 100;
12103     cmdexedelay         = 25;
12104     synchloops          = 32;
12105     bytedelay           = 0;
12106     pollindex           = 3;
12107     pollvalue           = 0x53;
12108     predelay            = 1;
12109     postdelay           = 1;
12110     pollmethod          = 1;
12111     pp_controlstack     =
12112         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12113         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12114         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12115         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
12116     hventerstabdelay    = 100;
12117     progmodedelay       = 0;
12118     latchcycles         = 5;
12119     togglevtg           = 1;
12120     poweroffdelay       = 15;
12121     resetdelayms        = 1;
12122     resetdelayus        = 0;
12123     hvleavestabdelay    = 15;
12124     chiperasepulsewidth = 0;
12125     chiperasepolltimeout = 10;
12126     programfusepulsewidth = 0;
12127     programfusepolltimeout = 5;
12128     programlockpulsewidth = 0;
12129     programlockpolltimeout = 5;
12130
12131     ocdrev              = 1;
12132
12133     memory "eeprom"
12134         paged           = no; /* leave this "no" */
12135         page_size       = 4;  /* for parallel programming */
12136         size            = 512;
12137         num_pages       = 128;
12138         min_write_delay = 9000;
12139         max_write_delay = 9000;
12140         readback_p1     = 0x00;
12141         readback_p2     = 0x00;
12142         read            = "  1   0   1   0      0   0   0   0",
12143                           "  0   0   0   0    a11 a10  a9  a8",
12144                           " a7  a6  a5  a4     a3  a2  a1  a0",
12145                           "  o   o   o   o      o   o   o   o";
12146
12147         write           = "  1   1   0   0      0   0   0   0",
12148                           "  0   0   0   0    a11 a10  a9  a8",
12149                           " a7  a6  a5  a4     a3  a2  a1  a0",
12150                           "  i   i   i   i      i   i   i   i";
12151
12152         loadpage_lo     = "  1   1   0   0      0   0   0   1",
12153                           "  0   0   0   0      0   0   0   0",
12154                           "  0   0   0   0      0   0  a1  a0",
12155                           "  i   i   i   i      i   i   i   i";
12156
12157         writepage       = "  1   1   0   0      0   0   1   0",
12158                           "  0   0   0   0    a11 a10  a9  a8",
12159                           " a7  a6  a5  a4     a3  a2   0   0",
12160                           "  x   x   x   x      x   x   x   x";
12161
12162         mode            = 0x41;
12163         delay           = 20;
12164         blocksize       = 4;
12165         readsize        = 256;
12166       ;
12167
12168     memory "flash"
12169         paged           = yes;
12170         size            = 16384;
12171         page_size       = 128;
12172         num_pages       = 128;
12173         min_write_delay = 4500;
12174         max_write_delay = 4500;
12175         readback_p1     = 0x00;
12176         readback_p2     = 0x00;
12177         read_lo         = "  0   0   1   0      0   0   0   0",
12178                           "a15 a14 a13 a12    a11 a10  a9  a8",
12179                           " a7  a6  a5  a4     a3  a2  a1  a0",
12180                           "  o   o   o   o      o   o   o   o";
12181
12182         read_hi         = "  0   0   1   0      1   0   0   0",
12183                           "a15 a14 a13 a12    a11 a10  a9  a8",
12184                           " a7  a6  a5  a4     a3  a2  a1  a0",
12185                           "  o   o   o   o      o   o   o   o";
12186
12187         loadpage_lo     = "  0   1   0   0      0   0   0   0",
12188                           "  x   x   x   x      x   x   x   x",
12189                           "  x   x  a5  a4     a3  a2  a1  a0",
12190                           "  i   i   i   i      i   i   i   i";
12191
12192         loadpage_hi     = "  0   1   0   0      1   0   0   0",
12193                           "  x   x   x   x      x   x   x   x",
12194                           "  x   x  a5  a4     a3  a2  a1  a0",
12195                           "  i   i   i   i      i   i   i   i";
12196
12197         writepage       = "  0   1   0   0      1   1   0   0",
12198                           "a15 a14 a13 a12    a11 a10  a9  a8",
12199                           " a7  a6   x   x      x   x   x   x",
12200                           "  x   x   x   x      x   x   x   x";
12201
12202         mode            = 0x41;
12203         delay           = 6;
12204         blocksize       = 128;
12205         readsize        = 256;
12206       ;
12207
12208     memory "lfuse"
12209         size            = 1;
12210         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12211                           "x x x x  x x x x  i i i i  i i i i";
12212
12213         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12214                           "x x x x  x x x x  o o o o  o o o o";
12215         min_write_delay = 9000;
12216         max_write_delay = 9000;
12217       ;
12218
12219     memory "hfuse"
12220         size            = 1;
12221         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12222                           "x x x x  x x x x  i i i i  i i i i";
12223
12224         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12225                           "x x x x  x x x x  o o o o  o o o o";
12226         min_write_delay = 9000;
12227         max_write_delay = 9000;
12228       ;
12229
12230     memory "efuse"
12231         size            = 1;
12232         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12233                           "x x x x  x x x x  i i i i  i i i i";
12234
12235         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12236                           "x x x x  x x x x  o o o o  o o o o";
12237         min_write_delay = 9000;
12238         max_write_delay = 9000;
12239       ;
12240
12241     memory "lock"
12242         size            = 1;
12243         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12244                           "x x x x  x x x x   x x o o  o o o o";
12245
12246         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12247                           "x x x x  x x x x   1 1 i i  i i i i";
12248         min_write_delay = 9000;
12249         max_write_delay = 9000;
12250       ;
12251
12252     memory "calibration"
12253         size            = 1;
12254         read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
12255                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
12256       ;
12257     memory "signature"
12258         size            = 3;
12259         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
12260                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12261       ;
12262   ;
12263
12264 #------------------------------------------------------------
12265 # AT90USB82
12266 #------------------------------------------------------------
12267 # Changes against AT90USB162 (beside IDs)
12268 #    memory "flash"
12269 #        size            = 8192;
12270 #        num_pages       = 64;
12271
12272 part
12273     id               = "usb82";
12274     desc             = "AT90USB82";
12275     has_jtag         = no;
12276     has_debugwire    = yes;
12277     signature        = 0x1e 0x93 0x82;
12278     usbpid           = 0x2ff7;
12279     chip_erase_delay = 9000;
12280     reset            = io;
12281     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12282                        "x x x x  x x x x    x x x x  x x x x";
12283     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12284                        "x x x x  x x x x    x x x x  x x x x";
12285     pagel            = 0xD7;
12286     bs2              = 0xC6;
12287
12288     timeout             = 200;
12289     stabdelay           = 100;
12290     cmdexedelay         = 25;
12291     synchloops          = 32;
12292     bytedelay           = 0;
12293     pollindex           = 3;
12294     pollvalue           = 0x53;
12295     predelay            = 1;
12296     postdelay           = 1;
12297     pollmethod          = 1;
12298     pp_controlstack     =
12299         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12300         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12301         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12302         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
12303     hventerstabdelay    = 100;
12304     progmodedelay       = 0;
12305     latchcycles         = 5;
12306     togglevtg           = 1;
12307     poweroffdelay       = 15;
12308     resetdelayms        = 1;
12309     resetdelayus        = 0;
12310     hvleavestabdelay    = 15;
12311     chiperasepulsewidth = 0;
12312     chiperasepolltimeout = 10;
12313     programfusepulsewidth = 0;
12314     programfusepolltimeout = 5;
12315     programlockpulsewidth = 0;
12316     programlockpolltimeout = 5;
12317
12318     ocdrev              = 1;
12319
12320     memory "eeprom"
12321         paged           = no; /* leave this "no" */
12322         page_size       = 4;  /* for parallel programming */
12323         size            = 512;
12324         num_pages       = 128;
12325         min_write_delay = 9000;
12326         max_write_delay = 9000;
12327         readback_p1     = 0x00;
12328         readback_p2     = 0x00;
12329         read            = "  1   0   1   0      0   0   0   0",
12330                           "  0   0   0   0    a11 a10  a9  a8",
12331                           " a7  a6  a5  a4     a3  a2  a1  a0",
12332                           "  o   o   o   o      o   o   o   o";
12333
12334         write           = "  1   1   0   0      0   0   0   0",
12335                           "  0   0   0   0    a11 a10  a9  a8",
12336                           " a7  a6  a5  a4     a3  a2  a1  a0",
12337                           "  i   i   i   i      i   i   i   i";
12338
12339         loadpage_lo     = "  1   1   0   0      0   0   0   1",
12340                           "  0   0   0   0      0   0   0   0",
12341                           "  0   0   0   0      0   0  a1  a0",
12342                           "  i   i   i   i      i   i   i   i";
12343
12344         writepage       = "  1   1   0   0      0   0   1   0",
12345                           "  0   0   0   0    a11 a10  a9  a8",
12346                           " a7  a6  a5  a4     a3  a2   0   0",
12347                           "  x   x   x   x      x   x   x   x";
12348
12349         mode            = 0x41;
12350         delay           = 20;
12351         blocksize       = 4;
12352         readsize        = 256;
12353       ;
12354
12355     memory "flash"
12356         paged           = yes;
12357         size            = 8192;
12358         page_size       = 128;
12359         num_pages       = 64;
12360         min_write_delay = 4500;
12361         max_write_delay = 4500;
12362         readback_p1     = 0x00;
12363         readback_p2     = 0x00;
12364         read_lo         = "  0   0   1   0      0   0   0   0",
12365                           "a15 a14 a13 a12    a11 a10  a9  a8",
12366                           " a7  a6  a5  a4     a3  a2  a1  a0",
12367                           "  o   o   o   o      o   o   o   o";
12368
12369         read_hi         = "  0   0   1   0      1   0   0   0",
12370                           "a15 a14 a13 a12    a11 a10  a9  a8",
12371                           " a7  a6  a5  a4     a3  a2  a1  a0",
12372                           "  o   o   o   o      o   o   o   o";
12373
12374         loadpage_lo     = "  0   1   0   0      0   0   0   0",
12375                           "  x   x   x   x      x   x   x   x",
12376                           "  x   x  a5  a4     a3  a2  a1  a0",
12377                           "  i   i   i   i      i   i   i   i";
12378
12379         loadpage_hi     = "  0   1   0   0      1   0   0   0",
12380                           "  x   x   x   x      x   x   x   x",
12381                           "  x   x  a5  a4     a3  a2  a1  a0",
12382                           "  i   i   i   i      i   i   i   i";
12383
12384         writepage       = "  0   1   0   0      1   1   0   0",
12385                           "a15 a14 a13 a12    a11 a10  a9  a8",
12386                           " a7  a6   x   x      x   x   x   x",
12387                           "  x   x   x   x      x   x   x   x";
12388
12389         mode            = 0x41;
12390         delay           = 6;
12391         blocksize       = 128;
12392         readsize        = 256;
12393       ;
12394
12395     memory "lfuse"
12396         size            = 1;
12397         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12398                           "x x x x  x x x x  i i i i  i i i i";
12399
12400         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12401                           "x x x x  x x x x  o o o o  o o o o";
12402         min_write_delay = 9000;
12403         max_write_delay = 9000;
12404       ;
12405
12406     memory "hfuse"
12407         size            = 1;
12408         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12409                           "x x x x  x x x x  i i i i  i i i i";
12410
12411         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12412                           "x x x x  x x x x  o o o o  o o o o";
12413         min_write_delay = 9000;
12414         max_write_delay = 9000;
12415       ;
12416
12417     memory "efuse"
12418         size            = 1;
12419         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12420                           "x x x x  x x x x  i i i i  i i i i";
12421
12422         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12423                           "x x x x  x x x x  o o o o  o o o o";
12424         min_write_delay = 9000;
12425         max_write_delay = 9000;
12426       ;
12427
12428     memory "lock"
12429         size            = 1;
12430         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12431                           "x x x x  x x x x   x x o o  o o o o";
12432
12433         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12434                           "x x x x  x x x x   1 1 i i  i i i i";
12435         min_write_delay = 9000;
12436         max_write_delay = 9000;
12437       ;
12438
12439     memory "calibration"
12440         size            = 1;
12441         read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
12442                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
12443       ;
12444     memory "signature"
12445         size            = 3;
12446         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
12447                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12448       ;
12449   ;
12450
12451 #------------------------------------------------------------
12452 # ATmega32U2
12453 #------------------------------------------------------------
12454 # Changes against AT90USB162 (beside IDs)
12455 #    memory "flash"
12456 #        size            = 32768;
12457 #        num_pages       = 256;
12458 #    memory "eeprom"
12459 #        size            = 1024;
12460 #        num_pages       = 256;
12461 part
12462     id               = "m32u2";
12463     desc             = "ATmega32U2";
12464     has_jtag         = no;
12465     has_debugwire    = yes;
12466     signature        = 0x1e 0x95 0x8a;
12467     usbpid           = 0x2ff0;
12468     chip_erase_delay = 9000;
12469     reset            = io;
12470     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12471                        "x x x x  x x x x    x x x x  x x x x";
12472     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12473                        "x x x x  x x x x    x x x x  x x x x";
12474     pagel            = 0xD7;
12475     bs2              = 0xC6;
12476
12477     timeout             = 200;
12478     stabdelay           = 100;
12479     cmdexedelay         = 25;
12480     synchloops          = 32;
12481     bytedelay           = 0;
12482     pollindex           = 3;
12483     pollvalue           = 0x53;
12484     predelay            = 1;
12485     postdelay           = 1;
12486     pollmethod          = 1;
12487     pp_controlstack     =
12488         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12489         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12490         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12491         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
12492     hventerstabdelay    = 100;
12493     progmodedelay       = 0;
12494     latchcycles         = 5;
12495     togglevtg           = 1;
12496     poweroffdelay       = 15;
12497     resetdelayms        = 1;
12498     resetdelayus        = 0;
12499     hvleavestabdelay    = 15;
12500     chiperasepulsewidth = 0;
12501     chiperasepolltimeout = 10;
12502     programfusepulsewidth = 0;
12503     programfusepolltimeout = 5;
12504     programlockpulsewidth = 0;
12505     programlockpolltimeout = 5;
12506
12507     ocdrev              = 1;
12508
12509     memory "eeprom"
12510         paged           = no; /* leave this "no" */
12511         page_size       = 4;  /* for parallel programming */
12512         size            = 1024;
12513         num_pages       = 256;
12514         min_write_delay = 9000;
12515         max_write_delay = 9000;
12516         readback_p1     = 0x00;
12517         readback_p2     = 0x00;
12518         read            = "  1   0   1   0      0   0   0   0",
12519                           "  0   0   0   0    a11 a10  a9  a8",
12520                           " a7  a6  a5  a4     a3  a2  a1  a0",
12521                           "  o   o   o   o      o   o   o   o";
12522
12523         write           = "  1   1   0   0      0   0   0   0",
12524                           "  0   0   0   0    a11 a10  a9  a8",
12525                           " a7  a6  a5  a4     a3  a2  a1  a0",
12526                           "  i   i   i   i      i   i   i   i";
12527
12528         loadpage_lo     = "  1   1   0   0      0   0   0   1",
12529                           "  0   0   0   0      0   0   0   0",
12530                           "  0   0   0   0      0   0  a1  a0",
12531                           "  i   i   i   i      i   i   i   i";
12532
12533         writepage       = "  1   1   0   0      0   0   1   0",
12534                           "  0   0   0   0    a11 a10  a9  a8",
12535                           " a7  a6  a5  a4     a3  a2   0   0",
12536                           "  x   x   x   x      x   x   x   x";
12537
12538         mode            = 0x41;
12539         delay           = 20;
12540         blocksize       = 4;
12541         readsize        = 256;
12542       ;
12543
12544     memory "flash"
12545         paged           = yes;
12546         size            = 32768;
12547         page_size       = 128;
12548         num_pages       = 256;
12549         min_write_delay = 4500;
12550         max_write_delay = 4500;
12551         readback_p1     = 0x00;
12552         readback_p2     = 0x00;
12553         read_lo         = "  0   0   1   0      0   0   0   0",
12554                           "a15 a14 a13 a12    a11 a10  a9  a8",
12555                           " a7  a6  a5  a4     a3  a2  a1  a0",
12556                           "  o   o   o   o      o   o   o   o";
12557
12558         read_hi         = "  0   0   1   0      1   0   0   0",
12559                           "a15 a14 a13 a12    a11 a10  a9  a8",
12560                           " a7  a6  a5  a4     a3  a2  a1  a0",
12561                           "  o   o   o   o      o   o   o   o";
12562
12563         loadpage_lo     = "  0   1   0   0      0   0   0   0",
12564                           "  x   x   x   x      x   x   x   x",
12565                           "  x   x  a5  a4     a3  a2  a1  a0",
12566                           "  i   i   i   i      i   i   i   i";
12567
12568         loadpage_hi     = "  0   1   0   0      1   0   0   0",
12569                           "  x   x   x   x      x   x   x   x",
12570                           "  x   x  a5  a4     a3  a2  a1  a0",
12571                           "  i   i   i   i      i   i   i   i";
12572
12573         writepage       = "  0   1   0   0      1   1   0   0",
12574                           "a15 a14 a13 a12    a11 a10  a9  a8",
12575                           " a7  a6   x   x      x   x   x   x",
12576                           "  x   x   x   x      x   x   x   x";
12577
12578         mode            = 0x41;
12579         delay           = 6;
12580         blocksize       = 128;
12581         readsize        = 256;
12582       ;
12583
12584     memory "lfuse"
12585         size            = 1;
12586         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12587                           "x x x x  x x x x  i i i i  i i i i";
12588
12589         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12590                           "x x x x  x x x x  o o o o  o o o o";
12591         min_write_delay = 9000;
12592         max_write_delay = 9000;
12593       ;
12594
12595     memory "hfuse"
12596         size            = 1;
12597         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12598                           "x x x x  x x x x  i i i i  i i i i";
12599
12600         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12601                           "x x x x  x x x x  o o o o  o o o o";
12602         min_write_delay = 9000;
12603         max_write_delay = 9000;
12604       ;
12605
12606     memory "efuse"
12607         size            = 1;
12608         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12609                           "x x x x  x x x x  i i i i  i i i i";
12610
12611         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12612                           "x x x x  x x x x  o o o o  o o o o";
12613         min_write_delay = 9000;
12614         max_write_delay = 9000;
12615       ;
12616
12617     memory "lock"
12618         size            = 1;
12619         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12620                           "x x x x  x x x x   x x o o  o o o o";
12621
12622         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12623                           "x x x x  x x x x   1 1 i i  i i i i";
12624         min_write_delay = 9000;
12625         max_write_delay = 9000;
12626       ;
12627
12628     memory "calibration"
12629         size            = 1;
12630         read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
12631                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
12632       ;
12633     memory "signature"
12634         size            = 3;
12635         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
12636                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12637       ;
12638   ;
12639 #------------------------------------------------------------
12640 # ATmega16U2
12641 #------------------------------------------------------------
12642 # Changes against ATmega32U2 (beside IDs)
12643 #    memory "flash"
12644 #        size            = 16384;
12645 #        num_pages       = 128;
12646 #    memory "eeprom"
12647 #        size            = 512;
12648 #        num_pages       = 128;
12649 part
12650     id               = "m16u2";
12651     desc             = "ATmega16U2";
12652     has_jtag         = no;
12653     has_debugwire    = yes;
12654     signature        = 0x1e 0x94 0x89;
12655     usbpid           = 0x2fef;
12656     chip_erase_delay = 9000;
12657     reset            = io;
12658     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12659                        "x x x x  x x x x    x x x x  x x x x";
12660     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12661                        "x x x x  x x x x    x x x x  x x x x";
12662     pagel            = 0xD7;
12663     bs2              = 0xC6;
12664
12665     timeout             = 200;
12666     stabdelay           = 100;
12667     cmdexedelay         = 25;
12668     synchloops          = 32;
12669     bytedelay           = 0;
12670     pollindex           = 3;
12671     pollvalue           = 0x53;
12672     predelay            = 1;
12673     postdelay           = 1;
12674     pollmethod          = 1;
12675     pp_controlstack     =
12676         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12677         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12678         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12679         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
12680     hventerstabdelay    = 100;
12681     progmodedelay       = 0;
12682     latchcycles         = 5;
12683     togglevtg           = 1;
12684     poweroffdelay       = 15;
12685     resetdelayms        = 1;
12686     resetdelayus        = 0;
12687     hvleavestabdelay    = 15;
12688     chiperasepulsewidth = 0;
12689     chiperasepolltimeout = 10;
12690     programfusepulsewidth = 0;
12691     programfusepolltimeout = 5;
12692     programlockpulsewidth = 0;
12693     programlockpolltimeout = 5;
12694
12695     ocdrev              = 1;
12696
12697     memory "eeprom"
12698         paged           = no; /* leave this "no" */
12699         page_size       = 4;  /* for parallel programming */
12700         size            = 512;
12701         num_pages       = 128;
12702         min_write_delay = 9000;
12703         max_write_delay = 9000;
12704         readback_p1     = 0x00;
12705         readback_p2     = 0x00;
12706         read            = "  1   0   1   0      0   0   0   0",
12707                           "  0   0   0   0    a11 a10  a9  a8",
12708                           " a7  a6  a5  a4     a3  a2  a1  a0",
12709                           "  o   o   o   o      o   o   o   o";
12710
12711         write           = "  1   1   0   0      0   0   0   0",
12712                           "  0   0   0   0    a11 a10  a9  a8",
12713                           " a7  a6  a5  a4     a3  a2  a1  a0",
12714                           "  i   i   i   i      i   i   i   i";
12715
12716         loadpage_lo     = "  1   1   0   0      0   0   0   1",
12717                           "  0   0   0   0      0   0   0   0",
12718                           "  0   0   0   0      0   0  a1  a0",
12719                           "  i   i   i   i      i   i   i   i";
12720
12721         writepage       = "  1   1   0   0      0   0   1   0",
12722                           "  0   0   0   0    a11 a10  a9  a8",
12723                           " a7  a6  a5  a4     a3  a2   0   0",
12724                           "  x   x   x   x      x   x   x   x";
12725
12726         mode            = 0x41;
12727         delay           = 20;
12728         blocksize       = 4;
12729         readsize        = 256;
12730       ;
12731
12732     memory "flash"
12733         paged           = yes;
12734         size            = 16384;
12735         page_size       = 128;
12736         num_pages       = 128;
12737         min_write_delay = 4500;
12738         max_write_delay = 4500;
12739         readback_p1     = 0x00;
12740         readback_p2     = 0x00;
12741         read_lo         = "  0   0   1   0      0   0   0   0",
12742                           "a15 a14 a13 a12    a11 a10  a9  a8",
12743                           " a7  a6  a5  a4     a3  a2  a1  a0",
12744                           "  o   o   o   o      o   o   o   o";
12745
12746         read_hi         = "  0   0   1   0      1   0   0   0",
12747                           "a15 a14 a13 a12    a11 a10  a9  a8",
12748                           " a7  a6  a5  a4     a3  a2  a1  a0",
12749                           "  o   o   o   o      o   o   o   o";
12750
12751         loadpage_lo     = "  0   1   0   0      0   0   0   0",
12752                           "  x   x   x   x      x   x   x   x",
12753                           "  x   x  a5  a4     a3  a2  a1  a0",
12754                           "  i   i   i   i      i   i   i   i";
12755
12756         loadpage_hi     = "  0   1   0   0      1   0   0   0",
12757                           "  x   x   x   x      x   x   x   x",
12758                           "  x   x  a5  a4     a3  a2  a1  a0",
12759                           "  i   i   i   i      i   i   i   i";
12760
12761         writepage       = "  0   1   0   0      1   1   0   0",
12762                           "a15 a14 a13 a12    a11 a10  a9  a8",
12763                           " a7  a6   x   x      x   x   x   x",
12764                           "  x   x   x   x      x   x   x   x";
12765
12766         mode            = 0x41;
12767         delay           = 6;
12768         blocksize       = 128;
12769         readsize        = 256;
12770       ;
12771
12772     memory "lfuse"
12773         size            = 1;
12774         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12775                           "x x x x  x x x x  i i i i  i i i i";
12776
12777         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12778                           "x x x x  x x x x  o o o o  o o o o";
12779         min_write_delay = 9000;
12780         max_write_delay = 9000;
12781       ;
12782
12783     memory "hfuse"
12784         size            = 1;
12785         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12786                           "x x x x  x x x x  i i i i  i i i i";
12787
12788         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12789                           "x x x x  x x x x  o o o o  o o o o";
12790         min_write_delay = 9000;
12791         max_write_delay = 9000;
12792       ;
12793
12794     memory "efuse"
12795         size            = 1;
12796         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12797                           "x x x x  x x x x  i i i i  i i i i";
12798
12799         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12800                           "x x x x  x x x x  o o o o  o o o o";
12801         min_write_delay = 9000;
12802         max_write_delay = 9000;
12803       ;
12804
12805     memory "lock"
12806         size            = 1;
12807         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12808                           "x x x x  x x x x   x x o o  o o o o";
12809
12810         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12811                           "x x x x  x x x x   1 1 i i  i i i i";
12812         min_write_delay = 9000;
12813         max_write_delay = 9000;
12814       ;
12815
12816     memory "calibration"
12817         size            = 1;
12818         read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
12819                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
12820       ;
12821     memory "signature"
12822         size            = 3;
12823         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
12824                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12825       ;
12826   ;
12827
12828 #------------------------------------------------------------
12829 # ATmega8U2
12830 #------------------------------------------------------------
12831 # Changes against ATmega16U2 (beside IDs)
12832 #    memory "flash"
12833 #        size            = 8192;
12834 #        page_size       = 64;
12835 #        blocksize       = 64;
12836
12837 part
12838     id               = "m8u2";
12839     desc             = "ATmega8U2";
12840     has_jtag         = no;
12841     has_debugwire    = yes;
12842     signature        = 0x1e 0x93 0x89;
12843     usbpid           = 0x2fee;
12844     chip_erase_delay = 9000;
12845     reset            = io;
12846     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12847                        "x x x x  x x x x    x x x x  x x x x";
12848     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12849                        "x x x x  x x x x    x x x x  x x x x";
12850     pagel            = 0xD7;
12851     bs2              = 0xC6;
12852
12853     timeout             = 200;
12854     stabdelay           = 100;
12855     cmdexedelay         = 25;
12856     synchloops          = 32;
12857     bytedelay           = 0;
12858     pollindex           = 3;
12859     pollvalue           = 0x53;
12860     predelay            = 1;
12861     postdelay           = 1;
12862     pollmethod          = 1;
12863     pp_controlstack     =
12864         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12865         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12866         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12867         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
12868     hventerstabdelay    = 100;
12869     progmodedelay       = 0;
12870     latchcycles         = 5;
12871     togglevtg           = 1;
12872     poweroffdelay       = 15;
12873     resetdelayms        = 1;
12874     resetdelayus        = 0;
12875     hvleavestabdelay    = 15;
12876     chiperasepulsewidth = 0;
12877     chiperasepolltimeout = 10;
12878     programfusepulsewidth = 0;
12879     programfusepolltimeout = 5;
12880     programlockpulsewidth = 0;
12881     programlockpolltimeout = 5;
12882
12883     ocdrev              = 1;
12884
12885     memory "eeprom"
12886         paged           = no; /* leave this "no" */
12887         page_size       = 4;  /* for parallel programming */
12888         size            = 512;
12889         num_pages       = 128;
12890         min_write_delay = 9000;
12891         max_write_delay = 9000;
12892         readback_p1     = 0x00;
12893         readback_p2     = 0x00;
12894         read            = "  1   0   1   0      0   0   0   0",
12895                           "  0   0   0   0    a11 a10  a9  a8",
12896                           " a7  a6  a5  a4     a3  a2  a1  a0",
12897                           "  o   o   o   o      o   o   o   o";
12898
12899         write           = "  1   1   0   0      0   0   0   0",
12900                           "  0   0   0   0    a11 a10  a9  a8",
12901                           " a7  a6  a5  a4     a3  a2  a1  a0",
12902                           "  i   i   i   i      i   i   i   i";
12903
12904         loadpage_lo     = "  1   1   0   0      0   0   0   1",
12905                           "  0   0   0   0      0   0   0   0",
12906                           "  0   0   0   0      0   0  a1  a0",
12907                           "  i   i   i   i      i   i   i   i";
12908
12909         writepage       = "  1   1   0   0      0   0   1   0",
12910                           "  0   0   0   0    a11 a10  a9  a8",
12911                           " a7  a6  a5  a4     a3  a2   0   0",
12912                           "  x   x   x   x      x   x   x   x";
12913
12914         mode            = 0x41;
12915         delay           = 20;
12916         blocksize       = 4;
12917         readsize        = 256;
12918       ;
12919
12920     memory "flash"
12921         paged           = yes;
12922         size            = 8192;
12923         page_size       = 128;
12924         num_pages       = 64;
12925         min_write_delay = 4500;
12926         max_write_delay = 4500;
12927         readback_p1     = 0x00;
12928         readback_p2     = 0x00;
12929         read_lo         = "  0   0   1   0      0   0   0   0",
12930                           "a15 a14 a13 a12    a11 a10  a9  a8",
12931                           " a7  a6  a5  a4     a3  a2  a1  a0",
12932                           "  o   o   o   o      o   o   o   o";
12933
12934         read_hi         = "  0   0   1   0      1   0   0   0",
12935                           "a15 a14 a13 a12    a11 a10  a9  a8",
12936                           " a7  a6  a5  a4     a3  a2  a1  a0",
12937                           "  o   o   o   o      o   o   o   o";
12938
12939         loadpage_lo     = "  0   1   0   0      0   0   0   0",
12940                           "  x   x   x   x      x   x   x   x",
12941                           "  x   x  a5  a4     a3  a2  a1  a0",
12942                           "  i   i   i   i      i   i   i   i";
12943
12944         loadpage_hi     = "  0   1   0   0      1   0   0   0",
12945                           "  x   x   x   x      x   x   x   x",
12946                           "  x   x  a5  a4     a3  a2  a1  a0",
12947                           "  i   i   i   i      i   i   i   i";
12948
12949         writepage       = "  0   1   0   0      1   1   0   0",
12950                           "a15 a14 a13 a12    a11 a10  a9  a8",
12951                           " a7  a6   x   x      x   x   x   x",
12952                           "  x   x   x   x      x   x   x   x";
12953
12954         mode            = 0x41;
12955         delay           = 6;
12956         blocksize       = 128;
12957         readsize        = 256;
12958       ;
12959
12960     memory "lfuse"
12961         size            = 1;
12962         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12963                           "x x x x  x x x x  i i i i  i i i i";
12964
12965         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12966                           "x x x x  x x x x  o o o o  o o o o";
12967         min_write_delay = 9000;
12968         max_write_delay = 9000;
12969       ;
12970
12971     memory "hfuse"
12972         size            = 1;
12973         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12974                           "x x x x  x x x x  i i i i  i i i i";
12975
12976         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12977                           "x x x x  x x x x  o o o o  o o o o";
12978         min_write_delay = 9000;
12979         max_write_delay = 9000;
12980       ;
12981
12982     memory "efuse"
12983         size            = 1;
12984         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12985                           "x x x x  x x x x  i i i i  i i i i";
12986
12987         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12988                           "x x x x  x x x x  o o o o  o o o o";
12989         min_write_delay = 9000;
12990         max_write_delay = 9000;
12991       ;
12992
12993     memory "lock"
12994         size            = 1;
12995         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12996                           "x x x x  x x x x   x x o o  o o o o";
12997
12998         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12999                           "x x x x  x x x x   1 1 i i  i i i i";
13000         min_write_delay = 9000;
13001         max_write_delay = 9000;
13002       ;
13003
13004     memory "calibration"
13005         size            = 1;
13006         read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
13007                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
13008       ;
13009     memory "signature"
13010         size            = 3;
13011         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
13012                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
13013       ;
13014   ;
13015 #------------------------------------------------------------
13016 # ATmega325
13017 #------------------------------------------------------------
13018
13019 part
13020     id               = "m325";
13021     desc             = "ATmega325";
13022     signature        = 0x1e 0x95 0x05;
13023     has_jtag         = yes;
13024 #   stk500_devcode   = 0x??; # No STK500v1 support?
13025 #   avr910_devcode   = 0x??; # Try the ATmega16 one
13026     avr910_devcode   = 0x74;
13027     pagel            = 0xd7;
13028     bs2              = 0xa0;
13029     chip_erase_delay = 9000;
13030     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
13031                        "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
13032
13033     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
13034                        "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
13035
13036     timeout             = 200;
13037     stabdelay           = 100;
13038     cmdexedelay         = 25;
13039     synchloops          = 32;
13040     bytedelay           = 0;
13041     pollindex           = 3;
13042     pollvalue           = 0x53;
13043     predelay            = 1;
13044     postdelay           = 1;
13045     pollmethod          = 1;
13046
13047     pp_controlstack     =
13048         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
13049         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
13050         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
13051         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
13052     hventerstabdelay    = 100;
13053     progmodedelay       = 0;
13054     latchcycles         = 5;
13055     togglevtg           = 1;
13056     poweroffdelay       = 15;
13057     resetdelayms        = 1;
13058     resetdelayus        = 0;
13059     hvleavestabdelay    = 15;
13060     chiperasepulsewidth = 0;
13061     chiperasepolltimeout = 10;
13062     programfusepulsewidth = 0;
13063     programfusepolltimeout = 5;
13064     programlockpulsewidth = 0;
13065     programlockpolltimeout = 5;
13066
13067     idr                 = 0x31;
13068     spmcr               = 0x57;
13069     allowfullpagebitstream = no;
13070
13071     ocdrev              = 3;
13072
13073     memory "eeprom"
13074         paged           = no; /* leave this "no" */
13075         page_size       = 4;  /* for parallel programming */
13076         size            = 1024;
13077         min_write_delay = 9000;
13078         max_write_delay = 9000;
13079         readback_p1     = 0xff;
13080         readback_p2     = 0xff;
13081         read            = "  1   0   1   0      0   0   0   0",
13082                           "  0   0   0   0      0   0  a9  a8",
13083                           " a7  a6  a5  a4     a3  a2  a1  a0",
13084                           "  o   o   o   o      o   o   o   o";
13085
13086         write           = "  1   1   0   0      0   0   0   0",
13087                           "  0   0   0   0      0   0  a9  a8",
13088                           " a7  a6  a5  a4     a3  a2  a1  a0",
13089                           "  i   i   i   i      i   i   i   i";
13090
13091         loadpage_lo     = "  1   1   0   0      0   0   0   1",
13092                           "  0   0   0   0      0   0   0   0",
13093                           "  0   0   0   0      0   0  a1  a0",
13094                           "  i   i   i   i      i   i   i   i";
13095
13096         writepage       = "  1   1   0   0      0   0   1   0",
13097                           "  0   0   0   0      0   0  a9  a8",
13098                           " a7  a6  a5  a4     a3  a2   0   0",
13099                           "  x   x   x   x      x   x   x   x";
13100
13101         mode            = 0x41;
13102         delay           = 10;
13103         blocksize       = 4;
13104         readsize        = 256;
13105       ;
13106
13107     memory "flash"
13108         paged           = yes;
13109         size            = 32768;
13110         page_size       = 128;
13111         num_pages       = 256;
13112         min_write_delay = 4500;
13113         max_write_delay = 4500;
13114         readback_p1     = 0xff;
13115         readback_p2     = 0xff;
13116         read_lo         = "  0   0   1   0      0   0   0   0",
13117                           "  0 a14 a13 a12    a11 a10  a9  a8",
13118                           " a7  a6  a5  a4     a3  a2  a1  a0",
13119                           "  o   o   o   o      o   o   o   o";
13120
13121         read_hi         = "  0   0   1   0      1   0   0   0",
13122                           "  0 a14 a13 a12    a11 a10  a9  a8",
13123                           " a7  a6  a5  a4     a3  a2  a1  a0",
13124                           "  o   o   o   o      o   o   o   o";
13125
13126         loadpage_lo     = "  0   1   0   0      0   0   0   0",
13127                           "  0   0   0   0      0   0   0   0",
13128                           " a7  a6  a5  a4     a3  a2  a1  a0",
13129                           "  i   i   i   i      i   i   i   i";
13130
13131         loadpage_hi     = "  0   1   0   0      1   0   0   0",
13132                           "  0   0   0   0      0   0   0   0",
13133                           " a7  a6  a5  a4     a3  a2  a1  a0",
13134                           "  i   i   i   i      i   i   i   i";
13135
13136         writepage       = "  0   1   0   0      1   1   0   0",
13137                           "  0 a14 a13 a12    a11 a10  a9  a8",
13138                           " a7  a6  a5  a4     a3  a2  a1  a0",
13139                           "  x   x   x   x      x   x   x   x";
13140
13141         mode            = 0x41;
13142         delay           = 10;
13143         blocksize       = 128;
13144         readsize        = 256;
13145       ;
13146
13147     memory "lock"
13148         size            = 1;
13149         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
13150                           "x x x x  x x x x   x x o o  o o o o";
13151
13152         write           = "1 0 1 0  1 1 0 0   1 1 1 0  0 0 0 0",
13153                           "0 0 0 0  0 0 0 0   1 1 i i  i i i i";
13154         min_write_delay = 9000;
13155         max_write_delay = 9000;
13156       ;
13157
13158     memory "lfuse"
13159         size            = 1;
13160         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
13161                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
13162
13163         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
13164                           "0 0 0 0  0 0 0 0   i i i i  i i i i";
13165         min_write_delay = 9000;
13166         max_write_delay = 9000;
13167       ;
13168
13169     memory "hfuse"
13170         size            = 1;
13171         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
13172                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
13173
13174         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
13175                           "0 0 0 0  0 0 0 0   i i i i  i i i i";
13176         min_write_delay = 9000;
13177         max_write_delay = 9000;
13178       ;
13179
13180     memory "efuse"
13181         size            = 1;
13182
13183         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
13184                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
13185
13186         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
13187                           "0 0 0 0  0 0 0 0  1 1 1 1  1 i i i";
13188         min_write_delay = 9000;
13189         max_write_delay = 9000;
13190       ;
13191
13192     memory "signature"
13193         size            = 3;
13194         read            = "0  0  1  1   0  0  0  0   0  0  0  0   0  0  0  0",
13195                           "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
13196       ;
13197
13198     memory "calibration"
13199         size            = 1;
13200
13201         read            = "0 0 1 1  1 0 0 0   0 0 0 0  0 0 0 0",
13202                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
13203         ;
13204   ;
13205
13206 #------------------------------------------------------------
13207 # ATmega645
13208 #------------------------------------------------------------
13209
13210 part
13211     id               = "m645";
13212     desc             = "ATmega645";
13213     signature        = 0x1E 0x96 0x05;
13214     has_jtag         = yes;
13215 #   stk500_devcode   = 0x??; # No STK500v1 support?
13216 #   avr910_devcode   = 0x??; # Try the ATmega16 one
13217     avr910_devcode   = 0x74;
13218     pagel            = 0xd7;
13219     bs2              = 0xa0;
13220     chip_erase_delay = 9000;
13221     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
13222                        "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
13223
13224     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
13225                        "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
13226
13227     timeout             = 200;
13228     stabdelay           = 100;
13229     cmdexedelay         = 25;
13230     synchloops          = 32;
13231     bytedelay           = 0;
13232     pollindex           = 3;
13233     pollvalue           = 0x53;
13234     predelay            = 1;
13235     postdelay           = 1;
13236     pollmethod          = 1;
13237
13238     pp_controlstack     =
13239         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
13240         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
13241         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
13242         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
13243     hventerstabdelay    = 100;
13244     progmodedelay       = 0;
13245     latchcycles         = 5;
13246     togglevtg           = 1;
13247     poweroffdelay       = 15;
13248     resetdelayms        = 1;
13249     resetdelayus        = 0;
13250     hvleavestabdelay    = 15;
13251     chiperasepulsewidth = 0;
13252     chiperasepolltimeout = 10;
13253     programfusepulsewidth = 0;
13254     programfusepolltimeout = 5;
13255     programlockpulsewidth = 0;
13256     programlockpolltimeout = 5;
13257
13258     idr                 = 0x31;
13259     spmcr               = 0x57;
13260     allowfullpagebitstream = no;
13261
13262     ocdrev              = 3;
13263
13264     memory "eeprom"
13265         paged           = no; /* leave this "no" */
13266         page_size       = 8;  /* for parallel programming */
13267         size            = 2048;
13268         min_write_delay = 9000;
13269         max_write_delay = 9000;
13270         readback_p1     = 0xff;
13271         readback_p2     = 0xff;
13272         read            = "  1   0   1   0      0   0   0   0",
13273                           "  0   0   0   0      0 a10  a9  a8",
13274                           " a7  a6  a5  a4     a3  a2  a1  a0",
13275                           "  o   o   o   o      o   o   o   o";
13276
13277         write           = "  1   1   0   0      0   0   0   0",
13278                           "  0   0   0   0      0 a10  a9  a8",
13279                           " a7  a6  a5  a4     a3  a2  a1  a0",
13280                           "  i   i   i   i      i   i   i   i";
13281
13282         loadpage_lo     = "  1   1   0   0      0   0   0   1",
13283                           "  0   0   0   0      0   0   0   0",
13284                           "  0   0   0   0      0  a2  a1  a0",
13285                           "  i   i   i   i      i   i   i   i";
13286
13287         writepage       = "  1   1   0   0      0   0   1   0",
13288                           "  0   0   0   0      0 a10  a9  a8",
13289                           " a7  a6  a5  a4     a3   0   0   0",
13290                           "  x   x   x   x      x   x   x   x";
13291
13292         mode            = 0x41;
13293         delay           = 10;
13294         blocksize       = 8;
13295         readsize        = 256;
13296       ;
13297
13298     memory "flash"
13299         paged           = yes;
13300         size            = 65536;
13301         page_size       = 256;
13302         num_pages       = 256;
13303         min_write_delay = 4500;
13304         max_write_delay = 4500;
13305         readback_p1     = 0xff;
13306         readback_p2     = 0xff;
13307         read_lo         = "   0   0   1   0      0   0   0   0",
13308                           " a15 a14 a13 a12    a11 a10  a9  a8",
13309                           "  a7  a6  a5  a4     a3  a2  a1  a0",
13310                           "   o   o   o   o      o   o   o   o";
13311
13312         read_hi         = "   0   0   1   0      1   0   0   0",
13313                           " a15 a14 a13 a12    a11 a10  a9  a8",
13314                           "  a7  a6  a5  a4     a3  a2  a1  a0",
13315                           "   o   o   o   o      o   o   o   o";
13316
13317         loadpage_lo     = "  0   1   0   0      0   0   0   0",
13318                           "  0   0   0   0      0   0   0   0",
13319                           "  a7 a6  a5  a4     a3  a2  a1  a0",
13320                           "  i   i   i   i      i   i   i   i";
13321
13322         loadpage_hi     = "  0   1   0   0      1   0   0   0",
13323                           "  0   0   0   0      0   0   0   0",
13324                           "  a7 a6  a5  a4     a3  a2  a1  a0",
13325                           "  i   i   i   i      i   i   i   i";
13326
13327         writepage       = "   0   1   0   0      1   1   0   0",
13328                           " a15 a14 a13 a12    a11 a10  a9  a8",
13329                           "  a7  a6  a5  a4     a3  a2  a1  a0",
13330                           "   0   0   0   0      0   0   0   0";
13331
13332         mode            = 0x41;
13333         delay           = 10;
13334         blocksize       = 128;
13335         readsize        = 256;
13336       ;
13337
13338     memory "lock"
13339         size            = 1;
13340         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
13341                           "x x x x  x x x x   x x o o  o o o o";
13342
13343         write           = "1 0 1 0  1 1 0 0   1 1 1 0  0 0 0 0",
13344                           "0 0 0 0  0 0 0 0   1 1 i i  i i i i";
13345         min_write_delay = 9000;
13346         max_write_delay = 9000;
13347       ;
13348
13349     memory "lfuse"
13350         size            = 1;
13351         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
13352                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
13353
13354         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
13355                           "0 0 0 0  0 0 0 0   i i i i  i i i i";
13356         min_write_delay = 9000;
13357         max_write_delay = 9000;
13358       ;
13359
13360     memory "hfuse"
13361         size            = 1;
13362         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
13363                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
13364
13365         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
13366                           "0 0 0 0  0 0 0 0   i i i i  i i i i";
13367         min_write_delay = 9000;
13368         max_write_delay = 9000;
13369       ;
13370
13371     memory "efuse"
13372         size            = 1;
13373
13374         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
13375                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
13376
13377         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
13378                           "0 0 0 0  0 0 0 0  1 1 1 1  1 i i i";
13379         min_write_delay = 9000;
13380         max_write_delay = 9000;
13381       ;
13382
13383     memory "signature"
13384         size            = 3;
13385         read            = "0  0  1  1   0  0  0  0   0  0  0  0   0  0  0  0",
13386                           "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
13387       ;
13388
13389     memory "calibration"
13390         size            = 1;
13391
13392         read            = "0 0 1 1  1 0 0 0   0 0 0 0  0 0 0 0",
13393                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
13394         ;
13395   ;
13396
13397 #------------------------------------------------------------
13398 # ATmega3250
13399 #------------------------------------------------------------
13400
13401 part parent "m325"
13402     id               = "m3250";
13403     desc             = "ATmega3250";
13404     signature        = 0x1E 0x95 0x06;
13405
13406     ocdrev              = 3;
13407   ;
13408
13409 #------------------------------------------------------------
13410 # ATmega6450
13411 #------------------------------------------------------------
13412
13413 part parent "m645"
13414     id               = "m6450";
13415     desc             = "ATmega6450";
13416     signature        = 0x1E 0x96 0x06;
13417
13418     ocdrev              = 3;
13419   ;
13420
13421 #------------------------------------------------------------
13422 # AVR XMEGA family common values
13423 #------------------------------------------------------------
13424
13425 part
13426     id          = ".xmega";
13427     desc        = "AVR XMEGA family common values";
13428     has_pdi     = yes;
13429     nvm_base    = 0x01c0;
13430     mcu_base    = 0x0090;
13431
13432     memory "signature"
13433         size            = 3;
13434         offset          = 0x1000090;
13435     ;
13436
13437     memory "prodsig"
13438         size            = 0x32;
13439         offset          = 0x8e0200;
13440         page_size       = 0x32;
13441         readsize        = 0x32;
13442     ;
13443
13444     memory "fuse1"
13445         size            = 1;
13446         offset          = 0x8f0021;
13447     ;
13448
13449     memory "fuse2"
13450         size            = 1;
13451         offset          = 0x8f0022;
13452     ;
13453
13454     memory "fuse4"
13455         size            = 1;
13456         offset          = 0x8f0024;
13457     ;
13458
13459     memory "fuse5"
13460         size            = 1;
13461         offset          = 0x8f0025;
13462     ;
13463
13464     memory "lock"
13465         size            = 1;
13466         offset          = 0x8f0027;
13467     ;
13468
13469     memory "data"
13470         # SRAM, only used to supply the offset
13471         offset          = 0x1000000;
13472     ;
13473 ;
13474
13475 #------------------------------------------------------------
13476 # ATxmega16A4U
13477 #------------------------------------------------------------
13478
13479 part parent ".xmega"
13480     id          = "x16a4u";
13481     desc        = "ATxmega16A4U";
13482     signature   = 0x1e 0x94 0x41;
13483     usbpid      = 0x2fe3;
13484
13485     memory "eeprom"
13486         size            = 0x400;
13487         offset          = 0x8c0000;
13488         page_size       = 0x20;
13489         readsize        = 0x100;
13490     ;
13491
13492     memory "application"
13493         size            = 0x4000;
13494         offset          = 0x800000;
13495         page_size       = 0x100;
13496         readsize        = 0x100;
13497     ;
13498
13499     memory "apptable"
13500         size            = 0x1000;
13501         offset          = 0x803000;
13502         page_size       = 0x100;
13503         readsize        = 0x100;
13504     ;
13505
13506     memory "boot"
13507         size            = 0x1000;
13508         offset          = 0x804000;
13509         page_size       = 0x100;
13510         readsize        = 0x100;
13511     ;
13512
13513     memory "flash"
13514         size            = 0x5000;
13515         offset          = 0x800000;
13516         page_size       = 0x100;
13517         readsize        = 0x100;
13518     ;
13519
13520     memory "usersig"
13521         size            = 0x100;
13522         offset          = 0x8e0400;
13523         page_size       = 0x100;
13524         readsize        = 0x100;
13525     ;
13526 ;
13527
13528 #------------------------------------------------------------
13529 # ATxmega16C4
13530 #------------------------------------------------------------
13531
13532 part parent "x16a4u"
13533     id          = "x16c4";
13534     desc        = "ATxmega16C4";
13535     signature   = 0x1e 0x95 0x44;
13536 ;
13537
13538 #------------------------------------------------------------
13539 # ATxmega16D4
13540 #------------------------------------------------------------
13541
13542 part parent "x16a4u"
13543     id          = "x16d4";
13544     desc        = "ATxmega16D4";
13545     signature   = 0x1e 0x94 0x42;
13546 ;
13547
13548 #------------------------------------------------------------
13549 # ATxmega16A4
13550 #------------------------------------------------------------
13551
13552 part parent "x16a4u"
13553     id          = "x16a4";
13554     desc        = "ATxmega16A4";
13555     signature   = 0x1e 0x94 0x41;
13556     has_jtag    = yes;
13557
13558     memory "fuse0"
13559         size            = 1;
13560         offset          = 0x8f0020;
13561     ;
13562 ;
13563
13564 #------------------------------------------------------------
13565 # ATxmega32A4U
13566 #------------------------------------------------------------
13567
13568 part parent ".xmega"
13569     id          = "x32a4u";
13570     desc        = "ATxmega32A4U";
13571     signature   = 0x1e 0x95 0x41;
13572     usbpid      = 0x2fe4;
13573
13574     memory "eeprom"
13575         size            = 0x400;
13576         offset          = 0x8c0000;
13577         page_size       = 0x20;
13578         readsize        = 0x100;
13579     ;
13580
13581     memory "application"
13582         size            = 0x8000;
13583         offset          = 0x800000;
13584         page_size       = 0x100;
13585         readsize        = 0x100;
13586     ;
13587
13588     memory "apptable"
13589         size            = 0x1000;
13590         offset          = 0x807000;
13591         page_size       = 0x100;
13592         readsize        = 0x100;
13593     ;
13594
13595     memory "boot"
13596         size            = 0x1000;
13597         offset          = 0x808000;
13598         page_size       = 0x100;
13599         readsize        = 0x100;
13600     ;
13601
13602     memory "flash"
13603         size            = 0x9000;
13604         offset          = 0x800000;
13605         page_size       = 0x100;
13606         readsize        = 0x100;
13607     ;
13608
13609     memory "usersig"
13610         size            = 0x100;
13611         offset          = 0x8e0400;
13612         page_size       = 0x100;
13613         readsize        = 0x100;
13614     ;
13615 ;
13616
13617 #------------------------------------------------------------
13618 # ATxmega32C4
13619 #------------------------------------------------------------
13620
13621 part parent "x32a4u"
13622     id          = "x32c4";
13623     desc        = "ATxmega32C4";
13624     signature   = 0x1e 0x94 0x43;
13625 ;
13626
13627 #------------------------------------------------------------
13628 # ATxmega32D4
13629 #------------------------------------------------------------
13630
13631 part parent "x32a4u"
13632     id          = "x32d4";
13633     desc        = "ATxmega32D4";
13634     signature   = 0x1e 0x95 0x42;
13635 ;
13636
13637 #------------------------------------------------------------
13638 # ATxmega32A4
13639 #------------------------------------------------------------
13640
13641 part parent "x32a4u"
13642     id          = "x32a4";
13643     desc        = "ATxmega32A4";
13644     signature   = 0x1e 0x95 0x41;
13645     has_jtag    = yes;
13646
13647     memory "fuse0"
13648         size            = 1;
13649         offset          = 0x8f0020;
13650     ;
13651 ;
13652
13653 #------------------------------------------------------------
13654 # ATxmega64A4U
13655 #------------------------------------------------------------
13656
13657 part parent ".xmega"
13658     id          = "x64a4u";
13659     desc        = "ATxmega64A4U";
13660     signature   = 0x1e 0x96 0x46;
13661     usbpid      = 0x2fe5;
13662
13663     memory "eeprom"
13664         size            = 0x800;
13665         offset          = 0x8c0000;
13666         page_size       = 0x20;
13667         readsize        = 0x100;
13668     ;
13669
13670     memory "application"
13671         size            = 0x10000;
13672         offset          = 0x800000;
13673         page_size       = 0x100;
13674         readsize        = 0x100;
13675     ;
13676
13677     memory "apptable"
13678         size            = 0x1000;
13679         offset          = 0x80f000;
13680         page_size       = 0x100;
13681         readsize        = 0x100;
13682     ;
13683
13684     memory "boot"
13685         size            = 0x1000;
13686         offset          = 0x810000;
13687         page_size       = 0x100;
13688         readsize        = 0x100;
13689     ;
13690
13691     memory "flash"
13692         size            = 0x11000;
13693         offset          = 0x800000;
13694         page_size       = 0x100;
13695         readsize        = 0x100;
13696     ;
13697
13698     memory "usersig"
13699         size            = 0x100;
13700         offset          = 0x8e0400;
13701         page_size       = 0x100;
13702         readsize        = 0x100;
13703     ;
13704 ;
13705
13706 #------------------------------------------------------------
13707 # ATxmega64C3
13708 #------------------------------------------------------------
13709
13710 part parent "x64a4u"
13711     id          = "x64c3";
13712     desc        = "ATxmega64C3";
13713     signature   = 0x1e 0x96 0x49;
13714     usbpid      = 0x2fd6;
13715 ;
13716
13717 #------------------------------------------------------------
13718 # ATxmega64D3
13719 #------------------------------------------------------------
13720
13721 part parent "x64a4u"
13722     id          = "x64d3";
13723     desc        = "ATxmega64D3";
13724     signature   = 0x1e 0x96 0x4a;
13725 ;
13726
13727 #------------------------------------------------------------
13728 # ATxmega64D4
13729 #------------------------------------------------------------
13730
13731 part parent "x64a4u"
13732     id          = "x64d4";
13733     desc        = "ATxmega64D4";
13734     signature   = 0x1e 0x96 0x47;
13735 ;
13736
13737 #------------------------------------------------------------
13738 # ATxmega64A1
13739 #------------------------------------------------------------
13740
13741 part parent "x64a4u"
13742     id          = "x64a1";
13743     desc        = "ATxmega64A1";
13744     signature   = 0x1e 0x96 0x4e;
13745     has_jtag    = yes;
13746
13747     memory "fuse0"
13748         size            = 1;
13749         offset          = 0x8f0020;
13750     ;
13751 ;
13752
13753 #------------------------------------------------------------
13754 # ATxmega64A1U
13755 #------------------------------------------------------------
13756
13757 part parent "x64a1"
13758     id          = "x64a1u";
13759     desc        = "ATxmega64A1U";
13760     signature   = 0x1e 0x96 0x4e;
13761     usbpid      = 0x2fe8;
13762 ;
13763
13764 #------------------------------------------------------------
13765 # ATxmega64A3
13766 #------------------------------------------------------------
13767
13768 part parent "x64a1"
13769     id          = "x64a3";
13770     desc        = "ATxmega64A3";
13771     signature   = 0x1e 0x96 0x42;
13772 ;
13773
13774 #------------------------------------------------------------
13775 # ATxmega64A3U
13776 #------------------------------------------------------------
13777
13778 part parent "x64a1"
13779     id          = "x64a3u";
13780     desc        = "ATxmega64A3U";
13781     signature   = 0x1e 0x96 0x42;
13782     usbpid      = 0x2fe5;
13783 ;
13784
13785 #------------------------------------------------------------
13786 # ATxmega64A4
13787 #------------------------------------------------------------
13788
13789 part parent "x64a1"
13790     id          = "x64a4";
13791     desc        = "ATxmega64A4";
13792     signature   = 0x1e 0x96 0x46;
13793 ;
13794
13795 #------------------------------------------------------------
13796 # ATxmega64B1
13797 #------------------------------------------------------------
13798
13799 part parent "x64a1"
13800     id          = "x64b1";
13801     desc        = "ATxmega64B1";
13802     signature   = 0x1e 0x96 0x52;
13803     usbpid      = 0x2fe1;
13804 ;
13805
13806 #------------------------------------------------------------
13807 # ATxmega64B3
13808 #------------------------------------------------------------
13809
13810 part parent "x64a1"
13811     id          = "x64b3";
13812     desc        = "ATxmega64B3";
13813     signature   = 0x1e 0x96 0x51;
13814     usbpid      = 0x2fdf;
13815 ;
13816
13817 #------------------------------------------------------------
13818 # ATxmega128C3
13819 #------------------------------------------------------------
13820
13821 part parent ".xmega"
13822     id          = "x128c3";
13823     desc        = "ATxmega128C3";
13824     signature   = 0x1e 0x97 0x52;
13825     usbpid      = 0x2fd7;
13826
13827     memory "eeprom"
13828         size            = 0x800;
13829         offset          = 0x8c0000;
13830         page_size       = 0x20;
13831         readsize        = 0x100;
13832     ;
13833
13834     memory "application"
13835         size            = 0x20000;
13836         offset          = 0x800000;
13837         page_size       = 0x200;
13838         readsize        = 0x100;
13839     ;
13840
13841     memory "apptable"
13842         size            = 0x2000;
13843         offset          = 0x81e000;
13844         page_size       = 0x200;
13845         readsize        = 0x100;
13846     ;
13847
13848     memory "boot"
13849         size            = 0x2000;
13850         offset          = 0x820000;
13851         page_size       = 0x200;
13852         readsize        = 0x100;
13853     ;
13854
13855     memory "flash"
13856         size            = 0x22000;
13857         offset          = 0x800000;
13858         page_size       = 0x200;
13859         readsize        = 0x100;
13860     ;
13861
13862     memory "usersig"
13863         size            = 0x200;
13864         offset          = 0x8e0400;
13865         page_size       = 0x200;
13866         readsize        = 0x100;
13867     ;
13868 ;
13869
13870 #------------------------------------------------------------
13871 # ATxmega128D3
13872 #------------------------------------------------------------
13873
13874 part parent "x128c3"
13875     id          = "x128d3";
13876     desc        = "ATxmega128D3";
13877     signature   = 0x1e 0x97 0x48;
13878 ;
13879
13880 #------------------------------------------------------------
13881 # ATxmega128D4
13882 #------------------------------------------------------------
13883
13884 part parent "x128c3"
13885     id          = "x128d4";
13886     desc        = "ATxmega128D4";
13887     signature   = 0x1e 0x97 0x47;
13888 ;
13889
13890 #------------------------------------------------------------
13891 # ATxmega128A1
13892 #------------------------------------------------------------
13893
13894 part parent "x128c3"
13895     id          = "x128a1";
13896     desc        = "ATxmega128A1";
13897     signature   = 0x1e 0x97 0x4c;
13898     has_jtag    = yes;
13899
13900     memory "fuse0"
13901         size            = 1;
13902         offset          = 0x8f0020;
13903     ;
13904 ;
13905
13906 #------------------------------------------------------------
13907 # ATxmega128A1 revision D
13908 #------------------------------------------------------------
13909
13910 part parent "x128a1"
13911     id          = "x128a1d";
13912     desc        = "ATxmega128A1revD";
13913     signature   = 0x1e 0x97 0x41;
13914 ;
13915
13916 #------------------------------------------------------------
13917 # ATxmega128A1U
13918 #------------------------------------------------------------
13919
13920 part parent "x128a1"
13921     id          = "x128a1u";
13922     desc        = "ATxmega128A1U";
13923     signature   = 0x1e 0x97 0x4c;
13924     usbpid      = 0x2fed;
13925 ;
13926
13927 #------------------------------------------------------------
13928 # ATxmega128A3
13929 #------------------------------------------------------------
13930
13931 part parent "x128a1"
13932     id          = "x128a3";
13933     desc        = "ATxmega128A3";
13934     signature   = 0x1e 0x97 0x42;
13935 ;
13936
13937 #------------------------------------------------------------
13938 # ATxmega128A3U
13939 #------------------------------------------------------------
13940
13941 part parent "x128a1"
13942     id          = "x128a3u";
13943     desc        = "ATxmega128A3U";
13944     signature   = 0x1e 0x97 0x42;
13945     usbpid      = 0x2fe6;
13946 ;
13947
13948 #------------------------------------------------------------
13949 # ATxmega128A4
13950 #------------------------------------------------------------
13951
13952 part parent ".xmega"
13953     id          = "x128a4";
13954     desc        = "ATxmega128A4";
13955     signature   = 0x1e 0x97 0x46;
13956     has_jtag    = yes;
13957
13958     memory "eeprom"
13959         size            = 0x800;
13960         offset          = 0x8c0000;
13961         page_size       = 0x20;
13962         readsize        = 0x100;
13963     ;
13964
13965     memory "application"
13966         size            = 0x20000;
13967         offset          = 0x800000;
13968         page_size       = 0x200;
13969         readsize        = 0x100;
13970     ;
13971
13972     memory "apptable"
13973         size            = 0x1000;
13974         offset          = 0x81f000;
13975         page_size       = 0x200;
13976         readsize        = 0x100;
13977     ;
13978
13979     memory "boot"
13980         size            = 0x2000;
13981         offset          = 0x820000;
13982         page_size       = 0x200;
13983         readsize        = 0x100;
13984     ;
13985
13986     memory "flash"
13987         size            = 0x22000;
13988         offset          = 0x800000;
13989         page_size       = 0x200;
13990         readsize        = 0x100;
13991     ;
13992
13993     memory "usersig"
13994         size            = 0x200;
13995         offset          = 0x8e0400;
13996         page_size       = 0x200;
13997         readsize        = 0x100;
13998     ;
13999
14000     memory "fuse0"
14001         size            = 1;
14002         offset          = 0x8f0020;
14003     ;
14004 ;
14005
14006 #------------------------------------------------------------
14007 # ATxmega128A4U
14008 #------------------------------------------------------------
14009
14010 part parent ".xmega"
14011     id          = "x128a4u";
14012     desc        = "ATxmega128A4U";
14013     signature   = 0x1e 0x97 0x46;
14014     usbpid      = 0x2fde;
14015
14016     memory "eeprom"
14017         size            = 0x800;
14018         offset          = 0x8c0000;
14019         page_size       = 0x20;
14020         readsize        = 0x100;
14021     ;
14022
14023     memory "application"
14024         size            = 0x20000;
14025         offset          = 0x800000;
14026         page_size       = 0x100;
14027         readsize        = 0x100;
14028     ;
14029
14030     memory "apptable"
14031         size            = 0x1000;
14032         offset          = 0x81f000;
14033         page_size       = 0x100;
14034         readsize        = 0x100;
14035     ;
14036
14037     memory "boot"
14038         size            = 0x2000;
14039         offset          = 0x820000;
14040         page_size       = 0x100;
14041         readsize        = 0x100;
14042     ;
14043
14044     memory "flash"
14045         size            = 0x22000;
14046         offset          = 0x800000;
14047         page_size       = 0x100;
14048         readsize        = 0x100;
14049     ;
14050
14051     memory "usersig"
14052         size            = 0x100;
14053         offset          = 0x8e0400;
14054         page_size       = 0x100;
14055         readsize        = 0x100;
14056     ;
14057 ;
14058
14059 #------------------------------------------------------------
14060 # ATxmega128B1
14061 #------------------------------------------------------------
14062
14063 part parent ".xmega"
14064     id          = "x128b1";
14065     desc        = "ATxmega128B1";
14066     signature   = 0x1e 0x97 0x4d;
14067     usbpid      = 0x2fea;
14068     has_jtag    = yes;
14069
14070     memory "eeprom"
14071         size            = 0x800;
14072         offset          = 0x8c0000;
14073         page_size       = 0x20;
14074         readsize        = 0x100;
14075     ;
14076
14077     memory "application"
14078         size            = 0x20000;
14079         offset          = 0x800000;
14080         page_size       = 0x100;
14081         readsize        = 0x100;
14082     ;
14083
14084     memory "apptable"
14085         size            = 0x2000;
14086         offset          = 0x81e000;
14087         page_size       = 0x100;
14088         readsize        = 0x100;
14089     ;
14090
14091     memory "boot"
14092         size            = 0x2000;
14093         offset          = 0x820000;
14094         page_size       = 0x100;
14095         readsize        = 0x100;
14096     ;
14097
14098     memory "flash"
14099         size            = 0x22000;
14100         offset          = 0x800000;
14101         page_size       = 0x100;
14102         readsize        = 0x100;
14103     ;
14104
14105     memory "usersig"
14106         size            = 0x100;
14107         offset          = 0x8e0400;
14108         page_size       = 0x100;
14109         readsize        = 0x100;
14110     ;
14111
14112     memory "fuse0"
14113         size            = 1;
14114         offset          = 0x8f0020;
14115     ;
14116 ;
14117
14118 #------------------------------------------------------------
14119 # ATxmega128B3
14120 #------------------------------------------------------------
14121
14122 part parent "x128b1"
14123     id          = "x128b3";
14124     desc        = "ATxmega128B3";
14125     signature   = 0x1e 0x97 0x4b;
14126     usbpid      = 0x2fe0;
14127 ;
14128
14129 #------------------------------------------------------------
14130 # ATxmega192C3
14131 #------------------------------------------------------------
14132
14133 part parent ".xmega"
14134     id          = "x192c3";
14135     desc        = "ATxmega192C3";
14136     signature   = 0x1e 0x97 0x51;
14137     # usbpid    = 0x2f??;
14138
14139     memory "eeprom"
14140         size            = 0x800;
14141         offset          = 0x8c0000;
14142         page_size       = 0x20;
14143         readsize        = 0x100;
14144     ;
14145
14146     memory "application"
14147         size            = 0x30000;
14148         offset          = 0x800000;
14149         page_size       = 0x200;
14150         readsize        = 0x100;
14151     ;
14152
14153     memory "apptable"
14154         size            = 0x2000;
14155         offset          = 0x82e000;
14156         page_size       = 0x200;
14157         readsize        = 0x100;
14158     ;
14159
14160     memory "boot"
14161         size            = 0x2000;
14162         offset          = 0x830000;
14163         page_size       = 0x200;
14164         readsize        = 0x100;
14165     ;
14166
14167     memory "flash"
14168         size            = 0x32000;
14169         offset          = 0x800000;
14170         page_size       = 0x200;
14171         readsize        = 0x100;
14172     ;
14173
14174     memory "usersig"
14175         size            = 0x200;
14176         offset          = 0x8e0400;
14177         page_size       = 0x200;
14178         readsize        = 0x100;
14179     ;
14180 ;
14181
14182 #------------------------------------------------------------
14183 # ATxmega192D3
14184 #------------------------------------------------------------
14185
14186 part parent "x192c3"
14187     id          = "x192d3";
14188     desc        = "ATxmega192D3";
14189     signature   = 0x1e 0x97 0x49;
14190 ;
14191
14192 #------------------------------------------------------------
14193 # ATxmega192A1
14194 #------------------------------------------------------------
14195
14196 part parent "x192c3"
14197     id          = "x192a1";
14198     desc        = "ATxmega192A1";
14199     signature   = 0x1e 0x97 0x4e;
14200     has_jtag    = yes;
14201
14202     memory "fuse0"
14203         size            = 1;
14204         offset          = 0x8f0020;
14205     ;
14206 ;
14207
14208 #------------------------------------------------------------
14209 # ATxmega192A3
14210 #------------------------------------------------------------
14211
14212 part parent "x192a1"
14213     id          = "x192a3";
14214     desc        = "ATxmega192A3";
14215     signature   = 0x1e 0x97 0x44;
14216 ;
14217
14218 #------------------------------------------------------------
14219 # ATxmega192A3U
14220 #------------------------------------------------------------
14221
14222 part parent "x192a1"
14223     id          = "x192a3u";
14224     desc        = "ATxmega192A3U";
14225     signature   = 0x1e 0x97 0x44;
14226     usbpid      = 0x2fe7;
14227 ;
14228
14229 #------------------------------------------------------------
14230 # ATxmega256C3
14231 #------------------------------------------------------------
14232
14233 part parent ".xmega"
14234     id          = "x256c3";
14235     desc        = "ATxmega256C3";
14236     signature   = 0x1e 0x98 0x46;
14237     usbpid      = 0x2fda;
14238
14239     memory "eeprom"
14240         size            = 0x1000;
14241         offset          = 0x8c0000;
14242         page_size       = 0x20;
14243         readsize        = 0x100;
14244     ;
14245
14246     memory "application"
14247         size            = 0x40000;
14248         offset          = 0x800000;
14249         page_size       = 0x200;
14250         readsize        = 0x100;
14251     ;
14252
14253     memory "apptable"
14254         size            = 0x2000;
14255         offset          = 0x83e000;
14256         page_size       = 0x200;
14257         readsize        = 0x100;
14258     ;
14259
14260     memory "boot"
14261         size            = 0x2000;
14262         offset          = 0x840000;
14263         page_size       = 0x200;
14264         readsize        = 0x100;
14265     ;
14266
14267     memory "flash"
14268         size            = 0x42000;
14269         offset          = 0x800000;
14270         page_size       = 0x200;
14271         readsize        = 0x100;
14272     ;
14273
14274     memory "usersig"
14275         size            = 0x200;
14276         offset          = 0x8e0400;
14277         page_size       = 0x200;
14278         readsize        = 0x100;
14279     ;
14280 ;
14281
14282 #------------------------------------------------------------
14283 # ATxmega256D3
14284 #------------------------------------------------------------
14285
14286 part parent "x256c3"
14287     id          = "x256d3";
14288     desc        = "ATxmega256D3";
14289     signature   = 0x1e 0x98 0x44;
14290 ;
14291
14292 #------------------------------------------------------------
14293 # ATxmega256A1
14294 #------------------------------------------------------------
14295
14296 part parent "x256c3"
14297     id          = "x256a1";
14298     desc        = "ATxmega256A1";
14299     signature   = 0x1e 0x98 0x46;
14300     has_jtag    = yes;
14301
14302     memory "fuse0"
14303         size            = 1;
14304         offset          = 0x8f0020;
14305     ;
14306 ;
14307
14308 #------------------------------------------------------------
14309 # ATxmega256A3
14310 #------------------------------------------------------------
14311
14312 part parent "x256a1"
14313     id          = "x256a3";
14314     desc        = "ATxmega256A3";
14315     signature   = 0x1e 0x98 0x42;
14316 ;
14317
14318 #------------------------------------------------------------
14319 # ATxmega256A3U
14320 #------------------------------------------------------------
14321
14322 part parent "x256a1"
14323     id          = "x256a3u";
14324     desc        = "ATxmega256A3U";
14325     signature   = 0x1e 0x98 0x42;
14326     usbpid      = 0x2fec;
14327 ;
14328
14329 #------------------------------------------------------------
14330 # ATxmega256A3B
14331 #------------------------------------------------------------
14332
14333 part parent "x256a1"
14334     id          = "x256a3b";
14335     desc        = "ATxmega256A3B";
14336     signature   = 0x1e 0x98 0x43;
14337 ;
14338
14339 #------------------------------------------------------------
14340 # ATxmega256A3BU
14341 #------------------------------------------------------------
14342
14343 part parent "x256a1"
14344     id          = "x256a3bu";
14345     desc        = "ATxmega256A3BU";
14346     signature   = 0x1e 0x98 0x43;
14347     usbpid      = 0x2fe2;
14348 ;
14349
14350 #------------------------------------------------------------
14351 # ATxmega384C3
14352 #------------------------------------------------------------
14353
14354 part parent ".xmega"
14355     id          = "x384c3";
14356     desc        = "ATxmega384C3";
14357     signature   = 0x1e 0x98 0x45;
14358     usbpid      = 0x2fdb;
14359
14360     memory "eeprom"
14361         size            = 0x1000;
14362         offset          = 0x8c0000;
14363         page_size       = 0x20;
14364         readsize        = 0x100;
14365     ;
14366
14367     memory "application"
14368         size            = 0x60000;
14369         offset          = 0x800000;
14370         page_size       = 0x200;
14371         readsize        = 0x100;
14372     ;
14373
14374     memory "apptable"
14375         size            = 0x2000;
14376         offset          = 0x85e000;
14377         page_size       = 0x200;
14378         readsize        = 0x100;
14379     ;
14380
14381     memory "boot"
14382         size            = 0x2000;
14383         offset          = 0x860000;
14384         page_size       = 0x200;
14385         readsize        = 0x100;
14386     ;
14387
14388     memory "flash"
14389         size            = 0x62000;
14390         offset          = 0x800000;
14391         page_size       = 0x200;
14392         readsize        = 0x100;
14393     ;
14394
14395     memory "usersig"
14396         size            = 0x200;
14397         offset          = 0x8e0400;
14398         page_size       = 0x200;
14399         readsize        = 0x100;
14400     ;
14401 ;
14402
14403 #------------------------------------------------------------
14404 # ATxmega384D3
14405 #------------------------------------------------------------
14406
14407 part parent "x384c3"
14408     id          = "x384d3";
14409     desc        = "ATxmega384D3";
14410     signature   = 0x1e 0x98 0x47;
14411 ;
14412
14413 #------------------------------------------------------------
14414 # ATxmega8E5
14415 #------------------------------------------------------------
14416
14417 part parent ".xmega"
14418     id          = "x8e5";
14419     desc        = "ATxmega8E5";
14420     signature   = 0x1e 0x93 0x41;
14421
14422     memory "eeprom"
14423         size            = 0x0200;
14424         offset          = 0x08c0000;
14425         page_size       = 0x20;
14426         readsize        = 0x100;
14427     ;
14428
14429     memory "application"
14430         size            = 0x2000;
14431         offset          = 0x0800000;
14432         page_size       = 0x80;
14433         readsize        = 0x100;
14434     ;
14435
14436     memory "apptable"
14437         size            = 0x800;
14438         offset          = 0x00801800;
14439         page_size       = 0x80;
14440         readsize        = 0x100;
14441     ;
14442
14443     memory "boot"
14444         size            = 0x800;
14445         offset          = 0x00802000;
14446         page_size       = 0x80;
14447         readsize        = 0x100;
14448     ;
14449
14450     memory "flash"
14451         size            = 0x2800;
14452         offset          = 0x0800000;
14453         page_size       = 0x80;
14454         readsize        = 0x100;
14455     ;
14456
14457     memory "usersig"
14458         size            = 0x80;
14459         offset          = 0x8e0400;
14460         page_size       = 0x80;
14461         readsize        = 0x100;
14462     ;
14463 ;
14464
14465 #------------------------------------------------------------
14466 # ATxmega16E5
14467 #------------------------------------------------------------
14468
14469 part parent ".xmega"
14470     id          = "x16e5";
14471     desc        = "ATxmega16E5";
14472     signature   = 0x1e 0x94 0x45;
14473
14474     memory "eeprom"
14475         size            = 0x0200;
14476         offset          = 0x08c0000;
14477         page_size       = 0x20;
14478         readsize        = 0x100;
14479     ;
14480
14481     memory "application"
14482         size            = 0x4000;
14483         offset          = 0x0800000;
14484         page_size       = 0x80;
14485         readsize        = 0x100;
14486     ;
14487
14488     memory "apptable"
14489         size            = 0x1000;
14490         offset          = 0x00803000;
14491         page_size       = 0x80;
14492         readsize        = 0x100;
14493     ;
14494
14495     memory "boot"
14496         size            = 0x1000;
14497         offset          = 0x00804000;
14498         page_size       = 0x80;
14499         readsize        = 0x100;
14500     ;
14501
14502     memory "flash"
14503         size            = 0x5000;
14504         offset          = 0x0800000;
14505         page_size       = 0x80;
14506         readsize        = 0x100;
14507     ;
14508
14509     memory "usersig"
14510         size            = 0x80;
14511         offset          = 0x8e0400;
14512         page_size       = 0x80;
14513         readsize        = 0x100;
14514     ;
14515 ;
14516
14517 #------------------------------------------------------------
14518 # ATxmega32E5
14519 #------------------------------------------------------------
14520
14521 part parent ".xmega"
14522     id          = "x32e5";
14523     desc        = "ATxmega32E5";
14524     signature   = 0x1e 0x95 0x4c;
14525
14526     memory "eeprom"
14527         size            = 0x0400;
14528         offset          = 0x08c0000;
14529         page_size       = 0x20;
14530         readsize        = 0x100;
14531     ;
14532
14533     memory "application"
14534         size            = 0x8000;
14535         offset          = 0x0800000;
14536         page_size       = 0x80;
14537         readsize        = 0x100;
14538     ;
14539
14540     memory "apptable"
14541         size            = 0x1000;
14542         offset          = 0x00807000;
14543         page_size       = 0x80;
14544         readsize        = 0x100;
14545     ;
14546
14547     memory "boot"
14548         size            = 0x1000;
14549         offset          = 0x00808000;
14550         page_size       = 0x80;
14551         readsize        = 0x100;
14552     ;
14553
14554     memory "flash"
14555         size            = 0x9000;
14556         offset          = 0x0800000;
14557         page_size       = 0x80;
14558         readsize        = 0x100;
14559     ;
14560
14561     memory "usersig"
14562         size            = 0x80;
14563         offset          = 0x8e0400;
14564         page_size       = 0x80;
14565         readsize        = 0x100;
14566     ;
14567 ;
14568
14569 #------------------------------------------------------------
14570 # AVR32UC3A0512
14571 #------------------------------------------------------------
14572
14573 part
14574     id          = "uc3a0512";
14575     desc        = "AT32UC3A0512";
14576     signature   = 0xED 0xC0 0x3F;
14577     has_jtag    = yes;
14578     is_avr32    = yes;
14579
14580     memory "flash"
14581         paged           = yes;
14582         page_size       = 512;           # bytes
14583         readsize        = 512;           # bytes
14584         num_pages       = 1024;          # could be set dynamicly
14585         size            = 0x00080000;    # could be set dynamicly
14586         offset          = 0x80000000;
14587     ;
14588 ;
14589
14590 part parent "uc3a0512"
14591     id          = "ucr2";
14592     desc        = "deprecated, use 'uc3a0512'";
14593 ;
14594
14595 #------------------------------------------------------------
14596 # ATtiny1634.
14597 #------------------------------------------------------------
14598
14599 part
14600     id              = "t1634";
14601     desc            = "ATtiny1634";
14602      has_debugwire = yes;
14603      flash_instr   = 0xB6, 0x01, 0x11;
14604      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
14605                 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
14606                 0x99, 0xF9, 0xBB, 0xAF;
14607     stk500_devcode  = 0x86;
14608     # avr910_devcode = 0x;
14609     signature       = 0x1e 0x94 0x12;
14610     pagel           = 0xB3;
14611     bs2             = 0xB1;
14612     reset           = io;
14613     chip_erase_delay = 9000;
14614     pgm_enable       = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
14615                        "x x x x x x x x x x x x x x x x";
14616
14617     chip_erase       = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
14618                        "x x x x x x x x x x x x x x x x";
14619
14620     timeout         = 200;
14621     stabdelay       = 100;
14622     cmdexedelay     = 25;
14623     synchloops      = 32;
14624     bytedelay       = 0;
14625     pollindex       = 3;
14626     pollvalue       = 0x53;
14627     predelay        = 1;
14628     postdelay       = 1;
14629     pollmethod      = 1;
14630
14631     pp_controlstack     =
14632         0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E,
14633         0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E,
14634         0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A,
14635         0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
14636     hventerstabdelay    = 100;
14637     progmodedelay       = 0;
14638     latchcycles         = 0;
14639     togglevtg           = 1;
14640     poweroffdelay       = 15;
14641     resetdelayms        = 1;
14642     resetdelayus        = 0;
14643     hvleavestabdelay    = 15;
14644     resetdelay          = 15;
14645     chiperasepulsewidth = 0;
14646     chiperasepolltimeout = 10;
14647     programfusepulsewidth = 0;
14648     programfusepolltimeout = 5;
14649     programlockpulsewidth = 0;
14650     programlockpolltimeout = 5;
14651
14652     memory "eeprom"
14653         paged           = no;
14654         page_size       = 4;
14655         size            = 256;
14656         min_write_delay = 3600;
14657         max_write_delay = 3600;
14658         readback_p1     = 0xff;
14659         readback_p2     = 0xff;
14660         read            = " 1 0 1 0 0 0 0 0",
14661                           " 0 0 0 x x x x a8",
14662                           " a7 a6 a5 a4 a3 a2 a1 a0",
14663                           " o o o o o o o o";
14664
14665         write           = " 1 1 0 0 0 0 0 0",
14666                           " 0 0 0 x x x x a8",
14667                           " a7 a6 a5 a4 a3 a2 a1 a0",
14668                           " i i i i i i i i";
14669
14670    loadpage_lo   = "  1   1   0   0      0   0   0   1",
14671            "  0   0   0   0      0   0   0   0",
14672            "  0   0   0   0      0   0  a1  a0",
14673            "  i   i   i   i      i   i   i   i";
14674
14675    writepage   = "  1   1   0   0      0   0   1   0",
14676            "  0   0   x   x      x   x   x  a8",
14677            " a7  a6  a5  a4     a3  a2   0   0",
14678            "  x   x   x   x      x   x   x   x";
14679
14680    mode      = 0x41;
14681    delay      = 5;
14682    blocksize   = 4;
14683    readsize   = 256;
14684         ;
14685
14686     memory "flash"
14687         paged           = yes;
14688         size            = 16384;
14689         page_size       = 32;
14690         num_pages       = 512;
14691         min_write_delay = 4500;
14692         max_write_delay = 4500;
14693         readback_p1     = 0xff;
14694         readback_p2     = 0xff;
14695         read_lo         = " 0 0 1 0 0 0 0 0",
14696                           " 0 0 0 a12 a11 a10 a9 a8",
14697                           " a7 a6 a5 a4 a3 a2 a1 a0",
14698                           " o o o o o o o o";
14699
14700         read_hi          = " 0 0 1 0 1 0 0 0",
14701                            " 0 0 0 a12 a11 a10 a9 a8",
14702                            " a7 a6 a5 a4 a3 a2 a1 a0",
14703                            " o o o o o o o o";
14704
14705         loadpage_lo     = " 0 1 0 0 0 0 0 0",
14706                           " 0 0 0 x x x x x",
14707                           " x x a5 a4 a3 a2 a1 a0",
14708                           " i i i i i i i i";
14709
14710         loadpage_hi     = " 0 1 0 0 1 0 0 0",
14711                           " 0 0 0 x x x x x",
14712                           " x x a5 a4 a3 a2 a1 a0",
14713                           " i i i i i i i i";
14714
14715         writepage       = " 0 1 0 0 1 1 0 0",
14716                           " 0 0 0 a12 a11 a10 a9 a8",
14717                           " a7 a6 x x x x x x",
14718                           " x x x x x x x x";
14719
14720         mode        = 0x41;
14721         delay       = 6;
14722         blocksize   = 128;
14723         readsize    = 256;
14724
14725         ;
14726
14727     memory "lfuse"
14728         size            = 1;
14729         min_write_delay = 4500;
14730         max_write_delay = 4500;
14731         read            = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
14732                           "x x x x x x x x o o o o o o o o";
14733
14734         write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
14735                           "x x x x x x x x i i i i i i i i";
14736         ;
14737
14738     memory "hfuse"
14739         size            = 1;
14740         min_write_delay = 4500;
14741         max_write_delay = 4500;
14742         read            = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
14743                           "x x x x x x x x o o o o o o o o";
14744
14745         write           = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
14746                           "x x x x x x x x i i i i i i i i";
14747         ;
14748
14749     memory "efuse"
14750         size            = 1;
14751         min_write_delay = 4500;
14752         max_write_delay = 4500;
14753         read            = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
14754                           "x x x x x x x x o o o o o o o o";
14755
14756         write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
14757                           "x x x x x x x x x x x i i i i i";
14758         ;
14759
14760     memory "lock"
14761         size            = 1;
14762         min_write_delay = 4500;
14763         max_write_delay = 4500;
14764         read            = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
14765                           "x x x x x x x x x x x x x x o o";
14766
14767         write           = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
14768                           "x x x x x x x x 1 1 1 1 1 1 i i";
14769         ;
14770
14771     memory "calibration"
14772         size            = 1;
14773         read            = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
14774                           "0 0 0 0 0 0 0 0 o o o o o o o o";
14775         ;
14776
14777     memory "signature"
14778         size            = 3;
14779         read            = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
14780                           "x x x x x x a1 a0 o o o o o o o o";
14781         ;
14782 ;
14783
14784 #------------------------------------------------------------
14785 # Common values for reduced core tinys (4/5/9/10/20/40)
14786 #------------------------------------------------------------
14787
14788 part
14789     id          = ".reduced_core_tiny";
14790     desc        = "Common values for reduced core tinys";
14791     has_tpi     = yes;
14792
14793     memory "signature"
14794         size            = 3;
14795         offset          = 0x3fc0;
14796         page_size       = 16;
14797     ;
14798
14799     memory "fuse"
14800         size            = 1;
14801         offset          = 0x3f40;
14802         page_size       = 16;
14803         blocksize       = 4;
14804     ;
14805
14806     memory "calibration"
14807         size            = 1;
14808         offset          = 0x3f80;
14809         page_size       = 16;
14810     ;
14811
14812     memory "lockbits"
14813         size            = 1;
14814         offset          = 0x3f00;
14815         page_size       = 16;
14816     ;
14817 ;
14818
14819 #------------------------------------------------------------
14820 # ATtiny4
14821 #------------------------------------------------------------
14822
14823 part parent ".reduced_core_tiny"
14824     id          = "t4";
14825     desc        = "ATtiny4";
14826     signature   = 0x1e 0x8f 0x0a;
14827
14828     memory "flash"
14829         size            = 512;
14830         offset          = 0x4000;
14831         page_size       = 16;
14832         blocksize       = 128;
14833     ;
14834 ;
14835
14836 #------------------------------------------------------------
14837 # ATtiny5
14838 #------------------------------------------------------------
14839
14840 part parent "t4"
14841     id          = "t5";
14842     desc        = "ATtiny5";
14843     signature   = 0x1e 0x8f 0x09;
14844 ;
14845
14846 #------------------------------------------------------------
14847 # ATtiny9
14848 #------------------------------------------------------------
14849
14850 part parent ".reduced_core_tiny"
14851     id          = "t9";
14852     desc        = "ATtiny9";
14853     signature   = 0x1e 0x90 0x08;
14854
14855     memory "flash"
14856         size            = 1024;
14857         offset          = 0x4000;
14858         page_size       = 16;
14859         blocksize       = 128;
14860     ;
14861 ;
14862
14863 #------------------------------------------------------------
14864 # ATtiny10
14865 #------------------------------------------------------------
14866
14867 part parent "t9"
14868     id          = "t10";
14869     desc        = "ATtiny10";
14870     signature   = 0x1e 0x90 0x03;
14871 ;
14872
14873 #------------------------------------------------------------
14874 # ATtiny20
14875 #------------------------------------------------------------
14876
14877 part parent ".reduced_core_tiny"
14878     id          = "t20";
14879     desc        = "ATtiny20";
14880     signature   = 0x1e 0x91 0x0F;
14881
14882     memory "flash"
14883         size            = 2048;
14884         offset          = 0x4000;
14885         page_size       = 16;
14886         blocksize       = 128;
14887     ;
14888 ;
14889
14890 #------------------------------------------------------------
14891 # ATtiny40
14892 #------------------------------------------------------------
14893
14894 part parent ".reduced_core_tiny"
14895     id          = "t40";
14896     desc        = "ATtiny40";
14897     signature   = 0x1e 0x92 0x0E;
14898
14899     memory "flash"
14900         size            = 4096;
14901         offset          = 0x4000;
14902         page_size       = 64;
14903         blocksize       = 128;
14904     ;
14905 ;
14906
14907 #------------------------------------------------------------
14908 # ATmega406
14909 #------------------------------------------------------------
14910
14911 part
14912     id                          = "m406";
14913     desc                        = "ATMEGA406";
14914     has_jtag                    = yes;
14915     signature                   = 0x1e 0x95 0x07;
14916
14917     # STK500 parameters (parallel programming IO lines)
14918     pagel                       = 0xa7;
14919     bs2                         = 0xa0;
14920     serial                      = no;
14921     parallel                    = yes;
14922
14923     # STK500v2 HV programming parameters, from XML
14924     pp_controlstack             = 0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
14925                                   0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
14926                                   0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
14927                                   0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
14928
14929     # JTAG ICE mkII parameters, also from XML files
14930     allowfullpagebitstream      = no;
14931     enablepageprogramming       = yes;
14932     idr                         = 0x51;
14933     rampz                       = 0x00;
14934     spmcr                       = 0x57;
14935     eecr                        = 0x3f;
14936
14937     memory "eeprom"
14938         paged           = no;
14939         size            = 512;
14940         page_size       = 4;
14941         blocksize       = 4;
14942         readsize        = 4;
14943         num_pages       = 128;
14944     ;
14945
14946     memory "flash"
14947         paged           = yes;
14948         size            = 40960;
14949         page_size       = 128;
14950         blocksize       = 128;
14951         readsize        = 128;
14952         num_pages       = 320;
14953     ;
14954
14955     memory "hfuse"
14956         size            = 1;
14957     ;
14958
14959     memory "lfuse"
14960         size            = 1;
14961     ;
14962
14963     memory "lockbits"
14964         size            = 1;
14965     ;
14966
14967     memory "signature"
14968         size            = 3;
14969     ;
14970 ;
14971
14972