First Commit
[owSlave2.git] / programmer / flash / avrdude.conf
1 # $Id: avrdude.conf.in 1012 2011-09-15 14:57:51Z 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 # Possible entry formats are:
14 #
15 #   programmer
16 #       id       = <id1> [, <id2> [, <id3>] ...] ;  # <idN> are quoted strings
17 #       desc     = <description> ;                  # quoted string
18 #       type     = par | stk500 | stk500v2 | stk500pp | stk500hvsp | stk500generic |
19 #                  stk600 | stk600pp | stk600hvsp |
20 #                  avr910 | butterfly | usbasp |
21 #                  jtagmki | jtagmkii | jtagmkii_isp | jtagmkii_dw |
22 #                  jtagmkII_avr32 | jtagmkii_pdi |
23 #                  dragon_dw | dragon_jtag | dragon_isp | dragon_pp |
24 #                  dragon_hvsp | dragon_pdi | arduino | wiring; # programmer type
25 #       baudrate = <num> ;                          # baudrate for avr910-programmer
26 #       vcc      = <num1> [, <num2> ... ] ;         # pin number(s)
27 #       reset    = <num> ;                          # pin number
28 #       sck      = <num> ;                          # pin number
29 #       mosi     = <num> ;                          # pin number
30 #       miso     = <num> ;                          # pin number
31 #       errled   = <num> ;                          # pin number
32 #       rdyled   = <num> ;                          # pin number
33 #       pgmled   = <num> ;                          # pin number
34 #       vfyled   = <num> ;                          # pin number
35 #                       usbvid   = <hexnum>;                                                                                            # USB VID (Vendor ID)
36 #       usbpid   = <hexnum>;                                                                                            #       USB PID (Product ID)
37 #       usbdev   = <interface>;                                                                                 # USB interface or other device info 
38 #       usbvendor = <vendorname>;                                                                               #       USB Vendor Name
39 #       usbproduct = <productname>;                                                                     # USB Product Name
40 #       usbsn    = <serialno>;                      # USB Serial Number
41 #
42 #        To invert a bit, use = ~ <num>, the spaces are important.
43 #     ;
44 #
45 #   part
46 #       id               = <id> ;                 # quoted string
47 #       desc             = <description> ;        # quoted string
48 #       has_jtag         = <yes/no> ;             # part has JTAG i/f
49 #       has_debugwire    = <yes/no> ;             # part has debugWire i/f
50 #       has_pdi          = <yes/no> ;             # part has PDI i/f
51 #       has_tpi          = <yes/no> ;             # part has TPI i/f
52 #       devicecode       = <num> ;            # deprecated, use stk500_devcode
53 #       stk500_devcode   = <num> ;                # numeric
54 #       avr910_devcode   = <num> ;                # numeric
55 #       signature        = <num> <num> <num> ;    # signature bytes
56 #       chip_erase_delay = <num> ;                # micro-seconds
57 #       reset            = dedicated | io;
58 #       retry_pulse      = reset | sck;
59 #       pgm_enable       = <instruction format> ;
60 #       chip_erase       = <instruction format> ;
61 #       chip_erase_delay = <num> ;                # chip erase delay (us)
62 #       # STK500 parameters (parallel programming IO lines)
63 #       pagel            = <num> ;                # pin name in hex, i.e., 0xD7
64 #       bs2              = <num> ;                # pin name in hex, i.e., 0xA0
65 #       serial           = <yes/no> ;             # can use serial downloading
66 #       parallel         = <yes/no/pseudo>;       # can use par. programming
67 #       # STK500v2 parameters, to be taken from Atmel's XML files
68 #       timeout          = <num> ;
69 #       stabdelay        = <num> ;
70 #       cmdexedelay      = <num> ;
71 #       synchloops       = <num> ;
72 #       bytedelay        = <num> ;
73 #       pollvalue        = <num> ;
74 #       pollindex        = <num> ;
75 #       predelay         = <num> ;
76 #       postdelay        = <num> ;
77 #       pollmethod       = <num> ;
78 #       mode             = <num> ;
79 #       delay            = <num> ;
80 #       blocksize        = <num> ;
81 #       readsize         = <num> ;
82 #       hvspcmdexedelay  = <num> ;
83 #       # STK500v2 HV programming parameters, from XML
84 #       pp_controlstack  = <num>, <num>, ...;   # PP only
85 #       hvsp_controlstack = <num>, <num>, ...;  # HVSP only
86 #       hventerstabdelay = <num>;
87 #       progmodedelay    = <num>;               # PP only
88 #       latchcycles      = <num>;
89 #       togglevtg        = <num>;
90 #       poweroffdelay    = <num>;
91 #       resetdelayms     = <num>;
92 #       resetdelayus     = <num>;
93 #       hvleavestabdelay = <num>;
94 #       resetdelay       = <num>;
95 #       synchcycles      = <num>;               # HVSP only
96 #       chiperasepulsewidth = <num>;            # PP only
97 #       chiperasepolltimeout = <num>;
98 #       chiperasetime    = <num>;               # HVSP only
99 #       programfusepulsewidth = <num>;          # PP only
100 #       programfusepolltimeout = <num>;
101 #       programlockpulsewidth = <num>;          # PP only
102 #       programlockpolltimeout = <num>;
103 #       # JTAG ICE mkII parameters, also from XML files
104 #       allowfullpagebitstream = <yes/no> ;
105 #       enablepageprogramming = <yes/no> ;
106 #       idr              = <num> ;                # IO addr of IDR (OCD) reg.
107 #       rampz            = <num> ;                # IO addr of RAMPZ reg.
108 #       spmcr            = <num> ;                # mem addr of SPMC[S]R reg.
109 #       eecr             = <num> ;                # mem addr of EECR reg.
110 #                                                 # (only when != 0x3c)
111 #       is_avr32         = <yes/no> ;             # AVR32 part
112 #
113 #       memory <memtype>
114 #           paged           = <yes/no> ;          # yes / no
115 #           size            = <num> ;             # bytes
116 #           page_size       = <num> ;             # bytes
117 #           num_pages       = <num> ;             # numeric
118 #           min_write_delay = <num> ;             # micro-seconds
119 #           max_write_delay = <num> ;             # micro-seconds
120 #           readback_p1     = <num> ;             # byte value
121 #           readback_p2     = <num> ;             # byte value
122 #           pwroff_after_write = <yes/no> ;       # yes / no
123 #           read            = <instruction format> ;
124 #           write           = <instruction format> ;
125 #           read_lo         = <instruction format> ;
126 #           read_hi         = <instruction format> ;
127 #           write_lo        = <instruction format> ;
128 #           write_hi        = <instruction format> ;
129 #           loadpage_lo     = <instruction format> ;
130 #           loadpage_hi     = <instruction format> ;
131 #           writepage       = <instruction format> ;
132 #         ;
133 #     ;
134 #
135 # If any of the above parameters are not specified, the default value
136 # of 0 is used for numerics or the empty string ("") for string
137 # values.  If a required parameter is left empty, AVRDUDE will
138 # complain.
139 #
140 # NOTES:
141 #   * 'devicecode' is the device code used by the STK500 (see codes 
142 #       listed below)
143 #   * Not all memory types will implement all instructions.
144 #   * AVR Fuse bits and Lock bits are implemented as a type of memory.
145 #   * Example memory types are:
146 #       "flash", "eeprom", "fuse", "lfuse" (low fuse), "hfuse" (high
147 #       fuse), "signature", "calibration", "lock"
148 #   * The memory type specified on the avrdude command line must match
149 #     one of the memory types defined for the specified chip.
150 #   * The pwroff_after_write flag causes avrdude to attempt to
151 #     power the device off and back on after an unsuccessful write to
152 #     the affected memory area if VCC programmer pins are defined.  If
153 #     VCC pins are not defined for the programmer, a message
154 #     indicating that the device needs a power-cycle is printed out.
155 #     This flag was added to work around a problem with the
156 #     at90s4433/2333's; see the at90s4433 errata at:
157 #
158 #         http://www.atmel.com/atmel/acrobat/doc1280.pdf
159 #
160 # INSTRUCTION FORMATS
161 #
162 #    Instruction formats are specified as a comma seperated list of
163 #    string values containing information (bit specifiers) about each
164 #    of the 32 bits of the instruction.  Bit specifiers may be one of
165 #    the following formats:
166 #
167 #       '1'  = the bit is always set on input as well as output
168 #
169 #       '0'  = the bit is always clear on input as well as output
170 #
171 #       'x'  = the bit is ignored on input and output
172 #
173 #       'a'  = the bit is an address bit, the bit-number matches this bit
174 #              specifier's position within the current instruction byte
175 #
176 #       'aN' = the bit is the Nth address bit, bit-number = N, i.e., a12
177 #              is address bit 12 on input, a0 is address bit 0.
178 #
179 #       'i'  = the bit is an input data bit
180 #
181 #       'o'  = the bit is an output data bit
182 #
183 #    Each instruction must be composed of 32 bit specifiers.  The
184 #    instruction specification closely follows the instruction data
185 #    provided in Atmel's data sheets for their parts.
186 #
187 # See below for some examples.
188 #
189 #
190 # The following are STK500 part device codes to use for the
191 # "devicecode" field of the part.  These came from Atmel's software
192 # section avr061.zip which accompanies the application note
193 # AVR061 available from:
194 #
195 #      http://www.atmel.com/atmel/acrobat/doc2525.pdf
196 #
197
198 #define ATTINY10    0x10  /* the _old_ one that never existed! */
199 #define ATTINY11    0x11
200 #define ATTINY12    0x12
201 #define ATTINY15    0x13
202 #define ATTINY13    0x14
203
204 #define ATTINY22    0x20
205 #define ATTINY26    0x21
206 #define ATTINY28    0x22
207 #define ATTINY2313  0x23
208
209 #define AT90S1200   0x33
210
211 #define AT90S2313   0x40
212 #define AT90S2323   0x41
213 #define AT90S2333   0x42
214 #define AT90S2343   0x43
215
216 #define AT90S4414   0x50
217 #define AT90S4433   0x51
218 #define AT90S4434   0x52
219 #define ATMEGA48    0x59
220
221 #define AT90S8515   0x60
222 #define AT90S8535   0x61
223 #define AT90C8534   0x62
224 #define ATMEGA8515  0x63
225 #define ATMEGA8535  0x64
226
227 #define ATMEGA8     0x70
228 #define ATMEGA88    0x73
229 #define ATMEGA168   0x86
230
231 #define ATMEGA161   0x80
232 #define ATMEGA163   0x81
233 #define ATMEGA16    0x82
234 #define ATMEGA162   0x83
235 #define ATMEGA169   0x84
236
237 #define ATMEGA323   0x90
238 #define ATMEGA32    0x91
239
240 #define ATMEGA64    0xA0
241
242 #define ATMEGA103   0xB1
243 #define ATMEGA128   0xB2
244 #define AT90CAN128  0xB3
245 #define AT90CAN64   0xB3
246 #define AT90CAN32   0xB3
247
248 #define AT86RF401   0xD0
249
250 #define AT89START   0xE0
251 #define AT89S51     0xE0
252 #define AT89S52     0xE1
253
254 # The following table lists the devices in the original AVR910
255 # appnote:
256 # |Device |Signature | Code |
257 # +-------+----------+------+
258 # |tiny12 | 1E 90 05 | 0x55 |
259 # |tiny15 | 1E 90 06 | 0x56 |
260 # |       |          |      |
261 # | S1200 | 1E 90 01 | 0x13 |
262 # |       |          |      |
263 # | S2313 | 1E 91 01 | 0x20 |
264 # | S2323 | 1E 91 02 | 0x48 |
265 # | S2333 | 1E 91 05 | 0x34 |
266 # | S2343 | 1E 91 03 | 0x4C |
267 # |       |          |      |
268 # | S4414 | 1E 92 01 | 0x28 |
269 # | S4433 | 1E 92 03 | 0x30 |
270 # | S4434 | 1E 92 02 | 0x6C |
271 # |       |          |      |
272 # | S8515 | 1E 93 01 | 0x38 |
273 # | S8535 | 1E 93 03 | 0x68 |
274 # |       |          |      |
275 # |mega32 | 1E 95 01 | 0x72 |
276 # |mega83 | 1E 93 05 | 0x65 |
277 # |mega103| 1E 97 01 | 0x41 |
278 # |mega161| 1E 94 01 | 0x60 |
279 # |mega163| 1E 94 02 | 0x64 |
280
281 # Appnote AVR109 also has a table of AVR910 device codes, which
282 # lists:
283 # dev         avr910   signature
284 # ATmega8     0x77     0x1E 0x93 0x07
285 # ATmega8515  0x3B     0x1E 0x93 0x06
286 # ATmega8535  0x6A     0x1E 0x93 0x08
287 # ATmega16    0x75     0x1E 0x94 0x03
288 # ATmega162   0x63     0x1E 0x94 0x04
289 # ATmega163   0x66     0x1E 0x94 0x02
290 # ATmega169   0x79     0x1E 0x94 0x05
291 # ATmega32    0x7F     0x1E 0x95 0x02
292 # ATmega323   0x73     0x1E 0x95 0x01
293 # ATmega64    0x46     0x1E 0x96 0x02
294 # ATmega128   0x44     0x1E 0x97 0x02
295 #
296 # These codes refer to "BOOT" device codes which are apparently
297 # different than standard device codes, for whatever reasons
298 # (often one above the standard code).
299
300 # There are several extended versions of AVR910 implementations around
301 # in the Internet.  These add the following codes (only devices that
302 # actually exist are listed):
303
304 # ATmega8515    0x3A
305 # ATmega128     0x43
306 # ATmega64      0x45
307 # ATtiny26      0x5E
308 # ATmega8535    0x69
309 # ATmega32      0x72
310 # ATmega16      0x74
311 # ATmega8       0x76
312 # ATmega169     0x78
313
314 #
315 # Overall avrdude defaults
316 #
317 default_parallel   = "lpt1";
318 default_serial     = "com1";
319 # default_bitclock = 2.5
320
321
322 #
323 # PROGRAMMER DEFINITIONS
324 #
325
326 # http://wiring.org.co/
327 # Basically STK500v2 protocol, with some glue to trigger the
328 # bootloader.
329 programmer
330   id    = "wiring";
331   desc  = "Wiring";
332   type  = wiring;
333 ;
334
335 programmer
336   id    = "arduino";
337   desc  = "Arduino";
338   type  = arduino;
339 ;
340 # this will interface with the chips on these programmers:
341 #
342 # http://real.kiev.ua/old/avreal/en/adapters
343 # http://www.amontec.com/jtagkey.shtml, jtagkey-tiny.shtml
344 # http://www.olimex.com/dev/arm-usb-ocd.html, arm-usb-tiny.html
345 # http://www.ethernut.de/en/hardware/turtelizer/index.html
346 # http://elk.informatik.fh-augsburg.de/hhweb/doc/openocd/usbjtag/usbjtag.html
347 # http://dangerousprototypes.com/docs/FT2232_breakout_board
348 # http://www.ftdichip.com/Products/Modules/DLPModules.htm,DLP-2232*,DLP-USB1232H
349 # http://flashrom.org/FT2232SPI_Programmer
350
351 # The drivers will look for a specific device and use the first one found.
352 # If you have mulitple devices, then look for unique information (like SN)
353 # And fill that in here.
354
355 programmer
356   id    = "avrftdi";
357   desc  = "FT2232D based generic programmer";
358   type  = avrftdi;
359   usbvid     = 0x0403;
360   usbpid     = 0x6010;
361   usbvendor  = "";
362   usbproduct = "";
363   usbdev     = "A";
364   usbsn      = "";
365 #ISP-signals - lower ACBUS-Nibble (default)
366   reset  = 4;
367   sck    = 1;
368   mosi   = 2;
369   miso   = 3;
370 #LED SIGNALs - higher ACBUS-Nibble
371 #  errled = 5;
372 #  rdyled = 6;
373 #  pgmled = 7;
374 #  vfyled = 8;
375 #Buffer Signal - ADBUS - Nibble
376 #  buff   = 9;
377 ;
378 # This is an implementation of the above with a buffer IC (74AC244) and
379 # 4 LEDs directly attached, active low. The buff and reset pins are
380 # understood (by avrdude) to be active low, so there's no
381 # need to invert the bits.
382 programmer
383   id    = "2232HIO";
384   desc  = "FT2232H based generic programmer";
385   type  = avrftdi;
386   usbvid     = 0x0403;
387 # Note: This PID is reserved for generic H devices and 
388 # should be programmed into the EEPROM
389 #  usbpid     = 0x8A48;
390    usbpid    = 0x6010;
391   usbdev = "A";
392   usbvendor  = "";
393   usbproduct = "";
394   usbsn      = "";
395 #ISP-signals 
396   reset  = 4;
397   sck    = 1;
398   mosi   = 2;
399   miso   = 3;
400   buff   = 5;
401 #LED SIGNALs 
402   errled = ~ 12;
403   rdyled = ~ 15;
404   pgmled = ~ 14;
405   vfyled = ~ 13;
406 ;
407
408 programmer
409   id    = "jtagkey";
410   desc  = "Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2";
411   type  = avrftdi;
412   usbvid     = 0x0403;
413 # Note: This PID is used in all JTAGKey variants
414   usbpid    = 0xCFF8;
415   usbdev = "A";
416   usbvendor  = "";
417   usbproduct = "";
418   usbsn      = "";
419 #ISP-signals => 20 - Pin connector on JTAGKey
420   reset  = 4; # TMS 7 violet
421   sck    = 1; # TCK 9 white
422   mosi   = 2; # TDI 5 green
423   miso   = 3; # TDO 13 orange
424   buff   = 5;
425 # VTG           VREF 1 brown with red tip
426 # GND           GND 20 black
427 # The colors are on the 20 pin breakout cable
428 # from Amontec
429 ;
430
431 programmer
432   id    = "avrisp";
433   desc  = "Atmel AVR ISP";
434   type  = stk500;
435 ;
436
437 programmer
438   id    = "avrispv2";
439   desc  = "Atmel AVR ISP V2";
440   type  =  stk500v2;
441 ;
442
443 programmer
444   id    = "avrispmkII";
445   desc  = "Atmel AVR ISP mkII";
446   type  =  stk500v2;
447 ;
448
449 programmer
450   id    = "avrisp2";
451   desc  = "Atmel AVR ISP mkII";
452   type  =  stk500v2;
453 ;
454
455 programmer
456   id    = "buspirate";
457   desc  = "The Bus Pirate";
458   type  = buspirate;
459 ;
460
461 # This is supposed to be the "default" STK500 entry.
462 # Attempts to select the correct firmware version
463 # by probing for it.  Better use one of the entries
464 # below instead.
465 programmer
466   id    = "stk500";
467   desc  = "Atmel STK500";
468   type  = stk500generic;
469 ;
470
471 programmer
472   id    = "stk500v1";
473   desc  = "Atmel STK500 Version 1.x firmware";
474   type  = stk500;
475 ;
476
477 programmer
478   id    = "mib510";
479   desc  = "Crossbow MIB510 programming board";
480   type  = stk500;
481 ;
482
483 programmer
484   id    = "stk500v2";
485   desc  = "Atmel STK500 Version 2.x firmware";
486   type  = stk500v2;
487 ;
488
489 programmer
490   id    = "stk500pp";
491   desc  = "Atmel STK500 V2 in parallel programming mode";
492   type  = stk500pp;
493 ;
494
495 programmer
496   id    = "stk500hvsp";
497   desc  = "Atmel STK500 V2 in high-voltage serial programming mode";
498   type  = stk500hvsp;
499 ;
500
501 programmer
502   id    = "stk600";
503   desc  = "Atmel STK600";
504   type  = stk600;
505 ;
506
507 programmer
508   id    = "stk600pp";
509   desc  = "Atmel STK600 in parallel programming mode";
510   type  = stk600pp;
511 ;
512
513 programmer
514   id    = "stk600hvsp";
515   desc  = "Atmel STK600 in high-voltage serial programming mode";
516   type  = stk600hvsp;
517 ;
518
519 programmer
520   id    = "avr910";
521   desc  = "Atmel Low Cost Serial Programmer";
522   type  = avr910;
523 ;
524
525 programmer
526   id    = "usbasp";
527   desc  = "USBasp, http://www.fischl.de/usbasp/";
528   type  = usbasp;
529 ;
530
531 programmer
532   id    = "usbtiny";
533   desc  = "USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/";
534   type  = usbtiny;
535 ;
536
537 programmer
538   id    = "butterfly";
539   desc  = "Atmel Butterfly Development Board";
540   type  = butterfly;
541 ;
542
543 programmer
544   id    = "avr109";
545   desc  = "Atmel AppNote AVR109 Boot Loader";
546   type  = butterfly;
547 ;
548
549 programmer
550   id    = "avr911";
551   desc  = "Atmel AppNote AVR911 AVROSP";
552   type  = butterfly;
553 ;
554  
555 # suggested in http://forum.mikrokopter.de/topic-post48317.html
556 programmer
557   id    = "mkbutterfly";
558   desc  = "Mikrokopter.de Butterfly";
559   type  = butterfly_mk;
560 ;
561
562 programmer
563   id    = "butterfly_mk";
564   desc  = "Mikrokopter.de Butterfly";
565   type  = butterfly_mk;
566 ;
567
568 programmer
569   id    = "jtagmkI";
570   desc  = "Atmel JTAG ICE (mkI)";
571   baudrate = 115200;    # default is 115200
572   type  = jtagmki;
573 ;
574
575 # easier to type
576 programmer
577   id    = "jtag1";
578   desc  = "Atmel JTAG ICE (mkI)";
579   baudrate = 115200;    # default is 115200
580   type  = jtagmki;
581 ;
582
583 # easier to type
584 programmer
585   id    = "jtag1slow";
586   desc  = "Atmel JTAG ICE (mkI)";
587   baudrate = 19200;
588   type  = jtagmki;
589 ;
590
591 programmer
592   id    = "jtagmkII";
593   desc  = "Atmel JTAG ICE mkII";
594   baudrate = 19200;    # default is 19200
595   type  = jtagmkii;
596 ;
597
598 # easier to type
599 programmer
600   id    = "jtag2slow";
601   desc  = "Atmel JTAG ICE mkII";
602   baudrate = 19200;    # default is 19200
603   type  = jtagmkii;
604 ;
605
606 # JTAG ICE mkII @ 115200 Bd
607 programmer
608   id    = "jtag2fast";
609   desc  = "Atmel JTAG ICE mkII";
610   baudrate = 115200;
611   type  = jtagmkii;
612 ;
613
614 # make the fast one the default, people will love that
615 programmer
616   id    = "jtag2";
617   desc  = "Atmel JTAG ICE mkII";
618   baudrate = 115200;
619   type  = jtagmkii;
620 ;
621
622 # JTAG ICE mkII in ISP mode
623 programmer
624   id    = "jtag2isp";
625   desc  = "Atmel JTAG ICE mkII in ISP mode";
626   baudrate = 115200;
627   type  = jtagmkii_isp;
628 ;
629
630 # JTAG ICE mkII in debugWire mode
631 programmer
632   id    = "jtag2dw";
633   desc  = "Atmel JTAG ICE mkII in debugWire mode";
634   baudrate = 115200;
635   type  = jtagmkii_dw;
636 ;
637
638 # JTAG ICE mkII in AVR32 mode
639 programmer
640   id    = "jtagmkII_avr32";
641   desc  = "Atmel JTAG ICE mkII im AVR32 mode";
642   baudrate = 115200;
643   type  = jtagmkii_avr32;
644 ;
645
646 # JTAG ICE mkII in AVR32 mode
647 programmer
648   id    = "jtag2avr32";
649   desc  = "Atmel JTAG ICE mkII im AVR32 mode";
650   baudrate = 115200;
651   type  = jtagmkii_avr32;
652 ;
653
654 # JTAG ICE mkII in PDI mode
655 programmer
656   id    = "jtag2pdi";
657   desc  = "Atmel JTAG ICE mkII PDI mode";
658   baudrate = 115200;
659   type  = jtagmkii_pdi;
660 ;
661
662 # AVR Dragon in JTAG mode
663 programmer
664   id    = "dragon_jtag";
665   desc  = "Atmel AVR Dragon in JTAG mode";
666   baudrate = 115200;
667   type  = dragon_jtag;
668 ;
669
670 # AVR Dragon in ISP mode
671 programmer
672   id    = "dragon_isp";
673   desc  = "Atmel AVR Dragon in ISP mode";
674   baudrate = 115200;
675   type  = dragon_isp;
676 ;
677
678 # AVR Dragon in PP mode
679 programmer
680   id    = "dragon_pp";
681   desc  = "Atmel AVR Dragon in PP mode";
682   baudrate = 115200;
683   type  = dragon_pp;
684 ;
685
686 # AVR Dragon in HVSP mode
687 programmer
688   id    = "dragon_hvsp";
689   desc  = "Atmel AVR Dragon in HVSP mode";
690   baudrate = 115200;
691   type  = dragon_hvsp;
692 ;
693
694 # AVR Dragon in debugWire mode
695 programmer
696   id    = "dragon_dw";
697   desc  = "Atmel AVR Dragon in debugWire mode";
698   baudrate = 115200;
699   type  = dragon_dw;
700 ;
701
702 # AVR Dragon in PDI mode
703 programmer
704   id    = "dragon_pdi";
705   desc  = "Atmel AVR Dragon in PDI mode";
706   baudrate = 115200;
707   type  = dragon_pdi;
708 ;
709
710 programmer
711   id    = "pavr";
712   desc  = "Jason Kyle's pAVR Serial Programmer";
713   type  = avr910;
714 ;
715
716 # Parallel port programmers.
717
718 programmer
719   id    = "bsd";
720   desc  = "Brian Dean's Programmer, http://www.bsdhome.com/avrdude/";
721   type  = par;
722   vcc   = 2, 3, 4, 5;
723   reset = 7;
724   sck   = 8;
725   mosi  = 9;
726   miso  = 10;
727 ;
728
729 programmer
730   id    = "stk200";
731   desc  = "STK200";
732   type  = par;
733   buff  = 4, 5;
734   sck   = 6;
735   mosi  = 7;
736   reset = 9;
737   miso  = 10;
738 ;
739
740 # The programming dongle used by the popular Ponyprog
741 # utility.  It is almost similar to the STK200 one,
742 # except that there is a LED indicating that the
743 # programming is currently in progress.
744
745 programmer
746   id    = "pony-stk200";
747   desc  = "Pony Prog STK200";
748   type  = par;
749   buff  = 4, 5;
750   sck   = 6;
751   mosi  = 7;
752   reset = 9;
753   miso  = 10;
754   pgmled = 8; 
755 ;
756
757 programmer
758   id    = "dt006";
759   desc  = "Dontronics DT006";
760   type  = par;
761   reset = 4;
762   sck   = 5;
763   mosi  = 2;
764   miso  = 11;
765 ;
766
767 programmer
768   id    = "dasaftdi";
769   desc  = "FTDI serial port banging, reset=rts sck=dtr mosi=txd miso=cts";
770   type  = serbb;
771   reset = ~7;
772   sck   = ~4;
773   mosi  = ~3;
774   miso  = ~8;
775 ;
776
777 programmer
778   id    = "dasaftdit1";
779   desc  = "FTDI serial port banging, reset=rts sck=dtr mosi=txd miso=cts";
780   type  = serbb;
781   reset = ~7;
782   sck   = ~4;
783   mosi  = ~3;
784   miso  = ~8;
785 ;
786
787
788 programmer
789   id    = "bascom";
790   desc  = "Bascom SAMPLE programming cable";
791   type  = par;
792   reset = 4;
793   sck   = 5;
794   mosi  = 2;
795   miso  = 11;
796 ;
797
798 programmer
799   id     = "alf";
800   desc   = "Nightshade ALF-PgmAVR, http://nightshade.homeip.net/";
801   type   = par;
802   vcc    = 2, 3, 4, 5;
803   buff   = 6;
804   reset  = 7;
805   sck    = 8;
806   mosi   = 9;
807   miso   = 10;
808   errled = 1;
809   rdyled = 14;
810   pgmled = 16;
811   vfyled = 17;
812 ;
813
814 programmer
815   id    = "sp12";
816   desc  = "Steve Bolt's Programmer";
817   type  = par;
818   vcc   = 4,5,6,7,8;
819   reset = 3;
820   sck   = 2;
821   mosi  = 9;
822   miso  = 11;
823 ;
824
825 programmer
826   id     = "picoweb";
827   desc   = "Picoweb Programming Cable, http://www.picoweb.net/";
828   type   = par;
829   reset  = 2;
830   sck    = 3;
831   mosi   = 4;
832   miso   = 13;
833 ;
834
835 programmer
836   id    = "abcmini";
837   desc  = "ABCmini Board, aka Dick Smith HOTCHIP";
838   type  = par;
839   reset = 4;
840   sck   = 3;
841   mosi  = 2;
842   miso  = 10;
843 ;
844
845 programmer
846   id    = "futurlec";
847   desc  = "Futurlec.com programming cable.";
848   type  = par;
849   reset = 3;
850   sck   = 2;
851   mosi  = 1;
852   miso  = 10;
853 ;
854
855
856 # From the contributor of the "xil" jtag cable:
857 # The "vcc" definition isn't really vcc (the cable gets its power from
858 # the programming circuit) but is necessary to switch one of the
859 # buffer lines (trying to add it to the "buff" lines doesn't work in 
860 # avrdude versions before 5.5j).
861 # With this, TMS connects to RESET, TDI to MOSI, TDO to MISO and TCK
862 # to SCK (plus vcc/gnd of course)
863 programmer
864   id    = "xil";
865   desc  = "Xilinx JTAG cable";
866   type  = par;
867   mosi  = 2;
868   sck   = 3;
869   reset = 4;
870   buff  = 5;
871   miso  = 13;
872   vcc   = 6;
873 ;
874
875
876 programmer
877   id = "dapa";
878   desc = "Direct AVR Parallel Access cable";
879   type = par;
880   vcc   = 3;
881   reset = 16;
882   sck = 1;
883   mosi = 2;
884   miso = 11;
885 ;
886
887 programmer
888   id    = "atisp";
889   desc  = "AT-ISP V1.1 programming cable for AVR-SDK1 from <http://micro-research.co.th/> micro-research.co.th";
890   type  = par;
891   reset = ~6;
892   sck   = ~8;
893   mosi  = ~7;
894   miso  = ~10;
895 ;
896
897 programmer
898   id    = "ere-isp-avr";
899   desc  = "ERE ISP-AVR <http://www.ere.co.th/download/sch050713.pdf>";
900   type  = par;
901   reset = ~4;
902   sck   = 3;
903   mosi  = 2;
904   miso  = 10;
905 ;
906
907 programmer
908   id    = "blaster";
909   desc  = "Altera ByteBlaster";
910   type  = par;
911   sck   = 2;
912   miso  = 11;
913   reset = 3;
914   mosi  = 8;
915   buff  = 14;
916 ;
917
918 # It is almost same as pony-stk200, except vcc on pin 5 to auto
919 # disconnect port (download on http://electropol.free.fr)
920 programmer
921   id    = "frank-stk200";
922   desc  = "Frank STK200";
923   type  = par;
924   vcc   = 5;
925   sck   = 6;
926   mosi  = 7;
927   reset = 9;
928   miso  = 10;
929   pgmled = 8;
930 ;
931
932 # The AT98ISP Cable is a simple parallel dongle for AT89 family.
933 # http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2877
934 programmer
935 id = "89isp";
936 desc = "Atmel at89isp cable";
937 type = par;
938 reset = 17;
939 sck = 1;
940 mosi = 2;
941 miso = 10;
942 ;
943
944
945 #
946 # some ultra cheap programmers use bitbanging on the 
947 # serialport.
948 #
949 # PC - DB9 - Pins for RS232:
950 #
951 # GND   5   -- |O
952 #              |   O| <-   9   RI
953 # DTR   4   <- |O   |
954 #              |   O| <-   8   CTS
955 # TXD   3   <- |O   |
956 #              |   O| ->   7   RTS
957 # RXD   2   -> |O   |
958 #              |   O| <-   6   DSR
959 # DCD   1   -> |O
960 #
961 # Using RXD is currently not supported.
962 # Using RI is not supported under Win32 but is supported under Posix.
963
964 # serial ponyprog design (dasa2 in uisp)
965 # reset=!txd sck=rts mosi=dtr miso=cts
966
967 programmer
968   id    = "ponyser";
969   desc  = "design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts";
970   type  = serbb;
971   reset = ~3;
972   sck   = 7;
973   mosi  = 4;
974   miso  = 8;
975 ;
976
977 # Same as above, different name
978 # reset=!txd sck=rts mosi=dtr miso=cts
979
980 programmer
981   id    = "siprog";
982   desc  = "Lancos SI-Prog <http://www.lancos.com/siprogsch.html>";
983   type  = serbb;
984   reset = ~3;
985   sck   = 7;
986   mosi  = 4;
987   miso  = 8;
988 ;
989
990 # unknown (dasa in uisp)
991 # reset=rts sck=dtr mosi=txd miso=cts
992
993 programmer
994   id    = "dasa";
995   desc  = "serial port banging, reset=rts sck=dtr mosi=txd miso=cts";
996   type  = serbb;
997   reset = 7;
998   sck   = 4;
999   mosi  = 3;
1000   miso  = 8;
1001 ;
1002
1003 # unknown (dasa3 in uisp)
1004 # reset=!dtr sck=rts mosi=txd miso=cts
1005
1006 programmer
1007   id    = "dasa3";
1008   desc  = "serial port banging, reset=!dtr sck=rts mosi=txd miso=cts";
1009   type  = serbb;
1010   reset = ~4;
1011   sck   = 7;
1012   mosi  = 3;
1013   miso  = 8;
1014 ;
1015
1016 # C2N232i (jumper configuration "auto")
1017 # reset=dtr sck=!rts mosi=!txd miso=!cts
1018
1019 programmer
1020   id    = "c2n232i";
1021   desc  = "serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts";
1022   type  = serbb;
1023   reset = 4;
1024   sck   = ~7;
1025   mosi  = ~3;
1026   miso  = ~8;
1027 ;
1028
1029 #
1030 # PART DEFINITIONS
1031 #
1032
1033 #------------------------------------------------------------
1034 # ATtiny11
1035 #------------------------------------------------------------
1036
1037 # This is an HVSP-only device.
1038
1039 part
1040     id                  = "t11";
1041     desc                = "ATtiny11";
1042     stk500_devcode      = 0x11;
1043     signature           = 0x1e 0x90 0x04;
1044     chip_erase_delay    = 20000;
1045
1046     timeout             = 200;
1047     hvsp_controlstack     =
1048         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00,
1049         0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
1050         0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
1051         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
1052     hventerstabdelay    = 100;
1053     progmodedelay       = 0;
1054     hvspcmdexedelay     = 0;
1055     synchcycles         = 6;
1056     latchcycles         = 1;
1057     togglevtg           = 1;
1058     poweroffdelay       = 25;
1059     resetdelayms        = 0;
1060     resetdelayus        = 50;
1061     hvleavestabdelay    = 100;
1062     resetdelay          = 25;
1063     chiperasepolltimeout = 40;
1064     chiperasetime       = 0;
1065     programfusepolltimeout = 25;
1066     programlockpolltimeout = 25;
1067
1068     memory "eeprom"
1069         size            = 64;
1070         blocksize       = 64;
1071         readsize        = 256;
1072         delay           = 5;
1073     ;
1074
1075     memory "flash"
1076         size            = 1024;
1077         blocksize       = 128;
1078         readsize        = 256;
1079         delay           = 3;
1080     ;
1081
1082     memory "signature"
1083         size            = 3;
1084     ;
1085
1086     memory "lock"
1087         size            = 1;
1088     ;
1089
1090     memory "calibration"
1091         size            = 1;
1092     ;
1093
1094     memory "fuse"
1095         size            = 1;
1096     ;
1097 ;
1098
1099 #------------------------------------------------------------
1100 # ATtiny12
1101 #------------------------------------------------------------
1102
1103 part
1104     id                  = "t12";
1105     desc                = "ATtiny12";
1106     stk500_devcode      = 0x12;
1107     avr910_devcode      = 0x55;
1108     signature           = 0x1e 0x90 0x05;
1109     chip_erase_delay    = 20000;
1110     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
1111                           "x x x x  x x x x   x x x x  x x x x";
1112
1113     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
1114                           "x x x x  x x x x   x x x x  x x x x";
1115
1116     timeout             = 200;
1117     stabdelay           = 100;
1118     cmdexedelay         = 25;
1119     synchloops          = 32;
1120     bytedelay           = 0;
1121     pollindex           = 3;
1122     pollvalue           = 0x53;
1123     predelay            = 1;
1124     postdelay           = 1;
1125     pollmethod          = 0;
1126
1127     hvsp_controlstack   =
1128         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00,
1129         0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
1130         0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
1131         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
1132     hventerstabdelay    = 100;
1133     hvspcmdexedelay     = 0;
1134     synchcycles         = 6;
1135     latchcycles         = 1;
1136     togglevtg           = 1;
1137     poweroffdelay       = 25;
1138     resetdelayms        = 0;
1139     resetdelayus        = 50;
1140     hvleavestabdelay    = 100;
1141     resetdelay          = 25;
1142     chiperasepolltimeout = 40;
1143     chiperasetime       = 0;
1144     programfusepolltimeout = 25;
1145     programlockpolltimeout = 25;
1146
1147     memory "eeprom"
1148         size            = 64;
1149         min_write_delay = 9000;
1150         max_write_delay = 20000;
1151         readback_p1     = 0xff;
1152         readback_p2     = 0xff;
1153         read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
1154                           "x  x a5 a4  a3 a2 a1 a0    o o o o  o o o o";
1155
1156         write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
1157                           "x  x a5 a4  a3 a2 a1 a0    i i i i  i i i i";
1158
1159         mode            = 0x04;
1160         delay           = 8;
1161         blocksize       = 64;
1162         readsize        = 256;
1163     ;
1164
1165     memory "flash"
1166         size            = 1024;
1167         min_write_delay = 4500;
1168         max_write_delay = 20000;
1169         readback_p1     = 0xff;
1170         readback_p2     = 0xff;
1171         read_lo         = "  0  0  1  0   0  0  0  0",
1172                           "  x  x  x  x   x  x  x a8",
1173                           " a7 a6 a5 a4  a3 a2 a1 a0",
1174                           "  o  o  o  o   o  o  o  o";
1175
1176         read_hi         = "  0  0  1  0   1  0  0  0",
1177                           "  x  x  x  x   x  x  x a8",
1178                           " a7 a6 a5 a4  a3 a2 a1 a0",
1179                           "  o  o  o  o   o  o  o  o";
1180
1181         write_lo        = "  0  1  0  0   0  0  0  0",
1182                           "  x  x  x  x   x  x  x a8",
1183                           " a7 a6 a5 a4  a3 a2 a1 a0",
1184                           "  i  i  i  i   i  i  i  i";
1185
1186         write_hi        = "  0  1  0  0   1  0  0  0",
1187                           "  x  x  x  x   x  x  x a8",
1188                           " a7 a6 a5 a4  a3 a2 a1 a0",
1189                           "  i  i  i  i   i  i  i  i";
1190
1191         mode            = 0x04;
1192         delay           = 5;
1193         blocksize       = 128;
1194         readsize        = 256;
1195     ;
1196
1197     memory "signature"
1198         size            = 3;
1199         read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
1200                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
1201     ;
1202
1203     memory "lock"
1204         size            = 1;
1205         read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
1206                           "x  x  x  x   x  x  x  x    x x x x  x o o x";
1207
1208         write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 i i 1",
1209                           "x  x  x  x   x  x  x  x    x x x x  x x x x";
1210         min_write_delay = 9000;
1211         max_write_delay = 9000;
1212     ;
1213
1214     memory "calibration"
1215         size            = 1;
1216         read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
1217                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
1218     ;
1219
1220     memory "fuse"
1221         size            = 1;
1222         read            = "0  1  0  1   0  0  0  0    x x x x  x x x x",
1223                           "x  x  x  x   x  x  x  x    o o o o  o o o o";
1224
1225         write           = "1  0  1  0   1  1  0  0    1 0 1 x  x x x x",
1226                           "x  x  x  x   x  x  x  x    i i i i  i i i i";
1227         min_write_delay = 9000;
1228         max_write_delay = 9000;
1229     ;
1230 ;
1231
1232 #------------------------------------------------------------
1233 # ATtiny13
1234 #------------------------------------------------------------
1235
1236 part
1237     id                  = "t13";
1238     desc                = "ATtiny13";
1239      has_debugwire = yes;
1240      flash_instr   = 0xB4, 0x0E, 0x1E;
1241      eeprom_instr  = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
1242                      0xBC, 0x0E, 0xB4, 0x0E, 0xBA, 0x0D, 0xBB, 0xBC,
1243                      0x99, 0xE1, 0xBB, 0xAC;
1244     stk500_devcode      = 0x14;
1245     signature           = 0x1e 0x90 0x07;
1246     chip_erase_delay    = 4000;
1247     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
1248                           "x x x x  x x x x   x x x x  x x x x";
1249
1250     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
1251                           "x x x x  x x x x   x x x x  x x x x";
1252
1253     timeout             = 200;
1254     stabdelay           = 100;
1255     cmdexedelay         = 25;
1256     synchloops          = 32;
1257     bytedelay           = 0;
1258     pollindex           = 3;
1259     pollvalue           = 0x53;
1260     predelay            = 1;
1261     postdelay           = 1;
1262     pollmethod          = 1;
1263
1264     hvsp_controlstack     =
1265         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
1266         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
1267         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
1268         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
1269     hventerstabdelay    = 100;
1270     progmodedelay       = 0;
1271     hvspcmdexedelay     = 0;
1272     synchcycles         = 6;
1273     latchcycles         = 1;
1274     togglevtg           = 1;
1275     poweroffdelay       = 25;
1276     resetdelayms        = 0;
1277     resetdelayus        = 90;
1278     hvleavestabdelay    = 100;
1279     resetdelay          = 25;
1280     chiperasepolltimeout = 40;
1281     chiperasetime       = 0;
1282     programfusepolltimeout = 25;
1283     programlockpolltimeout = 25;
1284
1285     memory "eeprom"
1286         size            = 64;
1287         page_size       = 4;
1288         min_write_delay = 4000;
1289         max_write_delay = 4000;
1290         readback_p1     = 0xff;
1291         readback_p2     = 0xff;
1292         read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x x",
1293                           "x  x a5 a4  a3 a2 a1 a0    o o o o  o o o o";
1294
1295         write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
1296                           "x  x a5 a4  a3 a2 a1 a0    i i i i  i i i i";
1297
1298         loadpage_lo     = "  1   1   0   0      0   0   0   1",
1299                           "  0   0   0   0      0   0   0   0",
1300                           "  0   0   0   0      0   0  a1  a0",
1301                           "  i   i   i   i      i   i   i   i";
1302
1303         writepage       = "  1   1   0   0      0   0   1   0",
1304                           "  0   0   x   x      x   x   x   x",
1305                           "  x   x  a5  a4     a3  a2   0   0",
1306                           "  x   x   x   x      x   x   x   x";
1307
1308         mode            = 0x41;
1309         delay           = 5;
1310         blocksize       = 4;
1311         readsize        = 256;
1312     ;
1313
1314     memory "flash"
1315         paged           = yes;
1316         size            = 1024;
1317         page_size       = 32;
1318         num_pages       = 32;
1319         min_write_delay = 4500;
1320         max_write_delay = 4500;
1321         readback_p1     = 0xff;
1322         readback_p2     = 0xff;
1323         read_lo         = "  0  0  1  0   0  0  0  0",
1324                           "  0  0  0  0   0  0  0 a8",
1325                           " a7 a6 a5 a4  a3 a2 a1 a0",
1326                           "  o  o  o  o   o  o  o  o";
1327
1328         read_hi         = "  0  0  1  0   1  0  0  0",
1329                           "  0  0  0  0   0  0  0 a8",
1330                           " a7 a6 a5 a4  a3 a2 a1 a0",
1331                           "  o  o  o  o   o  o  o  o";
1332
1333         loadpage_lo     = "  0  1  0  0   0  0  0  0",
1334                           "  0  0  0  x   x  x  x  x",
1335                           "  x  x  x  x  a3 a2 a1 a0",
1336                           "  i  i  i  i   i  i  i  i";
1337
1338         loadpage_hi     = "  0  1  0  0   1  0  0  0",
1339                           "  0  0  0  x   x  x  x  x",
1340                           "  x  x  x  x  a3 a2 a1 a0",
1341                           "  i  i  i  i   i  i  i  i";
1342
1343         writepage       = "  0  1  0  0   1  1  0  0",
1344                           "  0  0  0  0   0  0  0 a8",
1345                           " a7 a6 a5 a4   x  x  x  x",
1346                           "  x  x  x  x   x  x  x  x";
1347
1348         mode            = 0x41;
1349         delay           = 6;
1350         blocksize       = 32;
1351         readsize        = 256;
1352     ;
1353
1354     memory "signature"
1355         size            = 3;
1356         read            = "0  0  1  1   0  0  0  0    0 0 0 x  x x x x",
1357                           "x  x  x  x   x  x a1 a0    o o o o  o o o o";
1358     ;
1359
1360     memory "lock"
1361         size            = 1;
1362         min_write_delay = 4500;
1363         max_write_delay = 4500;
1364
1365         read            = "0  1  0  1   1  0  0  0    0 0 0 0  0 0 0 0",
1366                           "x  x  x  x   x  x  x  x    x x o o  o o o o";
1367
1368         write           = "1  0  1  0   1  1  0  0    1 1 1 x  x x x x",
1369                           "x  x  x  x   x  x  x  x    1 1 i i  i i i i";
1370     ;
1371
1372     memory "calibration"
1373         size            = 2;
1374         read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
1375                           "0  0  0  0   0  0  0 a0    o o o o  o o o o";
1376     ;
1377
1378     memory "lfuse"
1379         size            = 1;
1380         min_write_delay = 4500;
1381         max_write_delay = 4500;
1382
1383         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
1384                           "x x x x  x x x x  i i i i  i i i i";
1385
1386         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
1387                           "x x x x  x x x x  o o o o  o o o o";
1388       ;
1389
1390     memory "hfuse"
1391         size            = 1;
1392         min_write_delay = 4500;
1393         max_write_delay = 4500;
1394
1395         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
1396                           "x x x x  x x x x  i i i i  i i i i";
1397
1398         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
1399                           "x x x x  x x x x  o o o o  o o o o";
1400       ;
1401
1402 ;
1403
1404
1405 #------------------------------------------------------------
1406 # ATtiny15
1407 #------------------------------------------------------------
1408
1409 part
1410     id                  = "t15";
1411     desc                = "ATtiny15";
1412     stk500_devcode      = 0x13;
1413     avr910_devcode      = 0x56;
1414     signature           = 0x1e 0x90 0x06;
1415     chip_erase_delay    = 8200;
1416     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
1417                           "x x x x  x x x x   x x x x  x x x x";
1418
1419     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
1420                           "x x x x  x x x x   x x x x  x x x x";
1421
1422     timeout             = 200;
1423     stabdelay           = 100;
1424     cmdexedelay         = 25;
1425     synchloops          = 32;
1426     bytedelay           = 0;
1427     pollindex           = 3;
1428     pollvalue           = 0x53;
1429     predelay            = 1;
1430     postdelay           = 1;
1431     pollmethod          = 0;
1432
1433     hvsp_controlstack   =
1434         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00,
1435         0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
1436         0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
1437         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
1438     hventerstabdelay    = 100;
1439     hvspcmdexedelay     = 5;
1440     synchcycles         = 6;
1441     latchcycles         = 16;
1442     togglevtg           = 1;
1443     poweroffdelay       = 25;
1444     resetdelayms        = 0;
1445     resetdelayus        = 50;
1446     hvleavestabdelay    = 100;
1447     resetdelay          = 25;
1448     chiperasepolltimeout = 40;
1449     chiperasetime       = 0;
1450     programfusepolltimeout = 25;
1451     programlockpolltimeout = 25;
1452
1453     memory "eeprom"
1454         size            = 64;
1455         min_write_delay = 8200;
1456         max_write_delay = 8200;
1457         readback_p1     = 0xff;
1458         readback_p2     = 0xff;
1459         read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
1460                           "x  x a5 a4  a3 a2 a1 a0    o o o o  o o o o";
1461
1462         write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
1463                           "x  x a5 a4  a3 a2 a1 a0    i i i i  i i i i";
1464
1465         mode            = 0x04;
1466         delay           = 10;
1467         blocksize       = 64;
1468         readsize        = 256;
1469     ;
1470
1471     memory "flash"
1472         size            = 1024;
1473         min_write_delay = 4100;
1474         max_write_delay = 4100;
1475         readback_p1     = 0xff;
1476         readback_p2     = 0xff;
1477         read_lo         = "  0  0  1  0   0  0  0  0",
1478                           "  x  x  x  x   x  x  x a8",
1479                           " a7 a6 a5 a4  a3 a2 a1 a0",
1480                           "  o  o  o  o   o  o  o  o";
1481
1482         read_hi         = "  0  0  1  0   1  0  0  0",
1483                           "  x  x  x  x   x  x  x a8",
1484                           " a7 a6 a5 a4  a3 a2 a1 a0",
1485                           "  o  o  o  o   o  o  o  o";
1486
1487         write_lo        = "  0  1  0  0   0  0  0  0",
1488                           "  x  x  x  x   x  x  x a8",
1489                           " a7 a6 a5 a4  a3 a2 a1 a0",
1490                           "  i  i  i  i   i  i  i  i";
1491
1492         write_hi        = "  0  1  0  0   1  0  0  0",
1493                           "  x  x  x  x   x  x  x a8",
1494                           " a7 a6 a5 a4  a3 a2 a1 a0",
1495                           "  i  i  i  i   i  i  i  i";
1496
1497         mode            = 0x04;
1498         delay           = 5;
1499         blocksize       = 128;
1500         readsize        = 256;
1501     ;
1502
1503     memory "signature"
1504         size            = 3;
1505         read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
1506                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
1507     ;
1508
1509     memory "lock"
1510         size            = 1;
1511         read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
1512                           "x  x  x  x   x  x  x  x    x x x x  x o o x";
1513
1514         write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 i i 1",
1515                           "x  x  x  x   x  x  x  x    x x x x  x x x x";
1516         min_write_delay = 9000;
1517         max_write_delay = 9000;
1518     ;
1519
1520     memory "calibration"
1521         size            = 1;
1522         read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
1523                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
1524     ;
1525
1526     memory "fuse"
1527         size            = 1;
1528         read            = "0  1  0  1   0  0  0  0    x x x x  x x x x",
1529                           "x  x  x  x   x  x  x  x    o o o o  x x o o";
1530
1531         write           = "1  0  1  0   1  1  0  0    1 0 1 x  x x x x",
1532                           "x  x  x  x   x  x  x  x    i i i i  1 1 i i";
1533         min_write_delay = 9000;
1534         max_write_delay = 9000;
1535     ;
1536 ;
1537
1538 #------------------------------------------------------------
1539 # AT90s1200
1540 #------------------------------------------------------------
1541
1542 part
1543     id               = "1200";
1544     desc             = "AT90S1200";
1545     is_at90s1200     = yes;
1546     stk500_devcode   = 0x33;
1547     avr910_devcode   = 0x13;
1548     signature        = 0x1e 0x90 0x01;
1549     pagel            = 0xd7;
1550     bs2              = 0xa0;
1551     chip_erase_delay = 20000;
1552     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
1553                        "x x x x  x x x x    x x x x  x x x x";
1554
1555     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
1556                        "x x x x  x x x x    x x x x  x x x x";
1557
1558     timeout             = 200;
1559     stabdelay           = 100;
1560     cmdexedelay         = 25;
1561     synchloops          = 1;
1562     bytedelay           = 0;
1563     pollindex           = 0;
1564     pollvalue           = 0xFF;
1565     predelay            = 1;
1566     postdelay           = 1;
1567     pollmethod          = 0;
1568
1569     pp_controlstack     =
1570         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
1571         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
1572         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
1573         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
1574     hventerstabdelay    = 100;
1575     progmodedelay       = 0;
1576     latchcycles         = 0;
1577     togglevtg           = 0;
1578     poweroffdelay       = 0;
1579     resetdelayms        = 0;
1580     resetdelayus        = 0;
1581     hvleavestabdelay    = 15;
1582     chiperasepulsewidth = 15;
1583     chiperasepolltimeout = 0;
1584     programfusepulsewidth = 2;
1585     programfusepolltimeout = 0;
1586     programlockpulsewidth = 0;
1587     programlockpolltimeout = 1;
1588
1589     memory "eeprom"
1590         size            = 64;
1591         min_write_delay = 4000;
1592         max_write_delay = 9000;
1593         readback_p1     = 0x00;
1594         readback_p2     = 0xff;
1595         read            = "1 0  1  0   0  0  0  0   x x x x  x x x x", 
1596                           "x x a5 a4  a3 a2 a1 a0   o o o o  o o o o";
1597
1598         write           = "1 1  0  0   0  0  0  0   x x x x  x x x x",
1599                           "x x a5 a4  a3 a2 a1 a0   i i i i  i i i i";
1600
1601         mode            = 0x04;
1602         delay           = 20;
1603         blocksize       = 32;
1604         readsize        = 256;
1605       ;
1606     memory "flash"
1607         size            = 1024;
1608         min_write_delay = 4000;
1609         max_write_delay = 9000;
1610         readback_p1     = 0xff;
1611         readback_p2     = 0xff;
1612         read_lo         = "  0   0   1   0    0   0   0   0",
1613                           "  x   x   x   x    x   x   x  a8",
1614                           " a7  a6  a5  a4   a3  a2  a1  a0",
1615                           "  o   o   o   o    o   o   o   o";
1616
1617         read_hi         = "  0   0   1   0    1   0   0   0",
1618                           "  x   x   x   x    x   x   x  a8",
1619                           " a7  a6  a5  a4   a3  a2  a1  a0",
1620                           "  o   o   o   o    o   o   o   o";
1621
1622         write_lo        = "  0   1   0   0    0   0   0   0",
1623                           "  x   x   x   x    x   x   x  a8",
1624                           " a7  a6  a5  a4   a3  a2  a1  a0",
1625                           "  i   i   i   i    i   i   i   i";
1626
1627         write_hi        = "  0   1   0   0    1   0   0   0",
1628                           "  x   x   x   x    x   x   x  a8",
1629                           " a7  a6  a5  a4   a3  a2  a1  a0",
1630                           "  i   i   i   i    i   i   i   i";
1631
1632         mode            = 0x02;
1633         delay           = 15;
1634         blocksize       = 128;
1635         readsize        = 256;
1636       ;
1637     memory "signature"
1638         size            = 3;
1639         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
1640                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
1641       ;
1642     memory "fuse"
1643         size            = 1;
1644       ;
1645     memory "lock"
1646         size            = 1;
1647         min_write_delay = 9000;
1648         max_write_delay = 20000;
1649         write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
1650                           "x x x x  x x x x   x x x x  x x x x";
1651       ;
1652   ;
1653
1654 #------------------------------------------------------------
1655 # AT90s4414
1656 #------------------------------------------------------------
1657
1658 part
1659     id               = "4414";
1660     desc             = "AT90S4414";
1661     stk500_devcode   = 0x50;
1662     avr910_devcode   = 0x28;
1663     signature        = 0x1e 0x92 0x01;
1664     chip_erase_delay = 20000;
1665     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
1666                        "x x x x  x x x x    x x x x  x x x x";
1667
1668     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
1669                        "x x x x  x x x x    x x x x  x x x x";
1670
1671     timeout             = 200;
1672     stabdelay           = 100;
1673     cmdexedelay         = 25;
1674     synchloops          = 32;
1675     bytedelay           = 0;
1676     pollindex           = 3;
1677     pollvalue           = 0x53;
1678     predelay            = 1;
1679     postdelay           = 1;
1680     pollmethod          = 0;
1681
1682     pp_controlstack     =
1683         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
1684         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
1685         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
1686         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
1687     hventerstabdelay    = 100;
1688     progmodedelay       = 0;
1689     latchcycles         = 0;
1690     togglevtg           = 0;
1691     poweroffdelay       = 0;
1692     resetdelayms        = 0;
1693     resetdelayus        = 0;
1694     hvleavestabdelay    = 15;
1695     chiperasepulsewidth = 15;
1696     chiperasepolltimeout = 0;
1697     programfusepulsewidth = 2;
1698     programfusepolltimeout = 0;
1699     programlockpulsewidth = 0;
1700     programlockpolltimeout = 1;
1701
1702     memory "eeprom"
1703         size            = 256;
1704         min_write_delay = 9000;
1705         max_write_delay = 20000;
1706         readback_p1     = 0x80;
1707         readback_p2     = 0x7f;
1708         read            = " 1  0  1  0   0  0  0  0  x x x x  x x x a8", 
1709                           "a7 a6 a5 a4 a3 a2 a1 a0   o o o o  o o o o";
1710
1711         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x a8",
1712                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
1713
1714         mode            = 0x04;
1715         delay           = 12;
1716         blocksize       = 64;
1717         readsize        = 256;
1718       ;
1719     memory "flash"
1720         size            = 4096;
1721         min_write_delay = 9000;
1722         max_write_delay = 20000;
1723         readback_p1     = 0x7f;
1724         readback_p2     = 0x7f;
1725         read_lo         = "  0   0   1   0    0   0   0   0",
1726                           "  x   x   x   x  a11 a10  a9  a8",
1727                           " a7  a6  a5  a4   a3  a2  a1  a0",
1728                           "  o   o   o   o    o   o   o   o";
1729
1730         read_hi         = "  0   0   1   0    1   0   0   0",
1731                           "  x   x   x   x  a11 a10  a9  a8",
1732                           " a7  a6  a5  a4   a3  a2  a1  a0",
1733                           "  o   o   o   o    o   o   o   o";
1734
1735         write_lo        = "  0   1   0   0    0   0   0   0",
1736                           "  x   x   x   x  a11 a10  a9  a8",
1737                           " a7  a6  a5  a4   a3  a2  a1  a0",
1738                           "  i   i   i   i    i   i   i   i";
1739
1740         write_hi        = "  0   1   0   0    1   0   0   0",
1741                           "  x   x   x   x  a11 a10  a9  a8",
1742                           " a7  a6  a5  a4   a3  a2  a1  a0",
1743                           "  i   i   i   i    i   i   i   i";
1744
1745         mode            = 0x04;
1746         delay           = 12;
1747         blocksize       = 64;
1748         readsize        = 256;
1749       ;
1750     memory "signature"
1751         size            = 3;
1752         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
1753                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
1754       ;
1755     memory "fuse"
1756         size            = 1;
1757       ;
1758     memory "lock"
1759         size            = 1;
1760         write           = "1  0  1  0   1  1  0  0   1  1  1  1   1  i  i  1",
1761                           "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  x";
1762         min_write_delay = 9000;
1763         max_write_delay = 9000;
1764       ;
1765   ;
1766
1767 #------------------------------------------------------------
1768 # AT90s2313
1769 #------------------------------------------------------------
1770
1771 part
1772     id               = "2313";
1773     desc             = "AT90S2313";
1774     stk500_devcode   = 0x40;
1775     avr910_devcode   = 0x20;
1776     signature        = 0x1e 0x91 0x01;
1777     chip_erase_delay = 20000;
1778     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
1779                        "x x x x  x x x x    x x x x  x x x x";
1780
1781     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
1782                        "x x x x  x x x x    x x x x  x x x x";
1783
1784     timeout             = 200;
1785     stabdelay           = 100;
1786     cmdexedelay         = 25;
1787     synchloops          = 32;
1788     bytedelay           = 0;
1789     pollindex           = 3;
1790     pollvalue           = 0x53;
1791     predelay            = 1;
1792     postdelay           = 1;
1793     pollmethod          = 0;
1794
1795     pp_controlstack     =
1796         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
1797         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
1798         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
1799         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
1800     hventerstabdelay    = 100;
1801     progmodedelay       = 0;
1802     latchcycles         = 0;
1803     togglevtg           = 0;
1804     poweroffdelay       = 0;
1805     resetdelayms        = 0;
1806     resetdelayus        = 0;
1807     hvleavestabdelay    = 15;
1808     chiperasepulsewidth = 15;
1809     chiperasepolltimeout = 0;
1810     programfusepulsewidth = 2;
1811     programfusepolltimeout = 0;
1812     programlockpulsewidth = 0;
1813     programlockpolltimeout = 1;
1814
1815     memory "eeprom"
1816         size            = 128;
1817         min_write_delay = 4000;
1818         max_write_delay = 9000;
1819         readback_p1     = 0x80;
1820         readback_p2     = 0x7f;
1821         read            = "1  0  1  0   0  0  0  0   x x x x  x x x x", 
1822                           "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
1823
1824         write           = "1  1  0  0   0  0  0  0   x x x x  x x x x",
1825                           "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
1826
1827         mode            = 0x04;
1828         delay           = 12;
1829         blocksize       = 64;
1830         readsize        = 256;
1831       ;
1832     memory "flash"
1833         size            = 2048;
1834         min_write_delay = 4000;
1835         max_write_delay = 9000;
1836         readback_p1     = 0x7f;
1837         readback_p2     = 0x7f;
1838         read_lo         = "  0   0   1   0    0   0   0   0",
1839                           "  x   x   x   x    x   x  a9  a8",
1840                           " a7  a6  a5  a4   a3  a2  a1  a0",
1841                           "  o   o   o   o    o   o   o   o";
1842
1843         read_hi         = "  0   0   1   0    1   0   0   0",
1844                           "  x   x   x   x    x   x  a9  a8",
1845                           " a7  a6  a5  a4   a3  a2  a1  a0",
1846                           "  o   o   o   o    o   o   o   o";
1847
1848         write_lo        = "  0   1   0   0    0   0   0   0",
1849                           "  x   x   x   x    x   x  a9  a8",
1850                           " a7  a6  a5  a4   a3  a2  a1  a0",
1851                           "  i   i   i   i    i   i   i   i";
1852
1853         write_hi        = "  0   1   0   0    1   0   0   0",
1854                           "  x   x   x   x    x   x  a9  a8",
1855                           " a7  a6  a5  a4   a3  a2  a1  a0",
1856                           "  i   i   i   i    i   i   i   i";
1857
1858         mode            = 0x04;
1859         delay           = 12;
1860         blocksize       = 128;
1861         readsize        = 256;
1862       ;
1863     memory "signature"
1864         size            = 3;
1865         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
1866                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
1867       ;
1868     memory "fuse"
1869         size            = 1;
1870       ;
1871     memory "lock"
1872         size            = 1;
1873         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x i i x",
1874                           "x x x x  x x x x  x x x x  x x x x";
1875         min_write_delay = 9000;
1876         max_write_delay = 9000;
1877       ;
1878   ;
1879
1880 #------------------------------------------------------------
1881 # AT90s2333
1882 #------------------------------------------------------------
1883
1884 part
1885     id               = "2333";
1886 ##### WARNING: No XML file for device 'AT90S2333'! #####
1887     desc             = "AT90S2333";
1888     stk500_devcode   = 0x42;
1889     avr910_devcode   = 0x34;
1890     signature        = 0x1e 0x91 0x05;
1891     chip_erase_delay = 20000;
1892     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
1893                        "x x x x  x x x x    x x x x  x x x x";
1894
1895     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
1896                        "x x x x  x x x x    x x x x  x x x x";
1897
1898     timeout             = 200;
1899     stabdelay           = 100;
1900     cmdexedelay         = 25;
1901     synchloops          = 32;
1902     bytedelay           = 0;
1903     pollindex           = 3;
1904     pollvalue           = 0x53;
1905     predelay            = 1;
1906     postdelay           = 1;
1907     pollmethod          = 0;
1908
1909     pp_controlstack     =
1910         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
1911         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
1912         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
1913         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
1914     hventerstabdelay    = 100;
1915     progmodedelay       = 0;
1916     latchcycles         = 0;
1917     togglevtg           = 0;
1918     poweroffdelay       = 0;
1919     resetdelayms        = 0;
1920     resetdelayus        = 0;
1921     hvleavestabdelay    = 15;
1922     chiperasepulsewidth = 15;
1923     chiperasepolltimeout = 0;
1924     programfusepulsewidth = 2;
1925     programfusepolltimeout = 0;
1926     programlockpulsewidth = 0;
1927     programlockpolltimeout = 1;
1928
1929     memory "eeprom"
1930         size            = 128;
1931         min_write_delay = 9000;
1932         max_write_delay = 20000;
1933         readback_p1     = 0x00;
1934         readback_p2     = 0xff;
1935         read            = "1  0  1  0   0  0  0  0   x x x x  x x x x", 
1936                           "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
1937
1938         write           = "1  1  0  0   0  0  0  0   x x x x  x x x x",
1939                           "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
1940
1941         mode            = 0x04;
1942         delay           = 12;
1943         blocksize       = 128;
1944         readsize        = 256;
1945       ;
1946
1947     memory "flash"
1948         size            = 2048;
1949         min_write_delay = 9000;
1950         max_write_delay = 20000;
1951         readback_p1     = 0xff;
1952         readback_p2     = 0xff;
1953         read_lo         = "  0   0   1   0    0   0   0   0",
1954                           "  x   x   x   x    x   x  a9  a8",
1955                           " a7  a6  a5  a4   a3  a2  a1  a0",
1956                           "  o   o   o   o    o   o   o   o";
1957
1958         read_hi         = "  0   0   1   0    1   0   0   0",
1959                           "  x   x   x   x    x   x  a9  a8",
1960                           " a7  a6  a5  a4   a3  a2  a1  a0",
1961                           "  o   o   o   o    o   o   o   o";
1962
1963         write_lo        = "  0   1   0   0    0   0   0   0",
1964                           "  x   x   x   x    x   x  a9  a8",
1965                           " a7  a6  a5  a4   a3  a2  a1  a0",
1966                           "  i   i   i   i    i   i   i   i";
1967
1968         write_hi        = "  0   1   0   0    1   0   0   0",
1969                           "  x   x   x   x    x   x  a9  a8",
1970                           " a7  a6  a5  a4   a3  a2  a1  a0",
1971                           "  i   i   i   i    i   i   i   i";
1972
1973         mode            = 0x04;
1974         delay           = 12;
1975         blocksize       = 128;
1976         readsize        = 256;
1977       ;
1978
1979     memory "signature"
1980         size            = 3;
1981         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
1982                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
1983       ;
1984     memory "fuse"
1985         size            = 1;
1986         min_write_delay = 9000;
1987         max_write_delay = 20000;
1988         pwroff_after_write = yes;
1989         read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
1990                           "x x x x  x x x x   x x o o  o o o o";
1991
1992         write           = "1 0 1 0  1 1 0 0   1 0 1 i  i i i i",
1993                           "x x x x  x x x x   x x x x  x x x x";
1994       ;
1995     memory "lock"
1996         size            = 1;
1997         min_write_delay = 9000;
1998         max_write_delay = 20000;
1999         read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2000                           "x x x x  x x x x   x x x x  x o o x";
2001
2002         write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2003                           "x x x x  x x x x   x x x x  x x x x";
2004       ;
2005   ;
2006
2007
2008 #------------------------------------------------------------
2009 # AT90s2343 (also AT90s2323 and ATtiny22)
2010 #------------------------------------------------------------
2011
2012 part
2013     id               = "2343";
2014     desc             = "AT90S2343";
2015     stk500_devcode   = 0x43;
2016     avr910_devcode   = 0x4c;
2017     signature        = 0x1e 0x91 0x03;
2018     chip_erase_delay = 18000;
2019     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2020                        "x x x x  x x x x    x x x x  x x x x";
2021
2022     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
2023                        "x x x x  x x x x    x x x x  x x x x";
2024
2025     timeout             = 200;
2026     stabdelay           = 100;
2027     cmdexedelay         = 25;
2028     synchloops          = 32;
2029     bytedelay           = 0;
2030     pollindex           = 3;
2031     pollvalue           = 0x53;
2032     predelay            = 1;
2033     postdelay           = 1;
2034     pollmethod          = 0;
2035
2036     hvsp_controlstack   =
2037         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00,
2038         0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
2039         0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
2040         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
2041     hventerstabdelay    = 100;
2042     hvspcmdexedelay     = 0;
2043     synchcycles         = 6;
2044     latchcycles         = 1;
2045     togglevtg           = 0;
2046     poweroffdelay       = 25;
2047     resetdelayms        = 0;
2048     resetdelayus        = 50;
2049     hvleavestabdelay    = 100;
2050     resetdelay          = 25;
2051     chiperasepolltimeout = 40;
2052     chiperasetime       = 0;
2053     programfusepolltimeout = 25;
2054     programlockpolltimeout = 25;
2055
2056     memory "eeprom"
2057         size            = 128;
2058         min_write_delay = 9000;
2059         max_write_delay = 20000;
2060         readback_p1     = 0x00;
2061         readback_p2     = 0xff;
2062         read            = "1  0  1  0   0  0  0  0   0 0 0 0  0 0 0 0", 
2063                           "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2064
2065         write           = "1  1  0  0   0  0  0  0   0 0 0 0  0 0 0 0",
2066                           "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2067
2068         mode            = 0x04;
2069         delay           = 12;
2070         blocksize       = 64;
2071         readsize        = 256;
2072       ;
2073     memory "flash"
2074         size            = 2048;
2075         min_write_delay = 9000;
2076         max_write_delay = 20000;
2077         readback_p1     = 0xff;
2078         readback_p2     = 0xff;
2079         read_lo         = "  0   0   1   0    0   0   0   0",
2080                           "  x   x   x   x    x   x  a9  a8",
2081                           " a7  a6  a5  a4   a3  a2  a1  a0",
2082                           "  o   o   o   o    o   o   o   o";
2083
2084         read_hi         = "  0   0   1   0    1   0   0   0",
2085                           "  x   x   x   x    x   x  a9  a8",
2086                           " a7  a6  a5  a4   a3  a2  a1  a0",
2087                           "  o   o   o   o    o   o   o   o";
2088
2089         write_lo        = "  0   1   0   0    0   0   0   0",
2090                           "  x   x   x   x    x   x  a9  a8",
2091                           " a7  a6  a5  a4   a3  a2  a1  a0",
2092                           "  i   i   i   i    i   i   i   i";
2093
2094         write_hi        = "  0   1   0   0    1   0   0   0",
2095                           "  x   x   x   x    x   x  a9  a8",
2096                           " a7  a6  a5  a4   a3  a2  a1  a0",
2097                           "  i   i   i   i    i   i   i   i";
2098
2099         mode            = 0x04;
2100         delay           = 12;
2101         blocksize       = 128;
2102         readsize        = 128;
2103       ;
2104     memory "signature"
2105         size            = 3;
2106         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2107                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2108       ;
2109     memory "fuse"
2110         size            = 1;
2111         min_write_delay = 9000;
2112         max_write_delay = 20000;
2113         read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2114                           "x x x x  x x x x   o o o x  x x x o";
2115
2116         write           = "1 0 1 0  1 1 0 0   1 0 1 1  1 1 1 i",
2117                           "x x x x  x x x x   x x x x  x x x x";
2118       ;
2119     memory "lock"
2120         size            = 1;
2121         min_write_delay = 9000;
2122         max_write_delay = 20000;
2123         read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2124                           "x x x x  x x x x   o o o x  x x x o";
2125
2126         write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2127                           "x x x x  x x x x   x x x x  x x x x";
2128       ;
2129   ;
2130
2131
2132 #------------------------------------------------------------
2133 # AT90s4433
2134 #------------------------------------------------------------
2135
2136 part
2137     id               = "4433";
2138     desc             = "AT90S4433";
2139     stk500_devcode   = 0x51;
2140     avr910_devcode   = 0x30;
2141     signature        = 0x1e 0x92 0x03;
2142     chip_erase_delay = 20000;
2143     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2144                        "x x x x  x x x x    x x x x  x x x x";
2145
2146     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2147                        "x x x x  x x x x    x x x x  x x x x";
2148
2149     timeout             = 200;
2150     stabdelay           = 100;
2151     cmdexedelay         = 25;
2152     synchloops          = 32;
2153     bytedelay           = 0;
2154     pollindex           = 3;
2155     pollvalue           = 0x53;
2156     predelay            = 1;
2157     postdelay           = 1;
2158     pollmethod          = 0;
2159
2160     pp_controlstack     =
2161         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2162         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2163         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2164         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2165     hventerstabdelay    = 100;
2166     progmodedelay       = 0;
2167     latchcycles         = 0;
2168     togglevtg           = 0;
2169     poweroffdelay       = 0;
2170     resetdelayms        = 0;
2171     resetdelayus        = 0;
2172     hvleavestabdelay    = 15;
2173     chiperasepulsewidth = 15;
2174     chiperasepolltimeout = 0;
2175     programfusepulsewidth = 2;
2176     programfusepolltimeout = 0;
2177     programlockpulsewidth = 0;
2178     programlockpolltimeout = 1;
2179
2180     memory "eeprom"
2181         size            = 256;
2182         min_write_delay = 9000;
2183         max_write_delay = 20000;
2184         readback_p1     = 0x00;
2185         readback_p2     = 0xff;
2186         read            = " 1  0  1  0   0  0  0  0   x x x x  x x x x", 
2187                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2188
2189         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x x",
2190                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2191
2192         mode            = 0x04;
2193         delay           = 12;
2194         blocksize       = 128;
2195         readsize        = 256;
2196       ;
2197     memory "flash"
2198         size            = 4096;
2199         min_write_delay = 9000;
2200         max_write_delay = 20000;
2201         readback_p1     = 0xff;
2202         readback_p2     = 0xff;
2203         read_lo         = "  0   0   1   0    0   0   0   0",
2204                           "  x   x   x   x    x a10  a9  a8",
2205                           " a7  a6  a5  a4   a3  a2  a1  a0",
2206                           "  o   o   o   o    o   o   o   o";
2207
2208         read_hi         = "  0   0   1   0    1   0   0   0",
2209                           "  x   x   x   x    x a10  a9  a8",
2210                           " a7  a6  a5  a4   a3  a2  a1  a0",
2211                           "  o   o   o   o    o   o   o   o";
2212
2213         write_lo        = "  0   1   0   0    0   0   0   0",
2214                           "  x   x   x   x    x a10  a9  a8",
2215                           " a7  a6  a5  a4   a3  a2  a1  a0",
2216                           "  i   i   i   i    i   i   i   i";
2217
2218         write_hi        = "  0   1   0   0    1   0   0   0",
2219                           "  x   x   x   x    x a10  a9  a8",
2220                           " a7  a6  a5  a4   a3  a2  a1  a0",
2221                           "  i   i   i   i    i   i   i   i";
2222
2223         mode            = 0x04;
2224         delay           = 12;
2225         blocksize       = 128;
2226         readsize        = 256;
2227       ;
2228     memory "signature"
2229         size            = 3;
2230         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2231                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2232       ;
2233     memory "fuse"
2234         size            = 1;
2235         min_write_delay = 9000;
2236         max_write_delay = 20000;
2237         pwroff_after_write = yes;
2238         read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
2239                           "x x x x  x x x x   x x o o  o o o o";
2240
2241         write           = "1 0 1 0  1 1 0 0   1 0 1 i  i i i i",
2242                           "x x x x  x x x x   x x x x  x x x x";
2243       ;
2244     memory "lock"
2245         size            = 1;
2246         min_write_delay = 9000;
2247         max_write_delay = 20000;
2248         read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2249                           "x x x x  x x x x   x x x x  x o o x";
2250
2251         write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2252                           "x x x x  x x x x   x x x x  x x x x";
2253       ;
2254   ;
2255
2256 #------------------------------------------------------------
2257 # AT90s4434
2258 #------------------------------------------------------------
2259
2260 part
2261     id               = "4434";
2262 ##### WARNING: No XML file for device 'AT90S4434'! #####
2263     desc             = "AT90S4434";
2264     stk500_devcode   = 0x52;
2265     avr910_devcode   = 0x6c;
2266     signature        = 0x1e 0x92 0x02;
2267     chip_erase_delay = 20000;
2268     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2269                        "x x x x  x x x x    x x x x  x x x x";
2270
2271     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2272                        "x x x x  x x x x    x x x x  x x x x";
2273
2274     memory "eeprom"
2275         size            = 256;
2276         min_write_delay = 9000;
2277         max_write_delay = 20000;
2278         readback_p1     = 0x00;
2279         readback_p2     = 0xff;
2280         read            = " 1  0  1  0   0  0  0  0   x x x x  x x x x", 
2281                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2282
2283         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x x",
2284                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2285       ;
2286     memory "flash"
2287         size            = 4096;
2288         min_write_delay = 9000;
2289         max_write_delay = 20000;
2290         readback_p1     = 0xff;
2291         readback_p2     = 0xff;
2292         read_lo         = "  0   0   1   0    0   0   0   0",
2293                           "  x   x   x   x    x a10  a9  a8",
2294                           " a7  a6  a5  a4   a3  a2  a1  a0",
2295                           "  o   o   o   o    o   o   o   o";
2296
2297         read_hi         = "  0   0   1   0    1   0   0   0",
2298                           "  x   x   x   x    x a10  a9  a8",
2299                           " a7  a6  a5  a4   a3  a2  a1  a0",
2300                           "  o   o   o   o    o   o   o   o";
2301
2302         write_lo        = "  0   1   0   0    0   0   0   0",
2303                           "  x   x   x   x    x a10  a9  a8",
2304                           " a7  a6  a5  a4   a3  a2  a1  a0",
2305                           "  i   i   i   i    i   i   i   i";
2306
2307         write_hi        = "  0   1   0   0    1   0   0   0",
2308                           "  x   x   x   x    x a10  a9  a8",
2309                           " a7  a6  a5  a4   a3  a2  a1  a0",
2310                           "  i   i   i   i    i   i   i   i";
2311       ;
2312     memory "signature"
2313         size            = 3;
2314         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2315                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2316       ;
2317     memory "fuse"
2318         size            = 1;
2319         min_write_delay = 9000;
2320         max_write_delay = 20000;
2321         read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
2322                           "x x x x  x x x x   x x o o  o o o o";
2323
2324         write           = "1 0 1 0  1 1 0 0   1 0 1 i  i i i i",
2325                           "x x x x  x x x x   x x x x  x x x x";
2326       ;
2327     memory "lock"
2328         size            = 1;
2329         min_write_delay = 9000;
2330         max_write_delay = 20000;
2331         read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2332                           "x x x x  x x x x   x x x x  x o o x";
2333
2334         write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2335                           "x x x x  x x x x   x x x x  x x x x";
2336       ;
2337   ;
2338
2339 #------------------------------------------------------------
2340 # AT90s8515
2341 #------------------------------------------------------------
2342
2343 part
2344     id               = "8515";
2345     desc             = "AT90S8515";
2346     stk500_devcode   = 0x60;
2347     avr910_devcode   = 0x38;
2348     signature        = 0x1e 0x93 0x01;
2349     chip_erase_delay = 20000;
2350     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2351                        "x x x x  x x x x    x x x x  x x x x";
2352
2353     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
2354                        "x x x x  x x x x    x x x x  x x x x";
2355
2356     timeout             = 200;
2357     stabdelay           = 100;
2358     cmdexedelay         = 25;
2359     synchloops          = 32;
2360     bytedelay           = 0;
2361     pollindex           = 3;
2362     pollvalue           = 0x53;
2363     predelay            = 1;
2364     postdelay           = 1;
2365     pollmethod          = 0;
2366
2367     pp_controlstack     =
2368         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2369         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2370         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2371         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2372     hventerstabdelay    = 100;
2373     progmodedelay       = 0;
2374     latchcycles         = 0;
2375     togglevtg           = 0;
2376     poweroffdelay       = 0;
2377     resetdelayms        = 0;
2378     resetdelayus        = 0;
2379     hvleavestabdelay    = 15;
2380     resetdelay          = 15;
2381     chiperasepulsewidth = 15;
2382     chiperasepolltimeout = 0;
2383     programfusepulsewidth = 2;
2384     programfusepolltimeout = 0;
2385     programlockpulsewidth = 0;
2386     programlockpolltimeout = 1;
2387
2388     memory "eeprom"
2389         size            = 512;
2390         min_write_delay = 4000;
2391         max_write_delay = 9000;
2392         readback_p1     = 0x80;
2393         readback_p2     = 0x7f;
2394         read            = " 1  0  1  0   0  0  0  0  x x x x  x x x a8", 
2395                           "a7 a6 a5 a4 a3 a2 a1 a0   o o o o  o o o o";
2396
2397         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x a8",
2398                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2399
2400         mode            = 0x04;
2401         delay           = 12;
2402         blocksize       = 128;
2403         readsize        = 256;
2404       ;
2405     memory "flash"
2406         size            = 8192;
2407         min_write_delay = 4000;
2408         max_write_delay = 9000;
2409         readback_p1     = 0x7f;
2410         readback_p2     = 0x7f;
2411         read_lo         = "  0   0   1   0    0   0   0   0",
2412                           "  x   x   x   x  a11 a10  a9  a8",
2413                           " a7  a6  a5  a4   a3  a2  a1  a0",
2414                           "  o   o   o   o    o   o   o   o";
2415
2416         read_hi         = "  0   0   1   0    1   0   0   0",
2417                           "  x   x   x   x  a11 a10  a9  a8",
2418                           " a7  a6  a5  a4   a3  a2  a1  a0",
2419                           "  o   o   o   o    o   o   o   o";
2420
2421         write_lo        = "  0   1   0   0    0   0   0   0",
2422                           "  x   x   x   x  a11 a10  a9  a8",
2423                           " a7  a6  a5  a4   a3  a2  a1  a0",
2424                           "  i   i   i   i    i   i   i   i";
2425
2426         write_hi        = "  0   1   0   0    1   0   0   0",
2427                           "  x   x   x   x  a11 a10  a9  a8",
2428                           " a7  a6  a5  a4   a3  a2  a1  a0",
2429                           "  i   i   i   i    i   i   i   i";
2430
2431         mode            = 0x04;
2432         delay           = 12;
2433         blocksize       = 128;
2434         readsize        = 256;
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       ;
2444     memory "lock"
2445         size            = 1;
2446         write           = "1  0  1  0   1  1  0  0   1  1  1  1   1  i  i  1",
2447                           "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  x";
2448         min_write_delay = 9000;
2449         max_write_delay = 9000;
2450       ;
2451   ;
2452
2453 #------------------------------------------------------------
2454 # AT90s8535
2455 #------------------------------------------------------------
2456
2457 part
2458     id               = "8535";
2459     desc             = "AT90S8535";
2460     stk500_devcode   = 0x61;
2461     avr910_devcode   = 0x68;
2462     signature        = 0x1e 0x93 0x03;
2463     chip_erase_delay = 20000;
2464     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2465                        "x x x x  x x x x    x x x x  x x x x";
2466
2467     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2468                        "x x x x  x x x x    x x x x  x x x x";
2469
2470     timeout             = 200;
2471     stabdelay           = 100;
2472     cmdexedelay         = 25;
2473     synchloops          = 32;
2474     bytedelay           = 0;
2475     pollindex           = 3;
2476     pollvalue           = 0x53;
2477     predelay            = 1;
2478     postdelay           = 1;
2479     pollmethod          = 0;
2480
2481     pp_controlstack     =
2482         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2483         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2484         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2485         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2486     hventerstabdelay    = 100;
2487     progmodedelay       = 0;
2488     latchcycles         = 0;
2489     togglevtg           = 0;
2490     poweroffdelay       = 0;
2491     resetdelayms        = 0;
2492     resetdelayus        = 0;
2493     hvleavestabdelay    = 15;
2494     chiperasepulsewidth = 15;
2495     chiperasepolltimeout = 0;
2496     programfusepulsewidth = 2;
2497     programfusepolltimeout = 0;
2498     programlockpulsewidth = 0;
2499     programlockpolltimeout = 1;
2500
2501     memory "eeprom"
2502         size            = 512;
2503         min_write_delay = 9000;
2504         max_write_delay = 20000;
2505         readback_p1     = 0x00;
2506         readback_p2     = 0xff;
2507         read            = " 1  0  1  0   0  0  0  0   x x x x  x x x a8", 
2508                           "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
2509
2510         write           = " 1  1  0  0   0  0  0  0   x x x x  x x x a8",
2511                           "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
2512
2513         mode            = 0x04;
2514         delay           = 12;
2515         blocksize       = 128;
2516         readsize        = 256;
2517       ;
2518     memory "flash"
2519         size            = 8192;
2520         min_write_delay = 9000;
2521         max_write_delay = 20000;
2522         readback_p1     = 0xff;
2523         readback_p2     = 0xff;
2524         read_lo         = "  0   0   1   0    0   0   0   0",
2525                           "  x   x   x   x  a11 a10  a9  a8",
2526                           " a7  a6  a5  a4   a3  a2  a1  a0",
2527                           "  o   o   o   o    o   o   o   o";
2528
2529         read_hi         = "  0   0   1   0    1   0   0   0",
2530                           "  x   x   x   x  a11 a10  a9  a8",
2531                           " a7  a6  a5  a4   a3  a2  a1  a0",
2532                           "  o   o   o   o    o   o   o   o";
2533
2534         write_lo        = "  0   1   0   0    0   0   0   0",
2535                           "  x   x   x   x  a11 a10  a9  a8",
2536                           " a7  a6  a5  a4   a3  a2  a1  a0",
2537                           "  i   i   i   i    i   i   i   i";
2538
2539         write_hi        = "  0   1   0   0    1   0   0   0",
2540                           "  x   x   x   x  a11 a10  a9  a8",
2541                           " a7  a6  a5  a4   a3  a2  a1  a0",
2542                           "  i   i   i   i    i   i   i   i";
2543
2544         mode            = 0x04;
2545         delay           = 12;
2546         blocksize       = 128;
2547         readsize        = 256;
2548       ;
2549     memory "signature"
2550         size            = 3;
2551         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2552                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2553       ;
2554     memory "fuse"
2555         size            = 1;
2556         read            = "0  1  0  1   1  0  0  0   x  x  x  x   x  x  x  x",
2557                           "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  o";
2558         write           = "1  0  1  0   1  1  0  0   1  0  1  1   1  1  1  i",
2559                           "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  x";
2560         min_write_delay = 9000;
2561         max_write_delay = 9000;
2562       ;
2563     memory "lock"
2564         size            = 1;
2565         read            = "0  1  0  1   1  0  0  0   x  x  x  x   x  x  x  x",
2566                           "x  x  x  x   x  x  x  x   o  o  x  x   x  x  x  x";
2567         write           = "1  0  1  0   1  1  0  0   1  1  1  1   1  i  i  1",
2568                           "x  x  x  x   x  x  x  x   x  x  x  x   x  x  x  x";
2569         min_write_delay = 9000;
2570         max_write_delay = 9000;
2571       ;
2572   ;
2573
2574 #------------------------------------------------------------
2575 # ATmega103
2576 #------------------------------------------------------------
2577
2578 part
2579     id               = "m103";
2580     desc             = "ATMEGA103";
2581     stk500_devcode   = 0xB1;
2582     avr910_devcode   = 0x41;
2583     signature        = 0x1e 0x97 0x01;
2584     chip_erase_delay = 112000;
2585     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2586                        "x x x x  x x x x    x x x x  x x x x";
2587
2588     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2589                        "x x x x  x x x x    x x x x  x x x x";
2590
2591     timeout             = 200;
2592     stabdelay           = 100;
2593     cmdexedelay         = 25;
2594     synchloops          = 32;
2595     bytedelay           = 0;
2596     pollindex           = 3;
2597     pollvalue           = 0x53;
2598     predelay            = 1;
2599     postdelay           = 1;
2600     pollmethod          = 0;
2601
2602     pp_controlstack     =
2603         0x0E, 0x1E, 0x8E, 0x9E, 0x2E, 0x3E, 0xAE, 0xBE,
2604         0x4E, 0x5E, 0xCE, 0xDE, 0x6E, 0x7E, 0xEE, 0xDE,
2605         0x66, 0x76, 0xE6, 0xF6, 0x6A, 0x7A, 0xEA, 0x7A,
2606         0x7F, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2607     hventerstabdelay    = 100;
2608     progmodedelay       = 0;
2609     latchcycles         = 0;
2610     togglevtg           = 0;
2611     poweroffdelay       = 0;
2612     resetdelayms        = 0;
2613     resetdelayus        = 0;
2614     hvleavestabdelay    = 15;
2615     chiperasepulsewidth = 15;
2616     chiperasepolltimeout = 0;
2617     programfusepulsewidth = 2;
2618     programfusepolltimeout = 0;
2619     programlockpulsewidth = 0;
2620     programlockpolltimeout = 10;
2621
2622     memory "eeprom"
2623         size            = 4096;
2624         min_write_delay = 4000;
2625         max_write_delay = 9000;
2626         readback_p1     = 0x80;
2627         readback_p2     = 0x7f;
2628         read            = "  1   0   1   0      0   0   0   0",
2629                           "  x   x   x   x    a11 a10  a9  a8",
2630                           " a7  a6  a5  a4     a3  a2  a1  a0",
2631                           "  o   o   o   o      o   o   o   o";
2632
2633         write           = "  1   1   0   0      0   0   0   0",
2634                           "  x   x   x   x    a11 a10  a9  a8",
2635                           " a7  a6  a5  a4     a3  a2  a1  a0", 
2636                           "  i   i   i   i      i   i   i   i";
2637
2638         mode            = 0x04;
2639         delay           = 12;
2640         blocksize       = 64;
2641         readsize        = 256;
2642       ;
2643
2644     memory "flash"
2645         paged           = yes;
2646         size            = 131072;
2647         page_size       = 256;
2648         num_pages       = 512;
2649         min_write_delay = 22000;
2650         max_write_delay = 56000;
2651         readback_p1     = 0xff;
2652         readback_p2     = 0xff;
2653         read_lo         = "  0   0   1   0      0   0   0   0",
2654                           "a15 a14 a13 a12    a11 a10  a9  a8",
2655                           " a7  a6  a5  a4     a3  a2  a1  a0",
2656                           "  o   o   o   o      o   o   o   o";
2657
2658         read_hi         = "  0   0   1   0      1   0   0   0",
2659                           "a15 a14 a13 a12    a11 a10  a9  a8",
2660                           " a7  a6  a5  a4     a3  a2  a1  a0",
2661                           "  o   o   o   o      o   o   o   o";
2662
2663         loadpage_lo     = "  0   1   0   0      0   0   0   0",
2664                           "  x   x   x   x      x   x   x   x",
2665                           "  x  a6  a5  a4     a3  a2  a1  a0",
2666                           "  i   i   i   i      i   i   i   i";
2667
2668         loadpage_hi     = "  0   1   0   0      1   0   0   0",
2669                           "  x   x   x   x      x   x   x   x",
2670                           "  x  a6  a5  a4     a3  a2  a1  a0",
2671                           "  i   i   i   i      i   i   i   i";
2672
2673         writepage       = "  0   1   0   0      1   1   0   0",
2674                           "a15 a14 a13 a12    a11 a10  a9  a8",
2675                           " a7   x   x   x      x   x   x   x",
2676                           "  x   x   x   x      x   x   x   x";
2677
2678         mode            = 0x11;
2679         delay           = 70;
2680         blocksize       = 256;
2681         readsize        = 256;
2682       ;
2683
2684     memory "fuse"
2685         size            = 1;
2686         read            = "0 1 0 1  0 0 0 0  x x x x  x x x x",
2687                           "x x x x  x x x x  x x o x  o 1 o o";
2688
2689         write           = "1 0 1 0  1 1 0 0  1 0 1 1  i 1 i i",
2690                           "x x x x  x x x x  x x x x  x x x x";
2691         min_write_delay = 9000;
2692         max_write_delay = 9000;
2693       ;
2694
2695     memory "lock"
2696         size            = 1;
2697         read            = "0 1 0 1  1 0 0 0   x x x x  x x x x",
2698                           "x x x x  x x x x   x x x x  x o o x";
2699
2700         write           = "1 0 1 0  1 1 0 0   1 1 1 1  1 i i 1",
2701                           "x x x x  x x x x   x x x x  x x x x";
2702         min_write_delay = 9000;
2703         max_write_delay = 9000;
2704       ;
2705
2706     memory "signature"
2707         size            = 3;
2708         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2709                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2710       ;
2711   ;
2712
2713
2714 #------------------------------------------------------------
2715 # ATmega64
2716 #------------------------------------------------------------
2717
2718 part
2719     id               = "m64";
2720     desc             = "ATMEGA64";
2721     has_jtag         = yes;
2722     stk500_devcode   = 0xA0;
2723     avr910_devcode   = 0x45;
2724     signature        = 0x1e 0x96 0x02;
2725     chip_erase_delay = 9000;
2726     pagel            = 0xD7;
2727     bs2              = 0xA0;
2728     reset            = dedicated;
2729     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2730                        "x x x x  x x x x    x x x x  x x x x";
2731
2732     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2733                        "x x x x  x x x x    x x x x  x x x x";
2734
2735     timeout             = 200;
2736     stabdelay           = 100;
2737     cmdexedelay         = 25;
2738     synchloops          = 32;
2739     bytedelay           = 0;
2740     pollindex           = 3;
2741     pollvalue           = 0x53;
2742     predelay            = 1;
2743     postdelay           = 1;
2744     pollmethod          = 0;
2745
2746     pp_controlstack     =
2747         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2748         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2749         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2750         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2751     hventerstabdelay    = 100;
2752     progmodedelay       = 0;
2753     latchcycles         = 6;
2754     togglevtg           = 0;
2755     poweroffdelay       = 0;
2756     resetdelayms        = 0;
2757     resetdelayus        = 0;
2758     hvleavestabdelay    = 15;
2759     chiperasepulsewidth = 0;
2760     chiperasepolltimeout = 10;
2761     programfusepulsewidth = 0;
2762     programfusepolltimeout = 5;
2763     programlockpulsewidth = 0;
2764     programlockpolltimeout = 5;
2765
2766     idr                 = 0x22;
2767     spmcr               = 0x68;
2768     allowfullpagebitstream = yes;
2769
2770     memory "eeprom"
2771         paged           = no; /* leave this "no" */
2772         page_size       = 8;  /* for parallel programming */
2773         size            = 2048;
2774         min_write_delay = 9000;
2775         max_write_delay = 9000;
2776         readback_p1     = 0xff;
2777         readback_p2     = 0xff;
2778         read            = "  1   0   1   0      0   0   0   0",
2779                           "  x   x   x   x    a11 a10  a9  a8",
2780                           " a7  a6  a5  a4     a3  a2  a1  a0",
2781                           "  o   o   o   o      o   o   o   o";
2782
2783         write           = "  1   1   0   0      0   0   0   0",
2784                           "  x   x   x   x    a11 a10  a9  a8",
2785                           " a7  a6  a5  a4     a3  a2  a1  a0", 
2786                           "  i   i   i   i      i   i   i   i";
2787
2788         mode            = 0x04;
2789         delay           = 20;
2790         blocksize       = 64;
2791         readsize        = 256;
2792       ;
2793
2794     memory "flash"
2795         paged           = yes;
2796         size            = 65536;
2797         page_size       = 256;
2798         num_pages       = 256;
2799         min_write_delay = 4500;
2800         max_write_delay = 4500;
2801         readback_p1     = 0xff;
2802         readback_p2     = 0xff;
2803         read_lo         = "  0   0   1   0      0   0   0   0",
2804                           "  x a14 a13 a12    a11 a10  a9  a8",
2805                           " a7  a6  a5  a4     a3  a2  a1  a0",
2806                           "  o   o   o   o      o   o   o   o";
2807
2808         read_hi         = "  0   0   1   0      1   0   0   0",
2809                           "  x a14 a13 a12    a11 a10  a9  a8",
2810                           " a7  a6  a5  a4     a3  a2  a1  a0",
2811                           "  o   o   o   o      o   o   o   o";
2812
2813
2814         loadpage_lo     = "  0   1   0   0      0   0   0   0",
2815                           "  x   x   x   x      x   x   x   x",
2816                           "  x  a6  a5  a4     a3  a2  a1  a0",
2817                           "  i   i   i   i      i   i   i   i";
2818
2819         loadpage_hi     = "  0   1   0   0      1   0   0   0",
2820                           "  x   x   x   x      x   x   x   x",
2821                           "  x  a6  a5  a4     a3  a2  a1  a0",
2822                           "  i   i   i   i      i   i   i   i";
2823
2824         writepage       = "  0   1   0   0      1   1   0   0",
2825                           "  x a14 a13 a12    a11 a10  a9  a8",
2826                           " a7   x   x   x      x   x   x   x",
2827                           "  x   x   x   x      x   x   x   x";
2828
2829         mode            = 0x21;
2830         delay           = 6;
2831         blocksize       = 128;
2832         readsize        = 256;
2833       ;
2834
2835     memory "lfuse"
2836         size            = 1;
2837         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
2838                           "x x x x  x x x x  i i i i  i i i i";
2839
2840         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
2841                           "x x x x  x x x x  o o o o  o o o o";
2842         min_write_delay = 9000;
2843         max_write_delay = 9000;
2844       ;
2845
2846     memory "hfuse"
2847         size            = 1;
2848         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
2849                           "x x x x  x x x x  i i i i  i i i i";
2850
2851         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
2852                           "x x x x  x x x x  o o o o  o o o o";
2853         min_write_delay = 9000;
2854         max_write_delay = 9000;
2855       ;
2856
2857     memory "efuse"
2858         size            = 1;
2859         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
2860                           "x x x x  x x x x  x x x x  x x i i";
2861
2862         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
2863                           "x x x x  x x x x  o o o o  o o o o";
2864         min_write_delay = 9000;
2865         max_write_delay = 9000;
2866       ;
2867
2868     memory "lock"
2869         size            = 1;
2870         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
2871                           "x x x x  x x x x   x x o o  o o o o";
2872
2873         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
2874                           "x x x x  x x x x   1 1 i i  i i i i";
2875         min_write_delay = 9000;
2876         max_write_delay = 9000;
2877       ;
2878
2879     memory "calibration"
2880         size            = 4;
2881         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
2882                           "0 0 0 0  0 0 a1 a0  o o o o  o o o o";
2883       ;
2884
2885     memory "signature"
2886         size            = 3;
2887         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
2888                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
2889       ;
2890   ;
2891
2892
2893
2894
2895 #------------------------------------------------------------
2896 # ATmega128
2897 #------------------------------------------------------------
2898
2899 part
2900     id               = "m128";
2901     desc             = "ATMEGA128";
2902     has_jtag         = yes;
2903     stk500_devcode   = 0xB2;
2904     avr910_devcode   = 0x43;
2905     signature        = 0x1e 0x97 0x02;
2906     chip_erase_delay = 9000;
2907     pagel            = 0xD7;
2908     bs2              = 0xA0;
2909     reset            = dedicated;
2910     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
2911                        "x x x x  x x x x    x x x x  x x x x";
2912
2913     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
2914                        "x x x x  x x x x    x x x x  x x x x";
2915
2916     timeout             = 200;
2917     stabdelay           = 100;
2918     cmdexedelay         = 25;
2919     synchloops          = 32;
2920     bytedelay           = 0;
2921     pollindex           = 3;
2922     pollvalue           = 0x53;
2923     predelay            = 1;
2924     postdelay           = 1;
2925     pollmethod          = 0;
2926
2927     pp_controlstack     =
2928         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
2929         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
2930         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
2931         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
2932     hventerstabdelay    = 100;
2933     progmodedelay       = 0;
2934     latchcycles         = 6;
2935     togglevtg           = 0;
2936     poweroffdelay       = 0;
2937     resetdelayms        = 0;
2938     resetdelayus        = 0;
2939     hvleavestabdelay    = 15;
2940     chiperasepulsewidth = 0;
2941     chiperasepolltimeout = 10;
2942     programfusepulsewidth = 0;
2943     programfusepolltimeout = 5;
2944     programlockpulsewidth = 0;
2945     programlockpolltimeout = 5;
2946
2947     idr                 = 0x22;
2948     spmcr               = 0x68;
2949     rampz               = 0x3b;
2950     allowfullpagebitstream = yes;
2951
2952     memory "eeprom"
2953         paged           = no; /* leave this "no" */
2954         page_size       = 8;  /* for parallel programming */
2955         size            = 4096;
2956         min_write_delay = 9000;
2957         max_write_delay = 9000;
2958         readback_p1     = 0xff;
2959         readback_p2     = 0xff;
2960         read            = "  1   0   1   0      0   0   0   0",
2961                           "  x   x   x   x    a11 a10  a9  a8",
2962                           " a7  a6  a5  a4     a3  a2  a1  a0",
2963                           "  o   o   o   o      o   o   o   o";
2964
2965         write           = "  1   1   0   0      0   0   0   0",
2966                           "  x   x   x   x    a11 a10  a9  a8",
2967                           " a7  a6  a5  a4     a3  a2  a1  a0", 
2968                           "  i   i   i   i      i   i   i   i";
2969
2970         mode            = 0x04;
2971         delay           = 12;
2972         blocksize       = 64;
2973         readsize        = 256;
2974       ;
2975
2976     memory "flash"
2977         paged           = yes;
2978         size            = 131072;
2979         page_size       = 256;
2980         num_pages       = 512;
2981         min_write_delay = 4500;
2982         max_write_delay = 4500;
2983         readback_p1     = 0xff;
2984         readback_p2     = 0xff;
2985         read_lo         = "  0   0   1   0      0   0   0   0",
2986                           "a15 a14 a13 a12    a11 a10  a9  a8",
2987                           " a7  a6  a5  a4     a3  a2  a1  a0",
2988                           "  o   o   o   o      o   o   o   o";
2989
2990         read_hi         = "  0   0   1   0      1   0   0   0",
2991                           "a15 a14 a13 a12    a11 a10  a9  a8",
2992                           " a7  a6  a5  a4     a3  a2  a1  a0",
2993                           "  o   o   o   o      o   o   o   o";
2994
2995         loadpage_lo     = "  0   1   0   0      0   0   0   0",
2996                           "  x   x   x   x      x   x   x   x",
2997                           "  x  a6  a5  a4     a3  a2  a1  a0",
2998                           "  i   i   i   i      i   i   i   i";
2999
3000         loadpage_hi     = "  0   1   0   0      1   0   0   0",
3001                           "  x   x   x   x      x   x   x   x",
3002                           "  x  a6  a5  a4     a3  a2  a1  a0",
3003                           "  i   i   i   i      i   i   i   i";
3004
3005         writepage       = "  0   1   0   0      1   1   0   0",
3006                           "a15 a14 a13 a12    a11 a10  a9  a8",
3007                           " a7   x   x   x      x   x   x   x",
3008                           "  x   x   x   x      x   x   x   x";
3009
3010         mode            = 0x21;
3011         delay           = 6;
3012         blocksize       = 128;
3013         readsize        = 256;
3014       ;
3015
3016     memory "lfuse"
3017         size            = 1;
3018         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
3019                           "x x x x  x x x x  i i i i  i i i i";
3020
3021         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
3022                           "x x x x  x x x x  o o o o  o o o o";
3023         min_write_delay = 9000;
3024         max_write_delay = 9000;
3025       ;
3026
3027     memory "hfuse"
3028         size            = 1;
3029         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
3030                           "x x x x  x x x x  i i i i  i i i i";
3031
3032         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
3033                           "x x x x  x x x x  o o o o  o o o o";
3034         min_write_delay = 9000;
3035         max_write_delay = 9000;
3036       ;
3037
3038     memory "efuse"
3039         size            = 1;
3040         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3041                           "x x x x  x x x x  x x x x  x x i i";
3042
3043         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3044                           "x x x x  x x x x  o o o o  o o o o";
3045         min_write_delay = 9000;
3046         max_write_delay = 9000;
3047       ;
3048
3049     memory "lock"
3050         size            = 1;
3051         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3052                           "x x x x  x x x x   x x o o  o o o o";
3053
3054         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3055                           "x x x x  x x x x   1 1 i i  i i i i";
3056         min_write_delay = 9000;
3057         max_write_delay = 9000;
3058       ;
3059
3060     memory "calibration"
3061         size            = 4;
3062         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
3063                           "0 0 0 0  0 0 a1 a0  o o o o  o o o o";
3064       ;
3065
3066     memory "signature"
3067         size            = 3;
3068         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3069                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3070       ;
3071   ;
3072
3073 #------------------------------------------------------------
3074 # AT90CAN128
3075 #------------------------------------------------------------
3076
3077 part
3078     id               = "c128";
3079     desc             = "AT90CAN128";
3080     has_jtag         = yes;
3081     stk500_devcode   = 0xB3;
3082 #    avr910_devcode   = 0x43;
3083     signature        = 0x1e 0x97 0x81;
3084     chip_erase_delay = 9000;
3085     pagel            = 0xD7;
3086     bs2              = 0xA0;
3087     reset            = dedicated;
3088     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3089                        "x x x x  x x x x    x x x x  x x x x";
3090
3091     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
3092                        "x x x x  x x x x    x x x x  x x x x";
3093
3094     timeout             = 200;
3095     stabdelay           = 100;
3096     cmdexedelay         = 25;
3097     synchloops          = 32;
3098     bytedelay           = 0;
3099     pollindex           = 3;
3100     pollvalue           = 0x53;
3101     predelay            = 1;
3102     postdelay           = 1;
3103     pollmethod          = 1;
3104
3105     pp_controlstack     =
3106         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3107         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3108         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3109         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
3110     hventerstabdelay    = 100;
3111     progmodedelay       = 0;
3112     latchcycles         = 6;
3113     togglevtg           = 0;
3114     poweroffdelay       = 0;
3115     resetdelayms        = 0;
3116     resetdelayus        = 0;
3117     hvleavestabdelay    = 15;
3118     chiperasepulsewidth = 0;
3119     chiperasepolltimeout = 10;
3120     programfusepulsewidth = 0;
3121     programfusepolltimeout = 5;
3122     programlockpulsewidth = 0;
3123     programlockpolltimeout = 5;
3124
3125     idr                 = 0x31;
3126     spmcr               = 0x57;
3127     rampz               = 0x3b;
3128     eecr                = 0x3f;
3129     allowfullpagebitstream = no;
3130
3131     memory "eeprom"
3132         paged           = no; /* leave this "no" */
3133         page_size       = 8;  /* for parallel programming */
3134         size            = 4096;
3135         min_write_delay = 9000;
3136         max_write_delay = 9000;
3137         readback_p1     = 0xff;
3138         readback_p2     = 0xff;
3139         read            = "  1   0   1   0      0   0   0   0",
3140                           "  0   0   0   x    a11 a10  a9  a8",
3141                           " a7  a6  a5  a4     a3  a2  a1  a0",
3142                           "  o   o   o   o      o   o   o   o";
3143
3144         write           = "  1   1   0   0      0   0   0   0",
3145                           "  0   0   0   x    a11 a10  a9  a8",
3146                           " a7  a6  a5  a4     a3  a2  a1  a0", 
3147                           "  i   i   i   i      i   i   i   i";
3148
3149         loadpage_lo     = "  1   1   0   0      0   0   0   1",
3150                           "  0   0   0   0      0   0   0   0",
3151                           "  0   0   0   0      0  a2  a1  a0",
3152                           "  i   i   i   i      i   i   i   i";
3153
3154         writepage       = "  1   1   0   0      0   0   1   0",
3155                           "  0   0   x   x    a11 a10  a9  a8",
3156                           " a7  a6  a5  a4     a3   0   0   0",
3157                           "  x   x   x   x      x   x   x   x";
3158
3159
3160         mode            = 0x41;
3161         delay           = 20;
3162         blocksize       = 8;
3163         readsize        = 256;
3164       ;
3165
3166     memory "flash"
3167         paged           = yes;
3168         size            = 131072;
3169         page_size       = 256;
3170         num_pages       = 512;
3171         min_write_delay = 4500;
3172         max_write_delay = 4500;
3173         readback_p1     = 0xff;
3174         readback_p2     = 0xff;
3175         read_lo         = "  0   0   1   0      0   0   0   0",
3176                           "a15 a14 a13 a12    a11 a10  a9  a8",
3177                           " a7  a6  a5  a4     a3  a2  a1  a0",
3178                           "  o   o   o   o      o   o   o   o";
3179
3180         read_hi         = "  0   0   1   0      1   0   0   0",
3181                           "a15 a14 a13 a12    a11 a10  a9  a8",
3182                           " a7  a6  a5  a4     a3  a2  a1  a0",
3183                           "  o   o   o   o      o   o   o   o";
3184
3185         loadpage_lo     = "  0   1   0   0      0   0   0   0",
3186                           "  0   0   0   x      x   x   x   x",
3187                           "  x  a6  a5  a4     a3  a2  a1  a0",
3188                           "  i   i   i   i      i   i   i   i";
3189
3190         loadpage_hi     = "  0   1   0   0      1   0   0   0",
3191                           "  0   0   0   x      x   x   x   x",
3192                           "  x  a6  a5  a4     a3  a2  a1  a0",
3193                           "  i   i   i   i      i   i   i   i";
3194
3195         writepage       = "  0   1   0   0      1   1   0   0",
3196                           "a15 a14 a13 a12    a11 a10  a9  a8",
3197                           " a7   x   x   x      x   x   x   x",
3198                           "  x   x   x   x      x   x   x   x";
3199
3200         mode            = 0x41;
3201         delay           = 6;
3202         blocksize       = 256;
3203         readsize        = 256;
3204       ;
3205
3206     memory "lfuse"
3207         size            = 1;
3208         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
3209                           "x x x x  x x x x  i i i i  i i i i";
3210
3211         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
3212                           "x x x x  x x x x  o o o o  o o o o";
3213         min_write_delay = 9000;
3214         max_write_delay = 9000;
3215       ;
3216
3217     memory "hfuse"
3218         size            = 1;
3219         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
3220                           "x x x x  x x x x  i i i i  i i i i";
3221
3222         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
3223                           "x x x x  x x x x  o o o o  o o o o";
3224         min_write_delay = 9000;
3225         max_write_delay = 9000;
3226       ;
3227
3228     memory "efuse"
3229         size            = 1;
3230         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3231                           "x x x x  x x x x  x x x x  i i i i";
3232
3233         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3234                           "x x x x  x x x x  o o o o  o o o o";
3235         min_write_delay = 9000;
3236         max_write_delay = 9000;
3237       ;
3238
3239     memory "lock"
3240         size            = 1;
3241         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3242                           "x x x x  x x x x   x x o o  o o o o";
3243
3244         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3245                           "x x x x  x x x x   1 1 i i  i i i i";
3246         min_write_delay = 9000;
3247         max_write_delay = 9000;
3248       ;
3249
3250     memory "calibration"
3251         size            = 1;
3252         read            = "0 0 1 1  1 0 0 0  0 0 0 x  x x x x",
3253                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
3254       ;
3255
3256     memory "signature"
3257         size            = 3;
3258         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3259                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3260       ;
3261   ;
3262
3263 #------------------------------------------------------------
3264 # AT90CAN64
3265 #------------------------------------------------------------
3266
3267 part
3268     id               = "c64";
3269     desc             = "AT90CAN64";
3270     has_jtag         = yes;
3271     stk500_devcode   = 0xB3;
3272 #    avr910_devcode   = 0x43;
3273     signature        = 0x1e 0x96 0x81;
3274     chip_erase_delay = 9000;
3275     pagel            = 0xD7;
3276     bs2              = 0xA0;
3277     reset            = dedicated;
3278     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3279                        "x x x x  x x x x    x x x x  x x x x";
3280
3281     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
3282                        "x x x x  x x x x    x x x x  x x x x";
3283
3284     timeout             = 200;
3285     stabdelay           = 100;
3286     cmdexedelay         = 25;
3287     synchloops          = 32;
3288     bytedelay           = 0;
3289     pollindex           = 3;
3290     pollvalue           = 0x53;
3291     predelay            = 1;
3292     postdelay           = 1;
3293     pollmethod          = 1;
3294
3295     pp_controlstack     =
3296         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3297         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3298         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3299         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
3300     hventerstabdelay    = 100;
3301     progmodedelay       = 0;
3302     latchcycles         = 6;
3303     togglevtg           = 0;
3304     poweroffdelay       = 0;
3305     resetdelayms        = 0;
3306     resetdelayus        = 0;
3307     hvleavestabdelay    = 15;
3308     chiperasepulsewidth = 0;
3309     chiperasepolltimeout = 10;
3310     programfusepulsewidth = 0;
3311     programfusepolltimeout = 5;
3312     programlockpulsewidth = 0;
3313     programlockpolltimeout = 5;
3314
3315     idr                 = 0x31;
3316     spmcr               = 0x57;
3317     rampz               = 0x3b;
3318     eecr                = 0x3f;
3319     allowfullpagebitstream = no;
3320
3321     memory "eeprom"
3322         paged           = no; /* leave this "no" */
3323         page_size       = 8;  /* for parallel programming */
3324         size            = 2048;
3325         min_write_delay = 9000;
3326         max_write_delay = 9000;
3327         readback_p1     = 0xff;
3328         readback_p2     = 0xff;
3329         read            = "  1   0   1   0      0   0   0   0",
3330                           "  0   0   0   x      x a10  a9  a8",
3331                           " a7  a6  a5  a4     a3  a2  a1  a0",
3332                           "  o   o   o   o      o   o   o   o";
3333
3334         write           = "  1   1   0   0      0   0   0   0",
3335                           "  0   0   0   x      x a10  a9  a8",
3336                           " a7  a6  a5  a4     a3  a2  a1  a0",
3337                           "  i   i   i   i      i   i   i   i";
3338
3339         loadpage_lo     = "  1   1   0   0      0   0   0   1",
3340                           "  0   0   0   0      0   0   0   0",
3341                           "  0   0   0   0      0  a2  a1  a0",
3342                           "  i   i   i   i      i   i   i   i";
3343
3344         writepage       = "  1   1   0   0      0   0   1   0",
3345                           "  0   0   x   x      x a10  a9  a8",
3346                           " a7  a6  a5  a4     a3   0   0   0",
3347                           "  x   x   x   x      x   x   x   x";
3348
3349
3350         mode            = 0x41;
3351         delay           = 20;
3352         blocksize       = 8;
3353         readsize        = 256;
3354       ;
3355
3356     memory "flash"
3357         paged           = yes;
3358         size            = 65536;
3359         page_size       = 256;
3360         num_pages       = 256;
3361         min_write_delay = 4500;
3362         max_write_delay = 4500;
3363         readback_p1     = 0xff;
3364         readback_p2     = 0xff;
3365         read_lo         = "  0   0   1   0      0   0   0   0",
3366                           "a15 a14 a13 a12    a11 a10  a9  a8",
3367                           " a7  a6  a5  a4     a3  a2  a1  a0",
3368                           "  o   o   o   o      o   o   o   o";
3369
3370         read_hi         = "  0   0   1   0      1   0   0   0",
3371                           "a15 a14 a13 a12    a11 a10  a9  a8",
3372                           " a7  a6  a5  a4     a3  a2  a1  a0",
3373                           "  o   o   o   o      o   o   o   o";
3374
3375         loadpage_lo     = "  0   1   0   0      0   0   0   0",
3376                           "  0   0   0   x      x   x   x   x",
3377                           "  x  a6  a5  a4     a3  a2  a1  a0",
3378                           "  i   i   i   i      i   i   i   i";
3379
3380         loadpage_hi     = "  0   1   0   0      1   0   0   0",
3381                           "  0   0   0   x      x   x   x   x",
3382                           "  x  a6  a5  a4     a3  a2  a1  a0",
3383                           "  i   i   i   i      i   i   i   i";
3384
3385         writepage       = "  0   1   0   0      1   1   0   0",
3386                           "a15 a14 a13 a12    a11 a10  a9  a8",
3387                           " a7   x   x   x      x   x   x   x",
3388                           "  x   x   x   x      x   x   x   x";
3389
3390         mode            = 0x41;
3391         delay           = 6;
3392         blocksize       = 256;
3393         readsize        = 256;
3394       ;
3395
3396     memory "lfuse"
3397         size            = 1;
3398         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
3399                           "x x x x  x x x x  i i i i  i i i i";
3400
3401         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
3402                           "x x x x  x x x x  o o o o  o o o o";
3403         min_write_delay = 9000;
3404         max_write_delay = 9000;
3405       ;
3406
3407     memory "hfuse"
3408         size            = 1;
3409         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
3410                           "x x x x  x x x x  i i i i  i i i i";
3411
3412         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
3413                           "x x x x  x x x x  o o o o  o o o o";
3414         min_write_delay = 9000;
3415         max_write_delay = 9000;
3416       ;
3417
3418     memory "efuse"
3419         size            = 1;
3420         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3421                           "x x x x  x x x x  x x x x  i i i i";
3422
3423         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3424                           "x x x x  x x x x  o o o o  o o o o";
3425         min_write_delay = 9000;
3426         max_write_delay = 9000;
3427       ;
3428
3429     memory "lock"
3430         size            = 1;
3431         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3432                           "x x x x  x x x x   x x o o  o o o o";
3433
3434         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3435                           "x x x x  x x x x   1 1 i i  i i i i";
3436         min_write_delay = 9000;
3437         max_write_delay = 9000;
3438       ;
3439
3440     memory "calibration"
3441         size            = 1;
3442         read            = "0 0 1 1  1 0 0 0  0 0 0 x  x x x x",
3443                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
3444       ;
3445
3446     memory "signature"
3447         size            = 3;
3448         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3449                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3450       ;
3451   ;
3452
3453 #------------------------------------------------------------
3454 # AT90CAN32
3455 #------------------------------------------------------------
3456
3457 part
3458     id               = "c32";
3459     desc             = "AT90CAN32";
3460     has_jtag         = yes;
3461     stk500_devcode   = 0xB3;
3462 #    avr910_devcode   = 0x43;
3463     signature        = 0x1e 0x95 0x81;
3464     chip_erase_delay = 9000;
3465     pagel            = 0xD7;
3466     bs2              = 0xA0;
3467     reset            = dedicated;
3468     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3469                        "x x x x  x x x x    x x x x  x x x x";
3470
3471     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
3472                        "x x x x  x x x x    x x x x  x x x x";
3473
3474     timeout             = 200;
3475     stabdelay           = 100;
3476     cmdexedelay         = 25;
3477     synchloops          = 32;
3478     bytedelay           = 0;
3479     pollindex           = 3;
3480     pollvalue           = 0x53;
3481     predelay            = 1;
3482     postdelay           = 1;
3483     pollmethod          = 1;
3484
3485     pp_controlstack     =
3486         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3487         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3488         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3489         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
3490     hventerstabdelay    = 100;
3491     progmodedelay       = 0;
3492     latchcycles         = 6;
3493     togglevtg           = 0;
3494     poweroffdelay       = 0;
3495     resetdelayms        = 0;
3496     resetdelayus        = 0;
3497     hvleavestabdelay    = 15;
3498     chiperasepulsewidth = 0;
3499     chiperasepolltimeout = 10;
3500     programfusepulsewidth = 0;
3501     programfusepolltimeout = 5;
3502     programlockpulsewidth = 0;
3503     programlockpolltimeout = 5;
3504
3505     idr                 = 0x31;
3506     spmcr               = 0x57;
3507     rampz               = 0x3b;
3508     eecr                = 0x3f;
3509     allowfullpagebitstream = no;
3510
3511     memory "eeprom"
3512         paged           = no; /* leave this "no" */
3513         page_size       = 8;  /* for parallel programming */
3514         size            = 1024;
3515         min_write_delay = 9000;
3516         max_write_delay = 9000;
3517         readback_p1     = 0xff;
3518         readback_p2     = 0xff;
3519         read            = "  1   0   1   0      0   0   0   0",
3520                           "  0   0   0   x      x   x  a9  a8",
3521                           " a7  a6  a5  a4     a3  a2  a1  a0",
3522                           "  o   o   o   o      o   o   o   o";
3523
3524         write           = "  1   1   0   0      0   0   0   0",
3525                           "  0   0   0   x      x   x  a9  a8",
3526                           " a7  a6  a5  a4     a3  a2  a1  a0",
3527                           "  i   i   i   i      i   i   i   i";
3528
3529         loadpage_lo     = "  1   1   0   0      0   0   0   1",
3530                           "  0   0   0   0      0   0   0   0",
3531                           "  0   0   0   0      0  a2  a1  a0",
3532                           "  i   i   i   i      i   i   i   i";
3533
3534         writepage       = "  1   1   0   0      0   0   1   0",
3535                           "  0   0   x   x      x   x  a9  a8",
3536                           " a7  a6  a5  a4     a3   0   0   0",
3537                           "  x   x   x   x      x   x   x   x";
3538
3539
3540         mode            = 0x41;
3541         delay           = 20;
3542         blocksize       = 8;
3543         readsize        = 256;
3544       ;
3545
3546     memory "flash"
3547         paged           = yes;
3548         size            = 32768;
3549         page_size       = 256;
3550         num_pages       = 128;
3551         min_write_delay = 4500;
3552         max_write_delay = 4500;
3553         readback_p1     = 0xff;
3554         readback_p2     = 0xff;
3555         read_lo         = "  0   0   1   0      0   0   0   0",
3556                           "a15 a14 a13 a12    a11 a10  a9  a8",
3557                           " a7  a6  a5  a4     a3  a2  a1  a0",
3558                           "  o   o   o   o      o   o   o   o";
3559
3560         read_hi         = "  0   0   1   0      1   0   0   0",
3561                           "a15 a14 a13 a12    a11 a10  a9  a8",
3562                           " a7  a6  a5  a4     a3  a2  a1  a0",
3563                           "  o   o   o   o      o   o   o   o";
3564
3565         loadpage_lo     = "  0   1   0   0      0   0   0   0",
3566                           "  0   0   0   x      x   x   x   x",
3567                           "  x  a6  a5  a4     a3  a2  a1  a0",
3568                           "  i   i   i   i      i   i   i   i";
3569
3570         loadpage_hi     = "  0   1   0   0      1   0   0   0",
3571                           "  0   0   0   x      x   x   x   x",
3572                           "  x  a6  a5  a4     a3  a2  a1  a0",
3573                           "  i   i   i   i      i   i   i   i";
3574
3575         writepage       = "  0   1   0   0      1   1   0   0",
3576                           "a15 a14 a13 a12    a11 a10  a9  a8",
3577                           " a7   x   x   x      x   x   x   x",
3578                           "  x   x   x   x      x   x   x   x";
3579
3580         mode            = 0x41;
3581         delay           = 6;
3582         blocksize       = 256;
3583         readsize        = 256;
3584       ;
3585
3586     memory "lfuse"
3587         size            = 1;
3588         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
3589                           "x x x x  x x x x  i i i i  i i i i";
3590
3591         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
3592                           "x x x x  x x x x  o o o o  o o o o";
3593         min_write_delay = 9000;
3594         max_write_delay = 9000;
3595       ;
3596
3597     memory "hfuse"
3598         size            = 1;
3599         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
3600                           "x x x x  x x x x  i i i i  i i i i";
3601
3602         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
3603                           "x x x x  x x x x  o o o o  o o o o";
3604         min_write_delay = 9000;
3605         max_write_delay = 9000;
3606       ;
3607
3608     memory "efuse"
3609         size            = 1;
3610         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3611                           "x x x x  x x x x  x x x x  i i i i";
3612
3613         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3614                           "x x x x  x x x x  o o o o  o o o o";
3615         min_write_delay = 9000;
3616         max_write_delay = 9000;
3617       ;
3618
3619     memory "lock"
3620         size            = 1;
3621         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3622                           "x x x x  x x x x   x x o o  o o o o";
3623
3624         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3625                           "x x x x  x x x x   1 1 i i  i i i i";
3626         min_write_delay = 9000;
3627         max_write_delay = 9000;
3628       ;
3629
3630     memory "calibration"
3631         size            = 1;
3632         read            = "0 0 1 1  1 0 0 0  0 0 0 x  x x x x",
3633                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
3634       ;
3635
3636     memory "signature"
3637         size            = 3;
3638         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3639                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3640       ;
3641   ;
3642
3643
3644 #------------------------------------------------------------
3645 # ATmega16
3646 #------------------------------------------------------------
3647
3648 part
3649     id               = "m16";
3650     desc             = "ATMEGA16";
3651     has_jtag         = yes;
3652     stk500_devcode   = 0x82;
3653     avr910_devcode   = 0x74;
3654     signature        = 0x1e 0x94 0x03;
3655     pagel            = 0xd7;
3656     bs2              = 0xa0;
3657     chip_erase_delay = 9000;
3658     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3659                        "x x x x  x x x x    x x x x  x x x x";
3660
3661     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
3662                        "x x x x  x x x x    x x x x  x x x x";
3663
3664     timeout             = 200;
3665     stabdelay           = 100;
3666     cmdexedelay         = 25;
3667     synchloops          = 32;
3668     bytedelay           = 0;
3669     pollindex           = 3;
3670     pollvalue           = 0x53;
3671     predelay            = 1;
3672     postdelay           = 1;
3673     pollmethod          = 0;
3674
3675     pp_controlstack     =
3676         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3677         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3678         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3679         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
3680     hventerstabdelay    = 100;
3681     progmodedelay       = 100;
3682     latchcycles         = 6;
3683     togglevtg           = 0;
3684     poweroffdelay       = 0;
3685     resetdelayms        = 0;
3686     resetdelayus        = 0;
3687     hvleavestabdelay    = 15;
3688     resetdelay          = 15;
3689     chiperasepulsewidth = 0;
3690     chiperasepolltimeout = 10;
3691     programfusepulsewidth = 0;
3692     programfusepolltimeout = 5;
3693     programlockpulsewidth = 0;
3694     programlockpolltimeout = 5;
3695
3696     idr                 = 0x31;
3697     spmcr               = 0x57;
3698     allowfullpagebitstream = yes;
3699
3700     memory "eeprom"
3701         paged           = no; /* leave this "no" */
3702         page_size       = 4;  /* for parallel programming */
3703         size            = 512;
3704         min_write_delay = 9000;
3705         max_write_delay = 9000;
3706         readback_p1     = 0xff;
3707         readback_p2     = 0xff;
3708         read            = "  1   0   1   0      0   0   0   0",
3709                           "  0   0   x   x      x   x  a9  a8",
3710                           " a7  a6  a5  a4     a3  a2  a1  a0",
3711                           "  o   o   o   o      o   o   o   o";
3712
3713         write           = "  1   1   0   0      0   0   0   0",
3714                           "  0   0   x   x      x   x  a9  a8",
3715                           " a7  a6  a5  a4     a3  a2  a1  a0", 
3716                           "  i   i   i   i      i   i   i   i";
3717
3718         loadpage_lo     = "  1   1   0   0      0   0   0   1",
3719                           "  0   0   0   0      0   0   0   0",
3720                           "  0   0   0   0      0   0  a1  a0",
3721                           "  i   i   i   i      i   i   i   i";
3722
3723         writepage       = "  1   1   0   0      0   0   1   0",
3724                           "  0   0   x   x      x   x  a9  a8",
3725                           " a7  a6  a5  a4     a3  a2   0   0",
3726                           "  x   x   x   x      x   x   x   x";
3727
3728         mode            = 0x04;
3729         delay           = 10;
3730         blocksize       = 128;
3731         readsize        = 256;
3732       ;
3733
3734     memory "flash"
3735         paged           = yes;
3736         size            = 16384;
3737         page_size       = 128;
3738         num_pages       = 128;
3739         min_write_delay = 4500;
3740         max_write_delay = 4500;
3741         readback_p1     = 0xff;
3742         readback_p2     = 0xff;
3743         read_lo         = "  0   0   1   0      0   0   0   0",
3744                           "  0   0 a13 a12    a11 a10  a9  a8",
3745                           " a7  a6  a5  a4     a3  a2  a1  a0",
3746                           "  o   o   o   o      o   o   o   o";
3747
3748         read_hi         = "  0   0   1   0      1   0   0   0",
3749                           "  0   0 a13 a12    a11 a10  a9  a8",
3750                           " a7  a6  a5  a4     a3  a2  a1  a0",
3751                           "  o   o   o   o      o   o   o   o";
3752
3753         loadpage_lo     = "  0   1   0   0      0   0   0   0",
3754                           "  0   0   x   x      x   x   x   x",
3755                           "  x   x  a5  a4     a3  a2  a1  a0",
3756                           "  i   i   i   i      i   i   i   i";
3757
3758         loadpage_hi     = "  0   1   0   0      1   0   0   0",
3759                           "  0   0   x   x      x   x   x   x",
3760                           "  x   x  a5  a4     a3  a2  a1  a0",
3761                           "  i   i   i   i      i   i   i   i";
3762
3763         writepage       = "  0   1   0   0      1   1   0   0",
3764                           "  0   0 a13 a12    a11 a10  a9  a8",
3765                           " a7  a6   x   x      x   x   x   x",
3766                           "  x   x   x   x      x   x   x   x";
3767
3768         mode            = 0x21;
3769         delay           = 6;
3770         blocksize       = 128;
3771         readsize        = 256;
3772       ;
3773
3774     memory "lock"
3775         size            = 1;
3776         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3777                           "x x x x  x x x x   x x o o  o o o o";
3778
3779         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3780                           "x x x x  x x x x   1 1 i i  i i i i";
3781         min_write_delay = 9000;
3782         max_write_delay = 9000;
3783       ;
3784
3785     memory "lfuse"
3786         size            = 1;
3787         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
3788                           "x x x x  x x x x   o o o o  o o o o";
3789
3790         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
3791                           "x x x x  x x x x   i i i i  i i i i";
3792         min_write_delay = 9000;
3793         max_write_delay = 9000;
3794       ;
3795
3796     memory "hfuse"
3797         size            = 1;
3798         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
3799                           "x x x x  x x x x   o o o o  o o o o";
3800
3801         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
3802                           "x x x x  x x x x   i i i i  i i i i";
3803         min_write_delay = 9000;
3804         max_write_delay = 9000;
3805       ;
3806     memory "signature"
3807         size            = 3;
3808         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3809                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
3810       ;
3811     memory "calibration"
3812         size            = 4;
3813
3814         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
3815                           "0 0 0 0  0 0 a1 a0 o o o o  o o o o";
3816         ;
3817   ;
3818
3819
3820 #------------------------------------------------------------
3821 # ATmega164P
3822 #------------------------------------------------------------
3823
3824 # close to ATmega16
3825
3826 part
3827     id               = "m164p";
3828     desc             = "ATMEGA164P";
3829     has_jtag         = yes;
3830     stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
3831     avr910_devcode   = 0x74;
3832     signature        = 0x1e 0x94 0x0a;
3833     pagel            = 0xd7;
3834     bs2              = 0xa0;
3835     chip_erase_delay = 9000;
3836     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
3837                        "x x x x  x x x x    x x x x  x x x x";
3838
3839     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
3840                        "x x x x  x x x x    x x x x  x x x x";
3841
3842     timeout             = 200;
3843     stabdelay           = 100;
3844     cmdexedelay         = 25;
3845     synchloops          = 32;
3846     bytedelay           = 0;
3847     pollindex           = 3;
3848     pollvalue           = 0x53;
3849     predelay            = 1;
3850     postdelay           = 1;
3851     pollmethod          = 0;
3852
3853     pp_controlstack     =
3854         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
3855         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
3856         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
3857         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
3858     hventerstabdelay    = 100;
3859     progmodedelay       = 0;
3860     latchcycles         = 5;
3861     togglevtg           = 1;
3862     poweroffdelay       = 15;
3863     resetdelayms        = 1;
3864     resetdelayus        = 0;
3865     hvleavestabdelay    = 15;
3866     chiperasepulsewidth = 0;
3867     chiperasepolltimeout = 10;
3868     programfusepulsewidth = 0;
3869     programfusepolltimeout = 5;
3870     programlockpulsewidth = 0;
3871     programlockpolltimeout = 5;
3872
3873     idr                 = 0x31;
3874     spmcr               = 0x57;
3875     allowfullpagebitstream = no;
3876
3877     memory "eeprom"
3878         paged           = no; /* leave this "no" */
3879         page_size       = 4;  /* for parallel programming */
3880         size            = 512;
3881         min_write_delay = 9000;
3882         max_write_delay = 9000;
3883         readback_p1     = 0xff;
3884         readback_p2     = 0xff;
3885         read            = "  1   0   1   0      0   0   0   0",
3886                           "  0   0   x   x      x   x  a9  a8",
3887                           " a7  a6  a5  a4     a3  a2  a1  a0",
3888                           "  o   o   o   o      o   o   o   o";
3889
3890         write           = "  1   1   0   0      0   0   0   0",
3891                           "  0   0   x   x      x   x  a9  a8",
3892                           " a7  a6  a5  a4     a3  a2  a1  a0", 
3893                           "  i   i   i   i      i   i   i   i";
3894
3895         loadpage_lo     = "  1   1   0   0      0   0   0   1",
3896                           "  0   0   0   0      0   0   0   0",
3897                           "  0   0   0   0      0   0  a1  a0",
3898                           "  i   i   i   i      i   i   i   i";
3899
3900         writepage       = "  1   1   0   0      0   0   1   0",
3901                           "  0   0   x   x      x   x  a9  a8",
3902                           " a7  a6  a5  a4     a3  a2   0   0",
3903                           "  x   x   x   x      x   x   x   x";
3904
3905         mode            = 0x41;
3906         delay           = 10;
3907         blocksize       = 128;
3908         readsize        = 256;
3909       ;
3910
3911     memory "flash"
3912         paged           = yes;
3913         size            = 16384;
3914         page_size       = 128;
3915         num_pages       = 128;
3916         min_write_delay = 4500;
3917         max_write_delay = 4500;
3918         readback_p1     = 0xff;
3919         readback_p2     = 0xff;
3920         read_lo         = "  0   0   1   0      0   0   0   0",
3921                           "  0   0 a13 a12    a11 a10  a9  a8",
3922                           " a7  a6  a5  a4     a3  a2  a1  a0",
3923                           "  o   o   o   o      o   o   o   o";
3924
3925         read_hi         = "  0   0   1   0      1   0   0   0",
3926                           "  0   0 a13 a12    a11 a10  a9  a8",
3927                           " a7  a6  a5  a4     a3  a2  a1  a0",
3928                           "  o   o   o   o      o   o   o   o";
3929
3930         loadpage_lo     = "  0   1   0   0      0   0   0   0",
3931                           "  0   0   x   x      x   x   x   x",
3932                           "  x   x  a5  a4     a3  a2  a1  a0",
3933                           "  i   i   i   i      i   i   i   i";
3934
3935         loadpage_hi     = "  0   1   0   0      1   0   0   0",
3936                           "  0   0   x   x      x   x   x   x",
3937                           "  x   x  a5  a4     a3  a2  a1  a0",
3938                           "  i   i   i   i      i   i   i   i";
3939
3940         writepage       = "  0   1   0   0      1   1   0   0",
3941                           "  0   0 a13 a12    a11 a10  a9  a8",
3942                           " a7  a6   x   x      x   x   x   x",
3943                           "  x   x   x   x      x   x   x   x";
3944
3945         mode            = 0x21;
3946         delay           = 6;
3947         blocksize       = 128;
3948         readsize        = 256;
3949       ;
3950
3951     memory "lock"
3952         size            = 1;
3953         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
3954                           "x x x x  x x x x   x x o o  o o o o";
3955
3956         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
3957                           "x x x x  x x x x   1 1 i i  i i i i";
3958         min_write_delay = 9000;
3959         max_write_delay = 9000;
3960       ;
3961
3962     memory "lfuse"
3963         size            = 1;
3964         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
3965                           "x x x x  x x x x   o o o o  o o o o";
3966
3967         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
3968                           "x x x x  x x x x   i i i i  i i i i";
3969         min_write_delay = 9000;
3970         max_write_delay = 9000;
3971       ;
3972
3973     memory "hfuse"
3974         size            = 1;
3975         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
3976                           "x x x x  x x x x   o o o o  o o o o";
3977
3978         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
3979                           "x x x x  x x x x   i i i i  i i i i";
3980         min_write_delay = 9000;
3981         max_write_delay = 9000;
3982       ;
3983
3984     memory "efuse"
3985         size            = 1;
3986
3987         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
3988                           "x x x x  x x x x  o o o o  o o o o";
3989
3990         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
3991                           "x x x x  x x x x  1 1 1 1  1 i i i";
3992         min_write_delay = 9000;
3993         max_write_delay = 9000;
3994       ;
3995
3996     memory "signature"
3997         size            = 3;
3998         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
3999                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4000       ;
4001
4002     memory "calibration"
4003         size            = 1;
4004
4005         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4006                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
4007         ;
4008   ;
4009
4010
4011 #------------------------------------------------------------
4012 # ATmega324P
4013 #------------------------------------------------------------
4014
4015 # similar to ATmega164P
4016
4017 part
4018     id               = "m324p";
4019     desc             = "ATMEGA324P";
4020     has_jtag         = yes;
4021     stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4022     avr910_devcode   = 0x74;
4023     signature        = 0x1e 0x95 0x08;
4024     pagel            = 0xd7;
4025     bs2              = 0xa0;
4026     chip_erase_delay = 9000;
4027     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4028                        "x x x x  x x x x    x x x x  x x x x";
4029
4030     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4031                        "x x x x  x x x x    x x x x  x x x x";
4032
4033     timeout             = 200;
4034     stabdelay           = 100;
4035     cmdexedelay         = 25;
4036     synchloops          = 32;
4037     bytedelay           = 0;
4038     pollindex           = 3;
4039     pollvalue           = 0x53;
4040     predelay            = 1;
4041     postdelay           = 1;
4042     pollmethod          = 0;
4043
4044     pp_controlstack     =
4045         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4046         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4047         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4048         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
4049     hventerstabdelay    = 100;
4050     progmodedelay       = 0;
4051     latchcycles         = 5;
4052     togglevtg           = 1;
4053     poweroffdelay       = 15;
4054     resetdelayms        = 1;
4055     resetdelayus        = 0;
4056     hvleavestabdelay    = 15;
4057     chiperasepulsewidth = 0;
4058     chiperasepolltimeout = 10;
4059     programfusepulsewidth = 0;
4060     programfusepolltimeout = 5;
4061     programlockpulsewidth = 0;
4062     programlockpolltimeout = 5;
4063
4064     idr                 = 0x31;
4065     spmcr               = 0x57;
4066     allowfullpagebitstream = no;
4067
4068     memory "eeprom"
4069         paged           = no; /* leave this "no" */
4070         page_size       = 4;  /* for parallel programming */
4071         size            = 1024;
4072         min_write_delay = 9000;
4073         max_write_delay = 9000;
4074         readback_p1     = 0xff;
4075         readback_p2     = 0xff;
4076         read            = "  1   0   1   0      0   0   0   0",
4077                           "  0   0   x   x      x a10  a9  a8",
4078                           " a7  a6  a5  a4     a3  a2  a1  a0",
4079                           "  o   o   o   o      o   o   o   o";
4080
4081         write           = "  1   1   0   0      0   0   0   0",
4082                           "  0   0   x   x      x a10  a9  a8",
4083                           " a7  a6  a5  a4     a3  a2  a1  a0", 
4084                           "  i   i   i   i      i   i   i   i";
4085
4086         loadpage_lo     = "  1   1   0   0      0   0   0   1",
4087                           "  0   0   0   0      0   0   0   0",
4088                           "  0   0   0   0      0   0  a1  a0",
4089                           "  i   i   i   i      i   i   i   i";
4090
4091         writepage       = "  1   1   0   0      0   0   1   0",
4092                           "  0   0   x   x      x a10  a9  a8",
4093                           " a7  a6  a5  a4     a3  a2   0   0",
4094                           "  x   x   x   x      x   x   x   x";
4095
4096         mode            = 0x41;
4097         delay           = 10;
4098         blocksize       = 128;
4099         readsize        = 256;
4100       ;
4101
4102     memory "flash"
4103         paged           = yes;
4104         size            = 32768;
4105         page_size       = 128;
4106         num_pages       = 256;
4107         min_write_delay = 4500;
4108         max_write_delay = 4500;
4109         readback_p1     = 0xff;
4110         readback_p2     = 0xff;
4111         read_lo         = "  0   0   1   0      0   0   0   0",
4112                           "  0 a14 a13 a12    a11 a10  a9  a8",
4113                           " a7  a6  a5  a4     a3  a2  a1  a0",
4114                           "  o   o   o   o      o   o   o   o";
4115
4116         read_hi         = "  0   0   1   0      1   0   0   0",
4117                           "  0 a14 a13 a12    a11 a10  a9  a8",
4118                           " a7  a6  a5  a4     a3  a2  a1  a0",
4119                           "  o   o   o   o      o   o   o   o";
4120
4121         loadpage_lo     = "  0   1   0   0      0   0   0   0",
4122                           "  0   0   x   x      x   x   x   x",
4123                           "  x   x  a5  a4     a3  a2  a1  a0",
4124                           "  i   i   i   i      i   i   i   i";
4125
4126         loadpage_hi     = "  0   1   0   0      1   0   0   0",
4127                           "  0   0   x   x      x   x   x   x",
4128                           "  x   x  a5  a4     a3  a2  a1  a0",
4129                           "  i   i   i   i      i   i   i   i";
4130
4131         writepage       = "  0   1   0   0      1   1   0   0",
4132                           "  0 a14 a13 a12    a11 a10  a9  a8",
4133                           " a7  a6   x   x      x   x   x   x",
4134                           "  x   x   x   x      x   x   x   x";
4135
4136         mode            = 0x21;
4137         delay           = 6;
4138         blocksize       = 256;
4139         readsize        = 256;
4140       ;
4141
4142     memory "lock"
4143         size            = 1;
4144         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4145                           "x x x x  x x x x   x x o o  o o o o";
4146
4147         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4148                           "x x x x  x x x x   1 1 i i  i i i i";
4149         min_write_delay = 9000;
4150         max_write_delay = 9000;
4151       ;
4152
4153     memory "lfuse"
4154         size            = 1;
4155         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4156                           "x x x x  x x x x   o o o o  o o o o";
4157
4158         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4159                           "x x x x  x x x x   i i i i  i i i i";
4160         min_write_delay = 9000;
4161         max_write_delay = 9000;
4162       ;
4163
4164     memory "hfuse"
4165         size            = 1;
4166         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4167                           "x x x x  x x x x   o o o o  o o o o";
4168
4169         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4170                           "x x x x  x x x x   i i i i  i i i i";
4171         min_write_delay = 9000;
4172         max_write_delay = 9000;
4173       ;
4174
4175     memory "efuse"
4176         size            = 1;
4177
4178         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4179                           "x x x x  x x x x  o o o o  o o o o";
4180
4181         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4182                           "x x x x  x x x x  1 1 1 1  1 i i i";
4183         min_write_delay = 9000;
4184         max_write_delay = 9000;
4185       ;
4186
4187     memory "signature"
4188         size            = 3;
4189         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4190                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4191       ;
4192
4193     memory "calibration"
4194         size            = 1;
4195
4196         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4197                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
4198         ;
4199   ;
4200
4201
4202 #------------------------------------------------------------
4203 # ATmega324PA
4204 #------------------------------------------------------------
4205
4206 # similar to ATmega324P
4207
4208 part
4209     id               = "m324pa";
4210     desc             = "ATmega324PA";
4211     has_jtag         = yes;
4212     stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4213     avr910_devcode   = 0x74;
4214     signature        = 0x1e 0x95 0x11;
4215     pagel            = 0xd7;
4216     bs2              = 0xa0;
4217     chip_erase_delay = 9000;
4218     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4219                        "x x x x  x x x x    x x x x  x x x x";
4220
4221     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4222                        "x x x x  x x x x    x x x x  x x x x";
4223
4224     timeout             = 200;
4225     stabdelay           = 100;
4226     cmdexedelay         = 25;
4227     synchloops          = 32;
4228     bytedelay           = 0;
4229     pollindex           = 3;
4230     pollvalue           = 0x53;
4231     predelay            = 1;
4232     postdelay           = 1;
4233     pollmethod          = 0;
4234
4235     pp_controlstack     =
4236         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4237         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4238         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4239         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
4240     hventerstabdelay    = 100;
4241     progmodedelay       = 0;
4242     latchcycles         = 5;
4243     togglevtg           = 1;
4244     poweroffdelay       = 15;
4245     resetdelayms        = 1;
4246     resetdelayus        = 0;
4247     hvleavestabdelay    = 15;
4248     chiperasepulsewidth = 0;
4249     chiperasepolltimeout = 10;
4250     programfusepulsewidth = 0;
4251     programfusepolltimeout = 5;
4252     programlockpulsewidth = 0;
4253     programlockpolltimeout = 5;
4254
4255     idr                 = 0x31;
4256     spmcr               = 0x57;
4257     allowfullpagebitstream = no;
4258
4259     memory "eeprom"
4260         paged           = no; /* leave this "no" */
4261         page_size       = 4;  /* for parallel programming */
4262         size            = 1024;
4263         min_write_delay = 9000;
4264         max_write_delay = 9000;
4265         readback_p1     = 0xff;
4266         readback_p2     = 0xff;
4267         read            = "  1   0   1   0      0   0   0   0",
4268                           "  0   0   x   x      x a10  a9  a8",
4269                           " a7  a6  a5  a4     a3  a2  a1  a0",
4270                           "  o   o   o   o      o   o   o   o";
4271
4272         write           = "  1   1   0   0      0   0   0   0",
4273                           "  0   0   x   x      x a10  a9  a8",
4274                           " a7  a6  a5  a4     a3  a2  a1  a0", 
4275                           "  i   i   i   i      i   i   i   i";
4276
4277         loadpage_lo     = "  1   1   0   0      0   0   0   1",
4278                           "  0   0   0   0      0   0   0   0",
4279                           "  0   0   0   0      0   0  a1  a0",
4280                           "  i   i   i   i      i   i   i   i";
4281
4282         writepage       = "  1   1   0   0      0   0   1   0",
4283                           "  0   0   x   x      x a10  a9  a8",
4284                           " a7  a6  a5  a4     a3  a2   0   0",
4285                           "  x   x   x   x      x   x   x   x";
4286
4287         mode            = 0x41;
4288         delay           = 10;
4289         blocksize       = 128;
4290         readsize        = 256;
4291       ;
4292
4293     memory "flash"
4294         paged           = yes;
4295         size            = 32768;
4296         page_size       = 128;
4297         num_pages       = 256;
4298         min_write_delay = 4500;
4299         max_write_delay = 4500;
4300         readback_p1     = 0xff;
4301         readback_p2     = 0xff;
4302         read_lo         = "  0   0   1   0      0   0   0   0",
4303                           "  0 a14 a13 a12    a11 a10  a9  a8",
4304                           " a7  a6  a5  a4     a3  a2  a1  a0",
4305                           "  o   o   o   o      o   o   o   o";
4306
4307         read_hi         = "  0   0   1   0      1   0   0   0",
4308                           "  0 a14 a13 a12    a11 a10  a9  a8",
4309                           " a7  a6  a5  a4     a3  a2  a1  a0",
4310                           "  o   o   o   o      o   o   o   o";
4311
4312         loadpage_lo     = "  0   1   0   0      0   0   0   0",
4313                           "  0   0   x   x      x   x   x   x",
4314                           "  x   x  a5  a4     a3  a2  a1  a0",
4315                           "  i   i   i   i      i   i   i   i";
4316
4317         loadpage_hi     = "  0   1   0   0      1   0   0   0",
4318                           "  0   0   x   x      x   x   x   x",
4319                           "  x   x  a5  a4     a3  a2  a1  a0",
4320                           "  i   i   i   i      i   i   i   i";
4321
4322         writepage       = "  0   1   0   0      1   1   0   0",
4323                           "  0 a14 a13 a12    a11 a10  a9  a8",
4324                           " a7  a6   x   x      x   x   x   x",
4325                           "  x   x   x   x      x   x   x   x";
4326
4327         mode            = 0x21;
4328         delay           = 6;
4329         blocksize       = 256;
4330         readsize        = 256;
4331       ;
4332
4333     memory "lock"
4334         size            = 1;
4335         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4336                           "x x x x  x x x x   x x o o  o o o o";
4337
4338         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4339                           "x x x x  x x x x   1 1 i i  i i i i";
4340         min_write_delay = 9000;
4341         max_write_delay = 9000;
4342       ;
4343
4344     memory "lfuse"
4345         size            = 1;
4346         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4347                           "x x x x  x x x x   o o o o  o o o o";
4348
4349         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4350                           "x x x x  x x x x   i i i i  i i i i";
4351         min_write_delay = 9000;
4352         max_write_delay = 9000;
4353       ;
4354
4355     memory "hfuse"
4356         size            = 1;
4357         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4358                           "x x x x  x x x x   o o o o  o o o o";
4359
4360         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4361                           "x x x x  x x x x   i i i i  i i i i";
4362         min_write_delay = 9000;
4363         max_write_delay = 9000;
4364       ;
4365
4366     memory "efuse"
4367         size            = 1;
4368
4369         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4370                           "x x x x  x x x x  o o o o  o o o o";
4371
4372         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4373                           "x x x x  x x x x  1 1 1 1  1 i i i";
4374         min_write_delay = 9000;
4375         max_write_delay = 9000;
4376       ;
4377
4378     memory "signature"
4379         size            = 3;
4380         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4381                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4382       ;
4383
4384     memory "calibration"
4385         size            = 1;
4386
4387         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4388                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
4389         ;
4390   ;
4391
4392
4393 #------------------------------------------------------------
4394 # ATmega644
4395 #------------------------------------------------------------
4396
4397 # similar to ATmega164
4398
4399 part
4400     id               = "m644";
4401     desc             = "ATMEGA644";
4402     has_jtag         = yes;
4403     stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4404     avr910_devcode   = 0x74;
4405     signature        = 0x1e 0x96 0x09;
4406     pagel            = 0xd7;
4407     bs2              = 0xa0;
4408     chip_erase_delay = 9000;
4409     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4410                        "x x x x  x x x x    x x x x  x x x x";
4411
4412     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4413                        "x x x x  x x x x    x x x x  x x x x";
4414
4415     timeout             = 200;
4416     stabdelay           = 100;
4417     cmdexedelay         = 25;
4418     synchloops          = 32;
4419     bytedelay           = 0;
4420     pollindex           = 3;
4421     pollvalue           = 0x53;
4422     predelay            = 1;
4423     postdelay           = 1;
4424     pollmethod          = 0;
4425
4426     pp_controlstack     =
4427         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4428         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4429         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4430         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
4431     hventerstabdelay    = 100;
4432     progmodedelay       = 0;
4433     latchcycles         = 6;
4434     togglevtg           = 0;
4435     poweroffdelay       = 0;
4436     resetdelayms        = 0;
4437     resetdelayus        = 0;
4438     hvleavestabdelay    = 15;
4439     chiperasepulsewidth = 0;
4440     chiperasepolltimeout = 10;
4441     programfusepulsewidth = 0;
4442     programfusepolltimeout = 5;
4443     programlockpulsewidth = 0;
4444     programlockpolltimeout = 5;
4445
4446     idr                 = 0x31;
4447     spmcr               = 0x57;
4448     allowfullpagebitstream = no;
4449
4450     memory "eeprom"
4451         paged           = no; /* leave this "no" */
4452         page_size       = 8;  /* for parallel programming */
4453         size            = 2048;
4454         min_write_delay = 9000;
4455         max_write_delay = 9000;
4456         readback_p1     = 0xff;
4457         readback_p2     = 0xff;
4458         read            = "  1   0   1   0      0   0   0   0",
4459                           "  0   0   x   x    a11 a10  a9  a8",
4460                           " a7  a6  a5  a4     a3  a2  a1  a0",
4461                           "  o   o   o   o      o   o   o   o";
4462
4463         write           = "  1   1   0   0      0   0   0   0",
4464                           "  0   0   x   x    a11 a10  a9  a8",
4465                           " a7  a6  a5  a4     a3  a2  a1  a0", 
4466                           "  i   i   i   i      i   i   i   i";
4467
4468         loadpage_lo     = "  1   1   0   0      0   0   0   1",
4469                           "  0   0   0   0      0   0   0   0",
4470                           "  0   0   0   0      0  a2  a1  a0",
4471                           "  i   i   i   i      i   i   i   i";
4472
4473         writepage       = "  1   1   0   0      0   0   1   0",
4474                           "  0   0   x   x    a11 a10  a9  a8",
4475                           " a7  a6  a5  a4     a3   0   0   0",
4476                           "  x   x   x   x      x   x   x   x";
4477
4478         mode            = 0x41;
4479         delay           = 10;
4480         blocksize       = 128;
4481         readsize        = 256;
4482       ;
4483
4484     memory "flash"
4485         paged           = yes;
4486         size            = 65536;
4487         page_size       = 256;
4488         num_pages       = 256;
4489         min_write_delay = 4500;
4490         max_write_delay = 4500;
4491         readback_p1     = 0xff;
4492         readback_p2     = 0xff;
4493         read_lo         = "  0   0   1   0      0   0   0   0",
4494                           "a15 a14 a13 a12    a11 a10  a9  a8",
4495                           " a7  a6  a5  a4     a3  a2  a1  a0",
4496                           "  o   o   o   o      o   o   o   o";
4497
4498         read_hi         = "  0   0   1   0      1   0   0   0",
4499                           "a15 a14 a13 a12    a11 a10  a9  a8",
4500                           " a7  a6  a5  a4     a3  a2  a1  a0",
4501                           "  o   o   o   o      o   o   o   o";
4502
4503         loadpage_lo     = "  0   1   0   0      0   0   0   0",
4504                           "  0   0   x   x      x   x   x   x",
4505                           "  x  a6  a5  a4     a3  a2  a1  a0",
4506                           "  i   i   i   i      i   i   i   i";
4507
4508         loadpage_hi     = "  0   1   0   0      1   0   0   0",
4509                           "  0   0   x   x      x   x   x   x",
4510                           "  x  a6  a5  a4     a3  a2  a1  a0",
4511                           "  i   i   i   i      i   i   i   i";
4512
4513         writepage       = "  0   1   0   0      1   1   0   0",
4514                           "a15 a14 a13 a12    a11 a10  a9  a8",
4515                           " a7   x   x   x      x   x   x   x",
4516                           "  x   x   x   x      x   x   x   x";
4517
4518         mode            = 0x21;
4519         delay           = 6;
4520         blocksize       = 256;
4521         readsize        = 256;
4522       ;
4523
4524     memory "lock"
4525         size            = 1;
4526         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4527                           "x x x x  x x x x   x x o o  o o o o";
4528
4529         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4530                           "x x x x  x x x x   1 1 i i  i i i i";
4531         min_write_delay = 9000;
4532         max_write_delay = 9000;
4533       ;
4534
4535     memory "lfuse"
4536         size            = 1;
4537         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4538                           "x x x x  x x x x   o o o o  o o o o";
4539
4540         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4541                           "x x x x  x x x x   i i i i  i i i i";
4542         min_write_delay = 9000;
4543         max_write_delay = 9000;
4544       ;
4545
4546     memory "hfuse"
4547         size            = 1;
4548         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4549                           "x x x x  x x x x   o o o o  o o o o";
4550
4551         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4552                           "x x x x  x x x x   i i i i  i i i i";
4553         min_write_delay = 9000;
4554         max_write_delay = 9000;
4555       ;
4556
4557     memory "efuse"
4558         size            = 1;
4559
4560         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4561                           "x x x x  x x x x  o o o o  o o o o";
4562
4563         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4564                           "x x x x  x x x x  1 1 1 1  1 i i i";
4565         min_write_delay = 9000;
4566         max_write_delay = 9000;
4567       ;
4568
4569     memory "signature"
4570         size            = 3;
4571         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4572                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4573       ;
4574
4575     memory "calibration"
4576         size            = 1;
4577
4578         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4579                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
4580         ;
4581   ;
4582
4583 #------------------------------------------------------------
4584 # ATmega644P
4585 #------------------------------------------------------------
4586
4587 # similar to ATmega164p
4588
4589 part
4590     id               = "m644p";
4591     desc             = "ATMEGA644P";
4592     has_jtag         = yes;
4593     stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4594     avr910_devcode   = 0x74;
4595     signature        = 0x1e 0x96 0x0a;
4596     pagel            = 0xd7;
4597     bs2              = 0xa0;
4598     chip_erase_delay = 9000;
4599     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4600                        "x x x x  x x x x    x x x x  x x x x";
4601
4602     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4603                        "x x x x  x x x x    x x x x  x x x x";
4604
4605     timeout             = 200;
4606     stabdelay           = 100;
4607     cmdexedelay         = 25;
4608     synchloops          = 32;
4609     bytedelay           = 0;
4610     pollindex           = 3;
4611     pollvalue           = 0x53;
4612     predelay            = 1;
4613     postdelay           = 1;
4614     pollmethod          = 0;
4615
4616     pp_controlstack     =
4617         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4618         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4619         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4620         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
4621     hventerstabdelay    = 100;
4622     progmodedelay       = 0;
4623     latchcycles         = 6;
4624     togglevtg           = 0;
4625     poweroffdelay       = 0;
4626     resetdelayms        = 0;
4627     resetdelayus        = 0;
4628     hvleavestabdelay    = 15;
4629     chiperasepulsewidth = 0;
4630     chiperasepolltimeout = 10;
4631     programfusepulsewidth = 0;
4632     programfusepolltimeout = 5;
4633     programlockpulsewidth = 0;
4634     programlockpolltimeout = 5;
4635
4636     idr                 = 0x31;
4637     spmcr               = 0x57;
4638     allowfullpagebitstream = no;
4639
4640     memory "eeprom"
4641         paged           = no; /* leave this "no" */
4642         page_size       = 8;  /* for parallel programming */
4643         size            = 2048;
4644         min_write_delay = 9000;
4645         max_write_delay = 9000;
4646         readback_p1     = 0xff;
4647         readback_p2     = 0xff;
4648         read            = "  1   0   1   0      0   0   0   0",
4649                           "  0   0   x   x    a11 a10  a9  a8",
4650                           " a7  a6  a5  a4     a3  a2  a1  a0",
4651                           "  o   o   o   o      o   o   o   o";
4652
4653         write           = "  1   1   0   0      0   0   0   0",
4654                           "  0   0   x   x    a11 a10  a9  a8",
4655                           " a7  a6  a5  a4     a3  a2  a1  a0", 
4656                           "  i   i   i   i      i   i   i   i";
4657
4658         loadpage_lo     = "  1   1   0   0      0   0   0   1",
4659                           "  0   0   0   0      0   0   0   0",
4660                           "  0   0   0   0      0  a2  a1  a0",
4661                           "  i   i   i   i      i   i   i   i";
4662
4663         writepage       = "  1   1   0   0      0   0   1   0",
4664                           "  0   0   x   x    a11 a10  a9  a8",
4665                           " a7  a6  a5  a4     a3   0   0   0",
4666                           "  x   x   x   x      x   x   x   x";
4667
4668         mode            = 0x41;
4669         delay           = 10;
4670         blocksize       = 128;
4671         readsize        = 256;
4672       ;
4673
4674     memory "flash"
4675         paged           = yes;
4676         size            = 65536;
4677         page_size       = 256;
4678         num_pages       = 256;
4679         min_write_delay = 4500;
4680         max_write_delay = 4500;
4681         readback_p1     = 0xff;
4682         readback_p2     = 0xff;
4683         read_lo         = "  0   0   1   0      0   0   0   0",
4684                           "a15 a14 a13 a12    a11 a10  a9  a8",
4685                           " a7  a6  a5  a4     a3  a2  a1  a0",
4686                           "  o   o   o   o      o   o   o   o";
4687
4688         read_hi         = "  0   0   1   0      1   0   0   0",
4689                           "a15 a14 a13 a12    a11 a10  a9  a8",
4690                           " a7  a6  a5  a4     a3  a2  a1  a0",
4691                           "  o   o   o   o      o   o   o   o";
4692
4693         loadpage_lo     = "  0   1   0   0      0   0   0   0",
4694                           "  0   0   x   x      x   x   x   x",
4695                           "  x  a6  a5  a4     a3  a2  a1  a0",
4696                           "  i   i   i   i      i   i   i   i";
4697
4698         loadpage_hi     = "  0   1   0   0      1   0   0   0",
4699                           "  0   0   x   x      x   x   x   x",
4700                           "  x  a6  a5  a4     a3  a2  a1  a0",
4701                           "  i   i   i   i      i   i   i   i";
4702
4703         writepage       = "  0   1   0   0      1   1   0   0",
4704                           "a15 a14 a13 a12    a11 a10  a9  a8",
4705                           " a7   x   x   x      x   x   x   x",
4706                           "  x   x   x   x      x   x   x   x";
4707
4708         mode            = 0x21;
4709         delay           = 6;
4710         blocksize       = 256;
4711         readsize        = 256;
4712       ;
4713
4714     memory "lock"
4715         size            = 1;
4716         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4717                           "x x x x  x x x x   x x o o  o o o o";
4718
4719         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4720                           "x x x x  x x x x   1 1 i i  i i i i";
4721         min_write_delay = 9000;
4722         max_write_delay = 9000;
4723       ;
4724
4725     memory "lfuse"
4726         size            = 1;
4727         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4728                           "x x x x  x x x x   o o o o  o o o o";
4729
4730         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4731                           "x x x x  x x x x   i i i i  i i i i";
4732         min_write_delay = 9000;
4733         max_write_delay = 9000;
4734       ;
4735
4736     memory "hfuse"
4737         size            = 1;
4738         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4739                           "x x x x  x x x x   o o o o  o o o o";
4740
4741         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4742                           "x x x x  x x x x   i i i i  i i i i";
4743         min_write_delay = 9000;
4744         max_write_delay = 9000;
4745       ;
4746
4747     memory "efuse"
4748         size            = 1;
4749
4750         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4751                           "x x x x  x x x x  o o o o  o o o o";
4752
4753         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4754                           "x x x x  x x x x  1 1 1 1  1 i i i";
4755         min_write_delay = 9000;
4756         max_write_delay = 9000;
4757       ;
4758
4759     memory "signature"
4760         size            = 3;
4761         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4762                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4763       ;
4764
4765     memory "calibration"
4766         size            = 1;
4767
4768         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4769                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
4770         ;
4771   ;
4772
4773
4774
4775 #------------------------------------------------------------
4776 # ATmega1284P
4777 #------------------------------------------------------------
4778
4779 # similar to ATmega164p
4780
4781 part
4782     id               = "m1284p";
4783     desc             = "ATMEGA1284P";
4784     has_jtag         = yes;
4785     stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
4786     avr910_devcode   = 0x74;
4787     signature        = 0x1e 0x97 0x05;
4788     pagel            = 0xd7;
4789     bs2              = 0xa0;
4790     chip_erase_delay = 9000;
4791     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4792                        "x x x x  x x x x    x x x x  x x x x";
4793
4794     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4795                        "x x x x  x x x x    x x x x  x x x x";
4796
4797     timeout             = 200;
4798     stabdelay           = 100;
4799     cmdexedelay         = 25;
4800     synchloops          = 32;
4801     bytedelay           = 0;
4802     pollindex           = 3;
4803     pollvalue           = 0x53;
4804     predelay            = 1;
4805     postdelay           = 1;
4806     pollmethod          = 1;
4807
4808     pp_controlstack     =
4809         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
4810         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
4811         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
4812         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
4813     hventerstabdelay    = 100;
4814     progmodedelay       = 0;
4815     latchcycles         = 6;
4816     togglevtg           = 1;
4817     poweroffdelay       = 15;
4818     resetdelayms        = 1;
4819     resetdelayus        = 0;
4820     hvleavestabdelay    = 15;
4821     chiperasepulsewidth = 0;
4822     chiperasepolltimeout = 10;
4823     programfusepulsewidth = 0;
4824     programfusepolltimeout = 5;
4825     programlockpulsewidth = 0;
4826     programlockpolltimeout = 5;
4827
4828     idr                 = 0x31;
4829     spmcr               = 0x57;
4830     allowfullpagebitstream = no;
4831
4832     memory "eeprom"
4833         paged           = no; /* leave this "no" */
4834         page_size       = 8;  /* for parallel programming */
4835         size            = 4096;
4836         min_write_delay = 9000;
4837         max_write_delay = 9000;
4838         readback_p1     = 0xff;
4839         readback_p2     = 0xff;
4840         read            = "  1   0   1   0      0   0   0   0",
4841                           "  0   0   x   x    a11 a10  a9  a8",
4842                           " a7  a6  a5  a4     a3  a2  a1  a0",
4843                           "  o   o   o   o      o   o   o   o";
4844
4845         write           = "  1   1   0   0      0   0   0   0",
4846                           "  0   0   x   x    a11 a10  a9  a8",
4847                           " a7  a6  a5  a4     a3  a2  a1  a0", 
4848                           "  i   i   i   i      i   i   i   i";
4849
4850         loadpage_lo     = "  1   1   0   0      0   0   0   1",
4851                           "  0   0   0   0      0   0   0   0",
4852                           "  0   0   0   0      0  a2  a1  a0",
4853                           "  i   i   i   i      i   i   i   i";
4854
4855         writepage       = "  1   1   0   0      0   0   1   0",
4856                           "  0   0   x   x    a11 a10  a9  a8",
4857                           " a7  a6  a5  a4     a3   0   0   0",
4858                           "  x   x   x   x      x   x   x   x";
4859
4860         mode            = 0x41;
4861         delay           = 10;
4862         blocksize       = 128;
4863         readsize        = 256;
4864       ;
4865
4866     memory "flash"
4867         paged           = yes;
4868         size            = 131072;
4869         page_size       = 256;
4870         num_pages       = 512;
4871         min_write_delay = 4500;
4872         max_write_delay = 4500;
4873         readback_p1     = 0xff;
4874         readback_p2     = 0xff;
4875         read_lo         = "  0   0   1   0      0   0   0   0",
4876                           "a15 a14 a13 a12    a11 a10  a9  a8",
4877                           " a7  a6  a5  a4     a3  a2  a1  a0",
4878                           "  o   o   o   o      o   o   o   o";
4879
4880         read_hi         = "  0   0   1   0      1   0   0   0",
4881                           "a15 a14 a13 a12    a11 a10  a9  a8",
4882                           " a7  a6  a5  a4     a3  a2  a1  a0",
4883                           "  o   o   o   o      o   o   o   o";
4884
4885         loadpage_lo     = "  0   1   0   0      0   0   0   0",
4886                           "  0   0   x   x      x   x   x   x",
4887                           "  x  a6  a5  a4     a3  a2  a1  a0",
4888                           "  i   i   i   i      i   i   i   i";
4889
4890         loadpage_hi     = "  0   1   0   0      1   0   0   0",
4891                           "  0   0   x   x      x   x   x   x",
4892                           "  x  a6  a5  a4     a3  a2  a1  a0",
4893                           "  i   i   i   i      i   i   i   i";
4894
4895         writepage       = "  0   1   0   0      1   1   0   0",
4896                           "a15 a14 a13 a12    a11 a10  a9  a8",
4897                           " a7   x   x   x      x   x   x   x",
4898                           "  x   x   x   x      x   x   x   x";
4899
4900         mode            = 0x41;
4901         delay           = 10;
4902         blocksize       = 256;
4903         readsize        = 256;
4904       ;
4905
4906     memory "lock"
4907         size            = 1;
4908         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
4909                           "x x x x  x x x x   x x o o  o o o o";
4910
4911         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
4912                           "x x x x  x x x x   1 1 i i  i i i i";
4913         min_write_delay = 9000;
4914         max_write_delay = 9000;
4915       ;
4916
4917     memory "lfuse"
4918         size            = 1;
4919         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
4920                           "x x x x  x x x x   o o o o  o o o o";
4921
4922         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
4923                           "x x x x  x x x x   i i i i  i i i i";
4924         min_write_delay = 9000;
4925         max_write_delay = 9000;
4926       ;
4927
4928     memory "hfuse"
4929         size            = 1;
4930         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
4931                           "x x x x  x x x x   o o o o  o o o o";
4932
4933         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
4934                           "x x x x  x x x x   i i i i  i i i i";
4935         min_write_delay = 9000;
4936         max_write_delay = 9000;
4937       ;
4938
4939     memory "efuse"
4940         size            = 1;
4941
4942         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
4943                           "x x x x  x x x x  o o o o  o o o o";
4944
4945         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
4946                           "x x x x  x x x x  1 1 1 1  1 i i i";
4947         min_write_delay = 9000;
4948         max_write_delay = 9000;
4949       ;
4950
4951     memory "signature"
4952         size            = 3;
4953         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
4954                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
4955       ;
4956
4957     memory "calibration"
4958         size            = 1;
4959
4960         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
4961                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
4962         ;
4963   ;
4964
4965
4966
4967 #------------------------------------------------------------
4968 # ATmega162
4969 #------------------------------------------------------------
4970
4971 part
4972     id               = "m162";
4973     desc             = "ATMEGA162";
4974     has_jtag         = yes;
4975     stk500_devcode   = 0x83;
4976     avr910_devcode   = 0x63;
4977     signature        = 0x1e 0x94 0x04;
4978     chip_erase_delay = 9000;
4979     pagel            = 0xd7;
4980     bs2              = 0xa0;
4981
4982     idr              = 0x04;
4983     spmcr            = 0x57;
4984     allowfullpagebitstream = yes;
4985
4986     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
4987                        "x x x x  x x x x    x x x x  x x x x";
4988
4989     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
4990                        "x x x x  x x x x    x x x x  x x x x";
4991
4992     memory "flash"
4993         paged           = yes;
4994         size            = 16384;
4995         page_size       = 128;
4996         num_pages       = 128;
4997         min_write_delay = 4500;
4998         max_write_delay = 4500;
4999         readback_p1     = 0xff;
5000         readback_p2     = 0xff;
5001
5002         read_lo         = "  0   0   1   0      0   0   0   0",
5003                           "  0   0 a13 a12    a11 a10  a9  a8",
5004                           " a7  a6  a5  a4     a3  a2  a1  a0",
5005                           "  o   o   o   o      o   o   o   o";
5006
5007         read_hi         = "  0   0   1   0      1   0   0   0",
5008                           "  0   0 a13 a12    a11 a10  a9  a8",
5009                           " a7  a6  a5  a4     a3  a2  a1  a0",
5010                           "  o   o   o   o      o   o   o   o";
5011
5012         loadpage_lo     = "  0   1   0   0      0   0   0   0",
5013                           "  0   0   x   x      x   x   x   x",
5014                           "  x   x  a5  a4     a3  a2  a1  a0",
5015                           "  i   i   i   i      i   i   i   i";
5016
5017         loadpage_hi     = "  0   1   0   0      1   0   0   0",
5018                           "  0   0   x   x      x   x   x   x",
5019                           "  x   x  a5  a4     a3  a2  a1  a0",
5020                           "  i   i   i   i      i   i   i   i";
5021
5022         writepage       = "  0   1   0   0      1   1   0   0",
5023                           "  0   0 a13 a12    a11 a10  a9  a8",
5024                           " a7  a6   x   x      x   x   x   x",
5025                           "  x   x   x   x      x   x   x   x";
5026        mode        = 0x41;
5027     delay       = 10;
5028     blocksize   = 128;
5029     readsize    = 256;  
5030
5031         ;
5032
5033     timeout             = 200;
5034     stabdelay           = 100;
5035     cmdexedelay         = 25;
5036     synchloops          = 32;
5037     bytedelay           = 0;
5038     pollindex           = 3;
5039     pollvalue           = 0x53;
5040     predelay            = 1;
5041     postdelay           = 1;
5042     pollmethod          = 0;
5043
5044     pp_controlstack     =
5045         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5046         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5047         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5048         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5049     hventerstabdelay    = 100;
5050     progmodedelay       = 0;
5051     latchcycles         = 6;
5052     togglevtg           = 0;
5053     poweroffdelay       = 0;
5054     resetdelayms        = 0;
5055     resetdelayus        = 0;
5056     hvleavestabdelay    = 15;
5057     chiperasepulsewidth = 0;
5058     chiperasepolltimeout = 10;
5059     programfusepulsewidth = 0;
5060     programfusepolltimeout = 5;
5061     programlockpulsewidth = 0;
5062     programlockpolltimeout = 5;
5063
5064     memory "eeprom"
5065         paged           = no; /* leave this "no" */
5066         page_size       = 4;  /* for parallel programming */
5067         size            = 512;
5068         min_write_delay = 9000;
5069         max_write_delay = 9000;
5070         readback_p1     = 0xff;
5071         readback_p2     = 0xff;
5072
5073                 read            = "  1   0   1   0      0   0   0   0",
5074                           "  0   0   x   x      x   x  a9  a8",
5075                           " a7  a6  a5  a4     a3  a2  a1  a0",
5076                           "  o   o   o   o      o   o   o   o";
5077
5078                 write           = "  1   1   0   0      0   0   0   0",
5079                           "  0   0   x   x      x   x  a9  a8",
5080                           " a7  a6  a5  a4     a3  a2  a1  a0",
5081                           "  i   i   i   i      i   i   i   i";
5082
5083         loadpage_lo     = "  1   1   0   0      0   0   0   1",
5084                           "  0   0   0   0      0   0   0   0",
5085                           "  0   0   0   0      0   0  a1  a0",
5086                           "  i   i   i   i      i   i   i   i";
5087
5088         writepage       = "  1   1   0   0      0   0   1   0",
5089                           "  0   0   x   x      x   x  a9  a8",
5090                           " a7  a6  a5  a4     a3  a2   0   0",
5091                           "  x   x   x   x      x   x   x   x";
5092
5093         mode            = 0x41;
5094         delay           = 20;
5095         blocksize       = 4;
5096         readsize        = 256;
5097         ;
5098
5099     memory "lfuse"
5100         size            = 1;
5101         min_write_delay = 16000;
5102         max_write_delay = 16000;
5103         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5104                           "x x x x  x x x x   o o o o  o o o o";
5105
5106         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5107                           "x x x x  x x x x   i i i i  i i i i";
5108         ;
5109
5110     memory "hfuse"
5111         size            = 1;
5112         min_write_delay = 16000;
5113         max_write_delay = 16000;
5114
5115         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5116                           "x x x x  x x x x   o o o o  o o o o";
5117
5118         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5119                           "x x x x  x x x x   i i i i  i i i i";
5120         ;
5121
5122     memory "efuse"
5123         size            = 1;
5124         min_write_delay = 16000;
5125         max_write_delay = 16000;
5126
5127         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
5128                           "x x x x  x x x x  o o o o  o o o o";
5129
5130         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
5131                           "x x x x  x x x x  1 1 1 1  1 i i i";
5132       ;
5133
5134     memory "lock"
5135         size            = 1;
5136         min_write_delay = 16000;
5137         max_write_delay = 16000;
5138
5139         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5140                           "x x x x  x x x x   x x o o  o o o o";
5141
5142         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5143                           "x x x x  x x x x   1 1 i i  i i i i";
5144         ;
5145
5146     memory "signature"
5147         size            = 3;
5148
5149         read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
5150                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5151         ;
5152
5153     memory "calibration"
5154         size            = 1;
5155
5156         read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
5157                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
5158         ;
5159 ;
5160
5161
5162
5163 #------------------------------------------------------------
5164 # ATmega163
5165 #------------------------------------------------------------
5166
5167 part
5168     id               = "m163";
5169     desc             = "ATMEGA163";
5170     stk500_devcode   = 0x81;
5171     avr910_devcode   = 0x64;
5172     signature        = 0x1e 0x94 0x02;
5173     chip_erase_delay = 32000;
5174     pagel            = 0xd7;
5175     bs2              = 0xa0;
5176     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5177                        "x x x x  x x x x    x x x x  x x x x";
5178
5179     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5180                        "x x x x  x x x x    x x x x  x x x x";
5181
5182     timeout             = 200;
5183     stabdelay           = 100;
5184     cmdexedelay         = 25;
5185     synchloops          = 32;
5186     bytedelay           = 0;
5187     pollindex           = 3;
5188     pollvalue           = 0x53;
5189     predelay            = 1;
5190     postdelay           = 1;
5191     pollmethod          = 0;
5192
5193     pp_controlstack     =
5194         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5195         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5196         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5197         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5198     hventerstabdelay    = 100;
5199     progmodedelay       = 0;
5200     latchcycles         = 0;
5201     togglevtg           = 0;
5202     poweroffdelay       = 0;
5203     resetdelayms        = 0;
5204     resetdelayus        = 0;
5205     hvleavestabdelay    = 15;
5206     chiperasepulsewidth = 0;
5207     chiperasepolltimeout = 30;
5208     programfusepulsewidth = 0;
5209     programfusepolltimeout = 2;
5210     programlockpulsewidth = 0;
5211     programlockpolltimeout = 2;
5212
5213
5214    memory "eeprom"
5215         size            = 512;
5216         min_write_delay = 4000;
5217         max_write_delay = 4000;
5218         readback_p1     = 0xff;
5219         readback_p2     = 0xff;
5220         read            = "  1   0   1   0      0   0   0   0",
5221                           "  x   x   x   x      x   x   x  a8",
5222                           " a7  a6  a5  a4     a3  a2  a1  a0",
5223                           "  o   o   o   o      o   o   o   o";
5224
5225         write           = "  1   1   0   0      0   0   0   0",
5226                           "  x   x   x   x      x   x   x  a8",
5227                           " a7  a6  a5  a4     a3  a2  a1  a0",
5228                           "  i   i   i   i      i   i   i   i";
5229         mode            = 0x41;
5230         delay           = 20;
5231         blocksize       = 4;
5232         readsize        = 256;
5233       ;
5234
5235     memory "flash"
5236         paged           = yes;
5237         size            = 16384;
5238         page_size       = 128;
5239         num_pages       = 128;
5240         min_write_delay = 16000;
5241         max_write_delay = 16000;
5242         readback_p1     = 0xff;
5243         readback_p2     = 0xff;
5244         read_lo         = "  0   0   1   0      0   0   0   0",
5245                           "  x   x   x a12    a11 a10  a9  a8",
5246                           " a7  a6  a5  a4     a3  a2  a1  a0",
5247                           "  o   o   o   o      o   o   o   o";
5248
5249         read_hi         = "  0   0   1   0      1   0   0   0",
5250                           "  x   x   x a12    a11 a10  a9  a8",
5251                           " a7  a6  a5  a4     a3  a2  a1  a0",
5252                           "  o   o   o   o      o   o   o   o";
5253
5254         loadpage_lo     = "  0   1   0   0      0   0   0   0",
5255                           "  x   x   x   x      x   x   x   x",
5256                           "  x   x  a5  a4     a3  a2  a1  a0",
5257                           "  i   i   i   i      i   i   i   i";
5258
5259         loadpage_hi     = "  0   1   0   0      1   0   0   0",
5260                           "  x   x   x   x      x   x   x   x",
5261                           "  x   x  a5  a4     a3  a2  a1  a0",
5262                           "  i   i   i   i      i   i   i   i";
5263
5264         writepage       = "  0   1   0   0      1   1   0   0",
5265                           "  x   x   x a12    a11 a10  a9  a8",
5266                           " a7  a6   x   x      x   x   x   x",
5267                           "  x   x   x   x      x   x   x   x";
5268
5269         mode            = 0x11;
5270         delay           = 20;
5271         blocksize       = 128;
5272         readsize        = 256;
5273       ;
5274
5275     memory "lfuse"
5276         size            = 1;
5277         min_write_delay = 2000;
5278         max_write_delay = 2000;
5279         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5280                           "x x x x  x x x x   o o x x  o o o o";
5281
5282         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5283                           "x x x x  x x x x   i i 1 1  i i i i";
5284       ;
5285
5286     memory "hfuse"
5287         size            = 1;
5288         min_write_delay = 2000;
5289         max_write_delay = 2000;
5290         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5291                           "x x x x  x x x x   x x x x  1 o o o";
5292
5293         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5294                           "x x x x  x x x x   1 1 1 1  1 i i i";
5295       ;
5296
5297     memory "lock"
5298         size            = 1;
5299         min_write_delay = 2000;
5300         max_write_delay = 2000;
5301         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5302                           "x x x x  0 x x x   x x o o  o o o o";
5303
5304         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5305                           "x x x x  x x x x   1 1 i i  i i i i";
5306       ;
5307
5308     memory "signature"
5309         size            = 3;
5310         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
5311                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5312       ;
5313
5314     memory "calibration"
5315         size            = 1;
5316         read            = "0 0 1 1  1 0 0 0   x x x x  x x x x",
5317                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
5318       ;
5319   ;
5320
5321 #------------------------------------------------------------
5322 # ATmega169
5323 #------------------------------------------------------------
5324
5325 part
5326     id               = "m169";
5327     desc             = "ATMEGA169";
5328     has_jtag         = yes;
5329     stk500_devcode   = 0x85;
5330     avr910_devcode   = 0x78;
5331     signature        = 0x1e 0x94 0x05;
5332     chip_erase_delay = 9000;
5333     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5334                        "x x x x  x x x x    x x x x  x x x x";
5335
5336     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5337                        "x x x x  x x x x    x x x x  x x x x";
5338     timeout             = 200;
5339     stabdelay           = 100;
5340     cmdexedelay         = 25;
5341     synchloops          = 32;
5342     bytedelay           = 0;
5343     pollindex           = 3;
5344     pollvalue           = 0x53;
5345     predelay            = 1;
5346     postdelay           = 1;
5347     pollmethod          = 1;
5348
5349     pp_controlstack     =
5350         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5351         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5352         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5353         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5354     hventerstabdelay    = 100;
5355     progmodedelay       = 0;
5356     latchcycles         = 5;
5357     togglevtg           = 1;
5358     poweroffdelay       = 15;
5359     resetdelayms        = 1;
5360     resetdelayus        = 0;
5361     hvleavestabdelay    = 15;
5362     chiperasepulsewidth = 0;
5363     chiperasepolltimeout = 10;
5364     programfusepulsewidth = 0;
5365     programfusepolltimeout = 5;
5366     programlockpulsewidth = 0;
5367     programlockpolltimeout = 5;
5368
5369     idr                 = 0x31;
5370     spmcr               = 0x57;
5371
5372    memory "eeprom"
5373         paged           = no; /* leave this "no" */
5374         page_size       = 4;  /* for parallel programming */
5375         size            = 512;
5376         min_write_delay = 9000;
5377         max_write_delay = 9000;
5378         readback_p1     = 0xff;
5379         readback_p2     = 0xff;
5380         read            = "  1   0   1   0      0   0   0   0",
5381                           "  x   x   x   x      x   x   x  a8",
5382                           " a7  a6  a5  a4     a3  a2  a1  a0",
5383                           "  o   o   o   o      o   o   o   o";
5384
5385         write           = "  1   1   0   0      0   0   0   0",
5386                           "  x   x   x   x      x   x   x  a8",
5387                           " a7  a6  a5  a4     a3  a2  a1  a0", 
5388                           "  i   i   i   i      i   i   i   i";
5389
5390         loadpage_lo     = "  1   1   0   0      0   0   0   1",
5391                           "  0   0   0   0      0   0   0   0",
5392                           "  0   0   0   0      0   0  a1  a0",
5393                           "  i   i   i   i      i   i   i   i";
5394
5395         writepage       = "  1   1   0   0      0   0   1   0",
5396                           "  0   0   x   x      x   x   x  a8",
5397                           " a7  a6  a5  a4     a3  a2   0   0",
5398                           "  x   x   x   x      x   x   x   x";
5399
5400         mode            = 0x41;
5401         delay           = 20;
5402         blocksize       = 4;
5403         readsize        = 256;
5404       ;
5405
5406     memory "flash"
5407         paged           = yes;
5408         size            = 16384;
5409         page_size       = 128;
5410         num_pages       = 128;
5411         min_write_delay = 4500;
5412         max_write_delay = 4500;
5413         readback_p1     = 0xff;
5414         readback_p2     = 0xff;
5415         read_lo         = "  0   0   1   0      0   0   0   0",
5416                           "  x   x   x a12    a11 a10  a9  a8",
5417                           " a7  a6  a5  a4     a3  a2  a1  a0",
5418                           "  o   o   o   o      o   o   o   o";
5419
5420         read_hi         = "  0   0   1   0      1   0   0   0",
5421                           "  x   x   x a12    a11 a10  a9  a8",
5422                           " a7  a6  a5  a4     a3  a2  a1  a0",
5423                           "  o   o   o   o      o   o   o   o";
5424
5425         loadpage_lo     = "  0   1   0   0      0   0   0   0",
5426                           "  x   x   x   x      x   x   x   x",
5427                           "  x   x  a5  a4     a3  a2  a1  a0",
5428                           "  i   i   i   i      i   i   i   i";
5429
5430         loadpage_hi     = "  0   1   0   0      1   0   0   0",
5431                           "  x   x   x   x      x   x   x   x",
5432                           "  x   x  a5  a4     a3  a2  a1  a0",
5433                           "  i   i   i   i      i   i   i   i";
5434
5435         writepage       = "  0   1   0   0      1   1   0   0",
5436                           "  x   x   x a12    a11 a10  a9  a8",
5437                           " a7  a6   x   x      x   x   x   x",
5438                           "  x   x   x   x      x   x   x   x";
5439
5440         mode            = 0x41;
5441         delay           = 6;
5442         blocksize       = 128;
5443         readsize        = 256;
5444       ;
5445
5446     memory "lfuse"
5447         size            = 1;
5448         min_write_delay = 2000;
5449         max_write_delay = 2000;
5450         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5451                           "x x x x  x x x x   o o o o  o o o o";
5452
5453         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5454                           "x x x x  x x x x   i i i i  i i i i";
5455       ;
5456
5457     memory "hfuse"
5458         size            = 1;
5459         min_write_delay = 2000;
5460         max_write_delay = 2000;
5461         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5462                           "x x x x  x x x x   o o o o  o o o o";
5463
5464         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5465                           "x x x x  x x x x   i i i i  i i i i";
5466       ;
5467
5468     memory "efuse"
5469         size            = 1;
5470         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
5471                           "x x x x  x x x x  x x x x  i i i i";
5472
5473         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
5474                           "x x x x  x x x x  o o o o  o o o o";
5475       ;
5476
5477     memory "lock"
5478         size            = 1;
5479         min_write_delay = 2000;
5480         max_write_delay = 2000;
5481         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5482                           "x x x x  x x x x   x x o o  o o o o";
5483
5484         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5485                           "x x x x  x x x x   1 1 i i  i i i i";
5486       ;
5487
5488     memory "signature"
5489         size            = 3;
5490         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
5491                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5492       ;
5493
5494     memory "calibration"
5495         size            = 1;
5496         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
5497                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
5498       ;
5499   ;
5500
5501 #------------------------------------------------------------
5502 # ATmega329
5503 #------------------------------------------------------------
5504
5505 part
5506     id               = "m329";
5507     desc             = "ATMEGA329";
5508     has_jtag         = yes;
5509 #    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
5510 #    avr910_devcode   = 0x?;  # try the ATmega169 one:
5511     avr910_devcode   = 0x75;
5512     signature        = 0x1e 0x95 0x03;
5513     chip_erase_delay = 9000;
5514     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5515                        "x x x x  x x x x    x x x x  x x x x";
5516
5517     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5518                        "x x x x  x x x x    x x x x  x x x x";
5519     timeout             = 200;
5520     stabdelay           = 100;
5521     cmdexedelay         = 25;
5522     synchloops          = 32;
5523     bytedelay           = 0;
5524     pollindex           = 3;
5525     pollvalue           = 0x53;
5526     predelay            = 1;
5527     postdelay           = 1;
5528     pollmethod          = 1;
5529
5530     pp_controlstack     =
5531         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5532         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5533         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5534         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5535     hventerstabdelay    = 100;
5536     progmodedelay       = 0;
5537     latchcycles         = 5;
5538     togglevtg           = 1;
5539     poweroffdelay       = 15;
5540     resetdelayms        = 1;
5541     resetdelayus        = 0;
5542     hvleavestabdelay    = 15;
5543     chiperasepulsewidth = 0;
5544     chiperasepolltimeout = 10;
5545     programfusepulsewidth = 0;
5546     programfusepolltimeout = 5;
5547     programlockpulsewidth = 0;
5548     programlockpolltimeout = 5;
5549
5550     idr                 = 0x31;
5551     spmcr               = 0x57;
5552
5553    memory "eeprom"
5554         paged           = no; /* leave this "no" */
5555         page_size       = 4;  /* for parallel programming */
5556         size            = 1024;
5557         min_write_delay = 9000;
5558         max_write_delay = 9000;
5559         readback_p1     = 0xff;
5560         readback_p2     = 0xff;
5561         read            = "  1   0   1   0      0   0   0   0",
5562                           "  x   x   x   x      x   x  a9  a8",
5563                           " a7  a6  a5  a4     a3  a2  a1  a0",
5564                           "  o   o   o   o      o   o   o   o";
5565
5566         write           = "  1   1   0   0      0   0   0   0",
5567                           "  x   x   x   x      x   x  a9  a8",
5568                           " a7  a6  a5  a4     a3  a2  a1  a0",
5569                           "  i   i   i   i      i   i   i   i";
5570
5571         loadpage_lo     = "  1   1   0   0      0   0   0   1",
5572                           "  0   0   0   0      0   0   0   0",
5573                           "  0   0   0   0      0   0  a1  a0",
5574                           "  i   i   i   i      i   i   i   i";
5575
5576         writepage       = "  1   1   0   0      0   0   1   0",
5577                           "  0   0   x   x      x   x  a9  a8",
5578                           " a7  a6  a5  a4     a3  a2   0   0",
5579                           "  x   x   x   x      x   x   x   x";
5580
5581         mode            = 0x41;
5582         delay           = 20;
5583         blocksize       = 8;
5584         readsize        = 256;
5585       ;
5586
5587     memory "flash"
5588         paged           = yes;
5589         size            = 32768;
5590         page_size       = 128;
5591         num_pages       = 256;
5592         min_write_delay = 4500;
5593         max_write_delay = 4500;
5594         readback_p1     = 0xff;
5595         readback_p2     = 0xff;
5596         read_lo         = "  0   0   1   0      0   0   0   0",
5597                           "  x a14 a13 a12    a11 a10  a9  a8",
5598                           " a7  a6  a5  a4     a3  a2  a1  a0",
5599                           "  o   o   o   o      o   o   o   o";
5600
5601         read_hi         = "  0   0   1   0      1   0   0   0",
5602                           "  x a14 a13 a12    a11 a10  a9  a8",
5603                           " a7  a6  a5  a4     a3  a2  a1  a0",
5604                           "  o   o   o   o      o   o   o   o";
5605
5606         loadpage_lo     = "  0   1   0   0      0   0   0   0",
5607                           "  x   x   x   x      x   x   x   x",
5608                           "  x   x  a5  a4     a3  a2  a1  a0",
5609                           "  i   i   i   i      i   i   i   i";
5610
5611         loadpage_hi     = "  0   1   0   0      1   0   0   0",
5612                           "  x   x   x   x      x   x   x   x",
5613                           "  x   x  a5  a4     a3  a2  a1  a0",
5614                           "  i   i   i   i      i   i   i   i";
5615
5616         writepage       = "  0   1   0   0      1   1   0   0",
5617                           "  x   x   x a12    a11 a10  a9  a8",
5618                           " a7  a6   x   x      x   x   x   x",
5619                           "  x   x   x   x      x   x   x   x";
5620
5621         mode            = 0x41;
5622         delay           = 6;
5623         blocksize       = 256;
5624         readsize        = 256;
5625       ;
5626
5627     memory "lfuse"
5628         size            = 1;
5629         min_write_delay = 4500;
5630         max_write_delay = 4500;
5631         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5632                           "x x x x  x x x x   o o o o  o o o o";
5633
5634         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5635                           "x x x x  x x x x   i i i i  i i i i";
5636       ;
5637
5638     memory "hfuse"
5639         size            = 1;
5640         min_write_delay = 4500;
5641         max_write_delay = 4500;
5642         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5643                           "x x x x  x x x x   o o o o  o o o o";
5644
5645         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5646                           "x x x x  x x x x   i i i i  i i i i";
5647       ;
5648
5649     memory "efuse"
5650         size            = 1;
5651         min_write_delay = 4500;
5652         max_write_delay = 4500;
5653         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
5654                           "x x x x  x x x x   o o o o  o o o o";
5655
5656         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
5657                           "x x x x  x x x x   x x x x  x i i i";
5658       ;
5659
5660     memory "lock"
5661         size            = 1;
5662         min_write_delay = 4500;
5663         max_write_delay = 4500;
5664         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5665                           "x x x x  x x x x   x x o o  o o o o";
5666
5667         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5668                           "x x x x  x x x x   1 1 i i  i i i i";
5669       ;
5670
5671     memory "signature"
5672         size            = 3;
5673         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
5674                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5675       ;
5676
5677     memory "calibration"
5678         size            = 1;
5679         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
5680                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
5681       ;
5682   ;
5683
5684 #------------------------------------------------------------
5685 # ATmega329P
5686 #------------------------------------------------------------
5687 # Identical to ATmega329 except of the signature
5688
5689 part
5690     id               = "m329p";
5691     desc             = "ATMEGA329P";
5692     has_jtag         = yes;
5693 #    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
5694 #    avr910_devcode   = 0x?;  # try the ATmega169 one:
5695     avr910_devcode   = 0x75;
5696     signature        = 0x1e 0x95 0x0b;
5697     chip_erase_delay = 9000;
5698     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5699                        "x x x x  x x x x    x x x x  x x x x";
5700
5701     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5702                        "x x x x  x x x x    x x x x  x x x x";
5703     timeout             = 200;
5704     stabdelay           = 100;
5705     cmdexedelay         = 25;
5706     synchloops          = 32;
5707     bytedelay           = 0;
5708     pollindex           = 3;
5709     pollvalue           = 0x53;
5710     predelay            = 1;
5711     postdelay           = 1;
5712     pollmethod          = 1;
5713
5714     pp_controlstack     =
5715         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5716         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5717         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5718         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5719     hventerstabdelay    = 100;
5720     progmodedelay       = 0;
5721     latchcycles         = 5;
5722     togglevtg           = 1;
5723     poweroffdelay       = 15;
5724     resetdelayms        = 1;
5725     resetdelayus        = 0;
5726     hvleavestabdelay    = 15;
5727     chiperasepulsewidth = 0;
5728     chiperasepolltimeout = 10;
5729     programfusepulsewidth = 0;
5730     programfusepolltimeout = 5;
5731     programlockpulsewidth = 0;
5732     programlockpolltimeout = 5;
5733
5734     idr                 = 0x31;
5735     spmcr               = 0x57;
5736
5737    memory "eeprom"
5738         paged           = no; /* leave this "no" */
5739         page_size       = 4;  /* for parallel programming */
5740         size            = 1024;
5741         min_write_delay = 9000;
5742         max_write_delay = 9000;
5743         readback_p1     = 0xff;
5744         readback_p2     = 0xff;
5745         read            = "  1   0   1   0      0   0   0   0",
5746                           "  x   x   x   x      x   x  a9  a8",
5747                           " a7  a6  a5  a4     a3  a2  a1  a0",
5748                           "  o   o   o   o      o   o   o   o";
5749
5750         write           = "  1   1   0   0      0   0   0   0",
5751                           "  x   x   x   x      x   x  a9  a8",
5752                           " a7  a6  a5  a4     a3  a2  a1  a0",
5753                           "  i   i   i   i      i   i   i   i";
5754
5755         loadpage_lo     = "  1   1   0   0      0   0   0   1",
5756                           "  0   0   0   0      0   0   0   0",
5757                           "  0   0   0   0      0   0  a1  a0",
5758                           "  i   i   i   i      i   i   i   i";
5759
5760         writepage       = "  1   1   0   0      0   0   1   0",
5761                           "  0   0   x   x      x   x  a9  a8",
5762                           " a7  a6  a5  a4     a3  a2   0   0",
5763                           "  x   x   x   x      x   x   x   x";
5764
5765         mode            = 0x41;
5766         delay           = 20;
5767         blocksize       = 8;
5768         readsize        = 256;
5769       ;
5770
5771     memory "flash"
5772         paged           = yes;
5773         size            = 32768;
5774         page_size       = 128;
5775         num_pages       = 256;
5776         min_write_delay = 4500;
5777         max_write_delay = 4500;
5778         readback_p1     = 0xff;
5779         readback_p2     = 0xff;
5780         read_lo         = "  0   0   1   0      0   0   0   0",
5781                           "  x a14 a13 a12    a11 a10  a9  a8",
5782                           " a7  a6  a5  a4     a3  a2  a1  a0",
5783                           "  o   o   o   o      o   o   o   o";
5784
5785         read_hi         = "  0   0   1   0      1   0   0   0",
5786                           "  x a14 a13 a12    a11 a10  a9  a8",
5787                           " a7  a6  a5  a4     a3  a2  a1  a0",
5788                           "  o   o   o   o      o   o   o   o";
5789
5790         loadpage_lo     = "  0   1   0   0      0   0   0   0",
5791                           "  x   x   x   x      x   x   x   x",
5792                           "  x   x  a5  a4     a3  a2  a1  a0",
5793                           "  i   i   i   i      i   i   i   i";
5794
5795         loadpage_hi     = "  0   1   0   0      1   0   0   0",
5796                           "  x   x   x   x      x   x   x   x",
5797                           "  x   x  a5  a4     a3  a2  a1  a0",
5798                           "  i   i   i   i      i   i   i   i";
5799
5800         writepage       = "  0   1   0   0      1   1   0   0",
5801                           "  x   x   x a12    a11 a10  a9  a8",
5802                           " a7  a6   x   x      x   x   x   x",
5803                           "  x   x   x   x      x   x   x   x";
5804
5805         mode            = 0x41;
5806         delay           = 6;
5807         blocksize       = 256;
5808         readsize        = 256;
5809       ;
5810
5811     memory "lfuse"
5812         size            = 1;
5813         min_write_delay = 4500;
5814         max_write_delay = 4500;
5815         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
5816                           "x x x x  x x x x   o o o o  o o o o";
5817
5818         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
5819                           "x x x x  x x x x   i i i i  i i i i";
5820       ;
5821
5822     memory "hfuse"
5823         size            = 1;
5824         min_write_delay = 4500;
5825         max_write_delay = 4500;
5826         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
5827                           "x x x x  x x x x   o o o o  o o o o";
5828
5829         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
5830                           "x x x x  x x x x   i i i i  i i i i";
5831       ;
5832
5833     memory "efuse"
5834         size            = 1;
5835         min_write_delay = 4500;
5836         max_write_delay = 4500;
5837         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
5838                           "x x x x  x x x x   o o o o  o o o o";
5839
5840         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
5841                           "x x x x  x x x x   x x x x  x i i i";
5842       ;
5843
5844     memory "lock"
5845         size            = 1;
5846         min_write_delay = 4500;
5847         max_write_delay = 4500;
5848         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
5849                           "x x x x  x x x x   x x o o  o o o o";
5850
5851         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
5852                           "x x x x  x x x x   1 1 i i  i i i i";
5853       ;
5854
5855     memory "signature"
5856         size            = 3;
5857         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
5858                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
5859       ;
5860
5861     memory "calibration"
5862         size            = 1;
5863         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
5864                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
5865       ;
5866   ;
5867
5868 #------------------------------------------------------------
5869 # ATmega3290
5870 #------------------------------------------------------------
5871
5872 # identical to ATmega329
5873
5874 part
5875     id               = "m3290";
5876     desc             = "ATMEGA3290";
5877     has_jtag         = yes;
5878 #    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
5879 #    avr910_devcode   = 0x?;  # try the ATmega169 one:
5880     avr910_devcode   = 0x75;
5881     signature        = 0x1e 0x95 0x04;
5882     chip_erase_delay = 9000;
5883     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
5884                        "x x x x  x x x x    x x x x  x x x x";
5885
5886     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
5887                        "x x x x  x x x x    x x x x  x x x x";
5888     timeout             = 200;
5889     stabdelay           = 100;
5890     cmdexedelay         = 25;
5891     synchloops          = 32;
5892     bytedelay           = 0;
5893     pollindex           = 3;
5894     pollvalue           = 0x53;
5895     predelay            = 1;
5896     postdelay           = 1;
5897     pollmethod          = 1;
5898
5899     pp_controlstack     =
5900         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
5901         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
5902         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
5903         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
5904     hventerstabdelay    = 100;
5905     progmodedelay       = 0;
5906     latchcycles         = 5;
5907     togglevtg           = 1;
5908     poweroffdelay       = 15;
5909     resetdelayms        = 1;
5910     resetdelayus        = 0;
5911     hvleavestabdelay    = 15;
5912     chiperasepulsewidth = 0;
5913     chiperasepolltimeout = 10;
5914     programfusepulsewidth = 0;
5915     programfusepolltimeout = 5;
5916     programlockpulsewidth = 0;
5917     programlockpolltimeout = 5;
5918
5919     idr                 = 0x31;
5920     spmcr               = 0x57;
5921
5922    memory "eeprom"
5923         paged           = no; /* leave this "no" */
5924         page_size       = 4;  /* for parallel programming */
5925         size            = 1024;
5926         min_write_delay = 9000;
5927         max_write_delay = 9000;
5928         readback_p1     = 0xff;
5929         readback_p2     = 0xff;
5930         read            = "  1   0   1   0      0   0   0   0",
5931                           "  x   x   x   x      x   x  a9  a8",
5932                           " a7  a6  a5  a4     a3  a2  a1  a0",
5933                           "  o   o   o   o      o   o   o   o";
5934
5935         write           = "  1   1   0   0      0   0   0   0",
5936                           "  x   x   x   x      x   x  a9  a8",
5937                           " a7  a6  a5  a4     a3  a2  a1  a0",
5938                           "  i   i   i   i      i   i   i   i";
5939
5940         loadpage_lo     = "  1   1   0   0      0   0   0   1",
5941                           "  0   0   0   0      0   0   0   0",
5942                           "  0   0   0   0      0   0  a1  a0",
5943                           "  i   i   i   i      i   i   i   i";
5944
5945         writepage       = "  1   1   0   0      0   0   1   0",
5946                           "  0   0   x   x      x   x  a9  a8",
5947                           " a7  a6  a5  a4     a3  a3   0   0",
5948                           "  x   x   x   x      x   x   x   x";
5949
5950         mode            = 0x41;
5951         delay           = 20;
5952         blocksize       = 8;
5953         readsize        = 256;
5954       ;
5955
5956     memory "flash"
5957         paged           = yes;
5958         size            = 32768;
5959         page_size       = 128;
5960         num_pages       = 256;
5961         min_write_delay = 4500;
5962         max_write_delay = 4500;
5963         readback_p1     = 0xff;
5964         readback_p2     = 0xff;
5965         read_lo         = "  0   0   1   0      0   0   0   0",
5966                           "  x a14 a13 a12    a11 a10  a9  a8",
5967                           " a7  a6  a5  a4     a3  a2  a1  a0",
5968                           "  o   o   o   o      o   o   o   o";
5969
5970         read_hi         = "  0   0   1   0      1   0   0   0",
5971                           "  x a14 a13 a12    a11 a10  a9  a8",
5972                           " a7  a6  a5  a4     a3  a2  a1  a0",
5973                           "  o   o   o   o      o   o   o   o";
5974
5975         loadpage_lo     = "  0   1   0   0      0   0   0   0",
5976                           "  x   x   x   x      x   x   x   x",
5977                           "  x   x  a5  a4     a3  a2  a1  a0",
5978                           "  i   i   i   i      i   i   i   i";
5979
5980         loadpage_hi     = "  0   1   0   0      1   0   0   0",
5981                           "  x   x   x   x      x   x   x   x",
5982                           "  x   x  a5  a4     a3  a2  a1  a0",
5983                           "  i   i   i   i      i   i   i   i";
5984
5985         writepage       = "  0   1   0   0      1   1   0   0",
5986                           "  x   x   x a12    a11 a10  a9  a8",
5987                           " a7  a6   x   x      x   x   x   x",
5988                           "  x   x   x   x      x   x   x   x";
5989
5990         mode            = 0x41;
5991         delay           = 6;
5992         blocksize       = 256;
5993         readsize        = 256;
5994       ;
5995
5996     memory "lfuse"
5997         size            = 1;
5998         min_write_delay = 4500;
5999         max_write_delay = 4500;
6000         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6001                           "x x x x  x x x x   o o o o  o o o o";
6002
6003         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6004                           "x x x x  x x x x   i i i i  i i i i";
6005       ;
6006
6007     memory "hfuse"
6008         size            = 1;
6009         min_write_delay = 4500;
6010         max_write_delay = 4500;
6011         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6012                           "x x x x  x x x x   o o o o  o o o o";
6013
6014         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6015                           "x x x x  x x x x   i i i i  i i i i";
6016       ;
6017
6018     memory "efuse"
6019         size            = 1;
6020         min_write_delay = 4500;
6021         max_write_delay = 4500;
6022         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
6023                           "x x x x  x x x x   o o o o  o o o o";
6024
6025         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
6026                           "x x x x  x x x x   x x x x  x i i i";
6027       ;
6028
6029     memory "lock"
6030         size            = 1;
6031         min_write_delay = 4500;
6032         max_write_delay = 4500;
6033         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6034                           "x x x x  x x x x   x x o o  o o o o";
6035
6036         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6037                           "x x x x  x x x x   1 1 i i  i i i i";
6038       ;
6039
6040     memory "signature"
6041         size            = 3;
6042         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
6043                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6044       ;
6045
6046     memory "calibration"
6047         size            = 1;
6048         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
6049                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
6050       ;
6051   ;
6052
6053 #------------------------------------------------------------
6054 # ATmega3290P
6055 #------------------------------------------------------------
6056
6057 # identical to ATmega3290 except of the signature
6058
6059 part
6060     id               = "m3290p";
6061     desc             = "ATMEGA3290P";
6062     has_jtag         = yes;
6063 #    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
6064 #    avr910_devcode   = 0x?;  # try the ATmega169 one:
6065     avr910_devcode   = 0x75;
6066     signature        = 0x1e 0x95 0x0c;
6067     chip_erase_delay = 9000;
6068     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6069                        "x x x x  x x x x    x x x x  x x x x";
6070
6071     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
6072                        "x x x x  x x x x    x x x x  x x x x";
6073     timeout             = 200;
6074     stabdelay           = 100;
6075     cmdexedelay         = 25;
6076     synchloops          = 32;
6077     bytedelay           = 0;
6078     pollindex           = 3;
6079     pollvalue           = 0x53;
6080     predelay            = 1;
6081     postdelay           = 1;
6082     pollmethod          = 1;
6083
6084     pp_controlstack     =
6085         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6086         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6087         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6088         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6089     hventerstabdelay    = 100;
6090     progmodedelay       = 0;
6091     latchcycles         = 5;
6092     togglevtg           = 1;
6093     poweroffdelay       = 15;
6094     resetdelayms        = 1;
6095     resetdelayus        = 0;
6096     hvleavestabdelay    = 15;
6097     chiperasepulsewidth = 0;
6098     chiperasepolltimeout = 10;
6099     programfusepulsewidth = 0;
6100     programfusepolltimeout = 5;
6101     programlockpulsewidth = 0;
6102     programlockpolltimeout = 5;
6103
6104     idr                 = 0x31;
6105     spmcr               = 0x57;
6106
6107    memory "eeprom"
6108         paged           = no; /* leave this "no" */
6109         page_size       = 4;  /* for parallel programming */
6110         size            = 1024;
6111         min_write_delay = 9000;
6112         max_write_delay = 9000;
6113         readback_p1     = 0xff;
6114         readback_p2     = 0xff;
6115         read            = "  1   0   1   0      0   0   0   0",
6116                           "  x   x   x   x      x   x  a9  a8",
6117                           " a7  a6  a5  a4     a3  a2  a1  a0",
6118                           "  o   o   o   o      o   o   o   o";
6119
6120         write           = "  1   1   0   0      0   0   0   0",
6121                           "  x   x   x   x      x   x  a9  a8",
6122                           " a7  a6  a5  a4     a3  a2  a1  a0",
6123                           "  i   i   i   i      i   i   i   i";
6124
6125         loadpage_lo     = "  1   1   0   0      0   0   0   1",
6126                           "  0   0   0   0      0   0   0   0",
6127                           "  0   0   0   0      0   0  a1  a0",
6128                           "  i   i   i   i      i   i   i   i";
6129
6130         writepage       = "  1   1   0   0      0   0   1   0",
6131                           "  0   0   x   x      x   x  a9  a8",
6132                           " a7  a6  a5  a4     a3  a3   0   0",
6133                           "  x   x   x   x      x   x   x   x";
6134
6135         mode            = 0x41;
6136         delay           = 20;
6137         blocksize       = 8;
6138         readsize        = 256;
6139       ;
6140
6141     memory "flash"
6142         paged           = yes;
6143         size            = 32768;
6144         page_size       = 128;
6145         num_pages       = 256;
6146         min_write_delay = 4500;
6147         max_write_delay = 4500;
6148         readback_p1     = 0xff;
6149         readback_p2     = 0xff;
6150         read_lo         = "  0   0   1   0      0   0   0   0",
6151                           "  x a14 a13 a12    a11 a10  a9  a8",
6152                           " a7  a6  a5  a4     a3  a2  a1  a0",
6153                           "  o   o   o   o      o   o   o   o";
6154
6155         read_hi         = "  0   0   1   0      1   0   0   0",
6156                           "  x a14 a13 a12    a11 a10  a9  a8",
6157                           " a7  a6  a5  a4     a3  a2  a1  a0",
6158                           "  o   o   o   o      o   o   o   o";
6159
6160         loadpage_lo     = "  0   1   0   0      0   0   0   0",
6161                           "  x   x   x   x      x   x   x   x",
6162                           "  x   x  a5  a4     a3  a2  a1  a0",
6163                           "  i   i   i   i      i   i   i   i";
6164
6165         loadpage_hi     = "  0   1   0   0      1   0   0   0",
6166                           "  x   x   x   x      x   x   x   x",
6167                           "  x   x  a5  a4     a3  a2  a1  a0",
6168                           "  i   i   i   i      i   i   i   i";
6169
6170         writepage       = "  0   1   0   0      1   1   0   0",
6171                           "  x   x   x a12    a11 a10  a9  a8",
6172                           " a7  a6   x   x      x   x   x   x",
6173                           "  x   x   x   x      x   x   x   x";
6174
6175         mode            = 0x41;
6176         delay           = 6;
6177         blocksize       = 256;
6178         readsize        = 256;
6179       ;
6180
6181     memory "lfuse"
6182         size            = 1;
6183         min_write_delay = 4500;
6184         max_write_delay = 4500;
6185         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6186                           "x x x x  x x x x   o o o o  o o o o";
6187
6188         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6189                           "x x x x  x x x x   i i i i  i i i i";
6190       ;
6191
6192     memory "hfuse"
6193         size            = 1;
6194         min_write_delay = 4500;
6195         max_write_delay = 4500;
6196         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6197                           "x x x x  x x x x   o o o o  o o o o";
6198
6199         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6200                           "x x x x  x x x x   i i i i  i i i i";
6201       ;
6202
6203     memory "efuse"
6204         size            = 1;
6205         min_write_delay = 4500;
6206         max_write_delay = 4500;
6207         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
6208                           "x x x x  x x x x   o o o o  o o o o";
6209
6210         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
6211                           "x x x x  x x x x   x x x x  x i i i";
6212       ;
6213
6214     memory "lock"
6215         size            = 1;
6216         min_write_delay = 4500;
6217         max_write_delay = 4500;
6218         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6219                           "x x x x  x x x x   x x o o  o o o o";
6220
6221         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6222                           "x x x x  x x x x   1 1 i i  i i i i";
6223       ;
6224
6225     memory "signature"
6226         size            = 3;
6227         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
6228                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6229       ;
6230
6231     memory "calibration"
6232         size            = 1;
6233         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
6234                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
6235       ;
6236   ;
6237
6238 #------------------------------------------------------------
6239 # ATmega649
6240 #------------------------------------------------------------
6241
6242 part
6243     id               = "m649";
6244     desc             = "ATMEGA649";
6245     has_jtag         = yes;
6246 #    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
6247 #    avr910_devcode   = 0x?;  # try the ATmega169 one:
6248     avr910_devcode   = 0x75;
6249     signature        = 0x1e 0x96 0x03;
6250     chip_erase_delay = 9000;
6251     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6252                        "x x x x  x x x x    x x x x  x x x x";
6253
6254     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
6255                        "x x x x  x x x x    x x x x  x x x x";
6256     timeout             = 200;
6257     stabdelay           = 100;
6258     cmdexedelay         = 25;
6259     synchloops          = 32;
6260     bytedelay           = 0;
6261     pollindex           = 3;
6262     pollvalue           = 0x53;
6263     predelay            = 1;
6264     postdelay           = 1;
6265     pollmethod          = 1;
6266
6267     pp_controlstack     =
6268         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6269         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6270         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6271         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6272     hventerstabdelay    = 100;
6273     progmodedelay       = 0;
6274     latchcycles         = 5;
6275     togglevtg           = 1;
6276     poweroffdelay       = 15;
6277     resetdelayms        = 1;
6278     resetdelayus        = 0;
6279     hvleavestabdelay    = 15;
6280     chiperasepulsewidth = 0;
6281     chiperasepolltimeout = 10;
6282     programfusepulsewidth = 0;
6283     programfusepolltimeout = 5;
6284     programlockpulsewidth = 0;
6285     programlockpolltimeout = 5;
6286
6287     idr                 = 0x31;
6288     spmcr               = 0x57;
6289
6290    memory "eeprom"
6291         paged           = no; /* leave this "no" */
6292         page_size       = 8;  /* for parallel programming */
6293         size            = 2048;
6294         min_write_delay = 9000;
6295         max_write_delay = 9000;
6296         readback_p1     = 0xff;
6297         readback_p2     = 0xff;
6298         read            = "  1   0   1   0      0   0   0   0",
6299                           "  x   x   x   x      x a10  a9  a8",
6300                           " a7  a6  a5  a4     a3  a2  a1  a0",
6301                           "  o   o   o   o      o   o   o   o";
6302
6303         write           = "  1   1   0   0      0   0   0   0",
6304                           "  x   x   x   x      x a10  a9  a8",
6305                           " a7  a6  a5  a4     a3  a2  a1  a0",
6306                           "  i   i   i   i      i   i   i   i";
6307
6308         loadpage_lo     = "  1   1   0   0      0   0   0   1",
6309                           "  0   0   0   0      0   0   0   0",
6310                           "  0   0   0   0      0  a2  a1  a0",
6311                           "  i   i   i   i      i   i   i   i";
6312
6313         writepage       = "  1   1   0   0      0   0   1   0",
6314                           "  0   0   x   x      x a10  a9  a8",
6315                           " a7  a6  a5  a4     a3   0   0   0",
6316                           "  x   x   x   x      x   x   x   x";
6317
6318         mode            = 0x41;
6319         delay           = 20;
6320         blocksize       = 8;
6321         readsize        = 256;
6322       ;
6323
6324     memory "flash"
6325         paged           = yes;
6326         size            = 65536;
6327         page_size       = 256;
6328         num_pages       = 256;
6329         min_write_delay = 4500;
6330         max_write_delay = 4500;
6331         readback_p1     = 0xff;
6332         readback_p2     = 0xff;
6333         read_lo         = "  0   0   1   0      0   0   0   0",
6334                           "a15 a14 a13 a12    a11 a10  a9  a8",
6335                           " a7  a6  a5  a4     a3  a2  a1  a0",
6336                           "  o   o   o   o      o   o   o   o";
6337
6338         read_hi         = "  0   0   1   0      1   0   0   0",
6339                           "a15 a14 a13 a12    a11 a10  a9  a8",
6340                           " a7  a6  a5  a4     a3  a2  a1  a0",
6341                           "  o   o   o   o      o   o   o   o";
6342
6343         loadpage_lo     = "  0   1   0   0      0   0   0   0",
6344                           "  x   x   x   x      x   x   x   x",
6345                           "  x  a6  a5  a4     a3  a2  a1  a0",
6346                           "  i   i   i   i      i   i   i   i";
6347
6348         loadpage_hi     = "  0   1   0   0      1   0   0   0",
6349                           "  x   x   x   x      x   x   x   x",
6350                           "  x  a6  a5  a4     a3  a2  a1  a0",
6351                           "  i   i   i   i      i   i   i   i";
6352
6353         writepage       = "  0   1   0   0      1   1   0   0",
6354                           "  x   x   x a12    a11 a10  a9  a8",
6355                           " a7   x   x   x      x   x   x   x",
6356                           "  x   x   x   x      x   x   x   x";
6357
6358         mode            = 0x41;
6359         delay           = 6;
6360         blocksize       = 256;
6361         readsize        = 256;
6362       ;
6363
6364     memory "lfuse"
6365         size            = 1;
6366         min_write_delay = 4500;
6367         max_write_delay = 4500;
6368         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6369                           "x x x x  x x x x   o o o o  o o o o";
6370
6371         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6372                           "x x x x  x x x x   i i i i  i i i i";
6373       ;
6374
6375     memory "hfuse"
6376         size            = 1;
6377         min_write_delay = 4500;
6378         max_write_delay = 4500;
6379         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6380                           "x x x x  x x x x   o o o o  o o o o";
6381
6382         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6383                           "x x x x  x x x x   i i i i  i i i i";
6384       ;
6385
6386     memory "efuse"
6387         size            = 1;
6388         min_write_delay = 4500;
6389         max_write_delay = 4500;
6390         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
6391                           "x x x x  x x x x   o o o o  o o o o";
6392
6393         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
6394                           "x x x x  x x x x   x x x x  x i i i";
6395       ;
6396
6397     memory "lock"
6398         size            = 1;
6399         min_write_delay = 4500;
6400         max_write_delay = 4500;
6401         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6402                           "x x x x  x x x x   x x o o  o o o o";
6403
6404         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6405                           "x x x x  x x x x   1 1 i i  i i i i";
6406       ;
6407
6408     memory "signature"
6409         size            = 3;
6410         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
6411                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6412       ;
6413
6414     memory "calibration"
6415         size            = 1;
6416         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
6417                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
6418       ;
6419   ;
6420
6421 #------------------------------------------------------------
6422 # ATmega6490
6423 #------------------------------------------------------------
6424
6425 # identical to ATmega649
6426
6427 part
6428     id               = "m6490";
6429     desc             = "ATMEGA6490";
6430     has_jtag         = yes;
6431 #    stk500_devcode   = 0x85; # no STK500 support, only STK500v2
6432 #    avr910_devcode   = 0x?;  # try the ATmega169 one:
6433     avr910_devcode   = 0x75;
6434     signature        = 0x1e 0x96 0x04;
6435     chip_erase_delay = 9000;
6436     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6437                        "x x x x  x x x x    x x x x  x x x x";
6438
6439     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
6440                        "x x x x  x x x x    x x x x  x x x x";
6441     timeout             = 200;
6442     stabdelay           = 100;
6443     cmdexedelay         = 25;
6444     synchloops          = 32;
6445     bytedelay           = 0;
6446     pollindex           = 3;
6447     pollvalue           = 0x53;
6448     predelay            = 1;
6449     postdelay           = 1;
6450     pollmethod          = 1;
6451
6452     pp_controlstack     =
6453         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6454         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6455         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6456         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6457     hventerstabdelay    = 100;
6458     progmodedelay       = 0;
6459     latchcycles         = 5;
6460     togglevtg           = 1;
6461     poweroffdelay       = 15;
6462     resetdelayms        = 1;
6463     resetdelayus        = 0;
6464     hvleavestabdelay    = 15;
6465     chiperasepulsewidth = 0;
6466     chiperasepolltimeout = 10;
6467     programfusepulsewidth = 0;
6468     programfusepolltimeout = 5;
6469     programlockpulsewidth = 0;
6470     programlockpolltimeout = 5;
6471
6472     idr                 = 0x31;
6473     spmcr               = 0x57;
6474
6475    memory "eeprom"
6476         paged           = no; /* leave this "no" */
6477         page_size       = 8;  /* for parallel programming */
6478         size            = 2048;
6479         min_write_delay = 9000;
6480         max_write_delay = 9000;
6481         readback_p1     = 0xff;
6482         readback_p2     = 0xff;
6483         read            = "  1   0   1   0      0   0   0   0",
6484                           "  x   x   x   x      x a10  a9  a8",
6485                           " a7  a6  a5  a4     a3  a2  a1  a0",
6486                           "  o   o   o   o      o   o   o   o";
6487
6488         write           = "  1   1   0   0      0   0   0   0",
6489                           "  x   x   x   x      x a10  a9  a8",
6490                           " a7  a6  a5  a4     a3  a2  a1  a0",
6491                           "  i   i   i   i      i   i   i   i";
6492
6493         loadpage_lo     = "  1   1   0   0      0   0   0   1",
6494                           "  0   0   0   0      0   0   0   0",
6495                           "  0   0   0   0      0  a2  a1  a0",
6496                           "  i   i   i   i      i   i   i   i";
6497
6498         writepage       = "  1   1   0   0      0   0   1   0",
6499                           "  0   0   x   x      x   x   x  a8",
6500                           " a7  a6  a5  a4     a3   0   0   0",
6501                           "  x   x   x   x      x   x   x   x";
6502
6503         loadpage_lo     = "  1   1   0   0      0   0   0   1",
6504                           "  0   0   0   0      0   0   0   0",
6505                           "  0   0   0   0      0  a2  a1  a0",
6506                           "  i   i   i   i      i   i   i   i";
6507
6508         writepage       = "  1   1   0   0      0   0   1   0",
6509                           "  0   0   x   x      x a10  a9  a8",
6510                           " a7  a6  a5  a4     a3   0   0   0",
6511                           "  x   x   x   x      x   x   x   x";
6512
6513         mode            = 0x41;
6514         delay           = 20;
6515         blocksize       = 8;
6516         readsize        = 256;
6517       ;
6518
6519     memory "flash"
6520         paged           = yes;
6521         size            = 65536;
6522         page_size       = 256;
6523         num_pages       = 256;
6524         min_write_delay = 4500;
6525         max_write_delay = 4500;
6526         readback_p1     = 0xff;
6527         readback_p2     = 0xff;
6528         read_lo         = "  0   0   1   0      0   0   0   0",
6529                           "a15 a14 a13 a12    a11 a10  a9  a8",
6530                           " a7  a6  a5  a4     a3  a2  a1  a0",
6531                           "  o   o   o   o      o   o   o   o";
6532
6533         read_hi         = "  0   0   1   0      1   0   0   0",
6534                           "a15 a14 a13 a12    a11 a10  a9  a8",
6535                           " a7  a6  a5  a4     a3  a2  a1  a0",
6536                           "  o   o   o   o      o   o   o   o";
6537
6538         loadpage_lo     = "  0   1   0   0      0   0   0   0",
6539                           "  x   x   x   x      x   x   x   x",
6540                           "  x  a6  a5  a4     a3  a2  a1  a0",
6541                           "  i   i   i   i      i   i   i   i";
6542
6543         loadpage_hi     = "  0   1   0   0      1   0   0   0",
6544                           "  x   x   x   x      x   x   x   x",
6545                           "  x  a6  a5  a4     a3  a2  a1  a0",
6546                           "  i   i   i   i      i   i   i   i";
6547
6548         writepage       = "  0   1   0   0      1   1   0   0",
6549                           "  x   x   x a12    a11 a10  a9  a8",
6550                           " a7   x   x   x      x   x   x   x",
6551                           "  x   x   x   x      x   x   x   x";
6552
6553         mode            = 0x41;
6554         delay           = 6;
6555         blocksize       = 256;
6556         readsize        = 256;
6557       ;
6558
6559     memory "lfuse"
6560         size            = 1;
6561         min_write_delay = 4500;
6562         max_write_delay = 4500;
6563         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6564                           "x x x x  x x x x   o o o o  o o o o";
6565
6566         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6567                           "x x x x  x x x x   i i i i  i i i i";
6568       ;
6569
6570     memory "hfuse"
6571         size            = 1;
6572         min_write_delay = 4500;
6573         max_write_delay = 4500;
6574         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6575                           "x x x x  x x x x   o o o o  o o o o";
6576
6577         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6578                           "x x x x  x x x x   i i i i  i i i i";
6579       ;
6580
6581     memory "efuse"
6582         size            = 1;
6583         min_write_delay = 4500;
6584         max_write_delay = 4500;
6585         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
6586                           "x x x x  x x x x   o o o o  o o o o";
6587
6588         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
6589                           "x x x x  x x x x   x x x x  x i i i";
6590       ;
6591
6592     memory "lock"
6593         size            = 1;
6594         min_write_delay = 4500;
6595         max_write_delay = 4500;
6596         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6597                           "x x x x  x x x x   x x o o  o o o o";
6598
6599         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6600                           "x x x x  x x x x   1 1 i i  i i i i";
6601       ;
6602
6603     memory "signature"
6604         size            = 3;
6605         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
6606                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6607       ;
6608
6609     memory "calibration"
6610         size            = 1;
6611         read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
6612                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
6613       ;
6614   ;
6615
6616 #------------------------------------------------------------
6617 # ATmega32
6618 #------------------------------------------------------------
6619
6620 part
6621     id               = "m32";
6622     desc             = "ATMEGA32";
6623     has_jtag         = yes;
6624     stk500_devcode   = 0x91;
6625     avr910_devcode   = 0x72;
6626     signature        = 0x1e 0x95 0x02;
6627     chip_erase_delay = 9000;
6628     pagel            = 0xd7;
6629     bs2              = 0xa0;
6630     reset            = dedicated;
6631     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6632                        "x x x x  x x x x    x x x x  x x x x";
6633
6634     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
6635                        "x x x x  x x x x    x x x x  x x x x";
6636     timeout             = 200;
6637     stabdelay           = 100;
6638     cmdexedelay         = 25;
6639     synchloops          = 32;
6640     bytedelay           = 0;
6641     pollindex           = 3;
6642     pollvalue           = 0x53;
6643     predelay            = 1;
6644     postdelay           = 1;
6645     pollmethod          = 0;
6646
6647     pp_controlstack     =
6648         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6649         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6650         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6651         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6652     hventerstabdelay    = 100;
6653     progmodedelay       = 0;
6654     latchcycles         = 6;
6655     togglevtg           = 0;
6656     poweroffdelay       = 0;
6657     resetdelayms        = 0;
6658     resetdelayus        = 0;
6659     hvleavestabdelay    = 15;
6660     chiperasepulsewidth = 0;
6661     chiperasepolltimeout = 10;
6662     programfusepulsewidth = 0;
6663     programfusepolltimeout = 5;
6664     programlockpulsewidth = 0;
6665     programlockpolltimeout = 5;
6666
6667     idr                 = 0x31;
6668     spmcr               = 0x57;
6669     allowfullpagebitstream = yes;
6670
6671    memory "eeprom"
6672         paged           = no;   /* leave this "no" */
6673         page_size       = 4;    /* for parallel programming */
6674         size            = 1024;
6675         min_write_delay = 9000;
6676         max_write_delay = 9000;
6677         readback_p1     = 0xff;
6678         readback_p2     = 0xff;
6679         read            = "  1   0   1   0      0   0   0   0",
6680                           "  0   0   x   x      x   x  a9  a8",
6681                           " a7  a6  a5  a4     a3  a2  a1  a0",
6682                           "  o   o   o   o      o   o   o   o";
6683
6684         write           = "  1   1   0   0      0   0   0   0",
6685                           "  0   0   x   x      x   x  a9  a8",
6686                           " a7  a6  a5  a4     a3  a2  a1  a0",
6687                           "  i   i   i   i      i   i   i   i";
6688
6689         loadpage_lo     = "  1   1   0   0      0   0   0   1",
6690                           "  0   0   0   0      0   0   0   0",
6691                           "  0   0   0   0      0   0  a1  a0",
6692                           "  i   i   i   i      i   i   i   i";
6693
6694         writepage       = "  1   1   0   0      0   0   1   0",
6695                           "  0   0   x   x      x   x  a9  a8",
6696                           " a7  a6  a5  a4     a3  a2   0   0",
6697                           "  x   x   x   x      x   x   x   x";
6698
6699         mode            = 0x04;
6700         delay           = 10;
6701         blocksize       = 64;
6702         readsize        = 256;
6703       ;
6704
6705     memory "flash"
6706         paged           = yes;
6707         size            = 32768;
6708         page_size       = 128;
6709         num_pages       = 256;
6710         min_write_delay = 4500;
6711         max_write_delay = 4500;
6712         readback_p1     = 0xff;
6713         readback_p2     = 0xff;
6714         read_lo         = "  0   0   1   0      0   0   0   0",
6715                           "  0   0 a13 a12    a11 a10  a9  a8",
6716                           " a7  a6  a5  a4     a3  a2  a1  a0",
6717                           "  o   o   o   o      o   o   o   o";
6718
6719         read_hi         = "  0   0   1   0      1   0   0   0",
6720                           "  0   0 a13 a12    a11 a10  a9  a8",
6721                           " a7  a6  a5  a4     a3  a2  a1  a0",
6722                           "  o   o   o   o      o   o   o   o";
6723
6724         loadpage_lo     = "  0   1   0   0      0   0   0   0",
6725                           "  0   0   x   x      x   x   x   x",
6726                           "  x   x  a5  a4     a3  a2  a1  a0",
6727                           "  i   i   i   i      i   i   i   i";
6728
6729         loadpage_hi     = "  0   1   0   0      1   0   0   0",
6730                           "  0   0   x   x      x   x   x   x",
6731                           "  x   x  a5  a4     a3  a2  a1  a0",
6732                           "  i   i   i   i      i   i   i   i";
6733
6734         writepage       = "  0   1   0   0      1   1   0   0",
6735                           "  0   0 a13 a12    a11 a10  a9  a8",
6736                           " a7  a6   x   x      x   x   x   x",
6737                           "  x   x   x   x      x   x   x   x";
6738
6739         mode            = 0x21;
6740         delay           = 6;
6741         blocksize       = 64;
6742         readsize        = 256;
6743       ;
6744
6745     memory "lfuse"
6746         size            = 1;
6747         min_write_delay = 2000;
6748         max_write_delay = 2000;
6749         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
6750                           "x x x x  x x x x   o o o o  o o o o";
6751
6752         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
6753                           "x x x x  x x x x   i i i i  i i i i";
6754       ;
6755
6756     memory "hfuse"
6757         size            = 1;
6758         min_write_delay = 2000;
6759         max_write_delay = 2000;
6760         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
6761                           "x x x x  x x x x   o o o o  o o o o";
6762
6763         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
6764                           "x x x x  x x x x   i i i i  i i i i";
6765       ;
6766
6767     memory "lock"
6768         size            = 1;
6769         min_write_delay = 2000;
6770         max_write_delay = 2000;
6771         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6772                           "x x x x  x x x x   x x o o  o o o o";
6773
6774         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6775                           "x x x x  x x x x   1 1 i i  i i i i";
6776       ;
6777
6778     memory "signature"
6779         size            = 3;
6780         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x x",
6781                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o o";
6782       ;
6783
6784     memory "calibration"
6785         size            = 4;
6786         read            = "0 0 1 1  1 0 0 0    0 0 x x  x x x x",
6787                           "0 0 0 0  0 0 a1 a0  o o o o  o o o o";
6788       ;
6789   ;
6790
6791 #------------------------------------------------------------
6792 # ATmega161
6793 #------------------------------------------------------------
6794
6795 part
6796     id               = "m161";
6797     desc             = "ATMEGA161";
6798     stk500_devcode   = 0x80;
6799     avr910_devcode   = 0x60;
6800     signature        = 0x1e 0x94 0x01;
6801     chip_erase_delay = 28000;
6802     pagel            = 0xd7;
6803     bs2              = 0xa0;
6804     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6805                        "x x x x  x x x x    x x x x  x x x x";
6806
6807     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
6808                        "x x x x  x x x x    x x x x  x x x x";
6809     timeout             = 200;
6810     stabdelay           = 100;
6811     cmdexedelay         = 25;
6812     synchloops          = 32;
6813     bytedelay           = 0;
6814     pollindex           = 3;
6815     pollvalue           = 0x53;
6816     predelay            = 1;
6817     postdelay           = 1;
6818     pollmethod          = 0;
6819
6820     pp_controlstack     =
6821         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6822         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6823         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6824         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6825     hventerstabdelay    = 100;
6826     progmodedelay       = 0;
6827     latchcycles         = 0;
6828     togglevtg           = 0;
6829     poweroffdelay       = 0;
6830     resetdelayms        = 0;
6831     resetdelayus        = 0;
6832     hvleavestabdelay    = 15;
6833     chiperasepulsewidth = 0;
6834     chiperasepolltimeout = 30;
6835     programfusepulsewidth = 0;
6836     programfusepolltimeout = 2;
6837     programlockpulsewidth = 0;
6838     programlockpolltimeout = 2;
6839
6840    memory "eeprom"
6841         size            = 512;
6842         min_write_delay = 3400;
6843         max_write_delay = 3400;
6844         readback_p1     = 0xff;
6845         readback_p2     = 0xff;
6846         read            = "  1   0   1   0      0   0   0   0",
6847                           "  x   x   x   x      x   x   x  a8",
6848                           " a7  a6  a5  a4     a3  a2  a1  a0",
6849                           "  o   o   o   o      o   o   o   o";
6850
6851         write           = "  1   1   0   0      0   0   0   0",
6852                           "  x   x   x   x      x   x   x  a8",
6853                           " a7  a6  a5  a4     a3  a2  a1  a0",
6854                           "  i   i   i   i      i   i   i   i";
6855
6856         mode            = 0x04;
6857         delay           = 5;
6858         blocksize       = 128;
6859         readsize        = 256;
6860       ;
6861
6862     memory "flash"
6863         paged           = yes;
6864         size            = 16384;
6865         page_size       = 128;
6866         num_pages       = 128;
6867         min_write_delay = 14000;
6868         max_write_delay = 14000;
6869         readback_p1     = 0xff;
6870         readback_p2     = 0xff;
6871         read_lo         = "  0   0   1   0      0   0   0   0",
6872                           "  x   x   x a12    a11 a10  a9  a8",
6873                           " a7  a6  a5  a4     a3  a2  a1  a0",
6874                           "  o   o   o   o      o   o   o   o";
6875
6876         read_hi         = "  0   0   1   0      1   0   0   0",
6877                           "  x   x   x a12    a11 a10  a9  a8",
6878                           " a7  a6  a5  a4     a3  a2  a1  a0",
6879                           "  o   o   o   o      o   o   o   o";
6880
6881         loadpage_lo     = "  0   1   0   0      0   0   0   0",
6882                           "  x   x   x   x      x   x   x   x",
6883                           "  x   x  a5  a4     a3  a2  a1  a0",
6884                           "  i   i   i   i      i   i   i   i";
6885
6886         loadpage_hi     = "  0   1   0   0      1   0   0   0",
6887                           "  x   x   x   x      x   x   x   x",
6888                           "  x   x  a5  a4     a3  a2  a1  a0",
6889                           "  i   i   i   i      i   i   i   i";
6890
6891         writepage       = "  0   1   0   0      1   1   0   0",
6892                           "  x   x   x a12    a11 a10  a9  a8",
6893                           " a7  a6   x   x      x   x   x   x",
6894                           "  x   x   x   x      x   x   x   x";
6895
6896         mode            = 0x21;
6897         delay           = 16;
6898         blocksize       = 128;
6899         readsize        = 256;
6900       ;
6901
6902     memory "fuse"
6903         size            = 1;
6904         min_write_delay = 2000;
6905         max_write_delay = 2000;
6906         read            = "0 1 0 1  0 0 0 0   x x x x  x x x x",
6907                           "x x x x  x x x x   x o x o  o o o o";
6908
6909         write           = "1 0 1 0  1 1 0 0   1 0 1 x  x x x x",
6910                           "x x x x  x x x x   1 i 1 i  i i i i";
6911       ;
6912
6913     memory "lock"
6914         size            = 1;
6915         min_write_delay = 2000;
6916         max_write_delay = 2000;
6917         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
6918                           "x x x x  x x x x   x x o o  o o o o";
6919
6920         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
6921                           "x x x x  x x x x   1 1 i i  i i i i";
6922       ;
6923     memory "signature"
6924         size            = 3;
6925         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
6926                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
6927       ;
6928   ;
6929
6930
6931 #------------------------------------------------------------
6932 # ATmega8
6933 #------------------------------------------------------------
6934
6935 part
6936     id               = "m8";
6937     desc             = "ATMEGA8";
6938     stk500_devcode   = 0x70;
6939     avr910_devcode   = 0x76;
6940     signature        = 0x1e 0x93 0x07;
6941     pagel            = 0xd7;
6942     bs2              = 0xc2;
6943     chip_erase_delay = 10000;
6944     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
6945                        "x x x x  x x x x    x x x x  x x x x";
6946
6947     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
6948                        "x x x x  x x x x    x x x x  x x x x";
6949
6950     timeout             = 200;
6951     stabdelay           = 100;
6952     cmdexedelay         = 25;
6953     synchloops          = 32;
6954     bytedelay           = 0;
6955     pollindex           = 3;
6956     pollvalue           = 0x53;
6957     predelay            = 1;
6958     postdelay           = 1;
6959     pollmethod          = 0;
6960
6961     pp_controlstack     =
6962         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
6963         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
6964         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
6965         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
6966     hventerstabdelay    = 100;
6967     progmodedelay       = 0;
6968     latchcycles         = 5;
6969     togglevtg           = 1;
6970     poweroffdelay       = 15;
6971     resetdelayms        = 2;
6972     resetdelayus        = 0;
6973     hvleavestabdelay    = 15;
6974     resetdelay          = 15;
6975     chiperasepulsewidth = 0;
6976     chiperasepolltimeout = 10;
6977     programfusepulsewidth = 0;
6978     programfusepolltimeout = 5;
6979     programlockpulsewidth = 0;
6980     programlockpolltimeout = 5;
6981
6982     memory "eeprom"
6983         size            = 512;
6984         page_size       = 4;
6985         min_write_delay = 9000;
6986         max_write_delay = 9000;
6987         readback_p1     = 0xff;
6988         readback_p2     = 0xff;
6989         read            = "  1   0   1   0      0   0   0   0",
6990                           "  0   0   x   x      x   x   x  a8",
6991                           " a7  a6  a5  a4     a3  a2  a1  a0",
6992                           "  o   o   o   o      o   o   o   o";
6993
6994         write           = "  1   1   0   0      0   0   0   0",
6995                           "  0   0   x   x      x   x   x  a8",
6996                           " a7  a6  a5  a4     a3  a2  a1  a0", 
6997                           "  i   i   i   i      i   i   i   i";
6998
6999         mode            = 0x04;
7000         delay           = 20;
7001         blocksize       = 128;
7002         readsize        = 256;
7003       ;
7004     memory "flash"
7005         paged           = yes;
7006         size            = 8192;
7007         page_size       = 64;
7008         num_pages       = 128;
7009         min_write_delay = 4500;
7010         max_write_delay = 4500;
7011         readback_p1     = 0xff;
7012         readback_p2     = 0x00;
7013         read_lo         = "  0   0   1   0    0   0   0   0",
7014                           "  0   0   0   0  a11 a10  a9  a8",
7015                           " a7  a6  a5  a4   a3  a2  a1  a0",
7016                           "  o   o   o   o    o   o   o   o";
7017
7018         read_hi         = "  0   0   1   0    1   0   0   0",
7019                           "  0   0   0   0  a11 a10  a9  a8",
7020                           " a7  a6  a5  a4   a3  a2  a1  a0",
7021                           "  o   o   o   o    o   o   o   o";
7022
7023         loadpage_lo     = "  0   1   0   0      0   0   0   0",
7024                           "  0   0   0   0      x   x   x   x",
7025                           "  x   x   x  a4     a3  a2  a1  a0",
7026                           "  i   i   i   i      i   i   i   i";
7027
7028         loadpage_hi     = "  0   1   0   0      1   0   0   0",
7029                           "  0   0   0   0      x   x   x   x",
7030                           "  x   x   x  a4     a3  a2  a1  a0",
7031                           "  i   i   i   i      i   i   i   i";
7032
7033         writepage       = "  0   1   0   0      1   1   0   0",
7034                           "  0   0   0   0    a11 a10  a9  a8",
7035                           " a7  a6  a5   x      x   x   x   x",
7036                           "  x   x   x   x      x   x   x   x";
7037
7038         mode            = 0x21;
7039         delay           = 10;
7040         blocksize       = 64;
7041         readsize        = 256;
7042       ;
7043
7044     memory "lfuse"
7045         size            = 1;
7046         min_write_delay = 2000;
7047         max_write_delay = 2000;
7048         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
7049                           "x x x x  x x x x   o o o o  o o o o";
7050
7051         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
7052                           "x x x x  x x x x   i i i i  i i i i";
7053       ;
7054
7055     memory "hfuse"
7056         size            = 1;
7057         min_write_delay = 2000;
7058         max_write_delay = 2000;
7059         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
7060                           "x x x x  x x x x   o o o o  o o o o";
7061
7062         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
7063                           "x x x x  x x x x   i i i i  i i i i";
7064       ;
7065
7066     memory "lock"
7067         size            = 1;
7068         min_write_delay = 2000;
7069         max_write_delay = 2000;
7070         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
7071                           "x x x x  x x x x   x x o o  o o o o";
7072
7073         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
7074                           "x x x x  x x x x   1 1 i i  i i i i";
7075       ;
7076
7077     memory "calibration"
7078         size            = 4;
7079         read            = "0  0  1  1   1  0  0  0   0  0  x  x   x  x  x  x",
7080                           "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
7081       ;
7082
7083     memory "signature"
7084         size            = 3;
7085         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
7086                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
7087       ;
7088   ;
7089
7090
7091
7092 #------------------------------------------------------------
7093 # ATmega8515
7094 #------------------------------------------------------------
7095
7096 part
7097     id               = "m8515";
7098     desc             = "ATMEGA8515";
7099     stk500_devcode   = 0x63;
7100     avr910_devcode   = 0x3A;
7101     signature        = 0x1e 0x93 0x06;
7102     chip_erase_delay = 9000;
7103     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
7104                        "x x x x  x x x x    x x x x  x x x x";
7105
7106     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
7107                        "x x x x  x x x x    x x x x  x x x x";
7108
7109     timeout             = 200;
7110     stabdelay           = 100;
7111     cmdexedelay         = 25;
7112     synchloops          = 32;
7113     bytedelay           = 0;
7114     pollindex           = 3;
7115     pollvalue           = 0x53;
7116     predelay            = 1;
7117     postdelay           = 1;
7118     pollmethod          = 0;
7119
7120     pp_controlstack     =
7121         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
7122         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
7123         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
7124         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
7125     hventerstabdelay    = 100;
7126     progmodedelay       = 0;
7127     latchcycles         = 6;
7128     togglevtg           = 0;
7129     poweroffdelay       = 0;
7130     resetdelayms        = 0;
7131     resetdelayus        = 0;
7132     hvleavestabdelay    = 15;
7133     chiperasepulsewidth = 0;
7134     chiperasepolltimeout = 10;
7135     programfusepulsewidth = 0;
7136     programfusepolltimeout = 5;
7137     programlockpulsewidth = 0;
7138     programlockpolltimeout = 5;
7139
7140     memory "eeprom"
7141         size            = 512;
7142         min_write_delay = 9000;
7143         max_write_delay = 9000;
7144         readback_p1     = 0xff;
7145         readback_p2     = 0xff;
7146  read            = "  1   0   1   0      0   0   0   0",
7147                           "  0   0   x   x      x   x   x  a8",
7148                           " a7  a6  a5  a4     a3  a2  a1  a0",
7149                           "  o   o   o   o      o   o   o   o";
7150
7151  write           = "  1   1   0   0      0   0   0   0",
7152                           "  0   0   x   x      x   x   x  a8",
7153                           " a7  a6  a5  a4     a3  a2  a1  a0",
7154                           "  i   i   i   i      i   i   i   i";
7155
7156         mode            = 0x04;
7157         delay           = 20;
7158         blocksize       = 128;
7159         readsize        = 256;
7160       ;
7161     memory "flash"
7162         paged           = yes;
7163         size            = 8192;
7164         page_size       = 64;
7165         num_pages       = 128;
7166         min_write_delay = 4500;
7167         max_write_delay = 4500;
7168         readback_p1     = 0xff;
7169         readback_p2     = 0xff;
7170         read_lo         = "  0   0   1   0    0   0   0   0",
7171                           "  0   0   0   0  a11 a10  a9  a8",
7172                           " a7  a6  a5  a4   a3  a2  a1  a0",
7173                           "  o   o   o   o    o   o   o   o";
7174
7175         read_hi         = "  0   0   1   0    1   0   0   0",
7176                           "  0   0   0   0  a11 a10  a9  a8",
7177                           " a7  a6  a5  a4   a3  a2  a1  a0",
7178                           "  o   o   o   o    o   o   o   o";
7179
7180         loadpage_lo     = "  0   1   0   0      0   0   0   0",
7181                           "  0   0   0   0      x   x   x   x",
7182                           "  x   x   x  a4     a3  a2  a1  a0",
7183                           "  i   i   i   i      i   i   i   i";
7184
7185         loadpage_hi     = "  0   1   0   0      1   0   0   0",
7186                           "  0   0   0   0      x   x   x   x",
7187                           "  x   x   x  a4     a3  a2  a1  a0",
7188                           "  i   i   i   i      i   i   i   i";
7189
7190         writepage       = "  0   1   0   0      1   1   0   0",
7191                           "  0   0   0   0    a11 a10  a9  a8",
7192                           " a7  a6  a5   x      x   x   x   x",
7193                           "  x   x   x   x      x   x   x   x";
7194
7195         mode            = 0x21;
7196         delay           = 6;
7197         blocksize       = 64;
7198         readsize        = 256;
7199       ;
7200
7201     memory "lfuse"
7202         size            = 1;
7203         min_write_delay = 4500;
7204         max_write_delay = 4500;
7205         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
7206                           "x x x x  x x x x   o o o o  o o o o";
7207
7208         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
7209                           "x x x x  x x x x   i i i i  i i i i";
7210       ;
7211
7212     memory "hfuse"
7213         size            = 1;
7214         min_write_delay = 4500;
7215         max_write_delay = 4500;
7216         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
7217                           "x x x x  x x x x   o o o o  o o o o";
7218
7219         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
7220                           "x x x x  x x x x   i i i i  i i i i";
7221       ;
7222
7223     memory "lock"
7224         size            = 1;
7225         min_write_delay = 4500;
7226         max_write_delay = 4500;
7227         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
7228                           "x x x x  x x x x   x x o o  o o o o";
7229
7230         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
7231                           "x x x x  x x x x   1 1 i i  i i i i";
7232       ;
7233
7234     memory "calibration"
7235         size            = 4;
7236         read            = "0 0 1 1  1 0 0 0     0 0 x x  x x x x",
7237                           "0 0 0 0  0 0 a1 a0   o o o o  o o o o";
7238       ;
7239
7240     memory "signature"
7241         size            = 3;
7242         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
7243                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
7244       ;
7245   ;
7246
7247
7248
7249
7250 #------------------------------------------------------------
7251 # ATmega8535
7252 #------------------------------------------------------------
7253
7254 part
7255     id               = "m8535";
7256     desc             = "ATMEGA8535";
7257     stk500_devcode   = 0x64;
7258     avr910_devcode   = 0x69;
7259     signature        = 0x1e 0x93 0x08;
7260     pagel            = 0xd7;
7261     bs2              = 0xa0;
7262     chip_erase_delay = 9000;
7263     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
7264                        "x x x x  x x x x    x x x x  x x x x";
7265
7266     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
7267                        "x x x x  x x x x    x x x x  x x x x";
7268
7269     timeout             = 200;
7270     stabdelay           = 100;
7271     cmdexedelay         = 25;
7272     synchloops          = 32;
7273     bytedelay           = 0;
7274     pollindex           = 3;
7275     pollvalue           = 0x53;
7276     predelay            = 1;
7277     postdelay           = 1;
7278     pollmethod          = 0;
7279
7280     pp_controlstack     =
7281         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
7282         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
7283         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
7284         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
7285     hventerstabdelay    = 100;
7286     progmodedelay       = 0;
7287     latchcycles         = 6;
7288     togglevtg           = 0;
7289     poweroffdelay       = 0;
7290     resetdelayms        = 0;
7291     resetdelayus        = 0;
7292     hvleavestabdelay    = 15;
7293     chiperasepulsewidth = 0;
7294     chiperasepolltimeout = 10;
7295     programfusepulsewidth = 0;
7296     programfusepolltimeout = 5;
7297     programlockpulsewidth = 0;
7298     programlockpolltimeout = 5;
7299
7300     memory "eeprom"
7301         size            = 512;
7302         min_write_delay = 9000;
7303         max_write_delay = 9000;
7304         readback_p1     = 0xff;
7305         readback_p2     = 0xff;
7306         read            = "  1   0   1   0      0   0   0   0",
7307                           "  0   0   x   x      x   x   x  a8",
7308                           " a7  a6  a5  a4     a3  a2  a1  a0",
7309                           "  o   o   o   o      o   o   o   o";
7310
7311         write           = "  1   1   0   0      0   0   0   0",
7312                           "  0   0   x   x      x   x   x  a8",
7313                           " a7  a6  a5  a4     a3  a2  a1  a0",
7314                           "  i   i   i   i      i   i   i   i";
7315
7316         mode            = 0x04;
7317         delay           = 20;
7318         blocksize       = 128;
7319         readsize        = 256;
7320       ;
7321     memory "flash"
7322         paged           = yes;
7323         size            = 8192;
7324         page_size       = 64;
7325         num_pages       = 128;
7326         min_write_delay = 4500;
7327         max_write_delay = 4500;
7328         readback_p1     = 0xff;
7329         readback_p2     = 0xff;
7330         read_lo         = "  0   0   1   0    0   0   0   0",
7331                           "  0   0   0   0  a11 a10  a9  a8",
7332                           " a7  a6  a5  a4   a3  a2  a1  a0",
7333                           "  o   o   o   o    o   o   o   o";
7334
7335         read_hi         = "  0   0   1   0    1   0   0   0",
7336                           "  0   0   0   0  a11 a10  a9  a8",
7337                           " a7  a6  a5  a4   a3  a2  a1  a0",
7338                           "  o   o   o   o    o   o   o   o";
7339
7340         loadpage_lo     = "  0   1   0   0      0   0   0   0",
7341                           "  0   0   0   0      x   x   x   x",
7342                           "  x   x   x  a4     a3  a2  a1  a0",
7343                           "  i   i   i   i      i   i   i   i";
7344
7345         loadpage_hi     = "  0   1   0   0      1   0   0   0",
7346                           "  0   0   0   0      x   x   x   x",
7347                           "  x   x   x  a4     a3  a2  a1  a0",
7348                           "  i   i   i   i      i   i   i   i";
7349
7350         writepage       = "  0   1   0   0      1   1   0   0",
7351                           "  0   0   0   0    a11 a10  a9  a8",
7352                           " a7  a6  a5   x      x   x   x   x",
7353                           "  x   x   x   x      x   x   x   x";
7354
7355         mode            = 0x21;
7356         delay           = 6;
7357         blocksize       = 64;
7358         readsize        = 256;
7359       ;
7360
7361     memory "lfuse"
7362         size            = 1;
7363         min_write_delay = 2000;
7364         max_write_delay = 2000;
7365         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
7366                           "x x x x  x x x x   o o o o  o o o o";
7367
7368         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
7369                           "x x x x  x x x x   i i i i  i i i i";
7370       ;
7371
7372     memory "hfuse"
7373         size            = 1;
7374         min_write_delay = 2000;
7375         max_write_delay = 2000;
7376         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
7377                           "x x x x  x x x x   o o o o  o o o o";
7378
7379         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
7380                           "x x x x  x x x x   i i i i  i i i i";
7381       ;
7382
7383     memory "lock"
7384         size            = 1;
7385         min_write_delay = 2000;
7386         max_write_delay = 2000;
7387         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
7388                           "x x x x  x x x x   x x o o  o o o o";
7389
7390         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
7391                           "x x x x  x x x x   1 1 i i  i i i i";
7392       ;
7393
7394     memory "calibration"
7395         size            = 4;
7396         read            = "0 0 1 1  1 0 0 0   0 0 x x  x x x x",
7397                           "0 0 0 0  0 0 a1 a0 o o o o  o o o o";
7398       ;
7399
7400     memory "signature"
7401         size            = 3;
7402         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
7403                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
7404       ;
7405   ;
7406
7407
7408 #------------------------------------------------------------
7409 # ATtiny26
7410 #------------------------------------------------------------
7411
7412 part
7413     id                  = "t26";
7414     desc                = "ATTINY26";
7415     stk500_devcode      = 0x21;
7416     avr910_devcode      = 0x5e;
7417     signature           = 0x1e 0x91 0x09;
7418     pagel               = 0xb3;
7419     bs2                 = 0xb2;
7420     chip_erase_delay    = 9000;
7421     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
7422                           "x x x x  x x x x   x x x x  x x x x";
7423
7424     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
7425                           "x x x x  x x x x   x x x x  x x x x";
7426
7427     timeout             = 200;
7428     stabdelay           = 100;
7429     cmdexedelay         = 25;
7430     synchloops          = 32;
7431     bytedelay           = 0;
7432     pollindex           = 3;
7433     pollvalue           = 0x53;
7434     predelay            = 1;
7435     postdelay           = 1;
7436     pollmethod          = 0;
7437
7438     pp_controlstack     =
7439         0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC,
7440         0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC,
7441         0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C,
7442         0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
7443     hventerstabdelay    = 100;
7444     progmodedelay       = 0;
7445     latchcycles         = 5;
7446     togglevtg           = 1;
7447     poweroffdelay       = 15;
7448     resetdelayms        = 2;
7449     resetdelayus        = 0;
7450     hvleavestabdelay    = 15;
7451     chiperasepulsewidth = 0;
7452     chiperasepolltimeout = 10;
7453     programfusepulsewidth = 0;
7454     programfusepolltimeout = 5;
7455     programlockpulsewidth = 0;
7456     programlockpolltimeout = 5;
7457
7458     memory "eeprom"
7459         size            = 128;
7460         min_write_delay = 9000;
7461         max_write_delay = 9000;
7462         readback_p1     = 0xff;
7463         readback_p2     = 0xff;
7464         read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
7465                           "x a6 a5 a4  a3 a2 a1 a0    o o o o  o o o o";
7466
7467         write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
7468                           "x a6 a5 a4  a3 a2 a1 a0    i i i i  i i i i";
7469
7470         mode            = 0x04;
7471         delay           = 10;
7472         blocksize       = 64;
7473         readsize        = 256;
7474     ;
7475
7476     memory "flash"
7477         paged           = yes;
7478         size            = 2048;
7479         page_size       = 32;
7480         num_pages       = 64;
7481         min_write_delay = 4500;
7482         max_write_delay = 4500;
7483         readback_p1     = 0xff;
7484         readback_p2     = 0xff;
7485         read_lo         = "  0  0  1  0   0  0  0  0",
7486                           "  x  x  x  x   x  x a9 a8",
7487                           " a7 a6 a5 a4  a3 a2 a1 a0",
7488                           "  o  o  o  o   o  o  o  o";
7489
7490         read_hi         = "  0  0  1  0   1  0  0  0",
7491                           "  x  x  x  x   x  x a9 a8",
7492                           " a7 a6 a5 a4  a3 a2 a1 a0",
7493                           "  o  o  o  o   o  o  o  o";
7494
7495         loadpage_lo     = "  0  1  0  0   0  0  0  0",
7496                           "  x  x  x  x   x  x  x  x",
7497                           "  x  x  x  x  a3 a2 a1 a0",
7498                           "  i  i  i  i   i  i  i  i";
7499
7500         loadpage_hi     = "  0  1  0  0   1  0  0  0",
7501                           "  x  x  x  x   x  x  x  x",
7502                           "  x  x  x  x  a3 a2 a1 a0",
7503                           "  i  i  i  i   i  i  i  i";
7504
7505         writepage       = "  0  1  0  0   1  1  0  0",
7506                           "  x  x  x  x   x  x a9 a8",
7507                           " a7 a6 a5 a4   x  x  x  x",
7508                           "  x  x  x  x   x  x  x  x";
7509
7510         mode            = 0x21;
7511         delay           = 6;
7512         blocksize       = 16;
7513         readsize        = 256;
7514     ;
7515
7516     memory "signature"
7517         size            = 3;
7518         read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
7519                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7520     ;
7521
7522     memory "lock"
7523         size            = 1;
7524         read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
7525                           "x  x  x  x   x  x  x  x    x x x x  x x o o";
7526
7527         write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
7528                           "x  x  x  x   x  x  x  x    x x x x  x x x x";
7529         min_write_delay = 9000;
7530         max_write_delay = 9000;
7531     ;
7532
7533     memory "lfuse"
7534         size            = 1;
7535         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
7536                           "x x x x  x x x x  i i i i  i i i i";
7537
7538         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
7539                           "x x x x  x x x x  o o o o  o o o o";
7540         min_write_delay = 9000;
7541         max_write_delay = 9000;
7542       ;
7543
7544     memory "hfuse"
7545         size            = 1;
7546         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
7547                           "x x x x  x x x x  x x x i  i i i i";
7548
7549         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
7550                           "x x x x  x x x x  x x x o  o o o o";
7551         min_write_delay = 9000;
7552         max_write_delay = 9000;
7553       ;
7554
7555     memory "calibration"
7556         size            = 4;
7557         read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
7558                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7559     ;
7560
7561 ;
7562
7563
7564 #------------------------------------------------------------
7565 # ATtiny261
7566 #------------------------------------------------------------
7567 # Close to ATtiny26
7568
7569 part
7570     id                  = "t261";
7571     desc                = "ATTINY261";
7572      has_debugwire = yes;
7573      flash_instr   = 0xB4, 0x00, 0x10;
7574      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
7575                      0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC,
7576                      0x99, 0xE1, 0xBB, 0xAC;
7577 #    stk500_devcode      = 0x21;
7578 #    avr910_devcode      = 0x5e;
7579     signature           = 0x1e 0x91 0x0c;
7580     pagel               = 0xb3;
7581     bs2                 = 0xb2;
7582     chip_erase_delay    = 4000;
7583
7584     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
7585                           "x x x x  x x x x   x x x x  x x x x";
7586
7587     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
7588                           "x x x x  x x x x   x x x x  x x x x";
7589
7590     timeout             = 200;
7591     stabdelay           = 100;
7592     cmdexedelay         = 25;
7593     synchloops          = 32;
7594     bytedelay           = 0;
7595     pollindex           = 3;
7596     pollvalue           = 0x53;
7597     predelay            = 1;
7598     postdelay           = 1;
7599     pollmethod          = 0;
7600
7601     pp_controlstack     =
7602         0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC,
7603         0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC,
7604         0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C,
7605         0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
7606     hventerstabdelay    = 100;
7607     progmodedelay       = 0;
7608     latchcycles         = 5;
7609     togglevtg           = 1;
7610     poweroffdelay       = 15;
7611     resetdelayms        = 2;
7612     resetdelayus        = 0;
7613     hvleavestabdelay    = 15;
7614     chiperasepulsewidth = 0;
7615     chiperasepolltimeout = 10;
7616     programfusepulsewidth = 0;
7617     programfusepolltimeout = 5;
7618     programlockpulsewidth = 0;
7619     programlockpolltimeout = 5;
7620
7621     memory "eeprom"
7622         paged           = no;
7623         size            = 128;
7624         page_size       = 4;
7625         num_pages       = 32;
7626         min_write_delay = 4000;
7627         max_write_delay = 4000;
7628         readback_p1     = 0xff;
7629         readback_p2     = 0xff;
7630
7631         read            = "1  0  1  0   0  0  0  0    x x x x  x x x x",
7632                           "x a6 a5 a4  a3 a2 a1 a0    o o o o  o o o o";
7633
7634         write           = "1  1  0  0   0  0  0  0    x x x x  x x x x",
7635                           "x a6 a5 a4  a3 a2 a1 a0    i i i i  i i i i";
7636
7637         loadpage_lo     = "  1   1   0   0      0   0   0   1",
7638                           "  0   0   0   0      0   0   0   0",
7639                           "  0   0   0   0      0   0  a1  a0",
7640                           "  i   i   i   i      i   i   i   i";
7641
7642         writepage       = "  1   1   0   0      0   0   1   0",
7643                           "  0   0   x   x      x   x   x   x",
7644                           "  x  a6  a5  a4     a3  a2   0   0",
7645                           "  x   x   x   x      x   x   x   x";
7646
7647         mode            = 0x41;
7648         delay           = 10;
7649         blocksize       = 4;
7650         readsize        = 256;
7651     ;
7652
7653     memory "flash"
7654         paged           = yes;
7655         size            = 2048;
7656         page_size       = 32;
7657         num_pages       = 64;
7658         min_write_delay = 4500;
7659         max_write_delay = 4500;
7660         readback_p1     = 0xff;
7661         readback_p2     = 0xff;
7662
7663         read_lo         = "  0  0  1  0   0  0  0  0",
7664                           "  x  x  x  x   x  x a9 a8",
7665                           " a7 a6 a5 a4  a3 a2 a1 a0",
7666                           "  o  o  o  o   o  o  o  o";
7667
7668         read_hi         = "  0  0  1  0   1  0  0  0",
7669                           "  x  x  x  x   x  x a9 a8",
7670                           " a7 a6 a5 a4  a3 a2 a1 a0",
7671                           "  o  o  o  o   o  o  o  o";
7672
7673         loadpage_lo     = "  0  1  0  0   0  0  0  0",
7674                           "  x  x  x  x   x  x  x  x",
7675                           "  x  x  x  x  a3 a2 a1 a0",
7676                           "  i  i  i  i   i  i  i  i";
7677
7678         loadpage_hi     = "  0  1  0  0   1  0  0  0",
7679                           "  x  x  x  x   x  x  x  x",
7680                           "  x  x  x  x  a3 a2 a1 a0",
7681                           "  i  i  i  i   i  i  i  i";
7682
7683         writepage       = "  0  1  0  0   1  1  0  0",
7684                           "  x  x  x  x   x  x a9 a8",
7685                           " a7 a6 a5 a4   x  x  x  x",
7686                           "  x  x  x  x   x  x  x  x";
7687
7688         mode            = 0x41;
7689         delay           = 6;
7690         blocksize       = 32;
7691         readsize        = 256;
7692     ;
7693
7694     memory "signature"
7695         size            = 3;
7696         read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
7697                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7698     ;
7699
7700     memory "lock"
7701         size            = 1;
7702         read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
7703                           "x  x  x  x   x  x  x  x    x x x x  x x o o";
7704
7705         write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
7706                           "x  x  x  x   x  x  x  x    x x x x  x x x x";
7707         min_write_delay = 4500;
7708         max_write_delay = 4500;
7709     ;
7710
7711     memory "lfuse"
7712         size            = 1;
7713         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
7714                           "x x x x  x x x x  i i i i  i i i i";
7715
7716         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
7717                           "x x x x  x x x x  o o o o  o o o o";
7718         min_write_delay = 4500;
7719         max_write_delay = 4500;
7720       ;
7721
7722     memory "hfuse"
7723         size            = 1;
7724         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
7725                           "x x x x  x x x x  i i i i  i i i i";
7726
7727         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
7728                           "x x x x  x x x x  o o o o  o o o o";
7729         min_write_delay = 4500;
7730         max_write_delay = 4500;
7731       ;
7732
7733     memory "efuse"
7734         size            = 1;
7735         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
7736                           "x x x x  x x x x   x x x x  x x x i";
7737
7738         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
7739                           "x x x x  x x x x   x x x x  x x x o";
7740         min_write_delay = 4500;
7741         max_write_delay = 4500;
7742       ;
7743
7744     memory "calibration"
7745         size            = 1;
7746         read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
7747                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
7748     ;
7749
7750 ;
7751
7752
7753 #------------------------------------------------------------
7754 # ATtiny461
7755 #------------------------------------------------------------
7756 # Close to ATtiny261
7757
7758 part
7759     id                  = "t461";
7760     desc                = "ATTINY461";
7761      has_debugwire = yes;
7762      flash_instr   = 0xB4, 0x00, 0x10;
7763      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
7764                      0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC,
7765                      0x99, 0xE1, 0xBB, 0xAC;
7766 #    stk500_devcode      = 0x21;
7767 #    avr910_devcode      = 0x5e;
7768     signature           = 0x1e 0x92 0x08;
7769     pagel               = 0xb3;
7770     bs2                 = 0xb2;
7771     chip_erase_delay    = 4000;
7772
7773     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
7774                           "x x x x  x x x x   x x x x  x x x x";
7775
7776     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
7777                           "x x x x  x x x x   x x x x  x x x x";
7778
7779     timeout             = 200;
7780     stabdelay           = 100;
7781     cmdexedelay         = 25;
7782     synchloops          = 32;
7783     bytedelay           = 0;
7784     pollindex           = 3;
7785     pollvalue           = 0x53;
7786     predelay            = 1;
7787     postdelay           = 1;
7788     pollmethod          = 0;
7789
7790     pp_controlstack     =
7791         0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC,
7792         0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC,
7793         0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C,
7794         0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
7795     hventerstabdelay    = 100;
7796     progmodedelay       = 0;
7797     latchcycles         = 5;
7798     togglevtg           = 1;
7799     poweroffdelay       = 15;
7800     resetdelayms        = 2;
7801     resetdelayus        = 0;
7802     hvleavestabdelay    = 15;
7803     chiperasepulsewidth = 0;
7804     chiperasepolltimeout = 10;
7805     programfusepulsewidth = 0;
7806     programfusepolltimeout = 5;
7807     programlockpulsewidth = 0;
7808     programlockpolltimeout = 5;
7809
7810     memory "eeprom"
7811         paged           = no;
7812         size            = 256;
7813         page_size       = 4;
7814         num_pages       = 64;
7815         min_write_delay = 4000;
7816         max_write_delay = 4000;
7817         readback_p1     = 0xff;
7818         readback_p2     = 0xff;
7819
7820         read            = " 1  0  1  0   0  0  0  0    x x x x  x x x x",
7821                           "a7 a6 a5 a4  a3 a2 a1 a0    o o o o  o o o o";
7822
7823         write           = " 1  1  0  0   0  0  0  0    x x x x  x x x x",
7824                           "a7 a6 a5 a4  a3 a2 a1 a0    i i i i  i i i i";
7825
7826         loadpage_lo     = "  1   1   0   0      0   0   0   1",
7827                           "  0   0   0   0      0   0   0   0",
7828                           "  0   0   0   0      0   0  a1  a0",
7829                           "  i   i   i   i      i   i   i   i";
7830
7831         writepage       = "  1   1   0   0      0   0   1   0",
7832                           "  0   0   x   x      x   x   x   x",
7833                           " a7  a6  a5  a4     a3  a2   0   0",
7834                           "  x   x   x   x      x   x   x   x";
7835
7836         mode            = 0x41;
7837         delay           = 10;
7838         blocksize       = 4;
7839         readsize        = 256;
7840     ;
7841
7842     memory "flash"
7843         paged           = yes;
7844         size            = 4096;
7845         page_size       = 64;
7846         num_pages       = 64;
7847         min_write_delay = 4500;
7848         max_write_delay = 4500;
7849         readback_p1     = 0xff;
7850         readback_p2     = 0xff;
7851
7852         read_lo         = "  0  0  1  0   0   0  0  0",
7853                           "  x  x  x  x   x a10 a9 a8",
7854                           " a7 a6 a5 a4  a3  a2 a1 a0",
7855                           "  o  o  o  o   o   o  o  o";
7856
7857         read_hi         = "  0  0  1  0   1   0  0  0",
7858                           "  x  x  x  x   x a10 a9 a8",
7859                           " a7 a6 a5 a4  a3  a2 a1 a0",
7860                           "  o  o  o  o   o   o  o  o";
7861
7862         loadpage_lo     = "  0  1  0  0   0  0  0  0",
7863                           "  x  x  x  x   x  x  x  x",
7864                           "  x  x  x a4  a3 a2 a1 a0",
7865                           "  i  i  i  i   i  i  i  i";
7866
7867         loadpage_hi     = "  0  1  0  0   1  0  0  0",
7868                           "  x  x  x  x   x  x  x  x",
7869                           "  x  x  x a4  a3 a2 a1 a0",
7870                           "  i  i  i  i   i  i  i  i";
7871
7872         writepage       = "  0  1  0  0   1   1  0  0",
7873                           "  x  x  x  x   x a10 a9 a8",
7874                           " a7 a6 a5  x   x   x  x  x",
7875                           "  x  x  x  x   x   x  x  x";
7876
7877         mode            = 0x41;
7878         delay           = 6;
7879         blocksize       = 64;
7880         readsize        = 256;
7881     ;
7882
7883     memory "signature"
7884         size            = 3;
7885         read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
7886                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
7887     ;
7888
7889     memory "lock"
7890         size            = 1;
7891         read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
7892                           "x  x  x  x   x  x  x  x    x x x x  x x o o";
7893
7894         write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
7895                           "x  x  x  x   x  x  x  x    x x x x  x x x x";
7896         min_write_delay = 4500;
7897         max_write_delay = 4500;
7898     ;
7899
7900     memory "lfuse"
7901         size            = 1;
7902         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
7903                           "x x x x  x x x x  i i i i  i i i i";
7904
7905         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
7906                           "x x x x  x x x x  o o o o  o o o o";
7907         min_write_delay = 4500;
7908         max_write_delay = 4500;
7909       ;
7910
7911     memory "hfuse"
7912         size            = 1;
7913         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
7914                           "x x x x  x x x x  i i i i  i i i i";
7915
7916         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
7917                           "x x x x  x x x x  o o o o  o o o o";
7918         min_write_delay = 4500;
7919         max_write_delay = 4500;
7920       ;
7921
7922     memory "efuse"
7923         size            = 1;
7924         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
7925                           "x x x x  x x x x   x x x x  x x x i";
7926
7927         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
7928                           "x x x x  x x x x   x x x x  x x x o";
7929         min_write_delay = 4500;
7930         max_write_delay = 4500;
7931       ;
7932
7933     memory "calibration"
7934         size            = 1;
7935         read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
7936                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
7937     ;
7938
7939 ;
7940
7941
7942 #------------------------------------------------------------
7943 # ATtiny861
7944 #------------------------------------------------------------
7945 # Close to ATtiny461
7946
7947 part
7948     id                  = "t861";
7949     desc                = "ATTINY861";
7950      has_debugwire = yes;
7951      flash_instr   = 0xB4, 0x00, 0x10;
7952      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
7953                      0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC,
7954                      0x99, 0xE1, 0xBB, 0xAC;
7955 #    stk500_devcode      = 0x21;
7956 #    avr910_devcode      = 0x5e;
7957     signature           = 0x1e 0x93 0x0d;
7958     pagel               = 0xb3;
7959     bs2                 = 0xb2;
7960     chip_erase_delay    = 4000;
7961
7962     pgm_enable          = "1 0 1 0  1 1 0 0   0 1 0 1  0 0 1 1",
7963                           "x x x x  x x x x   x x x x  x x x x";
7964
7965     chip_erase          = "1 0 1 0  1 1 0 0   1 0 0 x  x x x x",
7966                           "x x x x  x x x x   x x x x  x x x x";
7967
7968     timeout             = 200;
7969     stabdelay           = 100;
7970     cmdexedelay         = 25;
7971     synchloops          = 32;
7972     bytedelay           = 0;
7973     pollindex           = 3;
7974     pollvalue           = 0x53;
7975     predelay            = 1;
7976     postdelay           = 1;
7977     pollmethod          = 0;
7978
7979     pp_controlstack     =
7980         0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC,
7981         0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC,
7982         0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C,
7983         0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
7984     hventerstabdelay    = 100;
7985     progmodedelay       = 0;
7986     latchcycles         = 5;
7987     togglevtg           = 1;
7988     poweroffdelay       = 15;
7989     resetdelayms        = 2;
7990     resetdelayus        = 0;
7991     hvleavestabdelay    = 15;
7992     chiperasepulsewidth = 0;
7993     chiperasepolltimeout = 10;
7994     programfusepulsewidth = 0;
7995     programfusepolltimeout = 5;
7996     programlockpulsewidth = 0;
7997     programlockpolltimeout = 5;
7998
7999     memory "eeprom"
8000         paged           = no;
8001         size            = 512;
8002         num_pages       = 128;
8003         page_size       = 4;
8004         min_write_delay = 4000;
8005         max_write_delay = 4000;
8006         readback_p1     = 0xff;
8007         readback_p2     = 0xff;
8008
8009         read            = " 1  0  1  0   0  0  0  0    x x x x  x x x a8",
8010                           "a7 a6 a5 a4  a3 a2 a1 a0    o o o o  o o o  o";
8011
8012         write           = " 1  1  0  0   0  0  0  0    x x x x  x x x a8",
8013                           "a7 a6 a5 a4  a3 a2 a1 a0    i i i i  i i i  i";
8014
8015         loadpage_lo     = "  1   1   0   0      0   0   0   1",
8016                           "  0   0   0   0      0   0   0   0",
8017                           "  0   0   0   0      0   0  a1  a0",
8018                           "  i   i   i   i      i   i   i   i";
8019
8020         writepage       = "  1   1   0   0      0   0   1   0",
8021                           "  0   0   x   x      x   x   x  a8",
8022                           " a7  a6  a5  a4     a3  a2   0   0",
8023                           "  x   x   x   x      x   x   x   x";
8024
8025         mode            = 0x41;
8026         delay           = 10;
8027         blocksize       = 4;
8028         readsize        = 256;
8029     ;
8030
8031     memory "flash"
8032         paged           = yes;
8033         size            = 8192;
8034         page_size       = 64;
8035         num_pages       = 128;
8036         min_write_delay = 4500;
8037         max_write_delay = 4500;
8038         readback_p1     = 0xff;
8039         readback_p2     = 0xff;
8040
8041         read_lo         = "  0  0  1  0   0   0  0  0",
8042                           "  x  x  x  x a11 a10 a9 a8",
8043                           " a7 a6 a5 a4  a3  a2 a1 a0",
8044                           "  o  o  o  o   o   o  o  o";
8045
8046         read_hi         = "  0  0  1  0   1   0  0  0",
8047                           "  x  x  x  x a11 a10 a9 a8",
8048                           " a7 a6 a5 a4  a3  a2 a1 a0",
8049                           "  o  o  o  o   o   o  o  o";
8050
8051         loadpage_lo     = "  0  1  0  0   0  0  0  0",
8052                           "  x  x  x  x   x  x  x  x",
8053                           "  x  x  x a4  a3 a2 a1 a0",
8054                           "  i  i  i  i   i  i  i  i";
8055
8056         loadpage_hi     = "  0  1  0  0   1  0  0  0",
8057                           "  x  x  x  x   x  x  x  x",
8058                           "  x  x  x a4  a3 a2 a1 a0",
8059                           "  i  i  i  i   i  i  i  i";
8060
8061         writepage       = "  0  1  0  0   1   1  0  0",
8062                           "  x  x  x  x a11 a10 a9 a8",
8063                           " a7 a6 a5  x   x   x  x  x",
8064                           "  x  x  x  x   x   x  x  x";
8065
8066         mode            = 0x41;
8067         delay           = 6;
8068         blocksize       = 64;
8069         readsize        = 256;
8070     ;
8071
8072     memory "signature"
8073         size            = 3;
8074         read            = "0  0  1  1   0  0  0  0    x x x x  x x x x",
8075                           "0  0  0  0   0  0 a1 a0    o o o o  o o o o";
8076     ;
8077
8078     memory "lock"
8079         size            = 1;
8080         read            = "0  1  0  1   1  0  0  0    x x x x  x x x x",
8081                           "x  x  x  x   x  x  x  x    x x x x  x x o o";
8082
8083         write           = "1  0  1  0   1  1  0  0    1 1 1 1  1 1 i i",
8084                           "x  x  x  x   x  x  x  x    x x x x  x x x x";
8085         min_write_delay = 4500;
8086         max_write_delay = 4500;
8087     ;
8088
8089     memory "lfuse"
8090         size            = 1;
8091         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
8092                           "x x x x  x x x x  i i i i  i i i i";
8093
8094         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
8095                           "x x x x  x x x x  o o o o  o o o o";
8096         min_write_delay = 4500;
8097         max_write_delay = 4500;
8098       ;
8099
8100     memory "hfuse"
8101         size            = 1;
8102         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
8103                           "x x x x  x x x x  i i i i  i i i i";
8104
8105         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
8106                           "x x x x  x x x x  o o o o  o o o o";
8107         min_write_delay = 4500;
8108         max_write_delay = 4500;
8109       ;
8110
8111     memory "efuse"
8112         size            = 1;
8113         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
8114                           "x x x x  x x x x   x x x x  x x x i";
8115
8116         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
8117                           "x x x x  x x x x   x x x x  x x x o";
8118         min_write_delay = 4500;
8119         max_write_delay = 4500;
8120       ;
8121
8122     memory "calibration"
8123         size            = 1;
8124         read            = "0  0  1  1   1  0  0  0    x x x x  x x x x",
8125                           "0  0  0  0   0  0  0  0    o o o o  o o o o";
8126     ;
8127
8128 ;
8129
8130
8131 #------------------------------------------------------------
8132 # ATmega48
8133 #------------------------------------------------------------
8134
8135 part
8136     id               = "m48";
8137     desc             = "ATMEGA48";
8138      has_debugwire = yes;
8139      flash_instr   = 0xB6, 0x01, 0x11;
8140      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
8141                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
8142                      0x99, 0xF9, 0xBB, 0xAF;
8143     stk500_devcode   = 0x59;
8144 #    avr910_devcode   = 0x;
8145     signature        = 0x1e 0x92 0x05;
8146     pagel            = 0xd7;
8147     bs2              = 0xc2;
8148     chip_erase_delay = 45000;
8149     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
8150                        "x x x x  x x x x    x x x x  x x x x";
8151
8152     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
8153                        "x x x x  x x x x    x x x x  x x x x";
8154
8155     timeout             = 200;
8156     stabdelay           = 100;
8157     cmdexedelay         = 25;
8158     synchloops          = 32;
8159     bytedelay           = 0;
8160     pollindex           = 3;
8161     pollvalue           = 0x53;
8162     predelay            = 1;
8163     postdelay           = 1;
8164     pollmethod          = 1;
8165
8166     pp_controlstack     =
8167         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
8168         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
8169         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
8170         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8171     hventerstabdelay    = 100;
8172     progmodedelay       = 0;
8173     latchcycles         = 5;
8174     togglevtg           = 1;
8175     poweroffdelay       = 15;
8176     resetdelayms        = 1;
8177     resetdelayus        = 0;
8178     hvleavestabdelay    = 15;
8179     resetdelay          = 15;
8180     chiperasepulsewidth = 0;
8181     chiperasepolltimeout = 10;
8182     programfusepulsewidth = 0;
8183     programfusepolltimeout = 5;
8184     programlockpulsewidth = 0;
8185     programlockpolltimeout = 5;
8186
8187     memory "eeprom"
8188         paged           = no;
8189         page_size       = 4;
8190         size            = 256;
8191         min_write_delay = 3600;
8192         max_write_delay = 3600;
8193         readback_p1     = 0xff;
8194         readback_p2     = 0xff;
8195         read            = "  1   0   1   0      0   0   0   0",
8196                           "  0   0   0   x      x   x   x   x",
8197                           " a7  a6  a5  a4     a3  a2  a1  a0",
8198                           "  o   o   o   o      o   o   o   o";
8199
8200         write           = "  1   1   0   0      0   0   0   0",
8201                           "  0   0   0   x      x   x   x   x",
8202                           " a7  a6  a5  a4     a3  a2  a1  a0", 
8203                           "  i   i   i   i      i   i   i   i";
8204
8205         loadpage_lo     = "  1   1   0   0      0   0   0   1",
8206                           "  0   0   0   0      0   0   0   0",
8207                           "  0   0   0   0      0   0  a1  a0",
8208                           "  i   i   i   i      i   i   i   i";
8209
8210         writepage       = "  1   1   0   0      0   0   1   0",
8211                           "  0   0   x   x      x   x   x   x",
8212                           " a7  a6  a5  a4     a3  a2   0   0",
8213                           "  x   x   x   x      x   x   x   x";
8214
8215         mode            = 0x41;
8216         delay           = 20;
8217         blocksize       = 4;
8218         readsize        = 256;
8219       ;
8220     memory "flash"
8221         paged           = yes;
8222         size            = 4096;
8223         page_size       = 64;
8224         num_pages       = 64;
8225         min_write_delay = 4500;
8226         max_write_delay = 4500;
8227         readback_p1     = 0x00;
8228         readback_p2     = 0x00;
8229         read_lo         = "  0   0   1   0    0   0   0   0",
8230                           "  0   0   0   0    0 a10  a9  a8",
8231                           " a7  a6  a5  a4   a3  a2  a1  a0",
8232                           "  o   o   o   o    o   o   o   o";
8233
8234         read_hi         = "  0   0   1   0    1   0   0   0",
8235                           "  0   0   0   0    0 a10  a9  a8",
8236                           " a7  a6  a5  a4   a3  a2  a1  a0",
8237                           "  o   o   o   o    o   o   o   o";
8238
8239         loadpage_lo     = "  0   1   0   0      0   0   0   0",
8240                           "  0   0   0   x      x   x   x   x",
8241                           "  x   x   x  a4     a3  a2  a1  a0",
8242                           "  i   i   i   i      i   i   i   i";
8243
8244         loadpage_hi     = "  0   1   0   0      1   0   0   0",
8245                           "  0   0   0   x      x   x   x   x",
8246                           "  x   x   x  a4     a3  a2  a1  a0",
8247                           "  i   i   i   i      i   i   i   i";
8248
8249         writepage       = "  0   1   0   0      1   1   0   0",
8250                           "  0   0   0   0      0 a10  a9  a8",
8251                           " a7  a6  a5   x      x   x   x   x",
8252                           "  x   x   x   x      x   x   x   x";
8253
8254         mode            = 0x41;
8255         delay           = 6;
8256         blocksize       = 64;
8257         readsize        = 256;
8258       ;
8259
8260     memory "lfuse"
8261         size            = 1;
8262         min_write_delay = 4500;
8263         max_write_delay = 4500;
8264         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
8265                           "x x x x  x x x x   o o o o  o o o o";
8266
8267         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
8268                           "x x x x  x x x x   i i i i  i i i i";
8269       ;
8270
8271     memory "hfuse"
8272         size            = 1;
8273         min_write_delay = 4500;
8274         max_write_delay = 4500;
8275         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
8276                           "x x x x  x x x x   o o o o  o o o o";
8277
8278         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
8279                           "x x x x  x x x x   i i i i  i i i i";
8280       ;
8281
8282     memory "efuse"
8283         size            = 1;
8284         min_write_delay = 4500;
8285         max_write_delay = 4500;
8286         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
8287                           "x x x x  x x x x   x x x x  x x x o";
8288
8289         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
8290                           "x x x x  x x x x   x x x x  x x x i";
8291       ;
8292
8293     memory "lock"
8294         size            = 1;
8295         min_write_delay = 4500;
8296         max_write_delay = 4500;
8297         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
8298                           "x x x x  x x x x   x x o o  o o o o";
8299
8300         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
8301                           "x x x x  x x x x   1 1 i i  i i i i";
8302       ;
8303
8304     memory "calibration"
8305         size            = 1;
8306         read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
8307                           "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
8308       ;
8309
8310     memory "signature"
8311         size            = 3;
8312         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
8313                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
8314       ;
8315   ;
8316
8317
8318 #------------------------------------------------------------
8319 # ATmega88
8320 #------------------------------------------------------------
8321
8322 part
8323     id               = "m88";
8324     desc             = "ATMEGA88";
8325      has_debugwire = yes;
8326      flash_instr   = 0xB6, 0x01, 0x11;
8327      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
8328                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
8329                      0x99, 0xF9, 0xBB, 0xAF;
8330     stk500_devcode   = 0x73;
8331 #    avr910_devcode   = 0x;
8332     signature        = 0x1e 0x93 0x0a;
8333     pagel            = 0xd7;
8334     bs2              = 0xc2;
8335     chip_erase_delay = 9000;
8336     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
8337                        "x x x x  x x x x    x x x x  x x x x";
8338
8339     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
8340                        "x x x x  x x x x    x x x x  x x x x";
8341
8342     timeout             = 200;
8343     stabdelay           = 100;
8344     cmdexedelay         = 25;
8345     synchloops          = 32;
8346     bytedelay           = 0;
8347     pollindex           = 3;
8348     pollvalue           = 0x53;
8349     predelay            = 1;
8350     postdelay           = 1;
8351     pollmethod          = 1;
8352
8353     pp_controlstack     =
8354         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
8355         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
8356         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
8357         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8358     hventerstabdelay    = 100;
8359     progmodedelay       = 0;
8360     latchcycles         = 5;
8361     togglevtg           = 1;
8362     poweroffdelay       = 15;
8363     resetdelayms        = 1;
8364     resetdelayus        = 0;
8365     hvleavestabdelay    = 15;
8366     resetdelay          = 15;
8367     chiperasepulsewidth = 0;
8368     chiperasepolltimeout = 10;
8369     programfusepulsewidth = 0;
8370     programfusepolltimeout = 5;
8371     programlockpulsewidth = 0;
8372     programlockpolltimeout = 5;
8373
8374     memory "eeprom"
8375         paged           = no;
8376         page_size       = 4;
8377         size            = 512;
8378         min_write_delay = 3600;
8379         max_write_delay = 3600;
8380         readback_p1     = 0xff;
8381         readback_p2     = 0xff;
8382         read            = "  1   0   1   0      0   0   0   0",
8383                           "  0   0   0   x      x   x   x  a8",
8384                           " a7  a6  a5  a4     a3  a2  a1  a0",
8385                           "  o   o   o   o      o   o   o   o";
8386
8387         write           = "  1   1   0   0      0   0   0   0",
8388                           "  0   0   0   x      x   x   x  a8",
8389                           " a7  a6  a5  a4     a3  a2  a1  a0", 
8390                           "  i   i   i   i      i   i   i   i";
8391
8392         loadpage_lo     = "  1   1   0   0      0   0   0   1",
8393                           "  0   0   0   0      0   0   0   0",
8394                           "  0   0   0   0      0   0  a1  a0",
8395                           "  i   i   i   i      i   i   i   i";
8396
8397         writepage       = "  1   1   0   0      0   0   1   0",
8398                           "  0   0   x   x      x   x   x  a8",
8399                           " a7  a6  a5  a4     a3  a2   0   0",
8400                           "  x   x   x   x      x   x   x   x";
8401
8402         mode            = 0x41;
8403         delay           = 20;
8404         blocksize       = 4;
8405         readsize        = 256;
8406       ;
8407     memory "flash"
8408         paged           = yes;
8409         size            = 8192;
8410         page_size       = 64;
8411         num_pages       = 128;
8412         min_write_delay = 4500;
8413         max_write_delay = 4500;
8414         readback_p1     = 0xff;
8415         readback_p2     = 0xff;
8416         read_lo         = "  0   0   1   0    0   0   0   0",
8417                           "  0   0   0   0  a11 a10  a9  a8",
8418                           " a7  a6  a5  a4   a3  a2  a1  a0",
8419                           "  o   o   o   o    o   o   o   o";
8420
8421         read_hi         = "  0   0   1   0    1   0   0   0",
8422                           "  0   0   0   0  a11 a10  a9  a8",
8423                           " a7  a6  a5  a4   a3  a2  a1  a0",
8424                           "  o   o   o   o    o   o   o   o";
8425
8426         loadpage_lo     = "  0   1   0   0      0   0   0   0",
8427                           "  0   0   0   x      x   x   x   x",
8428                           "  x   x   x  a4     a3  a2  a1  a0",
8429                           "  i   i   i   i      i   i   i   i";
8430
8431         loadpage_hi     = "  0   1   0   0      1   0   0   0",
8432                           "  0   0   0   x      x   x   x   x",
8433                           "  x   x   x  a4     a3  a2  a1  a0",
8434                           "  i   i   i   i      i   i   i   i";
8435
8436         writepage       = "  0   1   0   0      1   1   0   0",
8437                           "  0   0   0   0    a11 a10  a9  a8",
8438                           " a7  a6  a5   x      x   x   x   x",
8439                           "  x   x   x   x      x   x   x   x";
8440
8441         mode            = 0x41;
8442         delay           = 6;
8443         blocksize       = 64;
8444         readsize        = 256;
8445       ;
8446
8447     memory "lfuse"
8448         size            = 1;
8449         min_write_delay = 4500;
8450         max_write_delay = 4500;
8451         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
8452                           "x x x x  x x x x   o o o o  o o o o";
8453
8454         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
8455                           "x x x x  x x x x   i i i i  i i i i";
8456       ;
8457
8458     memory "hfuse"
8459         size            = 1;
8460         min_write_delay = 4500;
8461         max_write_delay = 4500;
8462         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
8463                           "x x x x  x x x x   o o o o  o o o o";
8464
8465         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
8466                           "x x x x  x x x x   i i i i  i i i i";
8467       ;
8468
8469     memory "efuse"
8470         size            = 1;
8471         min_write_delay = 4500;
8472         max_write_delay = 4500;
8473         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
8474                           "x x x x  x x x x   x x x x  x o o o";
8475
8476         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
8477                           "x x x x  x x x x   x x x x  x i i i";
8478       ;
8479
8480     memory "lock"
8481         size            = 1;
8482         min_write_delay = 4500;
8483         max_write_delay = 4500;
8484         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
8485                           "x x x x  x x x x   x x o o  o o o o";
8486
8487         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
8488                           "x x x x  x x x x   1 1 i i  i i i i";
8489       ;
8490
8491     memory "calibration"
8492         size            = 1;
8493         read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
8494                           "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
8495       ;
8496
8497     memory "signature"
8498         size            = 3;
8499         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
8500                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
8501       ;
8502   ;
8503
8504 #------------------------------------------------------------
8505 # ATmega88P
8506 #------------------------------------------------------------
8507
8508 part
8509     id               = "m88p";
8510     desc             = "ATMEGA88P";
8511      has_debugwire = yes;
8512      flash_instr   = 0xB6, 0x01, 0x11;
8513      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
8514                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
8515                      0x99, 0xF9, 0xBB, 0xAF;
8516     stk500_devcode   = 0x73;
8517 #    avr910_devcode   = 0x;
8518     signature        = 0x1e 0x93 0x0f;
8519     pagel            = 0xd7;
8520     bs2              = 0xc2;
8521     chip_erase_delay = 9000;
8522     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
8523                        "x x x x  x x x x    x x x x  x x x x";
8524
8525     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
8526                        "x x x x  x x x x    x x x x  x x x x";
8527
8528     timeout             = 200;
8529     stabdelay           = 100;
8530     cmdexedelay         = 25;
8531     synchloops          = 32;
8532     bytedelay           = 0;
8533     pollindex           = 3;
8534     pollvalue           = 0x53;
8535     predelay            = 1;
8536     postdelay           = 1;
8537     pollmethod          = 1;
8538
8539     pp_controlstack     =
8540         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
8541         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
8542         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
8543         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8544     hventerstabdelay    = 100;
8545     progmodedelay       = 0;
8546     latchcycles         = 5;
8547     togglevtg           = 1;
8548     poweroffdelay       = 15;
8549     resetdelayms        = 1;
8550     resetdelayus        = 0;
8551     hvleavestabdelay    = 15;
8552     resetdelay          = 15;
8553     chiperasepulsewidth = 0;
8554     chiperasepolltimeout = 10;
8555     programfusepulsewidth = 0;
8556     programfusepolltimeout = 5;
8557     programlockpulsewidth = 0;
8558     programlockpolltimeout = 5;
8559
8560     memory "eeprom"
8561         paged           = no;
8562         page_size       = 4;
8563         size            = 512;
8564         min_write_delay = 3600;
8565         max_write_delay = 3600;
8566         readback_p1     = 0xff;
8567         readback_p2     = 0xff;
8568         read            = "  1   0   1   0      0   0   0   0",
8569                           "  0   0   0   x      x   x   x  a8",
8570                           " a7  a6  a5  a4     a3  a2  a1  a0",
8571                           "  o   o   o   o      o   o   o   o";
8572
8573         write           = "  1   1   0   0      0   0   0   0",
8574                           "  0   0   0   x      x   x   x  a8",
8575                           " a7  a6  a5  a4     a3  a2  a1  a0", 
8576                           "  i   i   i   i      i   i   i   i";
8577
8578         loadpage_lo     = "  1   1   0   0      0   0   0   1",
8579                           "  0   0   0   0      0   0   0   0",
8580                           "  0   0   0   0      0   0  a1  a0",
8581                           "  i   i   i   i      i   i   i   i";
8582
8583         writepage       = "  1   1   0   0      0   0   1   0",
8584                           "  0   0   x   x      x   x   x  a8",
8585                           " a7  a6  a5  a4     a3  a2   0   0",
8586                           "  x   x   x   x      x   x   x   x";
8587
8588         mode            = 0x41;
8589         delay           = 20;
8590         blocksize       = 4;
8591         readsize        = 256;
8592       ;
8593     memory "flash"
8594         paged           = yes;
8595         size            = 8192;
8596         page_size       = 64;
8597         num_pages       = 128;
8598         min_write_delay = 4500;
8599         max_write_delay = 4500;
8600         readback_p1     = 0xff;
8601         readback_p2     = 0xff;
8602         read_lo         = "  0   0   1   0    0   0   0   0",
8603                           "  0   0   0   0  a11 a10  a9  a8",
8604                           " a7  a6  a5  a4   a3  a2  a1  a0",
8605                           "  o   o   o   o    o   o   o   o";
8606
8607         read_hi         = "  0   0   1   0    1   0   0   0",
8608                           "  0   0   0   0  a11 a10  a9  a8",
8609                           " a7  a6  a5  a4   a3  a2  a1  a0",
8610                           "  o   o   o   o    o   o   o   o";
8611
8612         loadpage_lo     = "  0   1   0   0      0   0   0   0",
8613                           "  0   0   0   x      x   x   x   x",
8614                           "  x   x   x  a4     a3  a2  a1  a0",
8615                           "  i   i   i   i      i   i   i   i";
8616
8617         loadpage_hi     = "  0   1   0   0      1   0   0   0",
8618                           "  0   0   0   x      x   x   x   x",
8619                           "  x   x   x  a4     a3  a2  a1  a0",
8620                           "  i   i   i   i      i   i   i   i";
8621
8622         writepage       = "  0   1   0   0      1   1   0   0",
8623                           "  0   0   0   0    a11 a10  a9  a8",
8624                           " a7  a6  a5   x      x   x   x   x",
8625                           "  x   x   x   x      x   x   x   x";
8626
8627         mode            = 0x41;
8628         delay           = 6;
8629         blocksize       = 64;
8630         readsize        = 256;
8631       ;
8632
8633     memory "lfuse"
8634         size            = 1;
8635         min_write_delay = 4500;
8636         max_write_delay = 4500;
8637         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
8638                           "x x x x  x x x x   o o o o  o o o o";
8639
8640         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
8641                           "x x x x  x x x x   i i i i  i i i i";
8642       ;
8643
8644     memory "hfuse"
8645         size            = 1;
8646         min_write_delay = 4500;
8647         max_write_delay = 4500;
8648         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
8649                           "x x x x  x x x x   o o o o  o o o o";
8650
8651         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
8652                           "x x x x  x x x x   i i i i  i i i i";
8653       ;
8654
8655     memory "efuse"
8656         size            = 1;
8657         min_write_delay = 4500;
8658         max_write_delay = 4500;
8659         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
8660                           "x x x x  x x x x   x x x x  x o o o";
8661
8662         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
8663                           "x x x x  x x x x   x x x x  x i i i";
8664       ;
8665
8666     memory "lock"
8667         size            = 1;
8668         min_write_delay = 4500;
8669         max_write_delay = 4500;
8670         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
8671                           "x x x x  x x x x   x x o o  o o o o";
8672
8673         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
8674                           "x x x x  x x x x   1 1 i i  i i i i";
8675       ;
8676
8677     memory "calibration"
8678         size            = 1;
8679         read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
8680                           "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
8681       ;
8682
8683     memory "signature"
8684         size            = 3;
8685         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
8686                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
8687       ;
8688   ;
8689
8690
8691 #------------------------------------------------------------
8692 # ATmega168
8693 #------------------------------------------------------------
8694
8695 part
8696     id              = "m168";
8697     desc            = "ATMEGA168";
8698      has_debugwire = yes;
8699      flash_instr   = 0xB6, 0x01, 0x11;
8700      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
8701                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
8702                      0x99, 0xF9, 0xBB, 0xAF;
8703     stk500_devcode  = 0x86;
8704     # avr910_devcode = 0x;
8705     signature       = 0x1e 0x94 0x06;
8706     pagel           = 0xd7;
8707     bs2             = 0xc2;
8708     chip_erase_delay = 9000;
8709     pgm_enable       = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
8710                        "x x x x x x x x x x x x x x x x";
8711
8712     chip_erase       = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
8713                        "x x x x x x x x x x x x x x x x";
8714
8715     timeout         = 200;
8716     stabdelay       = 100;
8717     cmdexedelay     = 25;
8718     synchloops      = 32;
8719     bytedelay       = 0;
8720     pollindex       = 3;
8721     pollvalue       = 0x53;
8722     predelay        = 1;
8723     postdelay       = 1;
8724     pollmethod      = 1;
8725
8726     pp_controlstack     =
8727         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
8728         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
8729         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
8730         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8731     hventerstabdelay    = 100;
8732     progmodedelay       = 0;
8733     latchcycles         = 5;
8734     togglevtg           = 1;
8735     poweroffdelay       = 15;
8736     resetdelayms        = 1;
8737     resetdelayus        = 0;
8738     hvleavestabdelay    = 15;
8739     resetdelay          = 15;
8740     chiperasepulsewidth = 0;
8741     chiperasepolltimeout = 10;
8742     programfusepulsewidth = 0;
8743     programfusepolltimeout = 5;
8744     programlockpulsewidth = 0;
8745     programlockpolltimeout = 5;
8746
8747     memory "eeprom"
8748         paged           = no;
8749         page_size       = 4;
8750         size            = 512;
8751         min_write_delay = 3600;
8752         max_write_delay = 3600;
8753         readback_p1     = 0xff;
8754         readback_p2     = 0xff;
8755         read            = " 1 0 1 0 0 0 0 0",
8756                           " 0 0 0 x x x x a8",
8757                           " a7 a6 a5 a4 a3 a2 a1 a0",
8758                           " o o o o o o o o";
8759     
8760         write           = " 1 1 0 0 0 0 0 0",
8761                           " 0 0 0 x x x x a8",
8762                           " a7 a6 a5 a4 a3 a2 a1 a0",
8763                           " i i i i i i i i";
8764
8765         loadpage_lo     = "  1   1   0   0      0   0   0   1",
8766                           "  0   0   0   0      0   0   0   0",
8767                           "  0   0   0   0      0   0  a1  a0",
8768                           "  i   i   i   i      i   i   i   i";
8769
8770         writepage       = "  1   1   0   0      0   0   1   0",
8771                           "  0   0   x   x      x   x   x  a8",
8772                           " a7  a6  a5  a4     a3  a2   0   0",
8773                           "  x   x   x   x      x   x   x   x";
8774
8775         mode            = 0x41;
8776         delay           = 20;
8777         blocksize       = 4;
8778         readsize        = 256;
8779         ;
8780
8781     memory "flash"
8782         paged           = yes;
8783         size            = 16384;
8784         page_size       = 128;
8785         num_pages       = 128;
8786         min_write_delay = 4500;
8787         max_write_delay = 4500;
8788         readback_p1     = 0xff;
8789         readback_p2     = 0xff;
8790         read_lo         = " 0 0 1 0 0 0 0 0",
8791                           " 0 0 0 a12 a11 a10 a9 a8",
8792                           " a7 a6 a5 a4 a3 a2 a1 a0",
8793                           " o o o o o o o o";
8794         
8795         read_hi          = " 0 0 1 0 1 0 0 0",
8796                            " 0 0 0 a12 a11 a10 a9 a8",
8797                            " a7 a6 a5 a4 a3 a2 a1 a0",
8798                            " o o o o o o o o";
8799         
8800         loadpage_lo     = " 0 1 0 0 0 0 0 0",
8801                           " 0 0 0 x x x x x",
8802                           " x x a5 a4 a3 a2 a1 a0",
8803                           " i i i i i i i i";
8804         
8805         loadpage_hi     = " 0 1 0 0 1 0 0 0",
8806                           " 0 0 0 x x x x x",
8807                           " x x a5 a4 a3 a2 a1 a0",
8808                           " i i i i i i i i";
8809         
8810         writepage       = " 0 1 0 0 1 1 0 0",
8811                           " 0 0 0 a12 a11 a10 a9 a8",
8812                           " a7 a6 x x x x x x",
8813                           " x x x x x x x x";
8814
8815         mode        = 0x41;
8816         delay       = 6;
8817         blocksize   = 128;
8818         readsize    = 256;
8819
8820         ;
8821         
8822     memory "lfuse"
8823         size            = 1;
8824         min_write_delay = 4500;
8825         max_write_delay = 4500;
8826         read            = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
8827                           "x x x x x x x x o o o o o o o o";
8828         
8829         write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
8830                           "x x x x x x x x i i i i i i i i";
8831         ;
8832     
8833     memory "hfuse"
8834         size            = 1;
8835         min_write_delay = 4500;
8836         max_write_delay = 4500;
8837         read            = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
8838                           "x x x x x x x x o o o o o o o o";
8839         
8840         write           = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
8841                           "x x x x x x x x i i i i i i i i";
8842         ;
8843     
8844     memory "efuse"
8845         size            = 1;
8846         min_write_delay = 4500;
8847         max_write_delay = 4500;
8848         read            = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
8849                           "x x x x x x x x x x x x x o o o";
8850         
8851         write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
8852                           "x x x x x x x x x x x x x i i i";
8853         ;
8854     
8855     memory "lock"
8856         size            = 1;
8857         min_write_delay = 4500;
8858         max_write_delay = 4500;
8859         read            = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
8860                           "x x x x x x x x x x o o o o o o";
8861         
8862         write           = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
8863                           "x x x x x x x x 1 1 i i i i i i";
8864         ;
8865     
8866     memory "calibration"
8867         size            = 1;
8868         read            = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
8869                           "0 0 0 0 0 0 0 0 o o o o o o o o";
8870         ;
8871     
8872     memory "signature"
8873         size            = 3;
8874         read            = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
8875                           "x x x x x x a1 a0 o o o o o o o o";
8876         ;
8877 ;
8878
8879 #------------------------------------------------------------
8880 # ATmega168P
8881 #------------------------------------------------------------
8882
8883 part
8884     id              = "m168p";
8885     desc            = "ATMEGA168P";
8886      has_debugwire = yes;
8887      flash_instr   = 0xB6, 0x01, 0x11;
8888      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
8889                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
8890                      0x99, 0xF9, 0xBB, 0xAF;
8891     stk500_devcode  = 0x86;
8892     # avr910_devcode = 0x;
8893     signature       = 0x1e 0x94 0x0b;
8894     pagel           = 0xd7;
8895     bs2             = 0xc2;
8896     chip_erase_delay = 9000;
8897     pgm_enable       = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
8898                        "x x x x x x x x x x x x x x x x";
8899
8900     chip_erase       = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
8901                        "x x x x x x x x x x x x x x x x";
8902
8903     timeout         = 200;
8904     stabdelay       = 100;
8905     cmdexedelay     = 25;
8906     synchloops      = 32;
8907     bytedelay       = 0;
8908     pollindex       = 3;
8909     pollvalue       = 0x53;
8910     predelay        = 1;
8911     postdelay       = 1;
8912     pollmethod      = 1;
8913
8914     pp_controlstack     =
8915         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
8916         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
8917         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
8918         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
8919     hventerstabdelay    = 100;
8920     progmodedelay       = 0;
8921     latchcycles         = 5;
8922     togglevtg           = 1;
8923     poweroffdelay       = 15;
8924     resetdelayms        = 1;
8925     resetdelayus        = 0;
8926     hvleavestabdelay    = 15;
8927     resetdelay          = 15;
8928     chiperasepulsewidth = 0;
8929     chiperasepolltimeout = 10;
8930     programfusepulsewidth = 0;
8931     programfusepolltimeout = 5;
8932     programlockpulsewidth = 0;
8933     programlockpolltimeout = 5;
8934
8935     memory "eeprom"
8936         paged           = no;
8937         page_size       = 4;
8938         size            = 512;
8939         min_write_delay = 3600;
8940         max_write_delay = 3600;
8941         readback_p1     = 0xff;
8942         readback_p2     = 0xff;
8943         read            = " 1 0 1 0 0 0 0 0",
8944                           " 0 0 0 x x x x a8",
8945                           " a7 a6 a5 a4 a3 a2 a1 a0",
8946                           " o o o o o o o o";
8947     
8948         write           = " 1 1 0 0 0 0 0 0",
8949                           " 0 0 0 x x x x a8",
8950                           " a7 a6 a5 a4 a3 a2 a1 a0",
8951                           " i i i i i i i i";
8952
8953         loadpage_lo     = "  1   1   0   0      0   0   0   1",
8954                           "  0   0   0   0      0   0   0   0",
8955                           "  0   0   0   0      0   0  a1  a0",
8956                           "  i   i   i   i      i   i   i   i";
8957
8958         writepage       = "  1   1   0   0      0   0   1   0",
8959                           "  0   0   x   x      x   x   x  a8",
8960                           " a7  a6  a5  a4     a3  a2   0   0",
8961                           "  x   x   x   x      x   x   x   x";
8962
8963         mode            = 0x41;
8964         delay           = 20;
8965         blocksize       = 4;
8966         readsize        = 256;
8967         ;
8968
8969     memory "flash"
8970         paged           = yes;
8971         size            = 16384;
8972         page_size       = 128;
8973         num_pages       = 128;
8974         min_write_delay = 4500;
8975         max_write_delay = 4500;
8976         readback_p1     = 0xff;
8977         readback_p2     = 0xff;
8978         read_lo         = " 0 0 1 0 0 0 0 0",
8979                           " 0 0 0 a12 a11 a10 a9 a8",
8980                           " a7 a6 a5 a4 a3 a2 a1 a0",
8981                           " o o o o o o o o";
8982         
8983         read_hi          = " 0 0 1 0 1 0 0 0",
8984                            " 0 0 0 a12 a11 a10 a9 a8",
8985                            " a7 a6 a5 a4 a3 a2 a1 a0",
8986                            " o o o o o o o o";
8987         
8988         loadpage_lo     = " 0 1 0 0 0 0 0 0",
8989                           " 0 0 0 x x x x x",
8990                           " x x a5 a4 a3 a2 a1 a0",
8991                           " i i i i i i i i";
8992         
8993         loadpage_hi     = " 0 1 0 0 1 0 0 0",
8994                           " 0 0 0 x x x x x",
8995                           " x x a5 a4 a3 a2 a1 a0",
8996                           " i i i i i i i i";
8997         
8998         writepage       = " 0 1 0 0 1 1 0 0",
8999                           " 0 0 0 a12 a11 a10 a9 a8",
9000                           " a7 a6 x x x x x x",
9001                           " x x x x x x x x";
9002
9003         mode        = 0x41;
9004         delay       = 6;
9005         blocksize   = 128;
9006         readsize    = 256;
9007
9008         ;
9009         
9010     memory "lfuse"
9011         size            = 1;
9012         min_write_delay = 4500;
9013         max_write_delay = 4500;
9014         read            = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
9015                           "x x x x x x x x o o o o o o o o";
9016         
9017         write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
9018                           "x x x x x x x x i i i i i i i i";
9019         ;
9020     
9021     memory "hfuse"
9022         size            = 1;
9023         min_write_delay = 4500;
9024         max_write_delay = 4500;
9025         read            = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
9026                           "x x x x x x x x o o o o o o o o";
9027         
9028         write           = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
9029                           "x x x x x x x x i i i i i i i i";
9030         ;
9031     
9032     memory "efuse"
9033         size            = 1;
9034         min_write_delay = 4500;
9035         max_write_delay = 4500;
9036         read            = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
9037                           "x x x x x x x x x x x x x o o o";
9038         
9039         write           = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
9040                           "x x x x x x x x x x x x x i i i";
9041         ;
9042     
9043     memory "lock"
9044         size            = 1;
9045         min_write_delay = 4500;
9046         max_write_delay = 4500;
9047         read            = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
9048                           "x x x x x x x x x x o o o o o o";
9049         
9050         write           = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
9051                           "x x x x x x x x 1 1 i i i i i i";
9052         ;
9053     
9054     memory "calibration"
9055         size            = 1;
9056         read            = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
9057                           "0 0 0 0 0 0 0 0 o o o o o o o o";
9058         ;
9059     
9060     memory "signature"
9061         size            = 3;
9062         read            = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
9063                           "x x x x x x a1 a0 o o o o o o o o";
9064         ;
9065 ;
9066
9067 #------------------------------------------------------------
9068 # ATtiny88
9069 #------------------------------------------------------------
9070
9071 part
9072     id               = "t88";
9073     desc             = "attiny88";
9074      has_debugwire = yes;
9075      flash_instr   = 0xB6, 0x01, 0x11;
9076      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
9077                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
9078                      0x99, 0xF9, 0xBB, 0xAF;
9079     stk500_devcode   = 0x73;
9080 #    avr910_devcode   = 0x;
9081     signature        = 0x1e 0x93 0x11;
9082     pagel            = 0xd7;
9083     bs2              = 0xc2;
9084     chip_erase_delay = 9000;
9085     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9086                        "x x x x  x x x x    x x x x  x x x x";
9087
9088     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
9089                        "x x x x  x x x x    x x x x  x x x x";
9090
9091     timeout             = 200;
9092     stabdelay           = 100;
9093     cmdexedelay         = 25;
9094     synchloops          = 32;
9095     bytedelay           = 0;
9096     pollindex           = 3;
9097     pollvalue           = 0x53;
9098     predelay            = 1;
9099     postdelay           = 1;
9100     pollmethod          = 1;
9101
9102     pp_controlstack     =
9103         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
9104         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
9105         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
9106         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
9107     hventerstabdelay    = 100;
9108     progmodedelay       = 0;
9109     latchcycles         = 5;
9110     togglevtg           = 1;
9111     poweroffdelay       = 15;
9112     resetdelayms        = 1;
9113     resetdelayus        = 0;
9114     hvleavestabdelay    = 15;
9115     resetdelay          = 15;
9116     chiperasepulsewidth = 0;
9117     chiperasepolltimeout = 10;
9118     programfusepulsewidth = 0;
9119     programfusepolltimeout = 5;
9120     programlockpulsewidth = 0;
9121     programlockpolltimeout = 5;
9122
9123     memory "eeprom"
9124         paged           = no;
9125         page_size       = 4;
9126         size            = 64;
9127         min_write_delay = 3600;
9128         max_write_delay = 3600;
9129         readback_p1     = 0xff;
9130         readback_p2     = 0xff;
9131         read            = "  1   0   1   0      0   0   0   0",
9132                           "  0   0   0   x      x   x   x   x",
9133                           "  x  a6  a5  a4     a3  a2  a1  a0",
9134                           "  o   o   o   o      o   o   o   o";
9135
9136         write           = "  1   1   0   0      0   0   0   0",
9137                           "  0   0   0   x      x   x   x   x",
9138                           "  x  a6  a5  a4     a3  a2  a1  a0",
9139                           "  i   i   i   i      i   i   i   i";
9140
9141         loadpage_lo     = "  1   1   0   0      0   0   0   1",
9142                           "  0   0   0   0      0   0   0   0",
9143                           "  0   0   0   0      0   0  a1  a0",
9144                           "  i   i   i   i      i   i   i   i";
9145
9146         writepage       = "  1   1   0   0      0   0   1   0",
9147                           "  0   0   x   x      x   x   x   x",
9148                           "  x  a6  a5  a4     a3  a2   0   0",
9149                           "  x   x   x   x      x   x   x   x";
9150
9151         mode            = 0x41;
9152         delay           = 20;
9153         blocksize       = 4;
9154         readsize        = 64;
9155       ;
9156     memory "flash"
9157         paged           = yes;
9158         size            = 8192;
9159         page_size       = 64;
9160         num_pages       = 128;
9161         min_write_delay = 4500;
9162         max_write_delay = 4500;
9163         readback_p1     = 0xff;
9164         readback_p2     = 0xff;
9165         read_lo         = "  0   0   1   0    0   0   0   0",
9166                           "  0   0   0   0  a11 a10  a9  a8",
9167                           " a7  a6  a5  a4   a3  a2  a1  a0",
9168                           "  o   o   o   o    o   o   o   o";
9169
9170         read_hi         = "  0   0   1   0    1   0   0   0",
9171                           "  0   0   0   0  a11 a10  a9  a8",
9172                           " a7  a6  a5  a4   a3  a2  a1  a0",
9173                           "  o   o   o   o    o   o   o   o";
9174
9175         loadpage_lo     = "  0   1   0   0      0   0   0   0",
9176                           "  0   0   0   x      x   x   x   x",
9177                           "  x   x   x  a4     a3  a2  a1  a0",
9178                           "  i   i   i   i      i   i   i   i";
9179
9180         loadpage_hi     = "  0   1   0   0      1   0   0   0",
9181                           "  0   0   0   x      x   x   x   x",
9182                           "  x   x   x  a4     a3  a2  a1  a0",
9183                           "  i   i   i   i      i   i   i   i";
9184
9185         writepage       = "  0   1   0   0      1   1   0   0",
9186                           "  0   0   0   0    a11 a10  a9  a8",
9187                           " a7  a6  a5   x      x   x   x   x",
9188                           "  x   x   x   x      x   x   x   x";
9189
9190         mode            = 0x41;
9191         delay           = 6;
9192         blocksize       = 64;
9193         readsize        = 256;
9194       ;
9195
9196     memory "lfuse"
9197         size            = 1;
9198         min_write_delay = 4500;
9199         max_write_delay = 4500;
9200         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
9201                           "x x x x  x x x x   o o o o  o o o o";
9202
9203         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
9204                           "x x x x  x x x x   i i i i  i i i i";
9205       ;
9206
9207     memory "hfuse"
9208         size            = 1;
9209         min_write_delay = 4500;
9210         max_write_delay = 4500;
9211         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
9212                           "x x x x  x x x x   o o o o  o o o o";
9213
9214         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
9215                           "x x x x  x x x x   i i i i  i i i i";
9216       ;
9217
9218     memory "efuse"
9219         size            = 1;
9220         min_write_delay = 4500;
9221         max_write_delay = 4500;
9222         read            = "0 1 0 1  0 0 0 0   0 0 0 0  1 0 0 0",
9223                           "x x x x  x x x x   x x x x  x o o o";
9224
9225         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 1 0 0",
9226                           "x x x x  x x x x   x x x x  x x x i";
9227       ;
9228
9229     memory "lock"
9230         size            = 1;
9231         min_write_delay = 4500;
9232         max_write_delay = 4500;
9233         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
9234                           "x x x x  x x x x   x x o o  o o o o";
9235
9236         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
9237                           "x x x x  x x x x   1 1 i i  i i i i";
9238       ;
9239
9240     memory "calibration"
9241         size            = 1;
9242         read            = "0  0  1  1   1  0  0  0   0  0  0  x   x  x  x  x",
9243                           "0  0  0  0   0  0  0  0   o  o  o  o   o  o  o  o";
9244       ;
9245
9246     memory "signature"
9247         size            = 3;
9248         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
9249                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9250       ;
9251   ;
9252
9253 #------------------------------------------------------------
9254 # ATmega328P
9255 #------------------------------------------------------------
9256
9257 part
9258     id                  = "m328p";
9259     desc                = "ATMEGA328P";
9260     has_debugwire       = yes;
9261     flash_instr         = 0xB6, 0x01, 0x11;
9262     eeprom_instr        = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
9263                           0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
9264                           0x99, 0xF9, 0xBB, 0xAF;
9265     stk500_devcode      = 0x86;
9266     # avr910_devcode    = 0x;
9267     signature           = 0x1e 0x95 0x0F;
9268     pagel               = 0xd7;
9269     bs2                 = 0xc2;
9270     chip_erase_delay    = 9000;
9271     pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
9272                  "x x x x x x x x x x x x x x x x";
9273
9274     chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
9275                  "x x x x x x x x x x x x x x x x";
9276
9277     timeout     = 200;
9278     stabdelay   = 100;
9279     cmdexedelay = 25;
9280     synchloops  = 32;
9281     bytedelay   = 0;
9282     pollindex   = 3;
9283     pollvalue   = 0x53;
9284     predelay    = 1;
9285     postdelay   = 1;
9286     pollmethod  = 1;
9287
9288     pp_controlstack =
9289         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
9290         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
9291         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
9292         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
9293     hventerstabdelay    = 100;
9294     progmodedelay       = 0;
9295     latchcycles         = 5;
9296     togglevtg           = 1;
9297     poweroffdelay       = 15;
9298     resetdelayms        = 1;
9299     resetdelayus        = 0;
9300     hvleavestabdelay    = 15;
9301     resetdelay          = 15;
9302     chiperasepulsewidth = 0;
9303     chiperasepolltimeout = 10;
9304     programfusepulsewidth = 0;
9305     programfusepolltimeout = 5;
9306     programlockpulsewidth = 0;
9307     programlockpolltimeout = 5;
9308
9309     memory "eeprom"
9310         paged           = no;
9311         page_size       = 4;
9312         size            = 1024;
9313         min_write_delay = 3600;
9314         max_write_delay = 3600;
9315         readback_p1     = 0xff;
9316         readback_p2     = 0xff;
9317         read = " 1 0 1 0 0 0 0 0",
9318                " 0 0 0 x x x a9 a8",
9319                " a7 a6 a5 a4 a3 a2 a1 a0",
9320                " o o o o o o o o";
9321
9322         write = " 1 1 0 0 0 0 0 0",
9323                 " 0 0 0 x x x a9 a8",
9324                 " a7 a6 a5 a4 a3 a2 a1 a0",
9325                 " i i i i i i i i";
9326
9327         loadpage_lo = " 1 1 0 0 0 0 0 1",
9328                       " 0 0 0 0 0 0 0 0",
9329                       " 0 0 0 0 0 0 a1 a0",
9330                       " i i i i i i i i";
9331
9332         writepage = " 1 1 0 0 0 0 1 0",
9333                     " 0 0 x x x x a9 a8",
9334                     " a7 a6 a5 a4 a3 a2 0 0",
9335                     " x x x x x x x x";
9336
9337         mode            = 0x41;
9338         delay           = 20;
9339         blocksize       = 4;
9340         readsize        = 256;
9341     ;
9342
9343     memory "flash"
9344         paged           = yes;
9345         size            = 32768;
9346         page_size       = 128;
9347         num_pages       = 256;
9348         min_write_delay = 4500;
9349         max_write_delay = 4500;
9350         readback_p1     = 0xff;
9351         readback_p2     = 0xff;
9352         read_lo = " 0 0 1 0 0 0 0 0",
9353                   " 0 0 a13 a12 a11 a10 a9 a8",
9354                   " a7 a6 a5 a4 a3 a2 a1 a0",
9355                   " o o o o o o o o";
9356
9357         read_hi = " 0 0 1 0 1 0 0 0",
9358                   " 0 0 a13 a12 a11 a10 a9 a8",
9359                   " a7 a6 a5 a4 a3 a2 a1 a0",
9360                   " o o o o o o o o";
9361
9362         loadpage_lo = " 0 1 0 0 0 0 0 0",
9363                       " 0 0 0 x x x x x",
9364                       " x x a5 a4 a3 a2 a1 a0",
9365                       " i i i i i i i i";
9366
9367         loadpage_hi = " 0 1 0 0 1 0 0 0",
9368                       " 0 0 0 x x x x x",
9369                       " x x a5 a4 a3 a2 a1 a0",
9370                       " i i i i i i i i";
9371
9372         writepage = " 0 1 0 0 1 1 0 0",
9373                     " 0 0 a13 a12 a11 a10 a9 a8",
9374                     " a7 a6 x x x x x x",
9375                     " x x x x x x x x";
9376
9377         mode            = 0x41;
9378         delay           = 6;
9379         blocksize       = 128;
9380         readsize        = 256;
9381
9382     ;
9383
9384     memory "lfuse"
9385         size = 1;
9386         min_write_delay = 4500;
9387         max_write_delay = 4500;
9388         read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
9389                "x x x x x x x x o o o o o o o o";
9390
9391         write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
9392                 "x x x x x x x x i i i i i i i i";
9393     ;
9394
9395     memory "hfuse"
9396         size = 1;
9397         min_write_delay = 4500;
9398         max_write_delay = 4500;
9399         read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
9400                "x x x x x x x x o o o o o o o o";
9401
9402         write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
9403                 "x x x x x x x x i i i i i i i i";
9404     ;
9405
9406     memory "efuse"
9407         size = 1;
9408         min_write_delay = 4500;
9409         max_write_delay = 4500;
9410         read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
9411                "x x x x x x x x x x x x x o o o";
9412
9413         write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
9414                 "x x x x x x x x x x x x x i i i";
9415     ;
9416
9417     memory "lock"
9418         size = 1;
9419         min_write_delay = 4500;
9420         max_write_delay = 4500;
9421         read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
9422                "x x x x x x x x x x o o o o o o";
9423
9424         write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
9425                 "x x x x x x x x 1 1 i i i i i i";
9426     ;
9427
9428     memory "calibration"
9429         size = 1;
9430         read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
9431                "0 0 0 0 0 0 0 0 o o o o o o o o";
9432     ;
9433
9434     memory "signature"
9435         size = 3;
9436         read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
9437                "x x x x x x a1 a0 o o o o o o o o";
9438     ;
9439 ;
9440
9441 #------------------------------------------------------------
9442 # ATtiny2313
9443 #------------------------------------------------------------
9444
9445 part
9446      id            = "t2313";
9447      desc          = "ATtiny2313";
9448      has_debugwire = yes;
9449      flash_instr   = 0xB2, 0x0F, 0x1F;
9450      eeprom_instr  = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
9451                      0xBA, 0x0F, 0xB2, 0x0F, 0xBA, 0x0D, 0xBB, 0xBC,
9452                      0x99, 0xE1, 0xBB, 0xAC;
9453      stk500_devcode   = 0x23;
9454 ##   Use the ATtiny26 devcode:
9455      avr910_devcode   = 0x5e;
9456      signature        = 0x1e 0x91 0x0a;
9457      pagel            = 0xD4;
9458      bs2              = 0xD6;
9459      reset            = io;
9460      chip_erase_delay = 9000;
9461
9462      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9463                         "x x x x  x x x x    x x x x  x x x x";
9464
9465      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
9466                         "x x x x  x x x x    x x x x  x x x x";
9467
9468     timeout             = 200;
9469     stabdelay           = 100;
9470     cmdexedelay         = 25;
9471     synchloops          = 32;
9472     bytedelay           = 0;
9473     pollindex           = 3;
9474     pollvalue           = 0x53;
9475     predelay            = 1;
9476     postdelay           = 1;
9477     pollmethod          = 1;
9478
9479     pp_controlstack     =
9480         0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E,
9481         0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E,
9482         0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A,
9483         0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
9484     hventerstabdelay    = 100;
9485     progmodedelay       = 0;
9486     latchcycles         = 5;
9487     togglevtg           = 1;
9488     poweroffdelay       = 15;
9489     resetdelayms        = 1;
9490     resetdelayus        = 0;
9491     hvleavestabdelay    = 15;
9492     chiperasepulsewidth = 0;
9493     chiperasepolltimeout = 10;
9494     programfusepulsewidth = 0;
9495     programfusepolltimeout = 5;
9496     programlockpulsewidth = 0;
9497     programlockpolltimeout = 5;
9498
9499      memory "eeprom"
9500          size            = 128;
9501         paged           = no;
9502         page_size       = 4;
9503          min_write_delay = 4000;
9504          max_write_delay = 4500;
9505          readback_p1     = 0xff;
9506          readback_p2     = 0xff;
9507          read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x x",
9508                            "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
9509
9510          write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x x",
9511                            "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
9512
9513         loadpage_lo     = "  1   1   0   0      0   0   0   1",
9514                           "  0   0   0   0      0   0   0   0",
9515                           "  0   0   0   0      0   0  a1  a0",
9516                           "  i   i   i   i      i   i   i   i";
9517
9518         writepage       = "  1   1   0   0      0   0   1   0",
9519                           "  0   0   x   x      x   x   x   x",
9520                           "  x  a6  a5  a4     a3  a2   0   0",
9521                           "  x   x   x   x      x   x   x   x";
9522
9523         mode            = 0x41;
9524         delay           = 6;
9525         blocksize       = 4;
9526         readsize        = 256;
9527        ;
9528      memory "flash"
9529          paged           = yes;
9530          size            = 2048;
9531          page_size       = 32;
9532          num_pages       = 64;
9533          min_write_delay = 4500;
9534          max_write_delay = 4500;
9535          readback_p1     = 0xff;
9536          readback_p2     = 0xff;
9537          read_lo         = "  0   0   1   0    0   0   0   0",
9538                            "  0   0   0   0    0   0  a9  a8",
9539                            " a7  a6  a5  a4   a3  a2  a1  a0",
9540                            "  o   o   o   o    o   o   o   o";
9541
9542          read_hi         = "  0   0   1   0    1   0   0   0",
9543                            "  0   0   0   0    0   0  a9  a8",
9544                            " a7  a6  a5  a4   a3  a2  a1  a0",
9545                            "  o   o   o   o    o   o   o   o";
9546
9547 # The information in the data sheet of April/2004 is wrong, this works:
9548          loadpage_lo     = "  0   1   0   0    0   0   0   0",
9549                            "  0   0   0   x    x   x   x   x",
9550                            "  x   x   x   x   a3  a2  a1  a0",
9551                            "  i   i   i   i    i   i   i   i";
9552
9553 # The information in the data sheet of April/2004 is wrong, this works:
9554          loadpage_hi     = "  0   1   0   0    1   0   0   0",
9555                            "  0   0   0   x    x   x   x   x",
9556                            "  x   x   x   x   a3  a2  a1  a0",
9557                            "  i   i   i   i    i   i   i   i";
9558
9559 # The information in the data sheet of April/2004 is wrong, this works:
9560          writepage       = "  0  1  0  0   1  1  0  0",
9561                            "  0  0  0  0   0  0 a9 a8",
9562                            " a7 a6 a5 a4   x  x  x  x",
9563                            "  x  x  x  x   x  x  x  x";
9564
9565         mode            = 0x41;
9566         delay           = 6;
9567         blocksize       = 32;
9568         readsize        = 256;
9569        ;
9570 #   ATtiny2313 has Signature Bytes: 0x1E 0x91 0x0A.
9571      memory "signature"
9572          size            = 3;
9573          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
9574                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9575        ;
9576      memory "lock"
9577          size            = 1;
9578          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9579                            "x x x x  x x x x  1 1 i i  i i i i";
9580          read           = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9581                           "x x x x  x x x x  x x o o  o o o o";
9582         min_write_delay = 9000;
9583         max_write_delay = 9000;
9584        ;
9585
9586      memory "lfuse"
9587          size            = 1;
9588          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9589                            "x x x x  x x x x  i i i i  i i i i";
9590
9591          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9592                            "x x x x  x x x x  o o o o  o o o o";
9593         min_write_delay = 9000;
9594         max_write_delay = 9000;
9595        ;
9596
9597      memory "hfuse"
9598          size            = 1;
9599          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9600                            "x x x x  x x x x  i i i i  i i i i";
9601
9602          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9603                            "x x x x  x x x x  o o o o  o o o o";
9604         min_write_delay = 9000;
9605         max_write_delay = 9000;
9606        ;
9607
9608      memory "efuse"
9609          size            = 1;
9610          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9611                            "x x x x  x x x x  x x x x  x x x i";
9612
9613          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9614                            "x x x x  x x x x  o o o o  o o o o";
9615         min_write_delay = 9000;
9616         max_write_delay = 9000;
9617      ;
9618 # The Tiny2313 has calibration data for both 4 MHz and 8 MHz.
9619 # The information in the data sheet of April/2004 is wrong, this works:
9620
9621      memory "calibration"
9622          size            = 2;
9623          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9624                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
9625      ;
9626   ;
9627
9628 #------------------------------------------------------------
9629 # ATtiny4313
9630 #------------------------------------------------------------
9631
9632 part
9633      id            = "t4313";
9634      desc          = "ATtiny4313";
9635      has_debugwire = yes;
9636      flash_instr   = 0xB2, 0x0F, 0x1F;
9637      eeprom_instr  = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
9638                      0xBA, 0x0F, 0xB2, 0x0F, 0xBA, 0x0D, 0xBB, 0xBC,
9639                      0x99, 0xE1, 0xBB, 0xAC;
9640      stk500_devcode   = 0x23;
9641 ##   Use the ATtiny26 devcode:
9642      avr910_devcode   = 0x5e;
9643      signature        = 0x1e 0x92 0x0d;
9644      pagel            = 0xD4;
9645      bs2              = 0xD6;
9646      reset            = io;
9647      chip_erase_delay = 9000;
9648
9649      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9650                         "x x x x  x x x x    x x x x  x x x x";
9651
9652      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
9653                         "x x x x  x x x x    x x x x  x x x x";
9654
9655     timeout             = 200;
9656     stabdelay           = 100;
9657     cmdexedelay         = 25;
9658     synchloops          = 32;
9659     bytedelay           = 0;
9660     pollindex           = 3;
9661     pollvalue           = 0x53;
9662     predelay            = 1;
9663     postdelay           = 1;
9664     pollmethod          = 1;
9665
9666     pp_controlstack     =
9667         0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E,
9668         0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E,
9669         0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A,
9670         0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
9671     hventerstabdelay    = 100;
9672     progmodedelay       = 0;
9673     latchcycles         = 5;
9674     togglevtg           = 1;
9675     poweroffdelay       = 15;
9676     resetdelayms        = 1;
9677     resetdelayus        = 0;
9678     hvleavestabdelay    = 15;
9679     chiperasepulsewidth = 0;
9680     chiperasepolltimeout = 10;
9681     programfusepulsewidth = 0;
9682     programfusepolltimeout = 5;
9683     programlockpulsewidth = 0;
9684     programlockpolltimeout = 5;
9685
9686      memory "eeprom"
9687          size            = 256;
9688         paged           = no;
9689         page_size       = 4;
9690          min_write_delay = 4000;
9691          max_write_delay = 4500;
9692          readback_p1     = 0xff;
9693          readback_p2     = 0xff;
9694          read            = "1   0  1  0   0  0  0  0   0 0 0 x  x x x x",
9695                            "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
9696
9697          write           = "1   1  0  0   0  0  0  0   0 0 0 x  x x x x",
9698                            "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
9699
9700         loadpage_lo     = "  1   1   0   0      0   0   0   1",
9701                           "  0   0   0   0      0   0   0   0",
9702                           "  0   0   0   0      0   0  a1  a0",
9703                           "  i   i   i   i      i   i   i   i";
9704
9705         writepage       = "  1   1   0   0      0   0   1   0",
9706                           "  0   0   x   x      x   x   x   x",
9707                           " a7  a6  a5  a4     a3  a2   0   0",
9708                           "  x   x   x   x      x   x   x   x";
9709
9710         mode            = 0x41;
9711         delay           = 6;
9712         blocksize       = 4;
9713         readsize        = 256;
9714        ;
9715      memory "flash"
9716          paged           = yes;
9717          size            = 4096;
9718          page_size       = 64;
9719          num_pages       = 64;
9720          min_write_delay = 4500;
9721          max_write_delay = 4500;
9722          readback_p1     = 0xff;
9723          readback_p2     = 0xff;
9724          read_lo         = "  0   0   1   0    0   0   0   0",
9725                            "  0   0   0   0    0 a10  a9  a8",
9726                            " a7  a6  a5  a4   a3  a2  a1  a0",
9727                            "  o   o   o   o    o   o   o   o";
9728
9729          read_hi         = "  0   0   1   0    1   0   0   0",
9730                            "  0   0   0   0    0 a10  a9  a8",
9731                            " a7  a6  a5  a4   a3  a2  a1  a0",
9732                            "  o   o   o   o    o   o   o   o";
9733
9734          loadpage_lo     = "  0   1   0   0    0   0   0   0",
9735                            "  0   0   0   x    x   x   x   x",
9736                            "  x   x   x  a4   a3  a2  a1  a0",
9737                            "  i   i   i   i    i   i   i   i";
9738
9739          loadpage_hi     = "  0   1   0   0    1   0   0   0",
9740                            "  0   0   0   x    x   x   x   x",
9741                            "  x   x   x  a4   a3  a2  a1  a0",
9742                            "  i   i   i   i    i   i   i   i";
9743
9744          writepage       = "  0  1  0  0   1   1  0  0",
9745                            "  0  0  0  0   0 a10 a9 a8",
9746                            " a7 a6 a5  x   x   x  x  x",
9747                            "  x  x  x  x   x   x  x  x";
9748
9749         mode            = 0x41;
9750         delay           = 6;
9751         blocksize       = 32;
9752         readsize        = 256;
9753        ;
9754 #   ATtiny4313 has Signature Bytes: 0x1E 0x92 0x0D.
9755      memory "signature"
9756          size            = 3;
9757          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
9758                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9759        ;
9760      memory "lock"
9761          size            = 1;
9762          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9763                            "x x x x  x x x x  1 1 i i  i i i i";
9764          read           = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9765                           "x x x x  x x x x  x x o o  o o o o";
9766         min_write_delay = 9000;
9767         max_write_delay = 9000;
9768        ;
9769
9770      memory "lfuse"
9771          size            = 1;
9772          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9773                            "x x x x  x x x x  i i i i  i i i i";
9774
9775          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9776                            "x x x x  x x x x  o o o o  o o o o";
9777         min_write_delay = 9000;
9778         max_write_delay = 9000;
9779        ;
9780
9781      memory "hfuse"
9782          size            = 1;
9783          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9784                            "x x x x  x x x x  i i i i  i i i i";
9785
9786          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9787                            "x x x x  x x x x  o o o o  o o o o";
9788         min_write_delay = 9000;
9789         max_write_delay = 9000;
9790        ;
9791
9792      memory "efuse"
9793          size            = 1;
9794          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9795                            "x x x x  x x x x  x x x x  x x x i";
9796
9797          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9798                            "x x x x  x x x x  o o o o  o o o o";
9799         min_write_delay = 9000;
9800         max_write_delay = 9000;
9801      ;
9802
9803      memory "calibration"
9804          size            = 2;
9805          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9806                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
9807      ;
9808   ;
9809
9810 #------------------------------------------------------------
9811 # AT90PWM2
9812 #------------------------------------------------------------
9813
9814 part
9815      id            = "pwm2";
9816      desc          = "AT90PWM2";
9817      has_debugwire = yes;
9818      flash_instr   = 0xB6, 0x01, 0x11;
9819      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
9820                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
9821                      0x99, 0xF9, 0xBB, 0xAF;
9822      stk500_devcode   = 0x65;
9823 ##  avr910_devcode   = ?;
9824      signature        = 0x1e 0x93 0x81;
9825      pagel            = 0xD8;
9826      bs2              = 0xE2;
9827      reset            = io;
9828      chip_erase_delay = 9000;
9829
9830      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
9831                         "x x x x  x x x x    x x x x  x x x x";
9832
9833      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
9834                         "x x x x  x x x x    x x x x  x x x x";
9835
9836     timeout             = 200;
9837     stabdelay           = 100;
9838     cmdexedelay         = 25;
9839     synchloops          = 32;
9840     bytedelay           = 0;
9841     pollindex           = 3;
9842     pollvalue           = 0x53;
9843     predelay            = 1;
9844     postdelay           = 1;
9845     pollmethod          = 1;
9846
9847     pp_controlstack     =
9848         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
9849         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
9850         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
9851         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
9852     hventerstabdelay    = 100;
9853     progmodedelay       = 0;
9854     latchcycles         = 5;
9855     togglevtg           = 1;
9856     poweroffdelay       = 15;
9857     resetdelayms        = 1;
9858     resetdelayus        = 0;
9859     hvleavestabdelay    = 15;
9860     chiperasepulsewidth = 0;
9861     chiperasepolltimeout = 10;
9862     programfusepulsewidth = 0;
9863     programfusepolltimeout = 5;
9864     programlockpulsewidth = 0;
9865     programlockpolltimeout = 5;
9866
9867      memory "eeprom"
9868          size            = 512;
9869         paged           = no;
9870         page_size       = 4;
9871          min_write_delay = 4000;
9872          max_write_delay = 4500;
9873          readback_p1     = 0xff;
9874          readback_p2     = 0xff;
9875          read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x a8",
9876                            "a7 a6 a5 a4  a3 a2 a1 a0  o o o o  o o o o";
9877
9878          write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x a8",
9879                            "a7 a6 a5 a4  a3 a2 a1 a0  i i i i  i i i i";
9880
9881         loadpage_lo     = "  1   1   0   0      0   0   0   1",
9882                           "  0   0   0   0      0   0   0   0",
9883                           "  0   0   0   0      0   0  a1  a0",
9884                           "  i   i   i   i      i   i   i   i";
9885
9886         writepage       = "  1   1   0   0      0   0   1   0",
9887                           "  0   0   x   x      x   x   x   x",
9888                           " a7  a6  a5  a4     a3  a2   0   0",
9889                           "  x   x   x   x      x   x   x   x";
9890
9891         mode            = 0x41;
9892         delay           = 6;
9893         blocksize       = 4;
9894         readsize        = 256;
9895        ;
9896      memory "flash"
9897          paged           = yes;
9898          size            = 8192;
9899          page_size       = 64;
9900          num_pages       = 128;
9901          min_write_delay = 4500;
9902          max_write_delay = 4500;
9903          readback_p1     = 0xff;
9904          readback_p2     = 0xff;
9905          read_lo         = "  0   0   1   0    0   0   0   0",
9906                            "  0   0   0   0   a11 a10 a9  a8",
9907                            " a7  a6  a5  a4   a3  a2  a1  a0",
9908                            "  o   o   o   o    o   o   o   o";
9909
9910          read_hi         = "  0   0   1   0    1   0   0   0",
9911                            "  0   0   0   0   a11 a10 a9  a8",
9912                            " a7  a6  a5  a4   a3  a2  a1  a0",
9913                            "  o   o   o   o    o   o   o   o";
9914
9915          loadpage_lo     = "  0   1   0   0    0   0   0   0",
9916                            "  0   0   0   x    x   x   x   x",
9917                            "  x   x   x  a4   a3  a2  a1  a0",
9918                            "  i   i   i   i    i   i   i   i";
9919
9920          loadpage_hi     = "  0   1   0   0    1   0   0   0",
9921                            "  0   0   0   x    x   x   x   x",
9922                            "  x   x   x  a4   a3  a2  a1  a0",
9923                            "  i   i   i   i    i   i   i   i";
9924
9925          writepage       = "  0  1  0  0   1   1   0   0",
9926                            "  0  0  0  0   a11 a10 a9  a8",
9927                            " a7 a6 a5  x   x   x   x   x",
9928                            "  x  x  x  x   x   x   x   x";
9929
9930         mode            = 0x41;
9931         delay           = 6;
9932         blocksize       = 64;
9933         readsize        = 256;
9934        ;
9935 #   AT90PWM2 has Signature Bytes: 0x1E 0x93 0x81.
9936      memory "signature"
9937          size            = 3;
9938          read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
9939                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
9940        ;
9941      memory "lock"
9942          size            = 1;
9943          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
9944                            "x x x x  x x x x  1 1 i i  i i i i";
9945
9946          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
9947                            "x x x x  x x x x  x x o o  o o o o";
9948         min_write_delay = 9000;
9949         max_write_delay = 9000;
9950        ;
9951
9952      memory "lfuse"
9953          size            = 1;
9954          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
9955                            "x x x x  x x x x  i i i i  i i i i";
9956
9957          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
9958                            "x x x x  x x x x  o o o o  o o o o";
9959         min_write_delay = 9000;
9960         max_write_delay = 9000;
9961        ;
9962
9963      memory "hfuse"
9964          size            = 1;
9965          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
9966                            "x x x x  x x x x  i i i i  i i i i";
9967
9968          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
9969                            "x x x x  x x x x  o o o o  o o o o";
9970         min_write_delay = 9000;
9971         max_write_delay = 9000;
9972        ;
9973
9974      memory "efuse"
9975          size            = 1;
9976          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
9977                            "x x x x  x x x x  x x x x  x x x i";
9978
9979          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
9980                            "x x x x  x x x x  o o o o  o o o o";
9981         min_write_delay = 9000;
9982         max_write_delay = 9000;
9983      ;
9984
9985      memory "calibration"
9986          size            = 1;
9987          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
9988                            "0  0  0  0   0  0  0  0    o o o o  o o o o";
9989      ;
9990   ;
9991
9992 #------------------------------------------------------------
9993 # AT90PWM3
9994 #------------------------------------------------------------
9995
9996 # Completely identical to AT90PWM2 (including the signature!)
9997
9998 part
9999      id            = "pwm3";
10000      desc          = "AT90PWM3";
10001      has_debugwire = yes;
10002      flash_instr   = 0xB6, 0x01, 0x11;
10003      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
10004                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
10005                      0x99, 0xF9, 0xBB, 0xAF;
10006      stk500_devcode   = 0x65;
10007 ##  avr910_devcode   = ?;
10008      signature        = 0x1e 0x93 0x81;
10009      pagel            = 0xD8;
10010      bs2              = 0xE2;
10011      reset            = io;
10012      chip_erase_delay = 9000;
10013
10014      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10015                         "x x x x  x x x x    x x x x  x x x x";
10016
10017      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
10018                         "x x x x  x x x x    x x x x  x x x x";
10019
10020     timeout             = 200;
10021     stabdelay           = 100;
10022     cmdexedelay         = 25;
10023     synchloops          = 32;
10024     bytedelay           = 0;
10025     pollindex           = 3;
10026     pollvalue           = 0x53;
10027     predelay            = 1;
10028     postdelay           = 1;
10029     pollmethod          = 1;
10030
10031     pp_controlstack     =
10032         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
10033         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
10034         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
10035         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
10036     hventerstabdelay    = 100;
10037     progmodedelay       = 0;
10038     latchcycles         = 5;
10039     togglevtg           = 1;
10040     poweroffdelay       = 15;
10041     resetdelayms        = 1;
10042     resetdelayus        = 0;
10043     hvleavestabdelay    = 15;
10044     chiperasepulsewidth = 0;
10045     chiperasepolltimeout = 10;
10046     programfusepulsewidth = 0;
10047     programfusepolltimeout = 5;
10048     programlockpulsewidth = 0;
10049     programlockpolltimeout = 5;
10050
10051      memory "eeprom"
10052          size            = 512;
10053         paged           = no;
10054         page_size       = 4;
10055          min_write_delay = 4000;
10056          max_write_delay = 4500;
10057          readback_p1     = 0xff;
10058          readback_p2     = 0xff;
10059          read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x a8",
10060                            "a7 a6 a5 a4  a3 a2 a1 a0  o o o o  o o o o";
10061
10062          write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x a8",
10063                            "a7 a6 a5 a4  a3 a2 a1 a0  i i i i  i i i i";
10064
10065         loadpage_lo     = "  1   1   0   0      0   0   0   1",
10066                           "  0   0   0   0      0   0   0   0",
10067                           "  0   0   0   0      0   0  a1  a0",
10068                           "  i   i   i   i      i   i   i   i";
10069
10070         writepage       = "  1   1   0   0      0   0   1   0",
10071                           "  0   0   x   x      x   x   x   x",
10072                           " a7  a6  a5  a4     a3  a2   0   0",
10073                           "  x   x   x   x      x   x   x   x";
10074
10075         mode            = 0x41;
10076         delay           = 6;
10077         blocksize       = 4;
10078         readsize        = 256;
10079        ;
10080      memory "flash"
10081          paged           = yes;
10082          size            = 8192;
10083          page_size       = 64;
10084          num_pages       = 128;
10085          min_write_delay = 4500;
10086          max_write_delay = 4500;
10087          readback_p1     = 0xff;
10088          readback_p2     = 0xff;
10089          read_lo         = "  0   0   1   0    0   0   0   0",
10090                            "  0   0   0   0   a11 a10 a9  a8",
10091                            " a7  a6  a5  a4   a3  a2  a1  a0",
10092                            "  o   o   o   o    o   o   o   o";
10093
10094          read_hi         = "  0   0   1   0    1   0   0   0",
10095                            "  0   0   0   0   a11 a10 a9  a8",
10096                            " a7  a6  a5  a4   a3  a2  a1  a0",
10097                            "  o   o   o   o    o   o   o   o";
10098
10099          loadpage_lo     = "  0   1   0   0    0   0   0   0",
10100                            "  0   0   0   x    x   x   x   x",
10101                            "  x   x   x  a4   a3  a2  a1  a0",
10102                            "  i   i   i   i    i   i   i   i";
10103
10104          loadpage_hi     = "  0   1   0   0    1   0   0   0",
10105                            "  0   0   0   x    x   x   x   x",
10106                            "  x   x   x  a4   a3  a2  a1  a0",
10107                            "  i   i   i   i    i   i   i   i";
10108
10109          writepage       = "  0  1  0  0   1   1   0   0",
10110                            "  0  0  0  0   a11 a10 a9  a8",
10111                            " a7 a6 a5  x   x   x   x   x",
10112                            "  x  x  x  x   x   x   x   x";
10113
10114         mode            = 0x41;
10115         delay           = 6;
10116         blocksize       = 64;
10117         readsize        = 256;
10118        ;
10119 #   AT90PWM2 has Signature Bytes: 0x1E 0x93 0x81.
10120      memory "signature"
10121          size            = 3;
10122          read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
10123                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10124        ;
10125      memory "lock"
10126          size            = 1;
10127          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
10128                            "x x x x  x x x x  1 1 i i  i i i i";
10129
10130          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
10131                            "x x x x  x x x x  x x o o  o o o o";
10132         min_write_delay = 9000;
10133         max_write_delay = 9000;
10134        ;
10135
10136      memory "lfuse"
10137          size            = 1;
10138          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10139                            "x x x x  x x x x  i i i i  i i i i";
10140
10141          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10142                            "x x x x  x x x x  o o o o  o o o o";
10143         min_write_delay = 9000;
10144         max_write_delay = 9000;
10145        ;
10146
10147      memory "hfuse"
10148          size            = 1;
10149          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10150                            "x x x x  x x x x  i i i i  i i i i";
10151
10152          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10153                            "x x x x  x x x x  o o o o  o o o o";
10154         min_write_delay = 9000;
10155         max_write_delay = 9000;
10156        ;
10157
10158      memory "efuse"
10159          size            = 1;
10160          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10161                            "x x x x  x x x x  x x x x  x x x i";
10162
10163          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10164                            "x x x x  x x x x  o o o o  o o o o";
10165         min_write_delay = 9000;
10166         max_write_delay = 9000;
10167      ;
10168
10169      memory "calibration"
10170          size            = 1;
10171          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
10172                            "0  0  0  0   0  0  0  0    o o o o  o o o o";
10173      ;
10174   ;
10175
10176 #------------------------------------------------------------
10177 # AT90PWM2B
10178 #------------------------------------------------------------
10179 # Same as AT90PWM2 but different signature.
10180
10181 part
10182      id            = "pwm2b";
10183      desc          = "AT90PWM2B";
10184      has_debugwire = yes;
10185      flash_instr   = 0xB6, 0x01, 0x11;
10186      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
10187                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
10188                      0x99, 0xF9, 0xBB, 0xAF;
10189      stk500_devcode   = 0x65;
10190 ##  avr910_devcode   = ?;
10191      signature        = 0x1e 0x93 0x83;
10192      pagel            = 0xD8;
10193      bs2              = 0xE2;
10194      reset            = io;
10195      chip_erase_delay = 9000;
10196
10197      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10198                         "x x x x  x x x x    x x x x  x x x x";
10199
10200      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
10201                         "x x x x  x x x x    x x x x  x x x x";
10202
10203     timeout             = 200;
10204     stabdelay           = 100;
10205     cmdexedelay         = 25;
10206     synchloops          = 32;
10207     bytedelay           = 0;
10208     pollindex           = 3;
10209     pollvalue           = 0x53;
10210     predelay            = 1;
10211     postdelay           = 1;
10212     pollmethod          = 1;
10213
10214     pp_controlstack     =
10215         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
10216         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
10217         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
10218         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
10219     hventerstabdelay    = 100;
10220     progmodedelay       = 0;
10221     latchcycles         = 5;
10222     togglevtg           = 1;
10223     poweroffdelay       = 15;
10224     resetdelayms        = 1;
10225     resetdelayus        = 0;
10226     hvleavestabdelay    = 15;
10227     chiperasepulsewidth = 0;
10228     chiperasepolltimeout = 10;
10229     programfusepulsewidth = 0;
10230     programfusepolltimeout = 5;
10231     programlockpulsewidth = 0;
10232     programlockpolltimeout = 5;
10233
10234      memory "eeprom"
10235          size            = 512;
10236         paged           = no;
10237         page_size       = 4;
10238          min_write_delay = 4000;
10239          max_write_delay = 4500;
10240          readback_p1     = 0xff;
10241          readback_p2     = 0xff;
10242          read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x a8",
10243                            "a7 a6 a5 a4  a3 a2 a1 a0  o o o o  o o o o";
10244
10245          write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x a8",
10246                            "a7 a6 a5 a4  a3 a2 a1 a0  i i i i  i i i i";
10247
10248         loadpage_lo     = "  1   1   0   0      0   0   0   1",
10249                           "  0   0   0   0      0   0   0   0",
10250                           "  0   0   0   0      0   0  a1  a0",
10251                           "  i   i   i   i      i   i   i   i";
10252
10253         writepage       = "  1   1   0   0      0   0   1   0",
10254                           "  0   0   x   x      x   x   x   x",
10255                           " a7  a6  a5  a4     a3  a2   0   0",
10256                           "  x   x   x   x      x   x   x   x";
10257
10258         mode            = 0x41;
10259         delay           = 6;
10260         blocksize       = 4;
10261         readsize        = 256;
10262        ;
10263      memory "flash"
10264          paged           = yes;
10265          size            = 8192;
10266          page_size       = 64;
10267          num_pages       = 128;
10268          min_write_delay = 4500;
10269          max_write_delay = 4500;
10270          readback_p1     = 0xff;
10271          readback_p2     = 0xff;
10272          read_lo         = "  0   0   1   0    0   0   0   0",
10273                            "  0   0   0   0   a11 a10 a9  a8",
10274                            " a7  a6  a5  a4   a3  a2  a1  a0",
10275                            "  o   o   o   o    o   o   o   o";
10276
10277          read_hi         = "  0   0   1   0    1   0   0   0",
10278                            "  0   0   0   0   a11 a10 a9  a8",
10279                            " a7  a6  a5  a4   a3  a2  a1  a0",
10280                            "  o   o   o   o    o   o   o   o";
10281
10282          loadpage_lo     = "  0   1   0   0    0   0   0   0",
10283                            "  0   0   0   x    x   x   x   x",
10284                            "  x   x   x  a4   a3  a2  a1  a0",
10285                            "  i   i   i   i    i   i   i   i";
10286
10287          loadpage_hi     = "  0   1   0   0    1   0   0   0",
10288                            "  0   0   0   x    x   x   x   x",
10289                            "  x   x   x  a4   a3  a2  a1  a0",
10290                            "  i   i   i   i    i   i   i   i";
10291
10292          writepage       = "  0  1  0  0   1   1   0   0",
10293                            "  0  0  0  0   a11 a10 a9  a8",
10294                            " a7 a6 a5  x   x   x   x   x",
10295                            "  x  x  x  x   x   x   x   x";
10296
10297         mode            = 0x41;
10298         delay           = 6;
10299         blocksize       = 64;
10300         readsize        = 256;
10301        ;
10302      memory "signature"
10303          size            = 3;
10304          read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
10305                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10306        ;
10307      memory "lock"
10308          size            = 1;
10309          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
10310                            "x x x x  x x x x  1 1 i i  i i i i";
10311
10312          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
10313                            "x x x x  x x x x  x x o o  o o o o";
10314         min_write_delay = 9000;
10315         max_write_delay = 9000;
10316        ;
10317
10318      memory "lfuse"
10319          size            = 1;
10320          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10321                            "x x x x  x x x x  i i i i  i i i i";
10322
10323          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10324                            "x x x x  x x x x  o o o o  o o o o";
10325         min_write_delay = 9000;
10326         max_write_delay = 9000;
10327        ;
10328
10329      memory "hfuse"
10330          size            = 1;
10331          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10332                            "x x x x  x x x x  i i i i  i i i i";
10333
10334          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10335                            "x x x x  x x x x  o o o o  o o o o";
10336         min_write_delay = 9000;
10337         max_write_delay = 9000;
10338        ;
10339
10340      memory "efuse"
10341          size            = 1;
10342          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10343                            "x x x x  x x x x  x x x x  x x x i";
10344
10345          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10346                            "x x x x  x x x x  o o o o  o o o o";
10347         min_write_delay = 9000;
10348         max_write_delay = 9000;
10349      ;
10350
10351      memory "calibration"
10352          size            = 1;
10353          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
10354                            "0  0  0  0   0  0  0  0    o o o o  o o o o";
10355      ;
10356   ;
10357
10358 #------------------------------------------------------------
10359 # AT90PWM3B
10360 #------------------------------------------------------------
10361
10362 # Completely identical to AT90PWM2B (including the signature!)
10363
10364 part
10365      id            = "pwm3b";
10366      desc          = "AT90PWM3B";
10367      has_debugwire = yes;
10368      flash_instr   = 0xB6, 0x01, 0x11;
10369      eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
10370                      0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
10371                      0x99, 0xF9, 0xBB, 0xAF;
10372      stk500_devcode   = 0x65;
10373 ##  avr910_devcode   = ?;
10374      signature        = 0x1e 0x93 0x83;
10375      pagel            = 0xD8;
10376      bs2              = 0xE2;
10377      reset            = io;
10378      chip_erase_delay = 9000;
10379
10380      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10381                         "x x x x  x x x x    x x x x  x x x x";
10382
10383      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
10384                         "x x x x  x x x x    x x x x  x x x x";
10385
10386     timeout             = 200;
10387     stabdelay           = 100;
10388     cmdexedelay         = 25;
10389     synchloops          = 32;
10390     bytedelay           = 0;
10391     pollindex           = 3;
10392     pollvalue           = 0x53;
10393     predelay            = 1;
10394     postdelay           = 1;
10395     pollmethod          = 1;
10396
10397     pp_controlstack     =
10398         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
10399         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
10400         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
10401         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
10402     hventerstabdelay    = 100;
10403     progmodedelay       = 0;
10404     latchcycles         = 5;
10405     togglevtg           = 1;
10406     poweroffdelay       = 15;
10407     resetdelayms        = 1;
10408     resetdelayus        = 0;
10409     hvleavestabdelay    = 15;
10410     chiperasepulsewidth = 0;
10411     chiperasepolltimeout = 10;
10412     programfusepulsewidth = 0;
10413     programfusepolltimeout = 5;
10414     programlockpulsewidth = 0;
10415     programlockpolltimeout = 5;
10416
10417      memory "eeprom"
10418          size            = 512;
10419         paged           = no;
10420         page_size       = 4;
10421          min_write_delay = 4000;
10422          max_write_delay = 4500;
10423          readback_p1     = 0xff;
10424          readback_p2     = 0xff;
10425          read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x a8",
10426                            "a7 a6 a5 a4  a3 a2 a1 a0  o o o o  o o o o";
10427
10428          write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x a8",
10429                            "a7 a6 a5 a4  a3 a2 a1 a0  i i i i  i i i i";
10430
10431         loadpage_lo     = "  1   1   0   0      0   0   0   1",
10432                           "  0   0   0   0      0   0   0   0",
10433                           "  0   0   0   0      0   0  a1  a0",
10434                           "  i   i   i   i      i   i   i   i";
10435
10436         writepage       = "  1   1   0   0      0   0   1   0",
10437                           "  0   0   x   x      x   x   x   x",
10438                           " a7  a6  a5  a4     a3  a2   0   0",
10439                           "  x   x   x   x      x   x   x   x";
10440
10441         mode            = 0x41;
10442         delay           = 6;
10443         blocksize       = 4;
10444         readsize        = 256;
10445        ;
10446      memory "flash"
10447          paged           = yes;
10448          size            = 8192;
10449          page_size       = 64;
10450          num_pages       = 128;
10451          min_write_delay = 4500;
10452          max_write_delay = 4500;
10453          readback_p1     = 0xff;
10454          readback_p2     = 0xff;
10455          read_lo         = "  0   0   1   0    0   0   0   0",
10456                            "  0   0   0   0   a11 a10 a9  a8",
10457                            " a7  a6  a5  a4   a3  a2  a1  a0",
10458                            "  o   o   o   o    o   o   o   o";
10459
10460          read_hi         = "  0   0   1   0    1   0   0   0",
10461                            "  0   0   0   0   a11 a10 a9  a8",
10462                            " a7  a6  a5  a4   a3  a2  a1  a0",
10463                            "  o   o   o   o    o   o   o   o";
10464
10465          loadpage_lo     = "  0   1   0   0    0   0   0   0",
10466                            "  0   0   0   x    x   x   x   x",
10467                            "  x   x   x  a4   a3  a2  a1  a0",
10468                            "  i   i   i   i    i   i   i   i";
10469
10470          loadpage_hi     = "  0   1   0   0    1   0   0   0",
10471                            "  0   0   0   x    x   x   x   x",
10472                            "  x   x   x  a4   a3  a2  a1  a0",
10473                            "  i   i   i   i    i   i   i   i";
10474
10475          writepage       = "  0  1  0  0   1   1   0   0",
10476                            "  0  0  0  0   a11 a10 a9  a8",
10477                            " a7 a6 a5  x   x   x   x   x",
10478                            "  x  x  x  x   x   x   x   x";
10479
10480         mode            = 0x41;
10481         delay           = 6;
10482         blocksize       = 64;
10483         readsize        = 256;
10484        ;
10485      memory "signature"
10486          size            = 3;
10487          read            = "0  0  1  1   0  0  0  0   0  0  x  x   x  x  x  x",
10488                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10489        ;
10490      memory "lock"
10491          size            = 1;
10492          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
10493                            "x x x x  x x x x  1 1 i i  i i i i";
10494
10495          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
10496                            "x x x x  x x x x  x x o o  o o o o";
10497         min_write_delay = 9000;
10498         max_write_delay = 9000;
10499        ;
10500
10501      memory "lfuse"
10502          size            = 1;
10503          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10504                            "x x x x  x x x x  i i i i  i i i i";
10505
10506          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10507                            "x x x x  x x x x  o o o o  o o o o";
10508         min_write_delay = 9000;
10509         max_write_delay = 9000;
10510        ;
10511
10512      memory "hfuse"
10513          size            = 1;
10514          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10515                            "x x x x  x x x x  i i i i  i i i i";
10516
10517          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10518                            "x x x x  x x x x  o o o o  o o o o";
10519         min_write_delay = 9000;
10520         max_write_delay = 9000;
10521        ;
10522
10523      memory "efuse"
10524          size            = 1;
10525          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10526                            "x x x x  x x x x  x x x x  x x x i";
10527
10528          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10529                            "x x x x  x x x x  o o o o  o o o o";
10530         min_write_delay = 9000;
10531         max_write_delay = 9000;
10532      ;
10533
10534      memory "calibration"
10535          size            = 1;
10536          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
10537                            "0  0  0  0   0  0  0  0    o o o o  o o o o";
10538      ;
10539   ;
10540
10541 #------------------------------------------------------------
10542 # ATtiny25
10543 #------------------------------------------------------------
10544
10545 part
10546      id            = "t25";
10547      desc          = "ATtiny25";
10548      has_debugwire = yes;
10549      flash_instr   = 0xB4, 0x02, 0x12;
10550      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
10551                      0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC,
10552                      0x99, 0xE1, 0xBB, 0xAC;
10553 ## no STK500 devcode in XML file, use the ATtiny45 one
10554      stk500_devcode   = 0x14;
10555 ##  avr910_devcode   = ?;
10556 ##  Try the AT90S2313 devcode:
10557      avr910_devcode   = 0x20;
10558      signature        = 0x1e 0x91 0x08;
10559      reset            = io;
10560      chip_erase_delay = 4500;
10561
10562      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10563                         "x x x x  x x x x    x x x x  x x x x";
10564
10565      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
10566                         "x x x x  x x x x    x x x x  x x x x";
10567
10568     timeout             = 200;
10569     stabdelay           = 100;
10570     cmdexedelay         = 25;
10571     synchloops          = 32;
10572     bytedelay           = 0;
10573     pollindex           = 3;
10574     pollvalue           = 0x53;
10575     predelay            = 1;
10576     postdelay           = 1;
10577     pollmethod          = 1;
10578
10579     hvsp_controlstack   =
10580         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
10581         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
10582         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
10583         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
10584     hventerstabdelay    = 100;
10585     hvspcmdexedelay     = 0;
10586     synchcycles         = 6;
10587     latchcycles         = 1;
10588     togglevtg           = 1;
10589     poweroffdelay       = 25;
10590     resetdelayms        = 1;
10591     resetdelayus        = 0;
10592     hvleavestabdelay    = 100;
10593     resetdelay          = 25;
10594     chiperasepolltimeout = 40;
10595     chiperasetime       = 0;
10596     programfusepolltimeout = 25;
10597     programlockpolltimeout = 25;
10598
10599      memory "eeprom"
10600          size            = 128;
10601         paged           = no;
10602         page_size       = 4;
10603          min_write_delay = 4000;
10604          max_write_delay = 4500;
10605          readback_p1     = 0xff;
10606          readback_p2     = 0xff;
10607          read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x x",
10608                            "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
10609
10610          write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x x",
10611                            "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
10612
10613         loadpage_lo     = "  1   1   0   0      0   0   0   1",
10614                           "  0   0   0   0      0   0   0   0",
10615                           "  0   0   0   0      0   0  a1  a0",
10616                           "  i   i   i   i      i   i   i   i";
10617
10618         writepage       = "  1   1   0   0      0   0   1   0",
10619                           "  0   0   x   x      x   x   x   x",
10620                           "  x  a6  a5  a4     a3  a2   0   0",
10621                           "  x   x   x   x      x   x   x   x";
10622
10623         mode            = 0x41;
10624         delay           = 6;
10625         blocksize       = 4;
10626         readsize        = 256;
10627        ;
10628      memory "flash"
10629          paged           = yes;
10630          size            = 2048;
10631          page_size       = 32;
10632          num_pages       = 64;
10633          min_write_delay = 4500;
10634          max_write_delay = 4500;
10635          readback_p1     = 0xff;
10636          readback_p2     = 0xff;
10637          read_lo         = "  0   0   1   0    0   0   0   0",
10638                            "  0   0   0   0    0   0  a9  a8",
10639                            " a7  a6  a5  a4   a3  a2  a1  a0",
10640                            "  o   o   o   o    o   o   o   o";
10641
10642          read_hi         = "  0   0   1   0    1   0   0   0",
10643                            "  0   0   0   0    0   0  a9  a8",
10644                            " a7  a6  a5  a4   a3  a2  a1  a0",
10645                            "  o   o   o   o    o   o   o   o";
10646
10647          loadpage_lo     = "  0   1   0   0    0   0   0   0",
10648                            "  0   0   0   x    x   x   x   x",
10649                            "  x   x   x   x   a3  a2  a1  a0",
10650                            "  i   i   i   i    i   i   i   i";
10651
10652          loadpage_hi     = "  0   1   0   0    1   0   0   0",
10653                            "  0   0   0   x    x   x   x   x",
10654                            "  x   x   x   x   a3  a2  a1  a0",
10655                            "  i   i   i   i    i   i   i   i";
10656
10657          writepage       = "  0  1  0  0   1  1  0  0",
10658                            "  0  0  0  0   0  0 a9 a8",
10659                            " a7 a6 a5 a4   x  x  x  x",
10660                            "  x  x  x  x   x  x  x  x";
10661
10662         mode            = 0x41;
10663         delay           = 6;
10664         blocksize       = 32;
10665         readsize        = 256;
10666        ;
10667 #   ATtiny25 has Signature Bytes: 0x1E 0x91 0x08.
10668      memory "signature"
10669          size            = 3;
10670          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
10671                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10672        ;
10673      memory "lock"
10674          size            = 1;
10675          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
10676                            "x x x x  x x x x  1 1 i i  i i i i";
10677         min_write_delay = 9000;
10678         max_write_delay = 9000;
10679        ;
10680
10681      memory "lfuse"
10682          size            = 1;
10683          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10684                            "x x x x  x x x x  i i i i  i i i i";
10685
10686          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10687                            "x x x x  x x x x  o o o o  o o o o";
10688         min_write_delay = 9000;
10689         max_write_delay = 9000;
10690        ;
10691
10692      memory "hfuse"
10693          size            = 1;
10694          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10695                            "x x x x  x x x x  i i i i  i i i i";
10696
10697          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10698                            "x x x x  x x x x  o o o o  o o o o";
10699         min_write_delay = 9000;
10700         max_write_delay = 9000;
10701        ;
10702
10703      memory "efuse"
10704          size            = 1;
10705          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10706                            "x x x x  x x x x  x x x x  x x x i";
10707
10708          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10709                            "x x x x  x x x x  o o o o  o o o o";
10710         min_write_delay = 9000;
10711         max_write_delay = 9000;
10712      ;
10713
10714      memory "calibration"
10715          size            = 2;
10716          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
10717                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
10718      ;
10719   ;
10720
10721 #------------------------------------------------------------
10722 # ATtiny45
10723 #------------------------------------------------------------
10724
10725 part
10726      id            = "t45";
10727      desc          = "ATtiny45";
10728      has_debugwire = yes;
10729      flash_instr   = 0xB4, 0x02, 0x12;
10730      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
10731                      0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC,
10732                      0x99, 0xE1, 0xBB, 0xAC;
10733      stk500_devcode   = 0x14;
10734 ##  avr910_devcode   = ?;
10735 ##  Try the AT90S2313 devcode:
10736      avr910_devcode   = 0x20;
10737      signature        = 0x1e 0x92 0x06;
10738      reset            = io;
10739      chip_erase_delay = 4500;
10740
10741      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10742                         "x x x x  x x x x    x x x x  x x x x";
10743
10744      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
10745                         "x x x x  x x x x    x x x x  x x x x";
10746
10747     timeout             = 200;
10748     stabdelay           = 100;
10749     cmdexedelay         = 25;
10750     synchloops          = 32;
10751     bytedelay           = 0;
10752     pollindex           = 3;
10753     pollvalue           = 0x53;
10754     predelay            = 1;
10755     postdelay           = 1;
10756     pollmethod          = 1;
10757
10758     hvsp_controlstack     =
10759         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
10760         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
10761         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
10762         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
10763     hventerstabdelay    = 100;
10764     progmodedelay       = 0;
10765     hvspcmdexedelay     = 0;
10766     synchcycles         = 6;
10767     latchcycles         = 1;
10768     togglevtg           = 1;
10769     poweroffdelay       = 25;
10770     resetdelayms        = 1;
10771     resetdelayus        = 0;
10772     hvleavestabdelay    = 100;
10773     resetdelay          = 25;
10774     chiperasepolltimeout = 40;
10775     chiperasetime       = 0;
10776     programfusepolltimeout = 25;
10777     programlockpolltimeout = 25;
10778
10779      memory "eeprom"
10780          size            = 256;
10781          page_size       = 4;
10782          min_write_delay = 4000;
10783          max_write_delay = 4500;
10784          readback_p1     = 0xff;
10785          readback_p2     = 0xff;
10786          read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x x",
10787                            "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
10788
10789          write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
10790                            "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
10791
10792         loadpage_lo     = "  1   1   0   0      0   0   0   1",
10793                           "  0   0   0   0      0   0   0   0",
10794                           "  0   0   0   0      0   0  a1  a0",
10795                           "  i   i   i   i      i   i   i   i";
10796
10797         writepage       = "  1   1   0   0      0   0   1   0",
10798                           "  0   0   x   x      x   x   x   x",
10799                           " a7  a6  a5  a4     a3  a2   0   0",
10800                           "  x   x   x   x      x   x   x   x";
10801
10802         mode            = 0x41;
10803         delay           = 6;
10804         blocksize       = 4;
10805         readsize        = 256;
10806        ;
10807      memory "flash"
10808          paged           = yes;
10809          size            = 4096;
10810          page_size       = 64;
10811          num_pages       = 64;
10812          min_write_delay = 4500;
10813          max_write_delay = 4500;
10814          readback_p1     = 0xff;
10815          readback_p2     = 0xff;
10816          read_lo         = "  0   0   1   0    0   0   0   0",
10817                            "  0   0   0   0    0  a10 a9  a8",
10818                            " a7  a6  a5  a4   a3  a2  a1  a0",
10819                            "  o   o   o   o    o   o   o   o";
10820
10821          read_hi         = "  0   0   1   0    1   0   0   0",
10822                            "  0   0   0   0    0  a10 a9  a8",
10823                            " a7  a6  a5  a4   a3  a2  a1  a0",
10824                            "  o   o   o   o    o   o   o   o";
10825
10826          loadpage_lo     = "  0   1   0   0    0   0   0   0",
10827                            "  0   0   0   x    x   x   x   x",
10828                            "  x   x   x  a4   a3  a2  a1  a0",
10829                            "  i   i   i   i    i   i   i   i";
10830
10831          loadpage_hi     = "  0   1   0   0    1   0   0   0",
10832                            "  0   0   0   x    x   x   x   x",
10833                            "  x   x   x  a4   a3  a2  a1  a0",
10834                            "  i   i   i   i    i   i   i   i";
10835
10836          writepage       = "  0  1  0  0   1  1  0  0",
10837                            "  0  0  0  0   0 a10 a9 a8",
10838                            " a7 a6 a5  x   x  x  x  x",
10839                            "  x  x  x  x   x  x  x  x";
10840
10841         mode            = 0x41;
10842         delay           = 6;
10843         blocksize       = 32;
10844         readsize        = 256;
10845        ;
10846 #   ATtiny45 has Signature Bytes: 0x1E 0x92 0x08. (Data sheet 2586C-AVR-06/05 (doc2586.pdf) indicates otherwise!)
10847      memory "signature"
10848          size            = 3;
10849          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
10850                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
10851        ;
10852      memory "lock"
10853          size            = 1;
10854          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
10855                            "x x x x  x x x x  1 1 i i  i i i i";
10856         min_write_delay = 9000;
10857         max_write_delay = 9000;
10858        ;
10859
10860      memory "lfuse"
10861          size            = 1;
10862          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
10863                            "x x x x  x x x x  i i i i  i i i i";
10864
10865          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
10866                            "x x x x  x x x x  o o o o  o o o o";
10867         min_write_delay = 9000;
10868         max_write_delay = 9000;
10869        ;
10870
10871      memory "hfuse"
10872          size            = 1;
10873          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
10874                            "x x x x  x x x x  i i i i  i i i i";
10875
10876          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
10877                            "x x x x  x x x x  o o o o  o o o o";
10878         min_write_delay = 9000;
10879         max_write_delay = 9000;
10880        ;
10881
10882      memory "efuse"
10883          size            = 1;
10884          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
10885                            "x x x x  x x x x  x x x x  x x x i";
10886
10887          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
10888                            "x x x x  x x x x  o o o o  o o o o";
10889         min_write_delay = 9000;
10890         max_write_delay = 9000;
10891      ;
10892
10893      memory "calibration"
10894          size            = 2;
10895          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
10896                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
10897      ;
10898   ;
10899
10900 #------------------------------------------------------------
10901 # ATtiny85
10902 #------------------------------------------------------------
10903
10904 part
10905      id            = "t85";
10906      desc          = "ATtiny85";
10907      has_debugwire = yes;
10908      flash_instr   = 0xB4, 0x02, 0x12;
10909      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
10910                      0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC,
10911                      0x99, 0xE1, 0xBB, 0xAC;
10912 ## no STK500 devcode in XML file, use the ATtiny45 one
10913      stk500_devcode   = 0x14;
10914 ##  avr910_devcode   = ?;
10915 ##  Try the AT90S2313 devcode:
10916      avr910_devcode   = 0x20;
10917      signature        = 0x1e 0x93 0x0b;
10918      reset            = io;
10919      chip_erase_delay = 4500;
10920
10921      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
10922                         "x x x x  x x x x    x x x x  x x x x";
10923
10924      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
10925                         "x x x x  x x x x    x x x x  x x x x";
10926
10927     timeout             = 200;
10928     stabdelay           = 100;
10929     cmdexedelay         = 25;
10930     synchloops          = 32;
10931     bytedelay           = 0;
10932     pollindex           = 3;
10933     pollvalue           = 0x53;
10934     predelay            = 1;
10935     postdelay           = 1;
10936     pollmethod          = 1;
10937
10938     hvsp_controlstack   =
10939         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
10940         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
10941         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
10942         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
10943     hventerstabdelay    = 100;
10944     hvspcmdexedelay     = 0;
10945     synchcycles         = 6;
10946     latchcycles         = 1;
10947     togglevtg           = 1;
10948     poweroffdelay       = 25;
10949     resetdelayms        = 1;
10950     resetdelayus        = 0;
10951     hvleavestabdelay    = 100;
10952     resetdelay          = 25;
10953     chiperasepolltimeout = 40;
10954     chiperasetime       = 0;
10955     programfusepolltimeout = 25;
10956     programlockpolltimeout = 25;
10957
10958      memory "eeprom"
10959          size            = 512;
10960         paged           = no;
10961         page_size       = 4;
10962          min_write_delay = 4000;
10963          max_write_delay = 4500;
10964          readback_p1     = 0xff;
10965          readback_p2     = 0xff;
10966          read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x a8",
10967                            "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
10968
10969          write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x a8",
10970                            "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
10971
10972         loadpage_lo     = "  1   1   0   0      0   0   0   1",
10973                           "  0   0   0   0      0   0   0   0",
10974                           "  0   0   0   0      0   0  a1  a0",
10975                           "  i   i   i   i      i   i   i   i";
10976
10977         writepage       = "  1   1   0   0      0   0   1   0",
10978                           "  0   0   x   x      x   x   x  a8",
10979                           " a7  a6  a5  a4     a3  a2   0   0",
10980                           "  x   x   x   x      x   x   x   x";
10981
10982         mode            = 0x41;
10983         delay           = 6;
10984         blocksize       = 4;
10985         readsize        = 256;
10986        ;
10987      memory "flash"
10988          paged           = yes;
10989          size            = 8192;
10990          page_size       = 64;
10991          num_pages       = 128;
10992          min_write_delay = 4500;
10993          max_write_delay = 4500;
10994          readback_p1     = 0xff;
10995          readback_p2     = 0xff;
10996          read_lo         = "  0   0   1   0    0   0   0   0",
10997                            "  0   0   0   0  a11 a10  a9  a8",
10998                            " a7  a6  a5  a4   a3  a2  a1  a0",
10999                            "  o   o   o   o    o   o   o   o";
11000
11001          read_hi         = "  0   0   1   0    1   0   0   0",
11002                            "  0   0   0   0  a11 a10  a9  a8",
11003                            " a7  a6  a5  a4   a3  a2  a1  a0",
11004                            "  o   o   o   o    o   o   o   o";
11005
11006          loadpage_lo     = "  0   1   0   0    0   0   0   0",
11007                            "  0   0   0   x    x   x   x   x",
11008                            "  x   x   x  a4   a3  a2  a1  a0",
11009                            "  i   i   i   i    i   i   i   i";
11010
11011          loadpage_hi     = "  0   1   0   0    1   0   0   0",
11012                            "  0   0   0   x    x   x   x   x",
11013                            "  x   x   x  a4   a3  a2  a1  a0",
11014                            "  i   i   i   i    i   i   i   i";
11015
11016          writepage       = "  0  1  0  0   1   1   0  0",
11017                            "  0  0  0  0  a11 a10 a9 a8",
11018                            " a7 a6 a5  x   x  x  x  x",
11019                            "  x  x  x  x   x  x  x  x";
11020
11021         mode            = 0x41;
11022         delay           = 6;
11023         blocksize       = 32;
11024         readsize        = 256;
11025        ;
11026 #   ATtiny85 has Signature Bytes: 0x1E 0x93 0x08.
11027      memory "signature"
11028          size            = 3;
11029          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
11030                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11031        ;
11032      memory "lock"
11033          size            = 1;
11034          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
11035                            "x x x x  x x x x  1 1 i i  i i i i";
11036         min_write_delay = 9000;
11037         max_write_delay = 9000;
11038        ;
11039
11040      memory "lfuse"
11041          size            = 1;
11042          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11043                            "x x x x  x x x x  i i i i  i i i i";
11044
11045          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11046                            "x x x x  x x x x  o o o o  o o o o";
11047         min_write_delay = 9000;
11048         max_write_delay = 9000;
11049        ;
11050
11051      memory "hfuse"
11052          size            = 1;
11053          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11054                            "x x x x  x x x x  i i i i  i i i i";
11055
11056          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11057                            "x x x x  x x x x  o o o o  o o o o";
11058         min_write_delay = 9000;
11059         max_write_delay = 9000;
11060        ;
11061
11062      memory "efuse"
11063          size            = 1;
11064          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11065                            "x x x x  x x x x  x x x x  x x x i";
11066
11067          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11068                            "x x x x  x x x x  o o o o  o o o o";
11069         min_write_delay = 9000;
11070         max_write_delay = 9000;
11071      ;
11072
11073      memory "calibration"
11074          size            = 2;
11075          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
11076                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
11077      ;
11078   ;
11079
11080 #------------------------------------------------------------
11081 # ATmega640
11082 #------------------------------------------------------------
11083 # Almost same as ATmega1280, except for different memory sizes
11084
11085 part
11086     id               = "m640";
11087     desc             = "ATMEGA640";
11088     signature        = 0x1e 0x96 0x08;
11089     has_jtag         = yes;
11090 #    stk500_devcode   = 0xB2;
11091 #    avr910_devcode   = 0x43;
11092     chip_erase_delay = 9000;
11093     pagel            = 0xD7;
11094     bs2              = 0xA0;
11095     reset            = dedicated;
11096     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11097                        "x x x x  x x x x    x x x x  x x x x";
11098
11099     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
11100                        "x x x x  x x x x    x x x x  x x x x";
11101
11102     timeout             = 200;
11103     stabdelay           = 100;
11104     cmdexedelay         = 25;
11105     synchloops          = 32;
11106     bytedelay           = 0;
11107     pollindex           = 3;
11108     pollvalue           = 0x53;
11109     predelay            = 1;
11110     postdelay           = 1;
11111     pollmethod          = 1;
11112
11113     pp_controlstack     =
11114         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
11115         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
11116         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
11117         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
11118     hventerstabdelay    = 100;
11119     progmodedelay       = 0;
11120     latchcycles         = 5;
11121     togglevtg           = 1;
11122     poweroffdelay       = 15;
11123     resetdelayms        = 1;
11124     resetdelayus        = 0;
11125     hvleavestabdelay    = 15;
11126     chiperasepulsewidth = 0;
11127     chiperasepolltimeout = 10;
11128     programfusepulsewidth = 0;
11129     programfusepolltimeout = 5;
11130     programlockpulsewidth = 0;
11131     programlockpolltimeout = 5;
11132
11133     idr                 = 0x31;
11134     spmcr               = 0x57;
11135     rampz               = 0x3b;
11136     allowfullpagebitstream = no;
11137
11138     memory "eeprom"
11139         paged           = no; /* leave this "no" */
11140         page_size       = 8;  /* for parallel programming */
11141         size            = 4096;
11142         min_write_delay = 9000;
11143         max_write_delay = 9000;
11144         readback_p1     = 0x00;
11145         readback_p2     = 0x00;
11146         read            = "  1   0   1   0      0   0   0   0",
11147                           "  x   x   x   x    a11 a10  a9  a8",
11148                           " a7  a6  a5  a4     a3  a2  a1  a0",
11149                           "  o   o   o   o      o   o   o   o";
11150
11151         write           = "  1   1   0   0      0   0   0   0",
11152                           "  x   x   x   x    a11 a10  a9  a8",
11153                           " a7  a6  a5  a4     a3  a2  a1  a0", 
11154                           "  i   i   i   i      i   i   i   i";
11155
11156         loadpage_lo     = "  1   1   0   0      0   0   0   1",
11157                           "  0   0   0   0      0   0   0   0",
11158                           "  0   0   0   0      0  a2  a1  a0",
11159                           "  i   i   i   i      i   i   i   i";
11160
11161         writepage       = "  1   1   0   0      0   0   1   0",
11162                           "  0   0   x   x    a11 a10  a9  a8",
11163                           " a7  a6  a5  a4     a3   0   0   0",
11164                           "  x   x   x   x      x   x   x   x";
11165
11166         mode            = 0x41;
11167         delay           = 10;
11168         blocksize       = 8;
11169         readsize        = 256;
11170       ;
11171
11172     memory "flash"
11173         paged           = yes;
11174         size            = 65536;
11175         page_size       = 256;
11176         num_pages       = 256;
11177         min_write_delay = 4500;
11178         max_write_delay = 4500;
11179         readback_p1     = 0x00;
11180         readback_p2     = 0x00;
11181         read_lo         = "  0   0   1   0      0   0   0   0",
11182                           "  0 a14 a13 a12    a11 a10  a9  a8",
11183                           " a7  a6  a5  a4     a3  a2  a1  a0",
11184                           "  o   o   o   o      o   o   o   o";
11185
11186         read_hi         = "  0   0   1   0      1   0   0   0",
11187                           "  0 a14 a13 a12    a11 a10  a9  a8",
11188                           " a7  a6  a5  a4     a3  a2  a1  a0",
11189                           "  o   o   o   o      o   o   o   o";
11190
11191         loadpage_lo     = "  0   1   0   0      0   0   0   0",
11192                           "  x   x   x   x      x   x   x   x",
11193                           "  x  a6  a5  a4     a3  a2  a1  a0",
11194                           "  i   i   i   i      i   i   i   i";
11195
11196         loadpage_hi     = "  0   1   0   0      1   0   0   0",
11197                           "  x   x   x   x      x   x   x   x",
11198                           "  x  a6  a5  a4     a3  a2  a1  a0",
11199                           "  i   i   i   i      i   i   i   i";
11200
11201         writepage       = "  0   1   0   0      1   1   0   0",
11202                           "  0 a14 a13 a12    a11 a10  a9  a8",
11203                           " a7   x   x   x      x   x   x   x",
11204                           "  x   x   x   x      x   x   x   x";
11205
11206         mode            = 0x41;
11207         delay           = 10;
11208         blocksize       = 256;
11209         readsize        = 256;
11210       ;
11211
11212     memory "lfuse"
11213         size            = 1;
11214         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11215                           "x x x x  x x x x  i i i i  i i i i";
11216
11217         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11218                           "x x x x  x x x x  o o o o  o o o o";
11219         min_write_delay = 9000;
11220         max_write_delay = 9000;
11221       ;
11222
11223     memory "hfuse"
11224         size            = 1;
11225         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11226                           "x x x x  x x x x  i i i i  i i i i";
11227
11228         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11229                           "x x x x  x x x x  o o o o  o o o o";
11230         min_write_delay = 9000;
11231         max_write_delay = 9000;
11232       ;
11233
11234     memory "efuse"
11235         size            = 1;
11236         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11237                           "x x x x  x x x x  x x x x  x i i i";
11238
11239         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11240                           "x x x x  x x x x  o o o o  o o o o";
11241         min_write_delay = 9000;
11242         max_write_delay = 9000;
11243       ;
11244
11245     memory "lock"
11246         size            = 1;
11247         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
11248                           "x x x x  x x x x   x x o o  o o o o";
11249
11250         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
11251                           "x x x x  x x x x   1 1 i i  i i i i";
11252         min_write_delay = 9000;
11253         max_write_delay = 9000;
11254       ;
11255
11256     memory "calibration"
11257         size            = 1;
11258         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
11259                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
11260       ;
11261
11262     memory "signature"
11263         size            = 3;
11264         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
11265                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11266       ;
11267   ;
11268
11269 #------------------------------------------------------------
11270 # ATmega1280
11271 #------------------------------------------------------------
11272
11273 part
11274     id               = "m1280";
11275     desc             = "ATMEGA1280";
11276     signature        = 0x1e 0x97 0x03;
11277     has_jtag         = yes;
11278 #    stk500_devcode   = 0xB2;
11279 #    avr910_devcode   = 0x43;
11280     chip_erase_delay = 9000;
11281     pagel            = 0xD7;
11282     bs2              = 0xA0;
11283     reset            = dedicated;
11284     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11285                        "x x x x  x x x x    x x x x  x x x x";
11286
11287     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
11288                        "x x x x  x x x x    x x x x  x x x x";
11289
11290     timeout             = 200;
11291     stabdelay           = 100;
11292     cmdexedelay         = 25;
11293     synchloops          = 32;
11294     bytedelay           = 0;
11295     pollindex           = 3;
11296     pollvalue           = 0x53;
11297     predelay            = 1;
11298     postdelay           = 1;
11299     pollmethod          = 1;
11300
11301     pp_controlstack     =
11302         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
11303         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
11304         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
11305         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
11306     hventerstabdelay    = 100;
11307     progmodedelay       = 0;
11308     latchcycles         = 5;
11309     togglevtg           = 1;
11310     poweroffdelay       = 15;
11311     resetdelayms        = 1;
11312     resetdelayus        = 0;
11313     hvleavestabdelay    = 15;
11314     chiperasepulsewidth = 0;
11315     chiperasepolltimeout = 10;
11316     programfusepulsewidth = 0;
11317     programfusepolltimeout = 5;
11318     programlockpulsewidth = 0;
11319     programlockpolltimeout = 5;
11320
11321     idr                 = 0x31;
11322     spmcr               = 0x57;
11323     rampz               = 0x3b;
11324     allowfullpagebitstream = no;
11325
11326     memory "eeprom"
11327         paged           = no; /* leave this "no" */
11328         page_size       = 8;  /* for parallel programming */
11329         size            = 4096;
11330         min_write_delay = 9000;
11331         max_write_delay = 9000;
11332         readback_p1     = 0x00;
11333         readback_p2     = 0x00;
11334         read            = "  1   0   1   0      0   0   0   0",
11335                           "  x   x   x   x    a11 a10  a9  a8",
11336                           " a7  a6  a5  a4     a3  a2  a1  a0",
11337                           "  o   o   o   o      o   o   o   o";
11338
11339         write           = "  1   1   0   0      0   0   0   0",
11340                           "  x   x   x   x    a11 a10  a9  a8",
11341                           " a7  a6  a5  a4     a3  a2  a1  a0", 
11342                           "  i   i   i   i      i   i   i   i";
11343
11344         loadpage_lo     = "  1   1   0   0      0   0   0   1",
11345                           "  0   0   0   0      0   0   0   0",
11346                           "  0   0   0   0      0  a2  a1  a0",
11347                           "  i   i   i   i      i   i   i   i";
11348
11349         writepage       = "  1   1   0   0      0   0   1   0",
11350                           "  0   0   x   x    a11 a10  a9  a8",
11351                           " a7  a6  a5  a4     a3   0   0   0",
11352                           "  x   x   x   x      x   x   x   x";
11353
11354         mode            = 0x41;
11355         delay           = 10;
11356         blocksize       = 8;
11357         readsize        = 256;
11358       ;
11359
11360     memory "flash"
11361         paged           = yes;
11362         size            = 131072;
11363         page_size       = 256;
11364         num_pages       = 512;
11365         min_write_delay = 4500;
11366         max_write_delay = 4500;
11367         readback_p1     = 0x00;
11368         readback_p2     = 0x00;
11369         read_lo         = "  0   0   1   0      0   0   0   0",
11370                           "a15 a14 a13 a12    a11 a10  a9  a8",
11371                           " a7  a6  a5  a4     a3  a2  a1  a0",
11372                           "  o   o   o   o      o   o   o   o";
11373
11374         read_hi         = "  0   0   1   0      1   0   0   0",
11375                           "a15 a14 a13 a12    a11 a10  a9  a8",
11376                           " a7  a6  a5  a4     a3  a2  a1  a0",
11377                           "  o   o   o   o      o   o   o   o";
11378
11379         loadpage_lo     = "  0   1   0   0      0   0   0   0",
11380                           "  x   x   x   x      x   x   x   x",
11381                           "  x  a6  a5  a4     a3  a2  a1  a0",
11382                           "  i   i   i   i      i   i   i   i";
11383
11384         loadpage_hi     = "  0   1   0   0      1   0   0   0",
11385                           "  x   x   x   x      x   x   x   x",
11386                           "  x  a6  a5  a4     a3  a2  a1  a0",
11387                           "  i   i   i   i      i   i   i   i";
11388
11389         writepage       = "  0   1   0   0      1   1   0   0",
11390                           "a15 a14 a13 a12    a11 a10  a9  a8",
11391                           " a7   x   x   x      x   x   x   x",
11392                           "  x   x   x   x      x   x   x   x";
11393
11394         mode            = 0x41;
11395         delay           = 10;
11396         blocksize       = 256;
11397         readsize        = 256;
11398       ;
11399
11400     memory "lfuse"
11401         size            = 1;
11402         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11403                           "x x x x  x x x x  i i i i  i i i i";
11404
11405         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11406                           "x x x x  x x x x  o o o o  o o o o";
11407         min_write_delay = 9000;
11408         max_write_delay = 9000;
11409       ;
11410
11411     memory "hfuse"
11412         size            = 1;
11413         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11414                           "x x x x  x x x x  i i i i  i i i i";
11415
11416         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11417                           "x x x x  x x x x  o o o o  o o o o";
11418         min_write_delay = 9000;
11419         max_write_delay = 9000;
11420       ;
11421
11422     memory "efuse"
11423         size            = 1;
11424         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11425                           "x x x x  x x x x  x x x x  x i i i";
11426
11427         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11428                           "x x x x  x x x x  o o o o  o o o o";
11429         min_write_delay = 9000;
11430         max_write_delay = 9000;
11431       ;
11432
11433     memory "lock"
11434         size            = 1;
11435         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
11436                           "x x x x  x x x x   x x o o  o o o o";
11437
11438         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
11439                           "x x x x  x x x x   1 1 i i  i i i i";
11440         min_write_delay = 9000;
11441         max_write_delay = 9000;
11442       ;
11443
11444     memory "calibration"
11445         size            = 1;
11446         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
11447                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
11448       ;
11449
11450     memory "signature"
11451         size            = 3;
11452         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
11453                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11454       ;
11455   ;
11456
11457 #------------------------------------------------------------
11458 # ATmega1281
11459 #------------------------------------------------------------
11460 # Identical to ATmega1280
11461
11462 part
11463     id               = "m1281";
11464     desc             = "ATMEGA1281";
11465     signature        = 0x1e 0x97 0x04;
11466     has_jtag         = yes;
11467 #    stk500_devcode   = 0xB2;
11468 #    avr910_devcode   = 0x43;
11469     chip_erase_delay = 9000;
11470     pagel            = 0xD7;
11471     bs2              = 0xA0;
11472     reset            = dedicated;
11473     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11474                        "x x x x  x x x x    x x x x  x x x x";
11475
11476     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
11477                        "x x x x  x x x x    x x x x  x x x x";
11478
11479     timeout             = 200;
11480     stabdelay           = 100;
11481     cmdexedelay         = 25;
11482     synchloops          = 32;
11483     bytedelay           = 0;
11484     pollindex           = 3;
11485     pollvalue           = 0x53;
11486     predelay            = 1;
11487     postdelay           = 1;
11488     pollmethod          = 1;
11489
11490     pp_controlstack     =
11491         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
11492         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
11493         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
11494         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
11495     hventerstabdelay    = 100;
11496     progmodedelay       = 0;
11497     latchcycles         = 5;
11498     togglevtg           = 1;
11499     poweroffdelay       = 15;
11500     resetdelayms        = 1;
11501     resetdelayus        = 0;
11502     hvleavestabdelay    = 15;
11503     chiperasepulsewidth = 0;
11504     chiperasepolltimeout = 10;
11505     programfusepulsewidth = 0;
11506     programfusepolltimeout = 5;
11507     programlockpulsewidth = 0;
11508     programlockpolltimeout = 5;
11509
11510     idr                 = 0x31;
11511     spmcr               = 0x57;
11512     rampz               = 0x3b;
11513     allowfullpagebitstream = no;
11514
11515     memory "eeprom"
11516         paged           = no; /* leave this "no" */
11517         page_size       = 8;  /* for parallel programming */
11518         size            = 4096;
11519         min_write_delay = 9000;
11520         max_write_delay = 9000;
11521         readback_p1     = 0x00;
11522         readback_p2     = 0x00;
11523         read            = "  1   0   1   0      0   0   0   0",
11524                           "  x   x   x   x    a11 a10  a9  a8",
11525                           " a7  a6  a5  a4     a3  a2  a1  a0",
11526                           "  o   o   o   o      o   o   o   o";
11527
11528         write           = "  1   1   0   0      0   0   0   0",
11529                           "  x   x   x   x    a11 a10  a9  a8",
11530                           " a7  a6  a5  a4     a3  a2  a1  a0", 
11531                           "  i   i   i   i      i   i   i   i";
11532
11533         loadpage_lo     = "  1   1   0   0      0   0   0   1",
11534                           "  0   0   0   0      0   0   0   0",
11535                           "  0   0   0   0      0  a2  a1  a0",
11536                           "  i   i   i   i      i   i   i   i";
11537
11538         writepage       = "  1   1   0   0      0   0   1   0",
11539                           "  0   0   x   x    a11 a10  a9  a8",
11540                           " a7  a6  a5  a4     a3   0   0   0",
11541                           "  x   x   x   x      x   x   x   x";
11542
11543         mode            = 0x41;
11544         delay           = 10;
11545         blocksize       = 8;
11546         readsize        = 256;
11547       ;
11548
11549     memory "flash"
11550         paged           = yes;
11551         size            = 131072;
11552         page_size       = 256;
11553         num_pages       = 512;
11554         min_write_delay = 4500;
11555         max_write_delay = 4500;
11556         readback_p1     = 0x00;
11557         readback_p2     = 0x00;
11558         read_lo         = "  0   0   1   0      0   0   0   0",
11559                           "a15 a14 a13 a12    a11 a10  a9  a8",
11560                           " a7  a6  a5  a4     a3  a2  a1  a0",
11561                           "  o   o   o   o      o   o   o   o";
11562
11563         read_hi         = "  0   0   1   0      1   0   0   0",
11564                           "a15 a14 a13 a12    a11 a10  a9  a8",
11565                           " a7  a6  a5  a4     a3  a2  a1  a0",
11566                           "  o   o   o   o      o   o   o   o";
11567
11568         loadpage_lo     = "  0   1   0   0      0   0   0   0",
11569                           "  x   x   x   x      x   x   x   x",
11570                           "  x  a6  a5  a4     a3  a2  a1  a0",
11571                           "  i   i   i   i      i   i   i   i";
11572
11573         loadpage_hi     = "  0   1   0   0      1   0   0   0",
11574                           "  x   x   x   x      x   x   x   x",
11575                           "  x  a6  a5  a4     a3  a2  a1  a0",
11576                           "  i   i   i   i      i   i   i   i";
11577
11578         writepage       = "  0   1   0   0      1   1   0   0",
11579                           "a15 a14 a13 a12    a11 a10  a9  a8",
11580                           " a7   x   x   x      x   x   x   x",
11581                           "  x   x   x   x      x   x   x   x";
11582
11583         mode            = 0x41;
11584         delay           = 10;
11585         blocksize       = 256;
11586         readsize        = 256;
11587       ;
11588
11589     memory "lfuse"
11590         size            = 1;
11591         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11592                           "x x x x  x x x x  i i i i  i i i i";
11593
11594         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11595                           "x x x x  x x x x  o o o o  o o o o";
11596         min_write_delay = 9000;
11597         max_write_delay = 9000;
11598       ;
11599
11600     memory "hfuse"
11601         size            = 1;
11602         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11603                           "x x x x  x x x x  i i i i  i i i i";
11604
11605         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11606                           "x x x x  x x x x  o o o o  o o o o";
11607         min_write_delay = 9000;
11608         max_write_delay = 9000;
11609       ;
11610
11611     memory "efuse"
11612         size            = 1;
11613         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11614                           "x x x x  x x x x  x x x x  x i i i";
11615
11616         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11617                           "x x x x  x x x x  o o o o  o o o o";
11618         min_write_delay = 9000;
11619         max_write_delay = 9000;
11620       ;
11621
11622     memory "lock"
11623         size            = 1;
11624         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
11625                           "x x x x  x x x x   x x o o  o o o o";
11626
11627         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
11628                           "x x x x  x x x x   1 1 i i  i i i i";
11629         min_write_delay = 9000;
11630         max_write_delay = 9000;
11631       ;
11632
11633     memory "calibration"
11634         size            = 1;
11635         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
11636                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
11637       ;
11638
11639     memory "signature"
11640         size            = 3;
11641         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
11642                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11643       ;
11644   ;
11645
11646 #------------------------------------------------------------
11647 # ATmega2560
11648 #------------------------------------------------------------
11649
11650 part
11651     id               = "m2560";
11652     desc             = "ATMEGA2560";
11653     signature        = 0x1e 0x98 0x01;
11654     has_jtag         = yes;
11655 #    stk500_devcode   = 0xB2;
11656 #    avr910_devcode   = 0x43;
11657     chip_erase_delay = 9000;
11658     pagel            = 0xD7;
11659     bs2              = 0xA0;
11660     reset            = dedicated;
11661     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11662                        "x x x x  x x x x    x x x x  x x x x";
11663
11664     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
11665                        "x x x x  x x x x    x x x x  x x x x";
11666
11667     timeout             = 200;
11668     stabdelay           = 100;
11669     cmdexedelay         = 25;
11670     synchloops          = 32;
11671     bytedelay           = 0;
11672     pollindex           = 3;
11673     pollvalue           = 0x53;
11674     predelay            = 1;
11675     postdelay           = 1;
11676     pollmethod          = 1;
11677
11678     pp_controlstack     =
11679         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
11680         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
11681         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
11682         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
11683     hventerstabdelay    = 100;
11684     progmodedelay       = 0;
11685     latchcycles         = 5;
11686     togglevtg           = 1;
11687     poweroffdelay       = 15;
11688     resetdelayms        = 1;
11689     resetdelayus        = 0;
11690     hvleavestabdelay    = 15;
11691     chiperasepulsewidth = 0;
11692     chiperasepolltimeout = 10;
11693     programfusepulsewidth = 0;
11694     programfusepolltimeout = 5;
11695     programlockpulsewidth = 0;
11696     programlockpolltimeout = 5;
11697
11698     idr                 = 0x31;
11699     spmcr               = 0x57;
11700     rampz               = 0x3b;
11701     allowfullpagebitstream = no;
11702
11703     memory "eeprom"
11704         paged           = no; /* leave this "no" */
11705         page_size       = 8;  /* for parallel programming */
11706         size            = 4096;
11707         min_write_delay = 9000;
11708         max_write_delay = 9000;
11709         readback_p1     = 0x00;
11710         readback_p2     = 0x00;
11711         read            = "  1   0   1   0      0   0   0   0",
11712                           "  x   x   x   x    a11 a10  a9  a8",
11713                           " a7  a6  a5  a4     a3  a2  a1  a0",
11714                           "  o   o   o   o      o   o   o   o";
11715
11716         write           = "  1   1   0   0      0   0   0   0",
11717                           "  x   x   x   x    a11 a10  a9  a8",
11718                           " a7  a6  a5  a4     a3  a2  a1  a0", 
11719                           "  i   i   i   i      i   i   i   i";
11720
11721         loadpage_lo     = "  1   1   0   0      0   0   0   1",
11722                           "  0   0   0   0      0   0   0   0",
11723                           "  0   0   0   0      0  a2  a1  a0",
11724                           "  i   i   i   i      i   i   i   i";
11725
11726         writepage       = "  1   1   0   0      0   0   1   0",
11727                           "  0   0   x   x    a11 a10  a9  a8",
11728                           " a7  a6  a5  a4     a3   0   0   0",
11729                           "  x   x   x   x      x   x   x   x";
11730
11731         mode            = 0x41;
11732         delay           = 10;
11733         blocksize       = 8;
11734         readsize        = 256;
11735       ;
11736
11737     memory "flash"
11738         paged           = yes;
11739         size            = 262144;
11740         page_size       = 256;
11741         num_pages       = 1024;
11742         min_write_delay = 4500;
11743         max_write_delay = 4500;
11744         readback_p1     = 0x00;
11745         readback_p2     = 0x00;
11746         read_lo         = "  0   0   1   0      0   0   0   0",
11747                           "a15 a14 a13 a12    a11 a10  a9  a8",
11748                           " a7  a6  a5  a4     a3  a2  a1  a0",
11749                           "  o   o   o   o      o   o   o   o";
11750
11751         read_hi         = "  0   0   1   0      1   0   0   0",
11752                           "a15 a14 a13 a12    a11 a10  a9  a8",
11753                           " a7  a6  a5  a4     a3  a2  a1  a0",
11754                           "  o   o   o   o      o   o   o   o";
11755
11756         loadpage_lo     = "  0   1   0   0      0   0   0   0",
11757                           "  x   x   x   x      x   x   x   x",
11758                           "  x  a6  a5  a4     a3  a2  a1  a0",
11759                           "  i   i   i   i      i   i   i   i";
11760
11761         loadpage_hi     = "  0   1   0   0      1   0   0   0",
11762                           "  x   x   x   x      x   x   x   x",
11763                           "  x  a6  a5  a4     a3  a2  a1  a0",
11764                           "  i   i   i   i      i   i   i   i";
11765
11766         writepage       = "  0   1   0   0      1   1   0   0",
11767                           "a15 a14 a13 a12    a11 a10  a9  a8",
11768                           " a7   x   x   x      x   x   x   x",
11769                           "  x   x   x   x      x   x   x   x";
11770
11771         load_ext_addr   = "  0   1   0   0      1   1   0   1",
11772                           "  0   0   0   0      0   0   0   0",
11773                           "  0   0   0   0      0   0   0 a16",
11774                           "  0   0   0   0      0   0   0   0";
11775
11776         mode            = 0x41;
11777         delay           = 10;
11778         blocksize       = 256;
11779         readsize        = 256;
11780       ;
11781
11782     memory "lfuse"
11783         size            = 1;
11784         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11785                           "x x x x  x x x x  i i i i  i i i i";
11786
11787         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11788                           "x x x x  x x x x  o o o o  o o o o";
11789         min_write_delay = 9000;
11790         max_write_delay = 9000;
11791       ;
11792
11793     memory "hfuse"
11794         size            = 1;
11795         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11796                           "x x x x  x x x x  i i i i  i i i i";
11797
11798         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11799                           "x x x x  x x x x  o o o o  o o o o";
11800         min_write_delay = 9000;
11801         max_write_delay = 9000;
11802       ;
11803
11804     memory "efuse"
11805         size            = 1;
11806         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
11807                           "x x x x  x x x x  x x x x  x i i i";
11808
11809         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
11810                           "x x x x  x x x x  o o o o  o o o o";
11811         min_write_delay = 9000;
11812         max_write_delay = 9000;
11813       ;
11814
11815     memory "lock"
11816         size            = 1;
11817         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
11818                           "x x x x  x x x x   x x o o  o o o o";
11819
11820         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
11821                           "x x x x  x x x x   1 1 i i  i i i i";
11822         min_write_delay = 9000;
11823         max_write_delay = 9000;
11824       ;
11825
11826     memory "calibration"
11827         size            = 1;
11828         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
11829                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
11830       ;
11831
11832     memory "signature"
11833         size            = 3;
11834         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
11835                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
11836       ;
11837   ;
11838
11839 #------------------------------------------------------------
11840 # ATmega2561
11841 #------------------------------------------------------------
11842
11843 part
11844     id               = "m2561";
11845     desc             = "ATMEGA2561";
11846     signature        = 0x1e 0x98 0x02;
11847     has_jtag         = yes;
11848 #    stk500_devcode   = 0xB2;
11849 #    avr910_devcode   = 0x43;
11850     chip_erase_delay = 9000;
11851     pagel            = 0xD7;
11852     bs2              = 0xA0;
11853     reset            = dedicated;
11854     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
11855                        "x x x x  x x x x    x x x x  x x x x";
11856
11857     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
11858                        "x x x x  x x x x    x x x x  x x x x";
11859
11860     timeout             = 200;
11861     stabdelay           = 100;
11862     cmdexedelay         = 25;
11863     synchloops          = 32;
11864     bytedelay           = 0;
11865     pollindex           = 3;
11866     pollvalue           = 0x53;
11867     predelay            = 1;
11868     postdelay           = 1;
11869     pollmethod          = 1;
11870
11871     pp_controlstack     =
11872         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
11873         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
11874         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
11875         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
11876     hventerstabdelay    = 100;
11877     progmodedelay       = 0;
11878     latchcycles         = 5;
11879     togglevtg           = 1;
11880     poweroffdelay       = 15;
11881     resetdelayms        = 1;
11882     resetdelayus        = 0;
11883     hvleavestabdelay    = 15;
11884     chiperasepulsewidth = 0;
11885     chiperasepolltimeout = 10;
11886     programfusepulsewidth = 0;
11887     programfusepolltimeout = 5;
11888     programlockpulsewidth = 0;
11889     programlockpolltimeout = 5;
11890
11891     idr                 = 0x31;
11892     spmcr               = 0x57;
11893     rampz               = 0x3b;
11894     allowfullpagebitstream = no;
11895
11896     memory "eeprom"
11897         paged           = no; /* leave this "no" */
11898         page_size       = 8;  /* for parallel programming */
11899         size            = 4096;
11900         min_write_delay = 9000;
11901         max_write_delay = 9000;
11902         readback_p1     = 0x00;
11903         readback_p2     = 0x00;
11904         read            = "  1   0   1   0      0   0   0   0",
11905                           "  x   x   x   x    a11 a10  a9  a8",
11906                           " a7  a6  a5  a4     a3  a2  a1  a0",
11907                           "  o   o   o   o      o   o   o   o";
11908
11909         write           = "  1   1   0   0      0   0   0   0",
11910                           "  x   x   x   x    a11 a10  a9  a8",
11911                           " a7  a6  a5  a4     a3  a2  a1  a0", 
11912                           "  i   i   i   i      i   i   i   i";
11913
11914         loadpage_lo     = "  1   1   0   0      0   0   0   1",
11915                           "  0   0   0   0      0   0   0   0",
11916                           "  0   0   0   0      0  a2  a1  a0",
11917                           "  i   i   i   i      i   i   i   i";
11918
11919         writepage       = "  1   1   0   0      0   0   1   0",
11920                           "  0   0   x   x    a11 a10  a9  a8",
11921                           " a7  a6  a5  a4     a3   0   0   0",
11922                           "  x   x   x   x      x   x   x   x";
11923
11924         mode            = 0x41;
11925         delay           = 10;
11926         blocksize       = 8;
11927         readsize        = 256;
11928       ;
11929
11930     memory "flash"
11931         paged           = yes;
11932         size            = 262144;
11933         page_size       = 256;
11934         num_pages       = 1024;
11935         min_write_delay = 4500;
11936         max_write_delay = 4500;
11937         readback_p1     = 0x00;
11938         readback_p2     = 0x00;
11939         read_lo         = "  0   0   1   0      0   0   0   0",
11940                           "a15 a14 a13 a12    a11 a10  a9  a8",
11941                           " a7  a6  a5  a4     a3  a2  a1  a0",
11942                           "  o   o   o   o      o   o   o   o";
11943
11944         read_hi         = "  0   0   1   0      1   0   0   0",
11945                           "a15 a14 a13 a12    a11 a10  a9  a8",
11946                           " a7  a6  a5  a4     a3  a2  a1  a0",
11947                           "  o   o   o   o      o   o   o   o";
11948
11949         loadpage_lo     = "  0   1   0   0      0   0   0   0",
11950                           "  x   x   x   x      x   x   x   x",
11951                           "  x  a6  a5  a4     a3  a2  a1  a0",
11952                           "  i   i   i   i      i   i   i   i";
11953
11954         loadpage_hi     = "  0   1   0   0      1   0   0   0",
11955                           "  x   x   x   x      x   x   x   x",
11956                           "  x  a6  a5  a4     a3  a2  a1  a0",
11957                           "  i   i   i   i      i   i   i   i";
11958
11959         writepage       = "  0   1   0   0      1   1   0   0",
11960                           "a15 a14 a13 a12    a11 a10  a9  a8",
11961                           " a7   x   x   x      x   x   x   x",
11962                           "  x   x   x   x      x   x   x   x";
11963
11964         load_ext_addr   = "  0   1   0   0      1   1   0   1",
11965                           "  0   0   0   0      0   0   0   0",
11966                           "  0   0   0   0      0   0   0 a16",
11967                           "  0   0   0   0      0   0   0   0";
11968
11969         mode            = 0x41;
11970         delay           = 10;
11971         blocksize       = 256;
11972         readsize        = 256;
11973       ;
11974
11975     memory "lfuse"
11976         size            = 1;
11977         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
11978                           "x x x x  x x x x  i i i i  i i i i";
11979
11980         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
11981                           "x x x x  x x x x  o o o o  o o o o";
11982         min_write_delay = 9000;
11983         max_write_delay = 9000;
11984       ;
11985
11986     memory "hfuse"
11987         size            = 1;
11988         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
11989                           "x x x x  x x x x  i i i i  i i i i";
11990
11991         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
11992                           "x x x x  x x x x  o o o o  o o o o";
11993         min_write_delay = 9000;
11994         max_write_delay = 9000;
11995       ;
11996
11997     memory "efuse"
11998         size            = 1;
11999         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12000                           "x x x x  x x x x  x x x x  x i i i";
12001
12002         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12003                           "x x x x  x x x x  o o o o  o o o o";
12004         min_write_delay = 9000;
12005         max_write_delay = 9000;
12006       ;
12007
12008     memory "lock"
12009         size            = 1;
12010         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12011                           "x x x x  x x x x   x x o o  o o o o";
12012
12013         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12014                           "x x x x  x x x x   1 1 i i  i i i i";
12015         min_write_delay = 9000;
12016         max_write_delay = 9000;
12017       ;
12018
12019     memory "calibration"
12020         size            = 1;
12021         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
12022                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
12023       ;
12024
12025     memory "signature"
12026         size            = 3;
12027         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
12028                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12029       ;
12030   ;
12031
12032 #------------------------------------------------------------
12033 # ATmega128RFA1
12034 #------------------------------------------------------------
12035 # Identical to ATmega2561 but half the ROM
12036
12037 part
12038     id               = "m128rfa1";
12039     desc             = "ATMEGA128RFA1";
12040     signature        = 0x1e 0xa7 0x01;
12041     has_jtag         = yes;
12042 #    stk500_devcode   = 0xB2;
12043 #    avr910_devcode   = 0x43;
12044     chip_erase_delay = 55000;
12045     pagel            = 0xD7;
12046     bs2              = 0xE2;
12047     reset            = dedicated;
12048     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12049                        "x x x x  x x x x    x x x x  x x x x";
12050
12051     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
12052                        "x x x x  x x x x    x x x x  x x x x";
12053
12054     timeout             = 200;
12055     stabdelay           = 100;
12056     cmdexedelay         = 25;
12057     synchloops          = 32;
12058     bytedelay           = 0;
12059     pollindex           = 3;
12060     pollvalue           = 0x53;
12061     predelay            = 1;
12062     postdelay           = 1;
12063     pollmethod          = 1;
12064
12065     pp_controlstack     =
12066         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12067         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12068         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12069         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
12070     hventerstabdelay    = 100;
12071     progmodedelay       = 0;
12072     latchcycles         = 5;
12073     togglevtg           = 1;
12074     poweroffdelay       = 15;
12075     resetdelayms        = 1;
12076     resetdelayus        = 0;
12077     hvleavestabdelay    = 15;
12078     chiperasepulsewidth = 0;
12079     chiperasepolltimeout = 10;
12080     programfusepulsewidth = 0;
12081     programfusepolltimeout = 5;
12082     programlockpulsewidth = 0;
12083     programlockpolltimeout = 5;
12084
12085     idr                 = 0x31;
12086     spmcr               = 0x57;
12087     rampz               = 0x3b;
12088     allowfullpagebitstream = no;
12089
12090     memory "eeprom"
12091         paged           = no; /* leave this "no" */
12092         page_size       = 8;  /* for parallel programming */
12093         size            = 4096;
12094         min_write_delay = 50000;
12095         max_write_delay = 50000;
12096         readback_p1     = 0x00;
12097         readback_p2     = 0x00;
12098         read            = "  1   0   1   0      0   0   0   0",
12099                           "  x   x   x   x    a11 a10  a9  a8",
12100                           " a7  a6  a5  a4     a3  a2  a1  a0",
12101                           "  o   o   o   o      o   o   o   o";
12102
12103         write           = "  1   1   0   0      0   0   0   0",
12104                           "  x   x   x   x    a11 a10  a9  a8",
12105                           " a7  a6  a5  a4     a3  a2  a1  a0", 
12106                           "  i   i   i   i      i   i   i   i";
12107
12108         loadpage_lo     = "  1   1   0   0      0   0   0   1",
12109                           "  0   0   0   0      0   0   0   0",
12110                           "  0   0   0   0      0  a2  a1  a0",
12111                           "  i   i   i   i      i   i   i   i";
12112
12113         writepage       = "  1   1   0   0      0   0   1   0",
12114                           "  0   0   x   x    a11 a10  a9  a8",
12115                           " a7  a6  a5  a4     a3   0   0   0",
12116                           "  x   x   x   x      x   x   x   x";
12117
12118         mode            = 0x41;
12119         delay           = 10;
12120         blocksize       = 8;
12121         readsize        = 256;
12122       ;
12123
12124     memory "flash"
12125         paged           = yes;
12126         size            = 131072;
12127         page_size       = 256;
12128         num_pages       = 512;
12129         min_write_delay = 50000;
12130         max_write_delay = 50000;
12131         readback_p1     = 0x00;
12132         readback_p2     = 0x00;
12133         read_lo         = "  0   0   1   0      0   0   0   0",
12134                           "a15 a14 a13 a12    a11 a10  a9  a8",
12135                           " a7  a6  a5  a4     a3  a2  a1  a0",
12136                           "  o   o   o   o      o   o   o   o";
12137
12138         read_hi         = "  0   0   1   0      1   0   0   0",
12139                           "a15 a14 a13 a12    a11 a10  a9  a8",
12140                           " a7  a6  a5  a4     a3  a2  a1  a0",
12141                           "  o   o   o   o      o   o   o   o";
12142
12143         loadpage_lo     = "  0   1   0   0      0   0   0   0",
12144                           "  x   x   x   x      x   x   x   x",
12145                           "  x  a6  a5  a4     a3  a2  a1  a0",
12146                           "  i   i   i   i      i   i   i   i";
12147
12148         loadpage_hi     = "  0   1   0   0      1   0   0   0",
12149                           "  x   x   x   x      x   x   x   x",
12150                           "  x  a6  a5  a4     a3  a2  a1  a0",
12151                           "  i   i   i   i      i   i   i   i";
12152
12153         writepage       = "  0   1   0   0      1   1   0   0",
12154                           "a15 a14 a13 a12    a11 a10  a9  a8",
12155                           " a7   x   x   x      x   x   x   x",
12156                           "  x   x   x   x      x   x   x   x";
12157
12158         mode            = 0x41;
12159         delay           = 20;
12160         blocksize       = 256;
12161         readsize        = 256;
12162       ;
12163
12164     memory "lfuse"
12165         size            = 1;
12166         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12167                           "x x x x  x x x x  i i i i  i i i i";
12168
12169         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12170                           "x x x x  x x x x  o o o o  o o o o";
12171         min_write_delay = 9000;
12172         max_write_delay = 9000;
12173       ;
12174
12175     memory "hfuse"
12176         size            = 1;
12177         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12178                           "x x x x  x x x x  i i i i  i i i i";
12179
12180         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12181                           "x x x x  x x x x  o o o o  o o o o";
12182         min_write_delay = 9000;
12183         max_write_delay = 9000;
12184       ;
12185
12186     memory "efuse"
12187         size            = 1;
12188         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12189                           "x x x x  x x x x  x x x x  x i i i";
12190
12191         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12192                           "x x x x  x x x x  o o o o  o o o o";
12193         min_write_delay = 9000;
12194         max_write_delay = 9000;
12195       ;
12196
12197     memory "lock"
12198         size            = 1;
12199         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12200                           "x x x x  x x x x   x x o o  o o o o";
12201
12202         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12203                           "x x x x  x x x x   1 1 i i  i i i i";
12204         min_write_delay = 9000;
12205         max_write_delay = 9000;
12206       ;
12207
12208     memory "calibration"
12209         size            = 1;
12210         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
12211                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
12212       ;
12213
12214     memory "signature"
12215         size            = 3;
12216         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
12217                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12218       ;
12219   ;
12220
12221 #------------------------------------------------------------
12222 # ATtiny24
12223 #------------------------------------------------------------
12224
12225 part
12226      id            = "t24";
12227      desc          = "ATtiny24";
12228      has_debugwire = yes;
12229      flash_instr   = 0xB4, 0x07, 0x17;
12230      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
12231                      0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
12232                      0x99, 0xE1, 0xBB, 0xAC;
12233 ## no STK500 devcode in XML file, use the ATtiny45 one
12234      stk500_devcode   = 0x14;
12235 ##  avr910_devcode   = ?;
12236 ##  Try the AT90S2313 devcode:
12237      avr910_devcode   = 0x20;
12238      signature        = 0x1e 0x91 0x0b;
12239      reset            = io;
12240      chip_erase_delay = 4500;
12241
12242      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12243                         "x x x x  x x x x    x x x x  x x x x";
12244
12245      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12246                         "x x x x  x x x x    x x x x  x x x x";
12247
12248     timeout             = 200;
12249     stabdelay           = 100;
12250     cmdexedelay         = 25;
12251     synchloops          = 32;
12252     bytedelay           = 0;
12253     pollindex           = 3;
12254     pollvalue           = 0x53;
12255     predelay            = 1;
12256     postdelay           = 1;
12257     pollmethod          = 1;
12258
12259     hvsp_controlstack   =
12260         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
12261         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
12262         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
12263         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F;
12264     hventerstabdelay    = 100;
12265     hvspcmdexedelay     = 0;
12266     synchcycles         = 6;
12267     latchcycles         = 1;
12268     togglevtg           = 1;
12269     poweroffdelay       = 25;
12270     resetdelayms        = 0;
12271     resetdelayus        = 70;
12272     hvleavestabdelay    = 100;
12273     resetdelay          = 25;
12274     chiperasepolltimeout = 40;
12275     chiperasetime       = 0;
12276     programfusepolltimeout = 25;
12277     programlockpolltimeout = 25;
12278
12279      memory "eeprom"
12280          size            = 128;
12281         paged           = no;
12282         page_size       = 4;
12283          min_write_delay = 4000;
12284          max_write_delay = 4500;
12285          readback_p1     = 0xff;
12286          readback_p2     = 0xff;
12287          read            = "1  0  1  0   0  0  0  0   0 0 0 x  x x x x",
12288                            "x a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
12289
12290          write           = "1  1  0  0   0  0  0  0   0 0 0 x  x x x x",
12291                            "x a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
12292
12293         loadpage_lo     = "  1   1   0   0      0   0   0   1",
12294                           "  0   0   0   0      0   0   0   0",
12295                           "  0   0   0   0      0   0  a1  a0",
12296                           "  i   i   i   i      i   i   i   i";
12297
12298         writepage       = "  1   1   0   0      0   0   1   0",
12299                           "  0   0   x   x      x   x   x   x",
12300                           "  x  a6  a5  a4     a3  a2   0   0",
12301                           "  x   x   x   x      x   x   x   x";
12302
12303         mode            = 0x41;
12304         delay           = 6;
12305         blocksize       = 4;
12306         readsize        = 256;
12307        ;
12308      memory "flash"
12309          paged           = yes;
12310          size            = 2048;
12311          page_size       = 32;
12312          num_pages       = 64;
12313          min_write_delay = 4500;
12314          max_write_delay = 4500;
12315          readback_p1     = 0xff;
12316          readback_p2     = 0xff;
12317          read_lo         = "  0   0   1   0    0   0   0   0",
12318                            "  0   0   0   0    0   0  a9  a8",
12319                            " a7  a6  a5  a4   a3  a2  a1  a0",
12320                            "  o   o   o   o    o   o   o   o";
12321
12322          read_hi         = "  0   0   1   0    1   0   0   0",
12323                            "  0   0   0   0    0   0  a9  a8",
12324                            " a7  a6  a5  a4   a3  a2  a1  a0",
12325                            "  o   o   o   o    o   o   o   o";
12326
12327          loadpage_lo     = "  0   1   0   0    0   0   0   0",
12328                            "  0   0   0   x    x   x   x   x",
12329                            "  x   x   x   x   a3  a2  a1  a0",
12330                            "  i   i   i   i    i   i   i   i";
12331
12332          loadpage_hi     = "  0   1   0   0    1   0   0   0",
12333                            "  0   0   0   x    x   x   x   x",
12334                            "  x   x   x   x   a3  a2  a1  a0",
12335                            "  i   i   i   i    i   i   i   i";
12336
12337          writepage       = "  0  1  0  0   1  1  0  0",
12338                            "  0  0  0  0   0  0 a9 a8",
12339                            " a7 a6 a5 a4   x  x  x  x",
12340                            "  x  x  x  x   x  x  x  x";
12341
12342         mode            = 0x41;
12343         delay           = 6;
12344         blocksize       = 32;
12345         readsize        = 256;
12346        ;
12347 #   ATtiny24 has Signature Bytes: 0x1E 0x91 0x0B.
12348      memory "signature"
12349          size            = 3;
12350          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
12351                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12352        ;
12353      memory "lock"
12354          size            = 1;
12355          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
12356                            "x x x x  x x x x  x x x x  x x i i";
12357          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
12358                            "0 0 0 0  0 0 0 0  o o o o  o o o o";
12359         min_write_delay = 9000;
12360         max_write_delay = 9000;
12361        ;
12362
12363      memory "lfuse"
12364          size            = 1;
12365          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12366                            "x x x x  x x x x  i i i i  i i i i";
12367
12368          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12369                            "x x x x  x x x x  o o o o  o o o o";
12370         min_write_delay = 9000;
12371         max_write_delay = 9000;
12372        ;
12373
12374      memory "hfuse"
12375          size            = 1;
12376          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12377                            "x x x x  x x x x  i i i i  i i i i";
12378
12379          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12380                            "x x x x  x x x x  o o o o  o o o o";
12381         min_write_delay = 9000;
12382         max_write_delay = 9000;
12383        ;
12384
12385      memory "efuse"
12386          size            = 1;
12387          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12388                            "x x x x  x x x x  x x x x  x x x i";
12389
12390          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12391                            "x x x x  x x x x  o o o o  o o o o";
12392         min_write_delay = 9000;
12393         max_write_delay = 9000;
12394      ;
12395
12396      memory "calibration"
12397          size            = 1;
12398          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
12399                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
12400      ;
12401   ;
12402
12403 #------------------------------------------------------------
12404 # ATtiny44
12405 #------------------------------------------------------------
12406
12407 part
12408      id            = "t44";
12409      desc          = "ATtiny44";
12410      has_debugwire = yes;
12411      flash_instr   = 0xB4, 0x07, 0x17;
12412      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
12413                      0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
12414                      0x99, 0xE1, 0xBB, 0xAC;
12415 ## no STK500 devcode in XML file, use the ATtiny45 one
12416      stk500_devcode   = 0x14;
12417 ##  avr910_devcode   = ?;
12418 ##  Try the AT90S2313 devcode:
12419      avr910_devcode   = 0x20;
12420      signature        = 0x1e 0x92 0x07;
12421      reset            = io;
12422      chip_erase_delay = 4500;
12423
12424      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12425                         "x x x x  x x x x    x x x x  x x x x";
12426
12427      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12428                         "x x x x  x x x x    x x x x  x x x x";
12429
12430     timeout             = 200;
12431     stabdelay           = 100;
12432     cmdexedelay         = 25;
12433     synchloops          = 32;
12434     bytedelay           = 0;
12435     pollindex           = 3;
12436     pollvalue           = 0x53;
12437     predelay            = 1;
12438     postdelay           = 1;
12439     pollmethod          = 1;
12440
12441     hvsp_controlstack   =
12442         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
12443         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
12444         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
12445         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F;
12446     hventerstabdelay    = 100;
12447     hvspcmdexedelay     = 0;
12448     synchcycles         = 6;
12449     latchcycles         = 1;
12450     togglevtg           = 1;
12451     poweroffdelay       = 25;
12452     resetdelayms        = 0;
12453     resetdelayus        = 70;
12454     hvleavestabdelay    = 100;
12455     resetdelay          = 25;
12456     chiperasepolltimeout = 40;
12457     chiperasetime       = 0;
12458     programfusepolltimeout = 25;
12459     programlockpolltimeout = 25;
12460
12461      memory "eeprom"
12462          size            = 256;
12463         paged           = no;
12464         page_size       = 4;
12465          min_write_delay = 4000;
12466          max_write_delay = 4500;
12467          readback_p1     = 0xff;
12468          readback_p2     = 0xff;
12469          read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x x",
12470                            "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
12471
12472          write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x x",
12473                            "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
12474
12475         loadpage_lo     = "  1   1   0   0      0   0   0   1",
12476                           "  0   0   0   0      0   0   0   0",
12477                           "  0   0   0   0      0   0  a1  a0",
12478                           "  i   i   i   i      i   i   i   i";
12479
12480         writepage       = "  1   1   0   0      0   0   1   0",
12481                           "  0   0   x   x      x   x   x   x",
12482                           "  x  a6  a5  a4     a3  a2   0   0",
12483                           "  x   x   x   x      x   x   x   x";
12484
12485         mode            = 0x41;
12486         delay           = 6;
12487         blocksize       = 4;
12488         readsize        = 256;
12489        ;
12490      memory "flash"
12491          paged           = yes;
12492          size            = 4096;
12493          page_size       = 64;
12494          num_pages       = 64;
12495          min_write_delay = 4500;
12496          max_write_delay = 4500;
12497          readback_p1     = 0xff;
12498          readback_p2     = 0xff;
12499          read_lo         = "  0   0   1   0    0   0   0   0",
12500                            "  0   0   0   0    0  a10 a9  a8",
12501                            " a7  a6  a5  a4   a3  a2  a1  a0",
12502                            "  o   o   o   o    o   o   o   o";
12503
12504          read_hi         = "  0   0   1   0    1   0   0   0",
12505                            "  0   0   0   0    0  a10 a9  a8",
12506                            " a7  a6  a5  a4   a3  a2  a1  a0",
12507                            "  o   o   o   o    o   o   o   o";
12508
12509          loadpage_lo     = "  0   1   0   0    0   0   0   0",
12510                            "  0   0   0   x    x   x   x   x",
12511                            "  x   x   x  a4   a3  a2  a1  a0",
12512                            "  i   i   i   i    i   i   i   i";
12513
12514          loadpage_hi     = "  0   1   0   0    1   0   0   0",
12515                            "  0   0   0   x    x   x   x   x",
12516                            "  x   x   x  a4   a3  a2  a1  a0",
12517                            "  i   i   i   i    i   i   i   i";
12518
12519          writepage       = "  0  1  0  0   1  1  0  0",
12520                            "  0  0  0  0   0 a10 a9 a8",
12521                            " a7 a6 a5  x   x  x  x  x",
12522                            "  x  x  x  x   x  x  x  x";
12523
12524         mode            = 0x41;
12525         delay           = 6;
12526         blocksize       = 32;
12527         readsize        = 256;
12528        ;
12529 #   ATtiny44 has Signature Bytes: 0x1E 0x92 0x07.
12530      memory "signature"
12531          size            = 3;
12532          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
12533                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12534        ;
12535      memory "lock"
12536          size            = 1;
12537          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
12538                            "x x x x  x x x x  x x x x  x x i i";
12539          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
12540                            "0 0 0 0  0 0 0 0  o o o o  o o o o";
12541         min_write_delay = 9000;
12542         max_write_delay = 9000;
12543        ;
12544
12545      memory "lfuse"
12546          size            = 1;
12547          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12548                            "x x x x  x x x x  i i i i  i i i i";
12549
12550          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12551                            "x x x x  x x x x  o o o o  o o o o";
12552         min_write_delay = 9000;
12553         max_write_delay = 9000;
12554        ;
12555
12556      memory "hfuse"
12557          size            = 1;
12558          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12559                            "x x x x  x x x x  i i i i  i i i i";
12560
12561          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12562                            "x x x x  x x x x  o o o o  o o o o";
12563         min_write_delay = 9000;
12564         max_write_delay = 9000;
12565        ;
12566
12567      memory "efuse"
12568          size            = 1;
12569          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12570                            "x x x x  x x x x  x x x x  x x x i";
12571
12572          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12573                            "x x x x  x x x x  o o o o  o o o o";
12574         min_write_delay = 9000;
12575         max_write_delay = 9000;
12576      ;
12577
12578      memory "calibration"
12579          size            = 1;
12580          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
12581                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
12582      ;
12583   ;
12584
12585 #------------------------------------------------------------
12586 # ATtiny84
12587 #------------------------------------------------------------
12588
12589 part
12590      id            = "t84";
12591      desc          = "ATtiny84";
12592      has_debugwire = yes;
12593      flash_instr   = 0xB4, 0x07, 0x17;
12594      eeprom_instr  = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D,
12595                      0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC,
12596                      0x99, 0xE1, 0xBB, 0xAC;
12597 ## no STK500 devcode in XML file, use the ATtiny45 one
12598      stk500_devcode   = 0x14;
12599 ##  avr910_devcode   = ?;
12600 ##  Try the AT90S2313 devcode:
12601      avr910_devcode   = 0x20;
12602      signature        = 0x1e 0x93 0x0c;
12603      reset            = io;
12604      chip_erase_delay = 4500;
12605
12606      pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12607                         "x x x x  x x x x    x x x x  x x x x";
12608
12609      chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
12610                         "x x x x  x x x x    x x x x  x x x x";
12611
12612     timeout             = 200;
12613     stabdelay           = 100;
12614     cmdexedelay         = 25;
12615     synchloops          = 32;
12616     bytedelay           = 0;
12617     pollindex           = 3;
12618     pollvalue           = 0x53;
12619     predelay            = 1;
12620     postdelay           = 1;
12621     pollmethod          = 1;
12622
12623     hvsp_controlstack   =
12624         0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66,
12625         0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78,
12626         0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10,
12627         0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F;
12628     hventerstabdelay    = 100;
12629     hvspcmdexedelay     = 0;
12630     synchcycles         = 6;
12631     latchcycles         = 1;
12632     togglevtg           = 1;
12633     poweroffdelay       = 25;
12634     resetdelayms        = 0;
12635     resetdelayus        = 70;
12636     hvleavestabdelay    = 100;
12637     resetdelay          = 25;
12638     chiperasepolltimeout = 40;
12639     chiperasetime       = 0;
12640     programfusepolltimeout = 25;
12641     programlockpolltimeout = 25;
12642
12643      memory "eeprom"
12644          size            = 512;
12645         paged           = no;
12646         page_size       = 4;
12647          min_write_delay = 4000;
12648          max_write_delay = 4500;
12649          readback_p1     = 0xff;
12650          readback_p2     = 0xff;
12651          read            = "1  0  1  0   0  0  0  0    0 0 0 x  x x x a8",
12652                            "a7 a6 a5 a4  a3 a2 a1 a0   o o o o  o o o o";
12653
12654          write           = "1  1  0  0   0  0  0  0    0 0 0 x  x x x a8",
12655                            "a7 a6 a5 a4  a3 a2 a1 a0   i i i i  i i i i";
12656
12657         loadpage_lo     = "  1   1   0   0      0   0   0   1",
12658                           "  0   0   0   0      0   0   0   0",
12659                           "  0   0   0   0      0   0  a1  a0",
12660                           "  i   i   i   i      i   i   i   i";
12661
12662         writepage       = "  1   1   0   0      0   0   1   0",
12663                           "  0   0   x   x      x   x   x   x",
12664                           "  x  a6  a5  a4     a3  a2   0   0",
12665                           "  x   x   x   x      x   x   x   x";
12666
12667         mode            = 0x41;
12668         delay           = 6;
12669         blocksize       = 4;
12670         readsize        = 256;
12671        ;
12672      memory "flash"
12673          paged           = yes;
12674          size            = 8192;
12675          page_size       = 64;
12676          num_pages       = 128;
12677          min_write_delay = 4500;
12678          max_write_delay = 4500;
12679          readback_p1     = 0xff;
12680          readback_p2     = 0xff;
12681          read_lo         = "  0   0   1   0    0   0   0   0",
12682                            "  0   0   0   0  a11 a10  a9  a8",
12683                            " a7  a6  a5  a4   a3  a2  a1  a0",
12684                            "  o   o   o   o    o   o   o   o";
12685
12686          read_hi         = "  0   0   1   0    1   0   0   0",
12687                            "  0   0   0   0  a11 a10  a9  a8",
12688                            " a7  a6  a5  a4   a3  a2  a1  a0",
12689                            "  o   o   o   o    o   o   o   o";
12690
12691          loadpage_lo     = "  0   1   0   0    0   0   0   0",
12692                            "  0   0   0   x    x   x   x   x",
12693                            "  x   x   x  a4   a3  a2  a1  a0",
12694                            "  i   i   i   i    i   i   i   i";
12695
12696          loadpage_hi     = "  0   1   0   0    1   0   0   0",
12697                            "  0   0   0   x    x   x   x   x",
12698                            "  x   x   x  a4   a3  a2  a1  a0",
12699                            "  i   i   i   i    i   i   i   i";
12700
12701          writepage       = "  0  1  0  0   1   1   0  0",
12702                            "  0  0  0  0  a11 a10 a9 a8",
12703                            " a7 a6 a5  x   x  x  x  x",
12704                            "  x  x  x  x   x  x  x  x";
12705
12706         mode            = 0x41;
12707         delay           = 6;
12708         blocksize       = 32;
12709         readsize        = 256;
12710        ;
12711 #   ATtiny84 has Signature Bytes: 0x1E 0x93 0x0C.
12712      memory "signature"
12713          size            = 3;
12714          read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
12715                            "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12716        ;
12717
12718      memory "lock"
12719          size            = 1;
12720          write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
12721                            "x x x x  x x x x  x x x x  x x i i";
12722          read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
12723                            "0 0 0 0  0 0 0 0  o o o o  o o o o";
12724         min_write_delay = 9000;
12725         max_write_delay = 9000;
12726        ;
12727
12728      memory "lfuse"
12729          size            = 1;
12730          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12731                            "x x x x  x x x x  i i i i  i i i i";
12732
12733          read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12734                            "x x x x  x x x x  o o o o  o o o o";
12735         min_write_delay = 9000;
12736         max_write_delay = 9000;
12737        ;
12738
12739      memory "hfuse"
12740          size            = 1;
12741          write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12742                            "x x x x  x x x x  i i i i  i i i i";
12743
12744          read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12745                            "x x x x  x x x x  o o o o  o o o o";
12746         min_write_delay = 9000;
12747         max_write_delay = 9000;
12748        ;
12749
12750      memory "efuse"
12751          size            = 1;
12752          write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12753                            "x x x x  x x x x  x x x x  x x x i";
12754
12755          read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12756                            "x x x x  x x x x  o o o o  o o o o";
12757         min_write_delay = 9000;
12758         max_write_delay = 9000;
12759      ;
12760
12761      memory "calibration"
12762          size            = 1;
12763          read            = "0  0  1  1   1  0  0  0    0 0 0 x  x x x x",
12764                            "0  0  0  0   0  0  0  a0   o o o o  o o o o";
12765      ;
12766   ;
12767
12768 #------------------------------------------------------------
12769 # ATmega32u4
12770 #------------------------------------------------------------
12771
12772 part
12773     id               = "m32u4";
12774     desc             = "ATmega32U4";
12775     signature        = 0x1e 0x95 0x87;
12776     has_jtag         = yes;
12777 #    stk500_devcode   = 0xB2;
12778 #    avr910_devcode   = 0x43;
12779     chip_erase_delay = 9000;
12780     pagel            = 0xD7;
12781     bs2              = 0xA0;
12782     reset            = dedicated;
12783     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12784                        "x x x x  x x x x    x x x x  x x x x";
12785
12786     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
12787                        "x x x x  x x x x    x x x x  x x x x";
12788
12789     timeout             = 200;
12790     stabdelay           = 100;
12791     cmdexedelay         = 25;
12792     synchloops          = 32;
12793     bytedelay           = 0;
12794     pollindex           = 3;
12795     pollvalue           = 0x53;
12796     predelay            = 1;
12797     postdelay           = 1;
12798     pollmethod          = 1;
12799
12800     pp_controlstack     =
12801         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12802         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12803         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12804         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
12805     hventerstabdelay    = 100;
12806     progmodedelay       = 0;
12807     latchcycles         = 5;
12808     togglevtg           = 1;
12809     poweroffdelay       = 15;
12810     resetdelayms        = 1;
12811     resetdelayus        = 0;
12812     hvleavestabdelay    = 15;
12813     chiperasepulsewidth = 0;
12814     chiperasepolltimeout = 10;
12815     programfusepulsewidth = 0;
12816     programfusepolltimeout = 5;
12817     programlockpulsewidth = 0;
12818     programlockpolltimeout = 5;
12819
12820     idr                 = 0x31;
12821     spmcr               = 0x57;
12822     rampz               = 0x3b;
12823     allowfullpagebitstream = no;
12824
12825     memory "eeprom"
12826         paged           = no; /* leave this "no" */
12827         page_size       = 8;  /* for parallel programming */
12828         size            = 1024;
12829         min_write_delay = 9000;
12830         max_write_delay = 9000;
12831         readback_p1     = 0x00;
12832         readback_p2     = 0x00;
12833         read            = "  1   0   1   0      0   0   0   0",
12834                           "  x   x   x   x      x a10  a9  a8",
12835                           " a7  a6  a5  a4     a3  a2  a1  a0",
12836                           "  o   o   o   o      o   o   o   o";
12837
12838         write           = "  1   1   0   0      0   0   0   0",
12839                           "  x   x   x   x      x a10  a9  a8",
12840                           " a7  a6  a5  a4     a3  a2  a1  a0", 
12841                           "  i   i   i   i      i   i   i   i";
12842
12843         loadpage_lo     = "  1   1   0   0      0   0   0   1",
12844                           "  0   0   0   0      0   0   0   0",
12845                           "  0   0   0   0      0  a2  a1  a0",
12846                           "  i   i   i   i      i   i   i   i";
12847
12848         writepage       = "  1   1   0   0      0   0   1   0",
12849                           "  0   0   x   x      x a10  a9  a8",
12850                           " a7  a6  a5  a4     a3   0   0   0",
12851                           "  x   x   x   x      x   x   x   x";
12852
12853         mode            = 0x41;
12854         delay           = 10;
12855         blocksize       = 8;
12856         readsize        = 256;
12857       ;
12858
12859     memory "flash"
12860         paged           = yes;
12861         size            = 32768;
12862         page_size       = 128;
12863         num_pages       = 256;
12864         min_write_delay = 4500;
12865         max_write_delay = 4500;
12866         readback_p1     = 0x00;
12867         readback_p2     = 0x00;
12868         read_lo         = "  0   0   1   0      0   0   0   0",
12869                           "  0 a14 a13 a12    a11 a10  a9  a8",
12870                           " a7  a6  a5  a4     a3  a2  a1  a0",
12871                           "  o   o   o   o      o   o   o   o";
12872
12873         read_hi         = "  0   0   1   0      1   0   0   0",
12874                           "  0 a14 a13 a12    a11 a10  a9  a8",
12875                           " a7  a6  a5  a4     a3  a2  a1  a0",
12876                           "  o   o   o   o      o   o   o   o";
12877
12878         loadpage_lo     = "  0   1   0   0      0   0   0   0",
12879                           "  x   x   x   x      x   x   x   x",
12880                           "  x   x  a5  a4     a3  a2  a1  a0",
12881                           "  i   i   i   i      i   i   i   i";
12882
12883         loadpage_hi     = "  0   1   0   0      1   0   0   0",
12884                           "  x   x   x   x      x   x   x   x",
12885                           "  x   x  a5  a4     a3  a2  a1  a0",
12886                           "  i   i   i   i      i   i   i   i";
12887
12888         writepage       = "  0   1   0   0      1   1   0   0",
12889                           " a15 a14 a13 a12    a11 a10  a9  a8",
12890                           " a7  a6   x   x      x   x   x   x",
12891                           "  x   x   x   x      x   x   x   x";
12892
12893         mode            = 0x41;
12894         delay           = 6;
12895         blocksize       = 128;
12896         readsize        = 256;
12897       ;
12898
12899     memory "lfuse"
12900         size            = 1;
12901         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
12902                           "x x x x  x x x x  i i i i  i i i i";
12903
12904         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
12905                           "x x x x  x x x x  o o o o  o o o o";
12906         min_write_delay = 9000;
12907         max_write_delay = 9000;
12908       ;
12909
12910     memory "hfuse"
12911         size            = 1;
12912         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
12913                           "x x x x  x x x x  i i i i  i i i i";
12914
12915         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
12916                           "x x x x  x x x x  o o o o  o o o o";
12917         min_write_delay = 9000;
12918         max_write_delay = 9000;
12919       ;
12920
12921     memory "efuse"
12922         size            = 1;
12923         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
12924                           "x x x x  x x x x  x x x x  i i i i";
12925
12926         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
12927                           "x x x x  x x x x  o o o o  o o o o";
12928         min_write_delay = 9000;
12929         max_write_delay = 9000;
12930       ;
12931
12932     memory "lock"
12933         size            = 1;
12934         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
12935                           "x x x x  x x x x   x x o o  o o o o";
12936
12937         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
12938                           "x x x x  x x x x   1 1 i i  i i i i";
12939         min_write_delay = 9000;
12940         max_write_delay = 9000;
12941       ;
12942
12943     memory "calibration"
12944         size            = 1;
12945         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
12946                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
12947       ;
12948
12949     memory "signature"
12950         size            = 3;
12951         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
12952                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
12953       ;
12954   ;
12955
12956 #------------------------------------------------------------
12957 # AT90USB646
12958 #------------------------------------------------------------
12959
12960 part
12961     id               = "usb646";
12962     desc             = "AT90USB646";
12963     signature        = 0x1e 0x96 0x82;
12964     has_jtag         = yes;
12965 #    stk500_devcode   = 0xB2;
12966 #    avr910_devcode   = 0x43;
12967     chip_erase_delay = 9000;
12968     pagel            = 0xD7;
12969     bs2              = 0xA0;
12970     reset            = dedicated;
12971     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
12972                        "x x x x  x x x x    x x x x  x x x x";
12973
12974     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
12975                        "x x x x  x x x x    x x x x  x x x x";
12976
12977     timeout             = 200;
12978     stabdelay           = 100;
12979     cmdexedelay         = 25;
12980     synchloops          = 32;
12981     bytedelay           = 0;
12982     pollindex           = 3;
12983     pollvalue           = 0x53;
12984     predelay            = 1;
12985     postdelay           = 1;
12986     pollmethod          = 1;
12987
12988     pp_controlstack     =
12989         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
12990         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
12991         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
12992         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
12993     hventerstabdelay    = 100;
12994     progmodedelay       = 0;
12995     latchcycles         = 5;
12996     togglevtg           = 1;
12997     poweroffdelay       = 15;
12998     resetdelayms        = 1;
12999     resetdelayus        = 0;
13000     hvleavestabdelay    = 15;
13001     chiperasepulsewidth = 0;
13002     chiperasepolltimeout = 10;
13003     programfusepulsewidth = 0;
13004     programfusepolltimeout = 5;
13005     programlockpulsewidth = 0;
13006     programlockpolltimeout = 5;
13007
13008     idr                 = 0x31;
13009     spmcr               = 0x57;
13010     rampz               = 0x3b;
13011     allowfullpagebitstream = no;
13012
13013     memory "eeprom"
13014         paged           = no; /* leave this "no" */
13015         page_size       = 8;  /* for parallel programming */
13016         size            = 2048;
13017         min_write_delay = 9000;
13018         max_write_delay = 9000;
13019         readback_p1     = 0x00;
13020         readback_p2     = 0x00;
13021         read            = "  1   0   1   0      0   0   0   0",
13022                           "  x   x   x   x      x a10  a9  a8",
13023                           " a7  a6  a5  a4     a3  a2  a1  a0",
13024                           "  o   o   o   o      o   o   o   o";
13025
13026         write           = "  1   1   0   0      0   0   0   0",
13027                           "  x   x   x   x      x a10  a9  a8",
13028                           " a7  a6  a5  a4     a3  a2  a1  a0", 
13029                           "  i   i   i   i      i   i   i   i";
13030
13031         loadpage_lo     = "  1   1   0   0      0   0   0   1",
13032                           "  0   0   0   0      0   0   0   0",
13033                           "  0   0   0   0      0  a2  a1  a0",
13034                           "  i   i   i   i      i   i   i   i";
13035
13036         writepage       = "  1   1   0   0      0   0   1   0",
13037                           "  0   0   x   x      x a10  a9  a8",
13038                           " a7  a6  a5  a4     a3   0   0   0",
13039                           "  x   x   x   x      x   x   x   x";
13040
13041         mode            = 0x41;
13042         delay           = 10;
13043         blocksize       = 8;
13044         readsize        = 256;
13045       ;
13046
13047     memory "flash"
13048         paged           = yes;
13049         size            = 65536;
13050         page_size       = 256;
13051         num_pages       = 256;
13052         min_write_delay = 4500;
13053         max_write_delay = 4500;
13054         readback_p1     = 0x00;
13055         readback_p2     = 0x00;
13056         read_lo         = "  0   0   1   0      0   0   0   0",
13057                           "  0 a14 a13 a12    a11 a10  a9  a8",
13058                           " a7  a6  a5  a4     a3  a2  a1  a0",
13059                           "  o   o   o   o      o   o   o   o";
13060
13061         read_hi         = "  0   0   1   0      1   0   0   0",
13062                           "  0 a14 a13 a12    a11 a10  a9  a8",
13063                           " a7  a6  a5  a4     a3  a2  a1  a0",
13064                           "  o   o   o   o      o   o   o   o";
13065
13066         loadpage_lo     = "  0   1   0   0      0   0   0   0",
13067                           "  x   x   x   x      x   x   x   x",
13068                           "  x  a6  a5  a4     a3  a2  a1  a0",
13069                           "  i   i   i   i      i   i   i   i";
13070
13071         loadpage_hi     = "  0   1   0   0      1   0   0   0",
13072                           "  x   x   x   x      x   x   x   x",
13073                           "  x  a6  a5  a4     a3  a2  a1  a0",
13074                           "  i   i   i   i      i   i   i   i";
13075
13076         writepage       = "  0   1   0   0      1   1   0   0",
13077                           "  0 a14 a13 a12    a11 a10  a9  a8",
13078                           " a7   x   x   x      x   x   x   x",
13079                           "  x   x   x   x      x   x   x   x";
13080
13081         mode            = 0x41;
13082         delay           = 6;
13083         blocksize       = 256;
13084         readsize        = 256;
13085       ;
13086
13087     memory "lfuse"
13088         size            = 1;
13089         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
13090                           "x x x x  x x x x  i i i i  i i i i";
13091
13092         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
13093                           "x x x x  x x x x  o o o o  o o o o";
13094         min_write_delay = 9000;
13095         max_write_delay = 9000;
13096       ;
13097
13098     memory "hfuse"
13099         size            = 1;
13100         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
13101                           "x x x x  x x x x  i i i i  i i i i";
13102
13103         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
13104                           "x x x x  x x x x  o o o o  o o o o";
13105         min_write_delay = 9000;
13106         max_write_delay = 9000;
13107       ;
13108
13109     memory "efuse"
13110         size            = 1;
13111         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
13112                           "x x x x  x x x x  x x x x  i i i i";
13113
13114         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
13115                           "x x x x  x x x x  o o o o  o o o o";
13116         min_write_delay = 9000;
13117         max_write_delay = 9000;
13118       ;
13119
13120     memory "lock"
13121         size            = 1;
13122         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
13123                           "x x x x  x x x x   x x o o  o o o o";
13124
13125         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
13126                           "x x x x  x x x x   1 1 i i  i i i i";
13127         min_write_delay = 9000;
13128         max_write_delay = 9000;
13129       ;
13130
13131     memory "calibration"
13132         size            = 1;
13133         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
13134                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
13135       ;
13136
13137     memory "signature"
13138         size            = 3;
13139         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
13140                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
13141       ;
13142   ;
13143
13144 #------------------------------------------------------------
13145 # AT90USB647
13146 #------------------------------------------------------------
13147 # identical to AT90USB646
13148
13149 part
13150     id               = "usb647";
13151     desc             = "AT90USB647";
13152     signature        = 0x1e 0x96 0x82;
13153     has_jtag         = yes;
13154 #    stk500_devcode   = 0xB2;
13155 #    avr910_devcode   = 0x43;
13156     chip_erase_delay = 9000;
13157     pagel            = 0xD7;
13158     bs2              = 0xA0;
13159     reset            = dedicated;
13160     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
13161                        "x x x x  x x x x    x x x x  x x x x";
13162
13163     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
13164                        "x x x x  x x x x    x x x x  x x x x";
13165
13166     timeout             = 200;
13167     stabdelay           = 100;
13168     cmdexedelay         = 25;
13169     synchloops          = 32;
13170     bytedelay           = 0;
13171     pollindex           = 3;
13172     pollvalue           = 0x53;
13173     predelay            = 1;
13174     postdelay           = 1;
13175     pollmethod          = 1;
13176
13177     pp_controlstack     =
13178         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
13179         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
13180         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
13181         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
13182     hventerstabdelay    = 100;
13183     progmodedelay       = 0;
13184     latchcycles         = 5;
13185     togglevtg           = 1;
13186     poweroffdelay       = 15;
13187     resetdelayms        = 1;
13188     resetdelayus        = 0;
13189     hvleavestabdelay    = 15;
13190     chiperasepulsewidth = 0;
13191     chiperasepolltimeout = 10;
13192     programfusepulsewidth = 0;
13193     programfusepolltimeout = 5;
13194     programlockpulsewidth = 0;
13195     programlockpolltimeout = 5;
13196
13197     idr                 = 0x31;
13198     spmcr               = 0x57;
13199     rampz               = 0x3b;
13200     allowfullpagebitstream = no;
13201
13202     memory "eeprom"
13203         paged           = no; /* leave this "no" */
13204         page_size       = 8;  /* for parallel programming */
13205         size            = 2048;
13206         min_write_delay = 9000;
13207         max_write_delay = 9000;
13208         readback_p1     = 0x00;
13209         readback_p2     = 0x00;
13210         read            = "  1   0   1   0      0   0   0   0",
13211                           "  x   x   x   x      x a10  a9  a8",
13212                           " a7  a6  a5  a4     a3  a2  a1  a0",
13213                           "  o   o   o   o      o   o   o   o";
13214
13215         write           = "  1   1   0   0      0   0   0   0",
13216                           "  x   x   x   x      x a10  a9  a8",
13217                           " a7  a6  a5  a4     a3  a2  a1  a0", 
13218                           "  i   i   i   i      i   i   i   i";
13219
13220         loadpage_lo     = "  1   1   0   0      0   0   0   1",
13221                           "  0   0   0   0      0   0   0   0",
13222                           "  0   0   0   0      0  a2  a1  a0",
13223                           "  i   i   i   i      i   i   i   i";
13224
13225         writepage       = "  1   1   0   0      0   0   1   0",
13226                           "  0   0   x   x      x a10  a9  a8",
13227                           " a7  a6  a5  a4     a3   0   0   0",
13228                           "  x   x   x   x      x   x   x   x";
13229
13230         mode            = 0x41;
13231         delay           = 10;
13232         blocksize       = 8;
13233         readsize        = 256;
13234       ;
13235
13236     memory "flash"
13237         paged           = yes;
13238         size            = 65536;
13239         page_size       = 256;
13240         num_pages       = 256;
13241         min_write_delay = 4500;
13242         max_write_delay = 4500;
13243         readback_p1     = 0x00;
13244         readback_p2     = 0x00;
13245         read_lo         = "  0   0   1   0      0   0   0   0",
13246                           "  0 a14 a13 a12    a11 a10  a9  a8",
13247                           " a7  a6  a5  a4     a3  a2  a1  a0",
13248                           "  o   o   o   o      o   o   o   o";
13249
13250         read_hi         = "  0   0   1   0      1   0   0   0",
13251                           "  0 a14 a13 a12    a11 a10  a9  a8",
13252                           " a7  a6  a5  a4     a3  a2  a1  a0",
13253                           "  o   o   o   o      o   o   o   o";
13254
13255         loadpage_lo     = "  0   1   0   0      0   0   0   0",
13256                           "  x   x   x   x      x   x   x   x",
13257                           "  x  a6  a5  a4     a3  a2  a1  a0",
13258                           "  i   i   i   i      i   i   i   i";
13259
13260         loadpage_hi     = "  0   1   0   0      1   0   0   0",
13261                           "  x   x   x   x      x   x   x   x",
13262                           "  x  a6  a5  a4     a3  a2  a1  a0",
13263                           "  i   i   i   i      i   i   i   i";
13264
13265         writepage       = "  0   1   0   0      1   1   0   0",
13266                           "  0 a14 a13 a12    a11 a10  a9  a8",
13267                           " a7   x   x   x      x   x   x   x",
13268                           "  x   x   x   x      x   x   x   x";
13269
13270         mode            = 0x41;
13271         delay           = 6;
13272         blocksize       = 256;
13273         readsize        = 256;
13274       ;
13275
13276     memory "lfuse"
13277         size            = 1;
13278         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
13279                           "x x x x  x x x x  i i i i  i i i i";
13280
13281         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
13282                           "x x x x  x x x x  o o o o  o o o o";
13283         min_write_delay = 9000;
13284         max_write_delay = 9000;
13285       ;
13286
13287     memory "hfuse"
13288         size            = 1;
13289         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
13290                           "x x x x  x x x x  i i i i  i i i i";
13291
13292         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
13293                           "x x x x  x x x x  o o o o  o o o o";
13294         min_write_delay = 9000;
13295         max_write_delay = 9000;
13296       ;
13297
13298     memory "efuse"
13299         size            = 1;
13300         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
13301                           "x x x x  x x x x  x x x x  i i i i";
13302
13303         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
13304                           "x x x x  x x x x  o o o o  o o o o";
13305         min_write_delay = 9000;
13306         max_write_delay = 9000;
13307       ;
13308
13309     memory "lock"
13310         size            = 1;
13311         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
13312                           "x x x x  x x x x   x x o o  o o o o";
13313
13314         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
13315                           "x x x x  x x x x   1 1 i i  i i i i";
13316         min_write_delay = 9000;
13317         max_write_delay = 9000;
13318       ;
13319
13320     memory "calibration"
13321         size            = 1;
13322         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
13323                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
13324       ;
13325
13326     memory "signature"
13327         size            = 3;
13328         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
13329                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
13330       ;
13331   ;
13332
13333 #------------------------------------------------------------
13334 # AT90USB1286
13335 #------------------------------------------------------------
13336
13337 part
13338     id               = "usb1286";
13339     desc             = "AT90USB1286";
13340     signature        = 0x1e 0x97 0x82;
13341     has_jtag         = yes;
13342 #    stk500_devcode   = 0xB2;
13343 #    avr910_devcode   = 0x43;
13344     chip_erase_delay = 9000;
13345     pagel            = 0xD7;
13346     bs2              = 0xA0;
13347     reset            = dedicated;
13348     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
13349                        "x x x x  x x x x    x x x x  x x x x";
13350
13351     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
13352                        "x x x x  x x x x    x x x x  x x x x";
13353
13354     timeout             = 200;
13355     stabdelay           = 100;
13356     cmdexedelay         = 25;
13357     synchloops          = 32;
13358     bytedelay           = 0;
13359     pollindex           = 3;
13360     pollvalue           = 0x53;
13361     predelay            = 1;
13362     postdelay           = 1;
13363     pollmethod          = 1;
13364
13365     pp_controlstack     =
13366         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
13367         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
13368         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
13369         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
13370     hventerstabdelay    = 100;
13371     progmodedelay       = 0;
13372     latchcycles         = 5;
13373     togglevtg           = 1;
13374     poweroffdelay       = 15;
13375     resetdelayms        = 1;
13376     resetdelayus        = 0;
13377     hvleavestabdelay    = 15;
13378     chiperasepulsewidth = 0;
13379     chiperasepolltimeout = 10;
13380     programfusepulsewidth = 0;
13381     programfusepolltimeout = 5;
13382     programlockpulsewidth = 0;
13383     programlockpolltimeout = 5;
13384
13385     idr                 = 0x31;
13386     spmcr               = 0x57;
13387     rampz               = 0x3b;
13388     allowfullpagebitstream = no;
13389
13390     memory "eeprom"
13391         paged           = no; /* leave this "no" */
13392         page_size       = 8;  /* for parallel programming */
13393         size            = 4096;
13394         min_write_delay = 9000;
13395         max_write_delay = 9000;
13396         readback_p1     = 0x00;
13397         readback_p2     = 0x00;
13398         read            = "  1   0   1   0      0   0   0   0",
13399                           "  x   x   x   x    a11 a10  a9  a8",
13400                           " a7  a6  a5  a4     a3  a2  a1  a0",
13401                           "  o   o   o   o      o   o   o   o";
13402
13403         write           = "  1   1   0   0      0   0   0   0",
13404                           "  x   x   x   x    a11 a10  a9  a8",
13405                           " a7  a6  a5  a4     a3  a2  a1  a0", 
13406                           "  i   i   i   i      i   i   i   i";
13407
13408         loadpage_lo     = "  1   1   0   0      0   0   0   1",
13409                           "  0   0   0   0      0   0   0   0",
13410                           "  0   0   0   0      0  a2  a1  a0",
13411                           "  i   i   i   i      i   i   i   i";
13412
13413         writepage       = "  1   1   0   0      0   0   1   0",
13414                           "  0   0   x   x      x a10  a9  a8",
13415                           " a7  a6  a5  a4     a3   0   0   0",
13416                           "  x   x   x   x      x   x   x   x";
13417
13418         mode            = 0x41;
13419         delay           = 10;
13420         blocksize       = 8;
13421         readsize        = 256;
13422       ;
13423
13424     memory "flash"
13425         paged           = yes;
13426         size            = 131072;
13427         page_size       = 256;
13428         num_pages       = 512;
13429         min_write_delay = 4500;
13430         max_write_delay = 4500;
13431         readback_p1     = 0x00;
13432         readback_p2     = 0x00;
13433         read_lo         = "  0   0   1   0      0   0   0   0",
13434                           "a15 a14 a13 a12    a11 a10  a9  a8",
13435                           " a7  a6  a5  a4     a3  a2  a1  a0",
13436                           "  o   o   o   o      o   o   o   o";
13437
13438         read_hi         = "  0   0   1   0      1   0   0   0",
13439                           "a15 a14 a13 a12    a11 a10  a9  a8",
13440                           " a7  a6  a5  a4     a3  a2  a1  a0",
13441                           "  o   o   o   o      o   o   o   o";
13442
13443         loadpage_lo     = "  0   1   0   0      0   0   0   0",
13444                           "  x   x   x   x      x   x   x   x",
13445                           "  x  a6  a5  a4     a3  a2  a1  a0",
13446                           "  i   i   i   i      i   i   i   i";
13447
13448         loadpage_hi     = "  0   1   0   0      1   0   0   0",
13449                           "  x   x   x   x      x   x   x   x",
13450                           "  x  a6  a5  a4     a3  a2  a1  a0",
13451                           "  i   i   i   i      i   i   i   i";
13452
13453         writepage       = "  0   1   0   0      1   1   0   0",
13454                           "a15 a14 a13 a12    a11 a10  a9  a8",
13455                           " a7   x   x   x      x   x   x   x",
13456                           "  x   x   x   x      x   x   x   x";
13457
13458         mode            = 0x41;
13459         delay           = 6;
13460         blocksize       = 256;
13461         readsize        = 256;
13462       ;
13463
13464     memory "lfuse"
13465         size            = 1;
13466         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
13467                           "x x x x  x x x x  i i i i  i i i i";
13468
13469         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
13470                           "x x x x  x x x x  o o o o  o o o o";
13471         min_write_delay = 9000;
13472         max_write_delay = 9000;
13473       ;
13474
13475     memory "hfuse"
13476         size            = 1;
13477         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
13478                           "x x x x  x x x x  i i i i  i i i i";
13479
13480         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
13481                           "x x x x  x x x x  o o o o  o o o o";
13482         min_write_delay = 9000;
13483         max_write_delay = 9000;
13484       ;
13485
13486     memory "efuse"
13487         size            = 1;
13488         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
13489                           "x x x x  x x x x  x x x x  i i i i";
13490
13491         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
13492                           "x x x x  x x x x  o o o o  o o o o";
13493         min_write_delay = 9000;
13494         max_write_delay = 9000;
13495       ;
13496
13497     memory "lock"
13498         size            = 1;
13499         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
13500                           "x x x x  x x x x   x x o o  o o o o";
13501
13502         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
13503                           "x x x x  x x x x   1 1 i i  i i i i";
13504         min_write_delay = 9000;
13505         max_write_delay = 9000;
13506       ;
13507
13508     memory "calibration"
13509         size            = 1;
13510         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
13511                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
13512       ;
13513
13514     memory "signature"
13515         size            = 3;
13516         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
13517                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
13518       ;
13519   ;
13520
13521 #------------------------------------------------------------
13522 # AT90USB1287
13523 #------------------------------------------------------------
13524 # identical to AT90USB1286
13525
13526 part
13527     id               = "usb1287";
13528     desc             = "AT90USB1287";
13529     signature        = 0x1e 0x97 0x82;
13530     has_jtag         = yes;
13531 #    stk500_devcode   = 0xB2;
13532 #    avr910_devcode   = 0x43;
13533     chip_erase_delay = 9000;
13534     pagel            = 0xD7;
13535     bs2              = 0xA0;
13536     reset            = dedicated;
13537     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
13538                        "x x x x  x x x x    x x x x  x x x x";
13539
13540     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
13541                        "x x x x  x x x x    x x x x  x x x x";
13542
13543     timeout             = 200;
13544     stabdelay           = 100;
13545     cmdexedelay         = 25;
13546     synchloops          = 32;
13547     bytedelay           = 0;
13548     pollindex           = 3;
13549     pollvalue           = 0x53;
13550     predelay            = 1;
13551     postdelay           = 1;
13552     pollmethod          = 1;
13553
13554     pp_controlstack     =
13555         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
13556         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
13557         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
13558         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
13559     hventerstabdelay    = 100;
13560     progmodedelay       = 0;
13561     latchcycles         = 5;
13562     togglevtg           = 1;
13563     poweroffdelay       = 15;
13564     resetdelayms        = 1;
13565     resetdelayus        = 0;
13566     hvleavestabdelay    = 15;
13567     chiperasepulsewidth = 0;
13568     chiperasepolltimeout = 10;
13569     programfusepulsewidth = 0;
13570     programfusepolltimeout = 5;
13571     programlockpulsewidth = 0;
13572     programlockpolltimeout = 5;
13573
13574     idr                 = 0x31;
13575     spmcr               = 0x57;
13576     rampz               = 0x3b;
13577     allowfullpagebitstream = no;
13578
13579     memory "eeprom"
13580         paged           = no; /* leave this "no" */
13581         page_size       = 8;  /* for parallel programming */
13582         size            = 4096;
13583         min_write_delay = 9000;
13584         max_write_delay = 9000;
13585         readback_p1     = 0x00;
13586         readback_p2     = 0x00;
13587         read            = "  1   0   1   0      0   0   0   0",
13588                           "  x   x   x   x    a11 a10  a9  a8",
13589                           " a7  a6  a5  a4     a3  a2  a1  a0",
13590                           "  o   o   o   o      o   o   o   o";
13591
13592         write           = "  1   1   0   0      0   0   0   0",
13593                           "  x   x   x   x    a11 a10  a9  a8",
13594                           " a7  a6  a5  a4     a3  a2  a1  a0", 
13595                           "  i   i   i   i      i   i   i   i";
13596
13597         loadpage_lo     = "  1   1   0   0      0   0   0   1",
13598                           "  0   0   0   0      0   0   0   0",
13599                           "  0   0   0   0      0  a2  a1  a0",
13600                           "  i   i   i   i      i   i   i   i";
13601
13602         writepage       = "  1   1   0   0      0   0   1   0",
13603                           "  0   0   x   x      x a10  a9  a8",
13604                           " a7  a6  a5  a4     a3   0   0   0",
13605                           "  x   x   x   x      x   x   x   x";
13606
13607         mode            = 0x41;
13608         delay           = 10;
13609         blocksize       = 8;
13610         readsize        = 256;
13611       ;
13612
13613     memory "flash"
13614         paged           = yes;
13615         size            = 131072;
13616         page_size       = 256;
13617         num_pages       = 512;
13618         min_write_delay = 4500;
13619         max_write_delay = 4500;
13620         readback_p1     = 0x00;
13621         readback_p2     = 0x00;
13622         read_lo         = "  0   0   1   0      0   0   0   0",
13623                           "a15 a14 a13 a12    a11 a10  a9  a8",
13624                           " a7  a6  a5  a4     a3  a2  a1  a0",
13625                           "  o   o   o   o      o   o   o   o";
13626
13627         read_hi         = "  0   0   1   0      1   0   0   0",
13628                           "a15 a14 a13 a12    a11 a10  a9  a8",
13629                           " a7  a6  a5  a4     a3  a2  a1  a0",
13630                           "  o   o   o   o      o   o   o   o";
13631
13632         loadpage_lo     = "  0   1   0   0      0   0   0   0",
13633                           "  x   x   x   x      x   x   x   x",
13634                           "  x  a6  a5  a4     a3  a2  a1  a0",
13635                           "  i   i   i   i      i   i   i   i";
13636
13637         loadpage_hi     = "  0   1   0   0      1   0   0   0",
13638                           "  x   x   x   x      x   x   x   x",
13639                           "  x  a6  a5  a4     a3  a2  a1  a0",
13640                           "  i   i   i   i      i   i   i   i";
13641
13642         writepage       = "  0   1   0   0      1   1   0   0",
13643                           "a15 a14 a13 a12    a11 a10  a9  a8",
13644                           " a7   x   x   x      x   x   x   x",
13645                           "  x   x   x   x      x   x   x   x";
13646
13647         mode            = 0x41;
13648         delay           = 6;
13649         blocksize       = 256;
13650         readsize        = 256;
13651       ;
13652
13653     memory "lfuse"
13654         size            = 1;
13655         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
13656                           "x x x x  x x x x  i i i i  i i i i";
13657
13658         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
13659                           "x x x x  x x x x  o o o o  o o o o";
13660         min_write_delay = 9000;
13661         max_write_delay = 9000;
13662       ;
13663
13664     memory "hfuse"
13665         size            = 1;
13666         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
13667                           "x x x x  x x x x  i i i i  i i i i";
13668
13669         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
13670                           "x x x x  x x x x  o o o o  o o o o";
13671         min_write_delay = 9000;
13672         max_write_delay = 9000;
13673       ;
13674
13675     memory "efuse"
13676         size            = 1;
13677         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
13678                           "x x x x  x x x x  x x x x  i i i i";
13679
13680         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
13681                           "x x x x  x x x x  o o o o  o o o o";
13682         min_write_delay = 9000;
13683         max_write_delay = 9000;
13684       ;
13685
13686     memory "lock"
13687         size            = 1;
13688         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
13689                           "x x x x  x x x x   x x o o  o o o o";
13690
13691         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
13692                           "x x x x  x x x x   1 1 i i  i i i i";
13693         min_write_delay = 9000;
13694         max_write_delay = 9000;
13695       ;
13696
13697     memory "calibration"
13698         size            = 1;
13699         read            = "0 0 1 1  1 0 0 0    x x x x  x x x x",
13700                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
13701       ;
13702
13703     memory "signature"
13704         size            = 3;
13705         read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
13706                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
13707       ;
13708   ;
13709
13710
13711 #------------------------------------------------------------
13712 # AT90USB162
13713 #------------------------------------------------------------
13714
13715 part
13716     id               = "usb162";
13717     desc             = "AT90USB162";
13718     has_jtag         = no;
13719     has_debugwire    = yes;
13720     signature        = 0x1e 0x94 0x82;
13721     chip_erase_delay = 9000;
13722     reset            = io;
13723     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
13724                        "x x x x  x x x x    x x x x  x x x x";
13725     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
13726                        "x x x x  x x x x    x x x x  x x x x";
13727     pagel            = 0xD7;
13728     bs2              = 0xC6;
13729
13730     timeout             = 200;
13731     stabdelay           = 100;
13732     cmdexedelay         = 25;
13733     synchloops          = 32;
13734     bytedelay           = 0;
13735     pollindex           = 3;
13736     pollvalue           = 0x53;
13737     predelay            = 1;
13738     postdelay           = 1;
13739     pollmethod          = 1;
13740     pp_controlstack     =
13741         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
13742         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
13743         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
13744         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
13745     hventerstabdelay    = 100;
13746     progmodedelay       = 0;
13747     latchcycles         = 5;
13748     togglevtg           = 1;
13749     poweroffdelay       = 15;
13750     resetdelayms        = 1;
13751     resetdelayus        = 0;
13752     hvleavestabdelay    = 15;
13753     chiperasepulsewidth = 0;
13754     chiperasepolltimeout = 10;
13755     programfusepulsewidth = 0;
13756     programfusepolltimeout = 5;
13757     programlockpulsewidth = 0;
13758     programlockpolltimeout = 5;
13759
13760     memory "eeprom"
13761         paged           = no; /* leave this "no" */
13762         page_size       = 4;  /* for parallel programming */
13763         size            = 512;
13764         num_pages       = 128;
13765         min_write_delay = 9000;
13766         max_write_delay = 9000;
13767         readback_p1     = 0x00;
13768         readback_p2     = 0x00;
13769         read            = "  1   0   1   0      0   0   0   0",
13770                           "  0   0   0   0    a11 a10  a9  a8",
13771                           " a7  a6  a5  a4     a3  a2  a1  a0",
13772                           "  o   o   o   o      o   o   o   o";
13773
13774         write           = "  1   1   0   0      0   0   0   0",
13775                           "  0   0   0   0    a11 a10  a9  a8",
13776                           " a7  a6  a5  a4     a3  a2  a1  a0",
13777                           "  i   i   i   i      i   i   i   i";
13778
13779         loadpage_lo     = "  1   1   0   0      0   0   0   1",
13780                           "  0   0   0   0      0   0   0   0",
13781                           "  0   0   0   0      0   0  a1  a0",
13782                           "  i   i   i   i      i   i   i   i";
13783
13784         writepage       = "  1   1   0   0      0   0   1   0",
13785                           "  0   0   0   0    a11 a10  a9  a8",
13786                           " a7  a6  a5  a4     a3  a2   0   0",
13787                           "  x   x   x   x      x   x   x   x";
13788
13789         mode            = 0x41;
13790         delay           = 20;
13791         blocksize       = 4;
13792         readsize        = 256;
13793       ;
13794
13795     memory "flash"
13796         paged           = yes;
13797         size            = 16384;
13798         page_size       = 128;
13799         num_pages       = 128;
13800         min_write_delay = 4500;
13801         max_write_delay = 4500;
13802         readback_p1     = 0x00;
13803         readback_p2     = 0x00;
13804         read_lo         = "  0   0   1   0      0   0   0   0",
13805                           "a15 a14 a13 a12    a11 a10  a9  a8",
13806                           " a7  a6  a5  a4     a3  a2  a1  a0",
13807                           "  o   o   o   o      o   o   o   o";
13808
13809         read_hi         = "  0   0   1   0      1   0   0   0",
13810                           "a15 a14 a13 a12    a11 a10  a9  a8",
13811                           " a7  a6  a5  a4     a3  a2  a1  a0",
13812                           "  o   o   o   o      o   o   o   o";
13813
13814         loadpage_lo     = "  0   1   0   0      0   0   0   0",
13815                           "  x   x   x   x      x   x   x   x",
13816                           "  x   x  a5  a4     a3  a2  a1  a0",
13817                           "  i   i   i   i      i   i   i   i";
13818
13819         loadpage_hi     = "  0   1   0   0      1   0   0   0",
13820                           "  x   x   x   x      x   x   x   x",
13821                           "  x   x  a5  a4     a3  a2  a1  a0",
13822                           "  i   i   i   i      i   i   i   i";
13823
13824         writepage       = "  0   1   0   0      1   1   0   0",
13825                           "a15 a14 a13 a12    a11 a10  a9  a8",
13826                           " a7  a6   x   x      x   x   x   x",
13827                           "  x   x   x   x      x   x   x   x";
13828
13829         mode            = 0x41;
13830         delay           = 6;
13831         blocksize       = 128;
13832         readsize        = 256;
13833       ;
13834
13835     memory "lfuse"
13836         size            = 1;
13837         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
13838                           "x x x x  x x x x  i i i i  i i i i";
13839
13840         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
13841                           "x x x x  x x x x  o o o o  o o o o";
13842         min_write_delay = 9000;
13843         max_write_delay = 9000;
13844       ;
13845
13846     memory "hfuse"
13847         size            = 1;
13848         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
13849                           "x x x x  x x x x  i i i i  i i i i";
13850
13851         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
13852                           "x x x x  x x x x  o o o o  o o o o";
13853         min_write_delay = 9000;
13854         max_write_delay = 9000;
13855       ;
13856
13857     memory "efuse"
13858         size            = 1;
13859         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
13860                           "x x x x  x x x x  i i i i  i i i i";
13861
13862         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
13863                           "x x x x  x x x x  o o o o  o o o o";
13864         min_write_delay = 9000;
13865         max_write_delay = 9000;
13866       ;
13867
13868     memory "lock"
13869         size            = 1;
13870         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
13871                           "x x x x  x x x x   x x o o  o o o o";
13872
13873         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
13874                           "x x x x  x x x x   1 1 i i  i i i i";
13875         min_write_delay = 9000;
13876         max_write_delay = 9000;
13877       ;
13878
13879     memory "calibration"
13880         size            = 1;
13881         read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
13882                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
13883       ;
13884     memory "signature"
13885         size            = 3;
13886         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
13887                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
13888       ;
13889   ;
13890
13891 #------------------------------------------------------------
13892 # AT90USB82
13893 #------------------------------------------------------------
13894 # Changes against AT90USB162 (beside IDs)
13895 #    memory "flash"
13896 #        size            = 8192;
13897 #        num_pages       = 64;
13898
13899 part
13900     id               = "usb82";
13901     desc             = "AT90USB82";
13902     has_jtag         = no;
13903     has_debugwire    = yes;
13904     signature        = 0x1e 0x93 0x82;
13905     chip_erase_delay = 9000;
13906     reset            = io;
13907     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
13908                        "x x x x  x x x x    x x x x  x x x x";
13909     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
13910                        "x x x x  x x x x    x x x x  x x x x";
13911     pagel            = 0xD7;
13912     bs2              = 0xC6;
13913
13914     timeout             = 200;
13915     stabdelay           = 100;
13916     cmdexedelay         = 25;
13917     synchloops          = 32;
13918     bytedelay           = 0;
13919     pollindex           = 3;
13920     pollvalue           = 0x53;
13921     predelay            = 1;
13922     postdelay           = 1;
13923     pollmethod          = 1;
13924     pp_controlstack     =
13925         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
13926         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
13927         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
13928         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
13929     hventerstabdelay    = 100;
13930     progmodedelay       = 0;
13931     latchcycles         = 5;
13932     togglevtg           = 1;
13933     poweroffdelay       = 15;
13934     resetdelayms        = 1;
13935     resetdelayus        = 0;
13936     hvleavestabdelay    = 15;
13937     chiperasepulsewidth = 0;
13938     chiperasepolltimeout = 10;
13939     programfusepulsewidth = 0;
13940     programfusepolltimeout = 5;
13941     programlockpulsewidth = 0;
13942     programlockpolltimeout = 5;
13943
13944     memory "eeprom"
13945         paged           = no; /* leave this "no" */
13946         page_size       = 4;  /* for parallel programming */
13947         size            = 512;
13948         num_pages       = 128;
13949         min_write_delay = 9000;
13950         max_write_delay = 9000;
13951         readback_p1     = 0x00;
13952         readback_p2     = 0x00;
13953         read            = "  1   0   1   0      0   0   0   0",
13954                           "  0   0   0   0    a11 a10  a9  a8",
13955                           " a7  a6  a5  a4     a3  a2  a1  a0",
13956                           "  o   o   o   o      o   o   o   o";
13957
13958         write           = "  1   1   0   0      0   0   0   0",
13959                           "  0   0   0   0    a11 a10  a9  a8",
13960                           " a7  a6  a5  a4     a3  a2  a1  a0",
13961                           "  i   i   i   i      i   i   i   i";
13962
13963         loadpage_lo     = "  1   1   0   0      0   0   0   1",
13964                           "  0   0   0   0      0   0   0   0",
13965                           "  0   0   0   0      0   0  a1  a0",
13966                           "  i   i   i   i      i   i   i   i";
13967
13968         writepage       = "  1   1   0   0      0   0   1   0",
13969                           "  0   0   0   0    a11 a10  a9  a8",
13970                           " a7  a6  a5  a4     a3  a2   0   0",
13971                           "  x   x   x   x      x   x   x   x";
13972
13973         mode            = 0x41;
13974         delay           = 20;
13975         blocksize       = 4;
13976         readsize        = 256;
13977       ;
13978
13979     memory "flash"
13980         paged           = yes;
13981         size            = 8192;
13982         page_size       = 128;
13983         num_pages       = 64;
13984         min_write_delay = 4500;
13985         max_write_delay = 4500;
13986         readback_p1     = 0x00;
13987         readback_p2     = 0x00;
13988         read_lo         = "  0   0   1   0      0   0   0   0",
13989                           "a15 a14 a13 a12    a11 a10  a9  a8",
13990                           " a7  a6  a5  a4     a3  a2  a1  a0",
13991                           "  o   o   o   o      o   o   o   o";
13992
13993         read_hi         = "  0   0   1   0      1   0   0   0",
13994                           "a15 a14 a13 a12    a11 a10  a9  a8",
13995                           " a7  a6  a5  a4     a3  a2  a1  a0",
13996                           "  o   o   o   o      o   o   o   o";
13997
13998         loadpage_lo     = "  0   1   0   0      0   0   0   0",
13999                           "  x   x   x   x      x   x   x   x",
14000                           "  x   x  a5  a4     a3  a2  a1  a0",
14001                           "  i   i   i   i      i   i   i   i";
14002
14003         loadpage_hi     = "  0   1   0   0      1   0   0   0",
14004                           "  x   x   x   x      x   x   x   x",
14005                           "  x   x  a5  a4     a3  a2  a1  a0",
14006                           "  i   i   i   i      i   i   i   i";
14007
14008         writepage       = "  0   1   0   0      1   1   0   0",
14009                           "a15 a14 a13 a12    a11 a10  a9  a8",
14010                           " a7  a6   x   x      x   x   x   x",
14011                           "  x   x   x   x      x   x   x   x";
14012
14013         mode            = 0x41;
14014         delay           = 6;
14015         blocksize       = 128;
14016         readsize        = 256;
14017       ;
14018
14019     memory "lfuse"
14020         size            = 1;
14021         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
14022                           "x x x x  x x x x  i i i i  i i i i";
14023
14024         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
14025                           "x x x x  x x x x  o o o o  o o o o";
14026         min_write_delay = 9000;
14027         max_write_delay = 9000;
14028       ;
14029
14030     memory "hfuse"
14031         size            = 1;
14032         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
14033                           "x x x x  x x x x  i i i i  i i i i";
14034
14035         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
14036                           "x x x x  x x x x  o o o o  o o o o";
14037         min_write_delay = 9000;
14038         max_write_delay = 9000;
14039       ;
14040
14041     memory "efuse"
14042         size            = 1;
14043         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
14044                           "x x x x  x x x x  i i i i  i i i i";
14045
14046         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
14047                           "x x x x  x x x x  o o o o  o o o o";
14048         min_write_delay = 9000;
14049         max_write_delay = 9000;
14050       ;
14051
14052     memory "lock"
14053         size            = 1;
14054         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
14055                           "x x x x  x x x x   x x o o  o o o o";
14056
14057         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
14058                           "x x x x  x x x x   1 1 i i  i i i i";
14059         min_write_delay = 9000;
14060         max_write_delay = 9000;
14061       ;
14062
14063     memory "calibration"
14064         size            = 1;
14065         read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
14066                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
14067       ;
14068     memory "signature"
14069         size            = 3;
14070         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
14071                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
14072       ;
14073   ;
14074
14075 #------------------------------------------------------------
14076 # ATmega32U2
14077 #------------------------------------------------------------
14078 # Changes against AT90USB162 (beside IDs)
14079 #    memory "flash"
14080 #        size            = 32768;
14081 #        num_pages       = 256;
14082 #    memory "eeprom"
14083 #        size            = 1024;
14084 #        num_pages       = 256;
14085 part
14086     id               = "m32u2";
14087     desc             = "ATmega32U2";
14088     has_jtag         = no;
14089     has_debugwire    = yes;
14090     signature        = 0x1e 0x95 0x8a;
14091     chip_erase_delay = 9000;
14092     reset            = io;
14093     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
14094                        "x x x x  x x x x    x x x x  x x x x";
14095     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
14096                        "x x x x  x x x x    x x x x  x x x x";
14097     pagel            = 0xD7;
14098     bs2              = 0xC6;
14099
14100     timeout             = 200;
14101     stabdelay           = 100;
14102     cmdexedelay         = 25;
14103     synchloops          = 32;
14104     bytedelay           = 0;
14105     pollindex           = 3;
14106     pollvalue           = 0x53;
14107     predelay            = 1;
14108     postdelay           = 1;
14109     pollmethod          = 1;
14110     pp_controlstack     =
14111         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
14112         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
14113         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
14114         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
14115     hventerstabdelay    = 100;
14116     progmodedelay       = 0;
14117     latchcycles         = 5;
14118     togglevtg           = 1;
14119     poweroffdelay       = 15;
14120     resetdelayms        = 1;
14121     resetdelayus        = 0;
14122     hvleavestabdelay    = 15;
14123     chiperasepulsewidth = 0;
14124     chiperasepolltimeout = 10;
14125     programfusepulsewidth = 0;
14126     programfusepolltimeout = 5;
14127     programlockpulsewidth = 0;
14128     programlockpolltimeout = 5;
14129
14130     memory "eeprom"
14131         paged           = no; /* leave this "no" */
14132         page_size       = 4;  /* for parallel programming */
14133         size            = 1024;
14134         num_pages       = 256;
14135         min_write_delay = 9000;
14136         max_write_delay = 9000;
14137         readback_p1     = 0x00;
14138         readback_p2     = 0x00;
14139         read            = "  1   0   1   0      0   0   0   0",
14140                           "  0   0   0   0    a11 a10  a9  a8",
14141                           " a7  a6  a5  a4     a3  a2  a1  a0",
14142                           "  o   o   o   o      o   o   o   o";
14143
14144         write           = "  1   1   0   0      0   0   0   0",
14145                           "  0   0   0   0    a11 a10  a9  a8",
14146                           " a7  a6  a5  a4     a3  a2  a1  a0",
14147                           "  i   i   i   i      i   i   i   i";
14148
14149         loadpage_lo     = "  1   1   0   0      0   0   0   1",
14150                           "  0   0   0   0      0   0   0   0",
14151                           "  0   0   0   0      0   0  a1  a0",
14152                           "  i   i   i   i      i   i   i   i";
14153
14154         writepage       = "  1   1   0   0      0   0   1   0",
14155                           "  0   0   0   0    a11 a10  a9  a8",
14156                           " a7  a6  a5  a4     a3  a2   0   0",
14157                           "  x   x   x   x      x   x   x   x";
14158
14159         mode            = 0x41;
14160         delay           = 20;
14161         blocksize       = 4;
14162         readsize        = 256;
14163       ;
14164
14165     memory "flash"
14166         paged           = yes;
14167         size            = 32768;
14168         page_size       = 128;
14169         num_pages       = 256;
14170         min_write_delay = 4500;
14171         max_write_delay = 4500;
14172         readback_p1     = 0x00;
14173         readback_p2     = 0x00;
14174         read_lo         = "  0   0   1   0      0   0   0   0",
14175                           "a15 a14 a13 a12    a11 a10  a9  a8",
14176                           " a7  a6  a5  a4     a3  a2  a1  a0",
14177                           "  o   o   o   o      o   o   o   o";
14178
14179         read_hi         = "  0   0   1   0      1   0   0   0",
14180                           "a15 a14 a13 a12    a11 a10  a9  a8",
14181                           " a7  a6  a5  a4     a3  a2  a1  a0",
14182                           "  o   o   o   o      o   o   o   o";
14183
14184         loadpage_lo     = "  0   1   0   0      0   0   0   0",
14185                           "  x   x   x   x      x   x   x   x",
14186                           "  x   x  a5  a4     a3  a2  a1  a0",
14187                           "  i   i   i   i      i   i   i   i";
14188
14189         loadpage_hi     = "  0   1   0   0      1   0   0   0",
14190                           "  x   x   x   x      x   x   x   x",
14191                           "  x   x  a5  a4     a3  a2  a1  a0",
14192                           "  i   i   i   i      i   i   i   i";
14193
14194         writepage       = "  0   1   0   0      1   1   0   0",
14195                           "a15 a14 a13 a12    a11 a10  a9  a8",
14196                           " a7  a6   x   x      x   x   x   x",
14197                           "  x   x   x   x      x   x   x   x";
14198
14199         mode            = 0x41;
14200         delay           = 6;
14201         blocksize       = 128;
14202         readsize        = 256;
14203       ;
14204
14205     memory "lfuse"
14206         size            = 1;
14207         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
14208                           "x x x x  x x x x  i i i i  i i i i";
14209
14210         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
14211                           "x x x x  x x x x  o o o o  o o o o";
14212         min_write_delay = 9000;
14213         max_write_delay = 9000;
14214       ;
14215
14216     memory "hfuse"
14217         size            = 1;
14218         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
14219                           "x x x x  x x x x  i i i i  i i i i";
14220
14221         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
14222                           "x x x x  x x x x  o o o o  o o o o";
14223         min_write_delay = 9000;
14224         max_write_delay = 9000;
14225       ;
14226
14227     memory "efuse"
14228         size            = 1;
14229         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
14230                           "x x x x  x x x x  i i i i  i i i i";
14231
14232         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
14233                           "x x x x  x x x x  o o o o  o o o o";
14234         min_write_delay = 9000;
14235         max_write_delay = 9000;
14236       ;
14237
14238     memory "lock"
14239         size            = 1;
14240         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
14241                           "x x x x  x x x x   x x o o  o o o o";
14242
14243         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
14244                           "x x x x  x x x x   1 1 i i  i i i i";
14245         min_write_delay = 9000;
14246         max_write_delay = 9000;
14247       ;
14248
14249     memory "calibration"
14250         size            = 1;
14251         read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
14252                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
14253       ;
14254     memory "signature"
14255         size            = 3;
14256         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
14257                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
14258       ;
14259   ;
14260 #------------------------------------------------------------
14261 # ATmega16U2
14262 #------------------------------------------------------------
14263 # Changes against ATmega32U2 (beside IDs)
14264 #    memory "flash"
14265 #        size            = 16384;
14266 #        num_pages       = 128;
14267 #    memory "eeprom"
14268 #        size            = 512;
14269 #        num_pages       = 128;
14270 part
14271     id               = "m16u2";
14272     desc             = "ATmega16U2";
14273     has_jtag         = no;
14274     has_debugwire    = yes;
14275     signature        = 0x1e 0x94 0x89;
14276     chip_erase_delay = 9000;
14277     reset            = io;
14278     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
14279                        "x x x x  x x x x    x x x x  x x x x";
14280     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
14281                        "x x x x  x x x x    x x x x  x x x x";
14282     pagel            = 0xD7;
14283     bs2              = 0xC6;
14284
14285     timeout             = 200;
14286     stabdelay           = 100;
14287     cmdexedelay         = 25;
14288     synchloops          = 32;
14289     bytedelay           = 0;
14290     pollindex           = 3;
14291     pollvalue           = 0x53;
14292     predelay            = 1;
14293     postdelay           = 1;
14294     pollmethod          = 1;
14295     pp_controlstack     =
14296         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
14297         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
14298         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
14299         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
14300     hventerstabdelay    = 100;
14301     progmodedelay       = 0;
14302     latchcycles         = 5;
14303     togglevtg           = 1;
14304     poweroffdelay       = 15;
14305     resetdelayms        = 1;
14306     resetdelayus        = 0;
14307     hvleavestabdelay    = 15;
14308     chiperasepulsewidth = 0;
14309     chiperasepolltimeout = 10;
14310     programfusepulsewidth = 0;
14311     programfusepolltimeout = 5;
14312     programlockpulsewidth = 0;
14313     programlockpolltimeout = 5;
14314
14315     memory "eeprom"
14316         paged           = no; /* leave this "no" */
14317         page_size       = 4;  /* for parallel programming */
14318         size            = 512;
14319         num_pages       = 128;
14320         min_write_delay = 9000;
14321         max_write_delay = 9000;
14322         readback_p1     = 0x00;
14323         readback_p2     = 0x00;
14324         read            = "  1   0   1   0      0   0   0   0",
14325                           "  0   0   0   0    a11 a10  a9  a8",
14326                           " a7  a6  a5  a4     a3  a2  a1  a0",
14327                           "  o   o   o   o      o   o   o   o";
14328
14329         write           = "  1   1   0   0      0   0   0   0",
14330                           "  0   0   0   0    a11 a10  a9  a8",
14331                           " a7  a6  a5  a4     a3  a2  a1  a0",
14332                           "  i   i   i   i      i   i   i   i";
14333
14334         loadpage_lo     = "  1   1   0   0      0   0   0   1",
14335                           "  0   0   0   0      0   0   0   0",
14336                           "  0   0   0   0      0   0  a1  a0",
14337                           "  i   i   i   i      i   i   i   i";
14338
14339         writepage       = "  1   1   0   0      0   0   1   0",
14340                           "  0   0   0   0    a11 a10  a9  a8",
14341                           " a7  a6  a5  a4     a3  a2   0   0",
14342                           "  x   x   x   x      x   x   x   x";
14343
14344         mode            = 0x41;
14345         delay           = 20;
14346         blocksize       = 4;
14347         readsize        = 256;
14348       ;
14349
14350     memory "flash"
14351         paged           = yes;
14352         size            = 16384;
14353         page_size       = 128;
14354         num_pages       = 128;
14355         min_write_delay = 4500;
14356         max_write_delay = 4500;
14357         readback_p1     = 0x00;
14358         readback_p2     = 0x00;
14359         read_lo         = "  0   0   1   0      0   0   0   0",
14360                           "a15 a14 a13 a12    a11 a10  a9  a8",
14361                           " a7  a6  a5  a4     a3  a2  a1  a0",
14362                           "  o   o   o   o      o   o   o   o";
14363
14364         read_hi         = "  0   0   1   0      1   0   0   0",
14365                           "a15 a14 a13 a12    a11 a10  a9  a8",
14366                           " a7  a6  a5  a4     a3  a2  a1  a0",
14367                           "  o   o   o   o      o   o   o   o";
14368
14369         loadpage_lo     = "  0   1   0   0      0   0   0   0",
14370                           "  x   x   x   x      x   x   x   x",
14371                           "  x   x  a5  a4     a3  a2  a1  a0",
14372                           "  i   i   i   i      i   i   i   i";
14373
14374         loadpage_hi     = "  0   1   0   0      1   0   0   0",
14375                           "  x   x   x   x      x   x   x   x",
14376                           "  x   x  a5  a4     a3  a2  a1  a0",
14377                           "  i   i   i   i      i   i   i   i";
14378
14379         writepage       = "  0   1   0   0      1   1   0   0",
14380                           "a15 a14 a13 a12    a11 a10  a9  a8",
14381                           " a7  a6   x   x      x   x   x   x",
14382                           "  x   x   x   x      x   x   x   x";
14383
14384         mode            = 0x41;
14385         delay           = 6;
14386         blocksize       = 128;
14387         readsize        = 256;
14388       ;
14389
14390     memory "lfuse"
14391         size            = 1;
14392         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
14393                           "x x x x  x x x x  i i i i  i i i i";
14394
14395         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
14396                           "x x x x  x x x x  o o o o  o o o o";
14397         min_write_delay = 9000;
14398         max_write_delay = 9000;
14399       ;
14400
14401     memory "hfuse"
14402         size            = 1;
14403         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
14404                           "x x x x  x x x x  i i i i  i i i i";
14405
14406         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
14407                           "x x x x  x x x x  o o o o  o o o o";
14408         min_write_delay = 9000;
14409         max_write_delay = 9000;
14410       ;
14411
14412     memory "efuse"
14413         size            = 1;
14414         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
14415                           "x x x x  x x x x  i i i i  i i i i";
14416
14417         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
14418                           "x x x x  x x x x  o o o o  o o o o";
14419         min_write_delay = 9000;
14420         max_write_delay = 9000;
14421       ;
14422
14423     memory "lock"
14424         size            = 1;
14425         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
14426                           "x x x x  x x x x   x x o o  o o o o";
14427
14428         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
14429                           "x x x x  x x x x   1 1 i i  i i i i";
14430         min_write_delay = 9000;
14431         max_write_delay = 9000;
14432       ;
14433
14434     memory "calibration"
14435         size            = 1;
14436         read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
14437                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
14438       ;
14439     memory "signature"
14440         size            = 3;
14441         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
14442                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
14443       ;
14444   ;
14445
14446 #------------------------------------------------------------
14447 # ATmega8U2
14448 #------------------------------------------------------------
14449 # Changes against ATmega16U2 (beside IDs)
14450 #    memory "flash"
14451 #        size            = 8192;
14452 #        page_size       = 64;
14453 #        blocksize       = 64;
14454
14455 part
14456     id               = "m8u2";
14457     desc             = "ATmega8U2";
14458     has_jtag         = no;
14459     has_debugwire    = yes;
14460     signature        = 0x1e 0x93 0x89;
14461     chip_erase_delay = 9000;
14462     reset            = io;
14463     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
14464                        "x x x x  x x x x    x x x x  x x x x";
14465     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
14466                        "x x x x  x x x x    x x x x  x x x x";
14467     pagel            = 0xD7;
14468     bs2              = 0xC6;
14469
14470     timeout             = 200;
14471     stabdelay           = 100;
14472     cmdexedelay         = 25;
14473     synchloops          = 32;
14474     bytedelay           = 0;
14475     pollindex           = 3;
14476     pollvalue           = 0x53;
14477     predelay            = 1;
14478     postdelay           = 1;
14479     pollmethod          = 1;
14480     pp_controlstack     =
14481         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
14482         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
14483         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
14484         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
14485     hventerstabdelay    = 100;
14486     progmodedelay       = 0;
14487     latchcycles         = 5;
14488     togglevtg           = 1;
14489     poweroffdelay       = 15;
14490     resetdelayms        = 1;
14491     resetdelayus        = 0;
14492     hvleavestabdelay    = 15;
14493     chiperasepulsewidth = 0;
14494     chiperasepolltimeout = 10;
14495     programfusepulsewidth = 0;
14496     programfusepolltimeout = 5;
14497     programlockpulsewidth = 0;
14498     programlockpolltimeout = 5;
14499
14500     memory "eeprom"
14501         paged           = no; /* leave this "no" */
14502         page_size       = 4;  /* for parallel programming */
14503         size            = 512;
14504         num_pages       = 128;
14505         min_write_delay = 9000;
14506         max_write_delay = 9000;
14507         readback_p1     = 0x00;
14508         readback_p2     = 0x00;
14509         read            = "  1   0   1   0      0   0   0   0",
14510                           "  0   0   0   0    a11 a10  a9  a8",
14511                           " a7  a6  a5  a4     a3  a2  a1  a0",
14512                           "  o   o   o   o      o   o   o   o";
14513
14514         write           = "  1   1   0   0      0   0   0   0",
14515                           "  0   0   0   0    a11 a10  a9  a8",
14516                           " a7  a6  a5  a4     a3  a2  a1  a0",
14517                           "  i   i   i   i      i   i   i   i";
14518
14519         loadpage_lo     = "  1   1   0   0      0   0   0   1",
14520                           "  0   0   0   0      0   0   0   0",
14521                           "  0   0   0   0      0   0  a1  a0",
14522                           "  i   i   i   i      i   i   i   i";
14523
14524         writepage       = "  1   1   0   0      0   0   1   0",
14525                           "  0   0   0   0    a11 a10  a9  a8",
14526                           " a7  a6  a5  a4     a3  a2   0   0",
14527                           "  x   x   x   x      x   x   x   x";
14528
14529         mode            = 0x41;
14530         delay           = 20;
14531         blocksize       = 4;
14532         readsize        = 256;
14533       ;
14534
14535     memory "flash"
14536         paged           = yes;
14537         size            = 8192;
14538         page_size       = 64;
14539         num_pages       = 128;
14540         min_write_delay = 4500;
14541         max_write_delay = 4500;
14542         readback_p1     = 0x00;
14543         readback_p2     = 0x00;
14544         read_lo         = "  0   0   1   0      0   0   0   0",
14545                           "a15 a14 a13 a12    a11 a10  a9  a8",
14546                           " a7  a6  a5  a4     a3  a2  a1  a0",
14547                           "  o   o   o   o      o   o   o   o";
14548
14549         read_hi         = "  0   0   1   0      1   0   0   0",
14550                           "a15 a14 a13 a12    a11 a10  a9  a8",
14551                           " a7  a6  a5  a4     a3  a2  a1  a0",
14552                           "  o   o   o   o      o   o   o   o";
14553
14554         loadpage_lo     = "  0   1   0   0      0   0   0   0",
14555                           "  x   x   x   x      x   x   x   x",
14556                           "  x   x  a5  a4     a3  a2  a1  a0",
14557                           "  i   i   i   i      i   i   i   i";
14558
14559         loadpage_hi     = "  0   1   0   0      1   0   0   0",
14560                           "  x   x   x   x      x   x   x   x",
14561                           "  x   x  a5  a4     a3  a2  a1  a0",
14562                           "  i   i   i   i      i   i   i   i";
14563
14564         writepage       = "  0   1   0   0      1   1   0   0",
14565                           "a15 a14 a13 a12    a11 a10  a9  a8",
14566                           " a7  a6   x   x      x   x   x   x",
14567                           "  x   x   x   x      x   x   x   x";
14568
14569         mode            = 0x41;
14570         delay           = 6;
14571         blocksize       = 64;
14572         readsize        = 256;
14573       ;
14574
14575     memory "lfuse"
14576         size            = 1;
14577         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 0 0 0",
14578                           "x x x x  x x x x  i i i i  i i i i";
14579
14580         read            = "0 1 0 1  0 0 0 0  0 0 0 0  0 0 0 0",
14581                           "x x x x  x x x x  o o o o  o o o o";
14582         min_write_delay = 9000;
14583         max_write_delay = 9000;
14584       ;
14585
14586     memory "hfuse"
14587         size            = 1;
14588         write           = "1 0 1 0  1 1 0 0  1 0 1 0  1 0 0 0",
14589                           "x x x x  x x x x  i i i i  i i i i";
14590
14591         read            = "0 1 0 1  1 0 0 0  0 0 0 0  1 0 0 0",
14592                           "x x x x  x x x x  o o o o  o o o o";
14593         min_write_delay = 9000;
14594         max_write_delay = 9000;
14595       ;
14596
14597     memory "efuse"
14598         size            = 1;
14599         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
14600                           "x x x x  x x x x  i i i i  i i i i";
14601
14602         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
14603                           "x x x x  x x x x  o o o o  o o o o";
14604         min_write_delay = 9000;
14605         max_write_delay = 9000;
14606       ;
14607
14608     memory "lock"
14609         size            = 1;
14610         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
14611                           "x x x x  x x x x   x x o o  o o o o";
14612
14613         write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
14614                           "x x x x  x x x x   1 1 i i  i i i i";
14615         min_write_delay = 9000;
14616         max_write_delay = 9000;
14617       ;
14618
14619     memory "calibration"
14620         size            = 1;
14621         read            = "0 0 1 1  1 0 0 0    0 0 0 x  x x x x",
14622                           "0 0 0 0  0 0 0 0    o o o o  o o o o";
14623       ;
14624     memory "signature"
14625         size            = 3;
14626         read            = "0  0  1  1   0  0  0  0   0  0  0  x   x  x  x  x",
14627                           "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
14628       ;
14629   ;
14630 #------------------------------------------------------------
14631 # ATmega325
14632 #------------------------------------------------------------
14633
14634 part
14635     id               = "m325";
14636     desc             = "ATMEGA325";
14637     signature        = 0x1e 0x95 0x05;
14638     has_jtag         = yes;
14639 #   stk500_devcode   = 0x??; # No STK500v1 support?
14640 #   avr910_devcode   = 0x??; # Try the ATmega16 one
14641     avr910_devcode   = 0x74;
14642     pagel            = 0xd7;
14643     bs2              = 0xa0;
14644     chip_erase_delay = 9000;
14645     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
14646                        "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
14647
14648     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
14649                        "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
14650
14651     timeout             = 200;
14652     stabdelay           = 100;
14653     cmdexedelay         = 25;
14654     synchloops          = 32;
14655     bytedelay           = 0;
14656     pollindex           = 3;
14657     pollvalue           = 0x53;
14658     predelay            = 1;
14659     postdelay           = 1;
14660     pollmethod          = 1;
14661
14662     pp_controlstack     =
14663         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
14664         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
14665         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
14666         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
14667     hventerstabdelay    = 100;
14668     progmodedelay       = 0;
14669     latchcycles         = 5;
14670     togglevtg           = 1;
14671     poweroffdelay       = 15;
14672     resetdelayms        = 1;
14673     resetdelayus        = 0;
14674     hvleavestabdelay    = 15;
14675     chiperasepulsewidth = 0;
14676     chiperasepolltimeout = 10;
14677     programfusepulsewidth = 0;
14678     programfusepolltimeout = 5;
14679     programlockpulsewidth = 0;
14680     programlockpolltimeout = 5;
14681
14682     idr                 = 0x31;
14683     spmcr               = 0x57;
14684     allowfullpagebitstream = no;
14685
14686     memory "eeprom"
14687         paged           = no; /* leave this "no" */
14688         page_size       = 4;  /* for parallel programming */
14689         size            = 1024;
14690         min_write_delay = 9000;
14691         max_write_delay = 9000;
14692         readback_p1     = 0xff;
14693         readback_p2     = 0xff;
14694         read            = "  1   0   1   0      0   0   0   0",
14695                           "  0   0   0   0      0   0  a9  a8",
14696                           " a7  a6  a5  a4     a3  a2  a1  a0",
14697                           "  o   o   o   o      o   o   o   o";
14698
14699         write           = "  1   1   0   0      0   0   0   0",
14700                           "  0   0   0   0      0   0  a9  a8",
14701                           " a7  a6  a5  a4     a3  a2  a1  a0",
14702                           "  i   i   i   i      i   i   i   i";
14703
14704         loadpage_lo     = "  1   1   0   0      0   0   0   1",
14705                           "  0   0   0   0      0   0   0   0",
14706                           "  0   0   0   0      0   0  a1  a0",
14707                           "  i   i   i   i      i   i   i   i";
14708
14709         writepage       = "  1   1   0   0      0   0   1   0",
14710                           "  0   0   0   0      0   0  a9  a8",
14711                           " a7  a6  a5  a4     a3  a2   0   0",
14712                           "  x   x   x   x      x   x   x   x";
14713
14714         mode            = 0x41;
14715         delay           = 10;
14716         blocksize       = 4;
14717         readsize        = 256;
14718       ;
14719
14720     memory "flash"
14721         paged           = yes;
14722         size            = 32768;
14723         page_size       = 128;
14724         num_pages       = 256;
14725         min_write_delay = 4500;
14726         max_write_delay = 4500;
14727         readback_p1     = 0xff;
14728         readback_p2     = 0xff;
14729         read_lo         = "  0   0   1   0      0   0   0   0",
14730                           "  0 a14 a13 a12    a11 a10  a9  a8",
14731                           " a7  a6  a5  a4     a3  a2  a1  a0",
14732                           "  o   o   o   o      o   o   o   o";
14733
14734         read_hi         = "  0   0   1   0      1   0   0   0",
14735                           "  0 a14 a13 a12    a11 a10  a9  a8",
14736                           " a7  a6  a5  a4     a3  a2  a1  a0",
14737                           "  o   o   o   o      o   o   o   o";
14738
14739         loadpage_lo     = "  0   1   0   0      0   0   0   0",
14740                           "  0   0   0   0      0   0   0   0",
14741                           " a7  a6  a5  a4     a3  a2  a1  a0",
14742                           "  i   i   i   i      i   i   i   i";
14743
14744         loadpage_hi     = "  0   1   0   0      1   0   0   0",
14745                           "  0   0   0   0      0   0   0   0",
14746                           " a7  a6  a5  a4     a3  a2  a1  a0",
14747                           "  i   i   i   i      i   i   i   i";
14748
14749         writepage       = "  0   1   0   0      1   1   0   0",
14750                           "  0 a14 a13 a12    a11 a10  a9  a8",
14751                           " a7  a6  a5  a4     a3  a2  a1  a0",
14752                           "  x   x   x   x      x   x   x   x";
14753
14754         mode            = 0x41;
14755         delay           = 10;
14756         blocksize       = 128;
14757         readsize        = 256;
14758       ;
14759
14760     memory "lock"
14761         size            = 1;
14762         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
14763                           "x x x x  x x x x   x x o o  o o o o";
14764
14765         write           = "1 0 1 0  1 1 0 0   1 1 1 0  0 0 0 0",
14766                           "0 0 0 0  0 0 0 0   1 1 i i  i i i i";
14767         min_write_delay = 9000;
14768         max_write_delay = 9000;
14769       ;
14770
14771     memory "lfuse"
14772         size            = 1;
14773         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
14774                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
14775
14776         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
14777                           "0 0 0 0  0 0 0 0   i i i i  i i i i";
14778         min_write_delay = 9000;
14779         max_write_delay = 9000;
14780       ;
14781
14782     memory "hfuse"
14783         size            = 1;
14784         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
14785                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
14786
14787         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
14788                           "0 0 0 0  0 0 0 0   i i i i  i i i i";
14789         min_write_delay = 9000;
14790         max_write_delay = 9000;
14791       ;
14792
14793     memory "efuse"
14794         size            = 1;
14795
14796         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
14797                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
14798
14799         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
14800                           "0 0 0 0  0 0 0 0  1 1 1 1  1 i i i";
14801         min_write_delay = 9000;
14802         max_write_delay = 9000;
14803       ;
14804
14805     memory "signature"
14806         size            = 3;
14807         read            = "0  0  1  1   0  0  0  0   0  0  0  0   0  0  0  0",
14808                           "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
14809       ;
14810
14811     memory "calibration"
14812         size            = 1;
14813
14814         read            = "0 0 1 1  1 0 0 0   0 0 0 0  0 0 0 0",
14815                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
14816         ;
14817   ;
14818
14819 #------------------------------------------------------------
14820 # ATmega645
14821 #------------------------------------------------------------
14822
14823 part
14824     id               = "m645";
14825     desc             = "ATMEGA645";
14826     signature        = 0x1E 0x96 0x05;
14827     has_jtag         = yes;
14828 #   stk500_devcode   = 0x??; # No STK500v1 support?
14829 #   avr910_devcode   = 0x??; # Try the ATmega16 one
14830     avr910_devcode   = 0x74;
14831     pagel            = 0xd7;
14832     bs2              = 0xa0;
14833     chip_erase_delay = 9000;
14834     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
14835                        "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
14836
14837     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
14838                        "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
14839
14840     timeout             = 200;
14841     stabdelay           = 100;
14842     cmdexedelay         = 25;
14843     synchloops          = 32;
14844     bytedelay           = 0;
14845     pollindex           = 3;
14846     pollvalue           = 0x53;
14847     predelay            = 1;
14848     postdelay           = 1;
14849     pollmethod          = 1;
14850
14851     pp_controlstack     =
14852         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
14853         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
14854         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
14855         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
14856     hventerstabdelay    = 100;
14857     progmodedelay       = 0;
14858     latchcycles         = 5;
14859     togglevtg           = 1;
14860     poweroffdelay       = 15;
14861     resetdelayms        = 1;
14862     resetdelayus        = 0;
14863     hvleavestabdelay    = 15;
14864     chiperasepulsewidth = 0;
14865     chiperasepolltimeout = 10;
14866     programfusepulsewidth = 0;
14867     programfusepolltimeout = 5;
14868     programlockpulsewidth = 0;
14869     programlockpolltimeout = 5;
14870
14871     idr                 = 0x31;
14872     spmcr               = 0x57;
14873     allowfullpagebitstream = no;
14874
14875     memory "eeprom"
14876         paged           = no; /* leave this "no" */
14877         page_size       = 8;  /* for parallel programming */
14878         size            = 2048;
14879         min_write_delay = 9000;
14880         max_write_delay = 9000;
14881         readback_p1     = 0xff;
14882         readback_p2     = 0xff;
14883         read            = "  1   0   1   0      0   0   0   0",
14884                           "  0   0   0   0      0 a10  a9  a8",
14885                           " a7  a6  a5  a4     a3  a2  a1  a0",
14886                           "  o   o   o   o      o   o   o   o";
14887
14888         write           = "  1   1   0   0      0   0   0   0",
14889                           "  0   0   0   0      0 a10  a9  a8",
14890                           " a7  a6  a5  a4     a3  a2  a1  a0",
14891                           "  i   i   i   i      i   i   i   i";
14892
14893         loadpage_lo     = "  1   1   0   0      0   0   0   1",
14894                           "  0   0   0   0      0   0   0   0",
14895                           "  0   0   0   0      0  a2  a1  a0",
14896                           "  i   i   i   i      i   i   i   i";
14897
14898         writepage       = "  1   1   0   0      0   0   1   0",
14899                           "  0   0   0   0      0 a10  a9  a8",
14900                           " a7  a6  a5  a4     a3   0   0   0",
14901                           "  x   x   x   x      x   x   x   x";
14902
14903         mode            = 0x41;
14904         delay           = 10;
14905         blocksize       = 8;
14906         readsize        = 256;
14907       ;
14908
14909     memory "flash"
14910         paged           = yes;
14911         size            = 65536;
14912         page_size       = 256;
14913         num_pages       = 256;
14914         min_write_delay = 4500;
14915         max_write_delay = 4500;
14916         readback_p1     = 0xff;
14917         readback_p2     = 0xff;
14918         read_lo         = "   0   0   1   0      0   0   0   0",
14919                           " a15 a14 a13 a12    a11 a10  a9  a8",
14920                           "  a7  a6  a5  a4     a3  a2  a1  a0",
14921                           "   o   o   o   o      o   o   o   o";
14922
14923         read_hi         = "   0   0   1   0      1   0   0   0",
14924                           " a15 a14 a13 a12    a11 a10  a9  a8",
14925                           "  a7  a6  a5  a4     a3  a2  a1  a0",
14926                           "   o   o   o   o      o   o   o   o";
14927
14928         loadpage_lo     = "  0   1   0   0      0   0   0   0",
14929                           "  0   0   0   0      0   0   0   0",
14930                           "  a7 a6  a5  a4     a3  a2  a1  a0",
14931                           "  i   i   i   i      i   i   i   i";
14932
14933         loadpage_hi     = "  0   1   0   0      1   0   0   0",
14934                           "  0   0   0   0      0   0   0   0",
14935                           "  a7 a6  a5  a4     a3  a2  a1  a0",
14936                           "  i   i   i   i      i   i   i   i";
14937
14938         writepage       = "   0   1   0   0      1   1   0   0",
14939                           " a15 a14 a13 a12    a11 a10  a9  a8",
14940                           "  a7  a6  a5  a4     a3  a2  a1  a0",
14941                           "   0   0   0   0      0   0   0   0";
14942
14943         mode            = 0x41;
14944         delay           = 10;
14945         blocksize       = 128;
14946         readsize        = 256;
14947       ;
14948
14949     memory "lock"
14950         size            = 1;
14951         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
14952                           "x x x x  x x x x   x x o o  o o o o";
14953
14954         write           = "1 0 1 0  1 1 0 0   1 1 1 0  0 0 0 0",
14955                           "0 0 0 0  0 0 0 0   1 1 i i  i i i i";
14956         min_write_delay = 9000;
14957         max_write_delay = 9000;
14958       ;
14959
14960     memory "lfuse"
14961         size            = 1;
14962         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
14963                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
14964
14965         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
14966                           "0 0 0 0  0 0 0 0   i i i i  i i i i";
14967         min_write_delay = 9000;
14968         max_write_delay = 9000;
14969       ;
14970
14971     memory "hfuse"
14972         size            = 1;
14973         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
14974                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
14975
14976         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
14977                           "0 0 0 0  0 0 0 0   i i i i  i i i i";
14978         min_write_delay = 9000;
14979         max_write_delay = 9000;
14980       ;
14981
14982     memory "efuse"
14983         size            = 1;
14984
14985         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
14986                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
14987
14988         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
14989                           "0 0 0 0  0 0 0 0  1 1 1 1  1 i i i";
14990         min_write_delay = 9000;
14991         max_write_delay = 9000;
14992       ;
14993
14994     memory "signature"
14995         size            = 3;
14996         read            = "0  0  1  1   0  0  0  0   0  0  0  0   0  0  0  0",
14997                           "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
14998       ;
14999
15000     memory "calibration"
15001         size            = 1;
15002
15003         read            = "0 0 1 1  1 0 0 0   0 0 0 0  0 0 0 0",
15004                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
15005         ;
15006   ;
15007
15008 #------------------------------------------------------------
15009 # ATmega3250
15010 #------------------------------------------------------------
15011
15012 part
15013     id               = "m3250";
15014     desc             = "ATMEGA3250";
15015     signature        = 0x1E 0x95 0x06;
15016     has_jtag         = yes;
15017 #   stk500_devcode   = 0x??; # No STK500v1 support?
15018 #   avr910_devcode   = 0x??; # Try the ATmega16 one
15019     avr910_devcode   = 0x74;
15020     pagel            = 0xd7;
15021     bs2              = 0xa0;
15022     chip_erase_delay = 9000;
15023     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
15024                        "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
15025
15026     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
15027                        "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
15028
15029     timeout             = 200;
15030     stabdelay           = 100;
15031     cmdexedelay         = 25;
15032     synchloops          = 32;
15033     bytedelay           = 0;
15034     pollindex           = 3;
15035     pollvalue           = 0x53;
15036     predelay            = 1;
15037     postdelay           = 1;
15038     pollmethod          = 1;
15039
15040     pp_controlstack     =
15041         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
15042         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
15043         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
15044         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
15045     hventerstabdelay    = 100;
15046     progmodedelay       = 0;
15047     latchcycles         = 5;
15048     togglevtg           = 1;
15049     poweroffdelay       = 15;
15050     resetdelayms        = 1;
15051     resetdelayus        = 0;
15052     hvleavestabdelay    = 15;
15053     chiperasepulsewidth = 0;
15054     chiperasepolltimeout = 10;
15055     programfusepulsewidth = 0;
15056     programfusepolltimeout = 5;
15057     programlockpulsewidth = 0;
15058     programlockpolltimeout = 5;
15059
15060     idr                 = 0x31;
15061     spmcr               = 0x57;
15062     allowfullpagebitstream = no;
15063
15064     memory "eeprom"
15065         paged           = no; /* leave this "no" */
15066         page_size       = 4;  /* for parallel programming */
15067         size            = 1024;
15068         min_write_delay = 9000;
15069         max_write_delay = 9000;
15070         readback_p1     = 0xff;
15071         readback_p2     = 0xff;
15072         read            = "  1   0   1   0      0   0   0   0",
15073                           "  0   0   0   0      0   0  a9  a8",
15074                           " a7  a6  a5  a4     a3  a2  a1  a0",
15075                           "  o   o   o   o      o   o   o   o";
15076
15077         write           = "  1   1   0   0      0   0   0   0",
15078                           "  0   0   0   0      0   0  a9  a8",
15079                           " a7  a6  a5  a4     a3  a2  a1  a0",
15080                           "  i   i   i   i      i   i   i   i";
15081
15082         loadpage_lo     = "  1   1   0   0      0   0   0   1",
15083                           "  0   0   0   0      0   0   0   0",
15084                           "  0   0   0   0      0   0  a1  a0",
15085                           "  i   i   i   i      i   i   i   i";
15086
15087         writepage       = "  1   1   0   0      0   0   1   0",
15088                           "  0   0   0   0      0   0  a9  a8",
15089                           " a7  a6  a5  a4     a3  a2   0   0",
15090                           "  x   x   x   x      x   x   x   x";
15091
15092         mode            = 0x41;
15093         delay           = 10;
15094         blocksize       = 4;
15095         readsize        = 256;
15096       ;
15097
15098     memory "flash"
15099         paged           = yes;
15100         size            = 32768;
15101         page_size       = 128;
15102         num_pages       = 256;
15103         min_write_delay = 4500;
15104         max_write_delay = 4500;
15105         readback_p1     = 0xff;
15106         readback_p2     = 0xff;
15107         read_lo         = "  0   0   1   0      0   0   0   0",
15108                           "  0 a14 a13 a12    a11 a10  a9  a8",
15109                           " a7  a6  a5  a4     a3  a2  a1  a0",
15110                           "  o   o   o   o      o   o   o   o";
15111
15112         read_hi         = "  0   0   1   0      1   0   0   0",
15113                           "  0 a14 a13 a12    a11 a10  a9  a8",
15114                           " a7  a6  a5  a4     a3  a2  a1  a0",
15115                           "  o   o   o   o      o   o   o   o";
15116
15117         loadpage_lo     = "  0   1   0   0      0   0   0   0",
15118                           "  0   0   0   0      0   0   0   0",
15119                           " a7  a6  a5  a4     a3  a2  a1  a0",
15120                           "  i   i   i   i      i   i   i   i";
15121
15122         loadpage_hi     = "  0   1   0   0      1   0   0   0",
15123                           "  0   0   0   0      0   0   0   0",
15124                           " a7  a6  a5  a4     a3  a2  a1  a0",
15125                           "  i   i   i   i      i   i   i   i";
15126
15127         writepage       = "  0   1   0   0      1   1   0   0",
15128                           "  0 a14 a13 a12    a11 a10  a9  a8",
15129                           " a7  a6  a5  a4     a3  a2  a1  a0",
15130                           "  x   x   x   x      x   x   x   x";
15131
15132         mode            = 0x41;
15133         delay           = 10;
15134         blocksize       = 128;
15135         readsize        = 256;
15136       ;
15137
15138     memory "lock"
15139         size            = 1;
15140         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
15141                           "x x x x  x x x x   x x o o  o o o o";
15142
15143         write           = "1 0 1 0  1 1 0 0   1 1 1 0  0 0 0 0",
15144                           "0 0 0 0  0 0 0 0   1 1 i i  i i i i";
15145         min_write_delay = 9000;
15146         max_write_delay = 9000;
15147       ;
15148
15149     memory "lfuse"
15150         size            = 1;
15151         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
15152                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
15153
15154         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
15155                           "0 0 0 0  0 0 0 0   i i i i  i i i i";
15156         min_write_delay = 9000;
15157         max_write_delay = 9000;
15158       ;
15159
15160     memory "hfuse"
15161         size            = 1;
15162         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
15163                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
15164
15165         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
15166                           "0 0 0 0  0 0 0 0   i i i i  i i i i";
15167         min_write_delay = 9000;
15168         max_write_delay = 9000;
15169       ;
15170
15171     memory "efuse"
15172         size            = 1;
15173
15174         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
15175                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
15176
15177         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
15178                           "0 0 0 0  0 0 0 0  1 1 1 1  1 i i i";
15179         min_write_delay = 9000;
15180         max_write_delay = 9000;
15181       ;
15182
15183     memory "signature"
15184         size            = 3;
15185         read            = "0  0  1  1   0  0  0  0   0  0  0  0   0  0  0  0",
15186                           "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
15187       ;
15188
15189     memory "calibration"
15190         size            = 1;
15191
15192         read            = "0 0 1 1  1 0 0 0   0 0 0 0  0 0 0 0",
15193                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
15194         ;
15195   ;
15196
15197 #------------------------------------------------------------
15198 # ATmega6450
15199 #------------------------------------------------------------
15200
15201 part
15202     id               = "m6450";
15203     desc             = "ATMEGA6450";
15204     signature        = 0x1E 0x96 0x06;
15205     has_jtag         = yes;
15206 #   stk500_devcode   = 0x??; # No STK500v1 support?
15207 #   avr910_devcode   = 0x??; # Try the ATmega16 one
15208     avr910_devcode   = 0x74;
15209     pagel            = 0xd7;
15210     bs2              = 0xa0;
15211     chip_erase_delay = 9000;
15212     pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
15213                        "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
15214
15215     chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 0  0 0 0 0",
15216                        "0 0 0 0  0 0 0 0    0 0 0 0  0 0 0 0";
15217
15218     timeout             = 200;
15219     stabdelay           = 100;
15220     cmdexedelay         = 25;
15221     synchloops          = 32;
15222     bytedelay           = 0;
15223     pollindex           = 3;
15224     pollvalue           = 0x53;
15225     predelay            = 1;
15226     postdelay           = 1;
15227     pollmethod          = 1;
15228
15229     pp_controlstack     =
15230         0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
15231         0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
15232         0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
15233         0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
15234     hventerstabdelay    = 100;
15235     progmodedelay       = 0;
15236     latchcycles         = 5;
15237     togglevtg           = 1;
15238     poweroffdelay       = 15;
15239     resetdelayms        = 1;
15240     resetdelayus        = 0;
15241     hvleavestabdelay    = 15;
15242     chiperasepulsewidth = 0;
15243     chiperasepolltimeout = 10;
15244     programfusepulsewidth = 0;
15245     programfusepolltimeout = 5;
15246     programlockpulsewidth = 0;
15247     programlockpolltimeout = 5;
15248
15249     idr                 = 0x31;
15250     spmcr               = 0x57;
15251     allowfullpagebitstream = no;
15252
15253     memory "eeprom"
15254         paged           = no; /* leave this "no" */
15255         page_size       = 8;  /* for parallel programming */
15256         size            = 2048;
15257         min_write_delay = 9000;
15258         max_write_delay = 9000;
15259         readback_p1     = 0xff;
15260         readback_p2     = 0xff;
15261         read            = "  1   0   1   0      0   0   0   0",
15262                           "  0   0   0   0      0 a10  a9  a8",
15263                           " a7  a6  a5  a4     a3  a2  a1  a0",
15264                           "  o   o   o   o      o   o   o   o";
15265
15266         write           = "  1   1   0   0      0   0   0   0",
15267                           "  0   0   0   0      0 a10  a9  a8",
15268                           " a7  a6  a5  a4     a3  a2  a1  a0",
15269                           "  i   i   i   i      i   i   i   i";
15270
15271         loadpage_lo     = "  1   1   0   0      0   0   0   1",
15272                           "  0   0   0   0      0   0   0   0",
15273                           "  0   0   0   0      0  a2  a1  a0",
15274                           "  i   i   i   i      i   i   i   i";
15275
15276         writepage       = "  1   1   0   0      0   0   1   0",
15277                           "  0   0   0   0      0 a10  a9  a8",
15278                           " a7  a6  a5  a4     a3   0   0   0",
15279                           "  x   x   x   x      x   x   x   x";
15280
15281         mode            = 0x41;
15282         delay           = 10;
15283         blocksize       = 4;
15284         readsize        = 256;
15285       ;
15286
15287     memory "flash"
15288         paged           = yes;
15289         size            = 65536;
15290         page_size       = 256;
15291         num_pages       = 256;
15292         min_write_delay = 4500;
15293         max_write_delay = 4500;
15294         readback_p1     = 0xff;
15295         readback_p2     = 0xff;
15296         read_lo         = "   0   0   1   0      0   0   0   0",
15297                           " a15 a14 a13 a12    a11 a10  a9  a8",
15298                           "  a7  a6  a5  a4     a3  a2  a1  a0",
15299                           "   o   o   o   o      o   o   o   o";
15300
15301         read_hi         = "   0   0   1   0      1   0   0   0",
15302                           " a15 a14 a13 a12    a11 a10  a9  a8",
15303                           "  a7  a6  a5  a4     a3  a2  a1  a0",
15304                           "   o   o   o   o      o   o   o   o";
15305
15306         loadpage_lo     = "  0   1   0   0      0   0   0   0",
15307                           "  0   0   0   0      0   0   0   0",
15308                           "  a7 a6  a5  a4     a3  a2  a1  a0",
15309                           "  i   i   i   i      i   i   i   i";
15310
15311         loadpage_hi     = "  0   1   0   0      1   0   0   0",
15312                           "  0   0   0   0      0   0   0   0",
15313                           "  a7 a6  a5  a4     a3  a2  a1  a0",
15314                           "  i   i   i   i      i   i   i   i";
15315
15316         writepage       = "   0   1   0   0      1   1   0   0",
15317                           " a15 a14 a13 a12    a11 a10  a9  a8",
15318                           "  a7  a6  a5  a4     a3  a2  a1  a0",
15319                           "   0   0   0   0      0   0   0   0";
15320
15321         mode            = 0x41;
15322         delay           = 10;
15323         blocksize       = 128;
15324         readsize        = 256;
15325       ;
15326
15327     memory "lock"
15328         size            = 1;
15329         read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
15330                           "x x x x  x x x x   x x o o  o o o o";
15331
15332         write           = "1 0 1 0  1 1 0 0   1 1 1 0  0 0 0 0",
15333                           "0 0 0 0  0 0 0 0   1 1 i i  i i i i";
15334         min_write_delay = 9000;
15335         max_write_delay = 9000;
15336       ;
15337
15338     memory "lfuse"
15339         size            = 1;
15340         read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
15341                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
15342
15343         write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
15344                           "0 0 0 0  0 0 0 0   i i i i  i i i i";
15345         min_write_delay = 9000;
15346         max_write_delay = 9000;
15347       ;
15348
15349     memory "hfuse"
15350         size            = 1;
15351         read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
15352                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
15353
15354         write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
15355                           "0 0 0 0  0 0 0 0   i i i i  i i i i";
15356         min_write_delay = 9000;
15357         max_write_delay = 9000;
15358       ;
15359
15360     memory "efuse"
15361         size            = 1;
15362
15363         read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
15364                           "0 0 0 0  0 0 0 0  o o o o  o o o o";
15365
15366         write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
15367                           "0 0 0 0  0 0 0 0  1 1 1 1  1 i i i";
15368         min_write_delay = 9000;
15369         max_write_delay = 9000;
15370       ;
15371
15372     memory "signature"
15373         size            = 3;
15374         read            = "0  0  1  1   0  0  0  0   0  0  0  0   0  0  0  0",
15375                           "0  0  0  0   0  0 a1 a0   o  o  o  o   o  o  o  o";
15376       ;
15377
15378     memory "calibration"
15379         size            = 1;
15380
15381         read            = "0 0 1 1  1 0 0 0   0 0 0 0  0 0 0 0",
15382                           "0 0 0 0  0 0 0 0   o o o o  o o o o";
15383         ;
15384   ;
15385
15386 #------------------------------------------------------------
15387 # ATXMEGA64A1
15388 #------------------------------------------------------------
15389
15390 part
15391     id          = "x64a1";
15392     desc        = "ATXMEGA64A1";
15393     signature   = 0x1e 0x96 0x4e;
15394     has_jtag    = yes;
15395     has_pdi     = yes;
15396     nvm_base    = 0x01c0;
15397
15398     memory "eeprom"
15399         size            = 0x0800;
15400         offset          = 0x08c0000;
15401         page_size       = 0x20;
15402         readsize        = 0x100;
15403     ;
15404
15405     memory "application"
15406         size            = 0x00010000;
15407         offset          = 0x0800000;
15408         page_size       = 0x100;
15409         readsize        = 0x100;
15410     ;
15411
15412     memory "apptable"
15413         size            = 0x00001000;
15414         offset          = 0x0080f000;
15415         page_size       = 0x100;
15416         readsize        = 0x100;
15417     ;
15418
15419     memory "boot"
15420         size            = 0x00001000;
15421         offset          = 0x00810000;
15422         page_size       = 0x100;
15423         readsize        = 0x100;
15424     ;
15425
15426     memory "flash"
15427         size            = 0x00011000;
15428         offset          = 0x0800000;
15429         page_size       = 0x100;
15430         readsize        = 0x100;
15431     ;
15432
15433     memory "prodsig"
15434         size            = 0x200;
15435         offset          = 0x8e0200;
15436         page_size       = 0x100;
15437         readsize        = 0x100;
15438     ;
15439
15440     memory "usersig"
15441         size            = 0x200;
15442         offset          = 0x8e0400;
15443         page_size       = 0x100;
15444         readsize        = 0x100;
15445     ;
15446
15447     memory "signature"
15448         size            = 3;
15449         offset          = 0x1000090;
15450     ;
15451
15452     memory "fuse0"
15453         size            = 1;
15454         offset          = 0x8f0020;
15455     ;
15456
15457     memory "fuse1"
15458         size            = 1;
15459         offset          = 0x8f0021;
15460     ;
15461
15462     memory "fuse2"
15463         size            = 1;
15464         offset          = 0x8f0022;
15465     ;
15466
15467     memory "fuse4"
15468         size            = 1;
15469         offset          = 0x8f0024;
15470     ;
15471
15472     memory "fuse5"
15473         size            = 1;
15474         offset          = 0x8f0025;
15475     ;
15476
15477     memory "lock"
15478         size            = 1;
15479         offset          = 0x8f0027;
15480     ;
15481 ;
15482
15483 #------------------------------------------------------------
15484 # ATXMEGA128A1
15485 #------------------------------------------------------------
15486
15487 part
15488     id          = "x128a1";
15489     desc        = "ATXMEGA128A1";
15490     signature   = 0x1e 0x97 0x4c;
15491     has_jtag    = yes;
15492     has_pdi     = yes;
15493     nvm_base    = 0x01c0;
15494
15495     memory "eeprom"
15496         size            = 0x0800;
15497         offset          = 0x08c0000;
15498         page_size       = 0x20;
15499         readsize        = 0x100;
15500     ;
15501
15502     memory "application"
15503         size            = 0x00020000;
15504         offset          = 0x0800000;
15505         page_size       = 0x100;
15506         readsize        = 0x100;
15507     ;
15508
15509     memory "apptable"
15510         size            = 0x00002000;
15511         offset          = 0x0081e000;
15512         page_size       = 0x100;
15513         readsize        = 0x100;
15514     ;
15515
15516     memory "boot"
15517         size            = 0x00002000;
15518         offset          = 0x00820000;
15519         page_size       = 0x100;
15520         readsize        = 0x100;
15521     ;
15522
15523     memory "flash"
15524         size            = 0x00022000;
15525         offset          = 0x0800000;
15526         page_size       = 0x100;
15527         readsize        = 0x100;
15528     ;
15529
15530     memory "prodsig"
15531         size            = 0x200;
15532         offset          = 0x8e0200;
15533         page_size       = 0x100;
15534         readsize        = 0x100;
15535     ;
15536
15537     memory "usersig"
15538         size            = 0x200;
15539         offset          = 0x8e0400;
15540         page_size       = 0x100;
15541         readsize        = 0x100;
15542     ;
15543
15544     memory "signature"
15545         size            = 3;
15546         offset          = 0x1000090;
15547     ;
15548
15549     memory "fuse0"
15550         size            = 1;
15551         offset          = 0x8f0020;
15552     ;
15553
15554     memory "fuse1"
15555         size            = 1;
15556         offset          = 0x8f0021;
15557     ;
15558
15559     memory "fuse2"
15560         size            = 1;
15561         offset          = 0x8f0022;
15562     ;
15563
15564     memory "fuse4"
15565         size            = 1;
15566         offset          = 0x8f0024;
15567     ;
15568
15569     memory "fuse5"
15570         size            = 1;
15571         offset          = 0x8f0025;
15572     ;
15573
15574     memory "lock"
15575         size            = 1;
15576         offset          = 0x8f0027;
15577     ;
15578 ;
15579
15580 #------------------------------------------------------------
15581 # ATXMEGA128A1REVD
15582 #------------------------------------------------------------
15583
15584 part
15585     id          = "x128a1d";
15586     desc        = "ATXMEGA128A1REVD";
15587     signature   = 0x1e 0x97 0x41;
15588     has_jtag    = yes;
15589     has_pdi     = yes;
15590     nvm_base    = 0x01c0;
15591
15592     memory "eeprom"
15593         size            = 0x0800;
15594         offset          = 0x08c0000;
15595         page_size       = 0x20;
15596         readsize        = 0x100;
15597     ;
15598
15599     memory "application"
15600         size            = 0x00020000;
15601         offset          = 0x0800000;
15602         page_size       = 0x100;
15603         readsize        = 0x100;
15604     ;
15605
15606     memory "apptable"
15607         size            = 0x00002000;
15608         offset          = 0x0081e000;
15609         page_size       = 0x100;
15610         readsize        = 0x100;
15611     ;
15612
15613     memory "boot"
15614         size            = 0x00002000;
15615         offset          = 0x00820000;
15616         page_size       = 0x100;
15617         readsize        = 0x100;
15618     ;
15619
15620     memory "flash"
15621         size            = 0x00022000;
15622         offset          = 0x0800000;
15623         page_size       = 0x100;
15624         readsize        = 0x100;
15625     ;
15626
15627     memory "prodsig"
15628         size            = 0x200;
15629         offset          = 0x8e0200;
15630         page_size       = 0x100;
15631         readsize        = 0x100;
15632     ;
15633
15634     memory "usersig"
15635         size            = 0x200;
15636         offset          = 0x8e0400;
15637         page_size       = 0x100;
15638         readsize        = 0x100;
15639     ;
15640
15641     memory "signature"
15642         size            = 3;
15643         offset          = 0x1000090;
15644     ;
15645
15646     memory "fuse0"
15647         size            = 1;
15648         offset          = 0x8f0020;
15649     ;
15650
15651     memory "fuse1"
15652         size            = 1;
15653         offset          = 0x8f0021;
15654     ;
15655
15656     memory "fuse2"
15657         size            = 1;
15658         offset          = 0x8f0022;
15659     ;
15660
15661     memory "fuse4"
15662         size            = 1;
15663         offset          = 0x8f0024;
15664     ;
15665
15666     memory "fuse5"
15667         size            = 1;
15668         offset          = 0x8f0025;
15669     ;
15670
15671     memory "lock"
15672         size            = 1;
15673         offset          = 0x8f0027;
15674     ;
15675 ;
15676
15677 #------------------------------------------------------------
15678 # ATXMEGA192A1
15679 #------------------------------------------------------------
15680
15681 part
15682     id          = "x192a1";
15683     desc        = "ATXMEGA192A1";
15684     signature   = 0x1e 0x97 0x4e;
15685     has_jtag    = yes;
15686     has_pdi     = yes;
15687     nvm_base    = 0x01c0;
15688
15689     memory "eeprom"
15690         size            = 0x0800;
15691         offset          = 0x08c0000;
15692         page_size       = 0x20;
15693         readsize        = 0x100;
15694     ;
15695
15696     memory "application"
15697         size            = 0x00030000;
15698         offset          = 0x0800000;
15699         page_size       = 0x100;
15700         readsize        = 0x100;
15701     ;
15702
15703     memory "apptable"
15704         size            = 0x00002000;
15705         offset          = 0x0082e000;
15706         page_size       = 0x100;
15707         readsize        = 0x100;
15708     ;
15709
15710     memory "boot"
15711         size            = 0x00002000;
15712         offset          = 0x00830000;
15713         page_size       = 0x100;
15714         readsize        = 0x100;
15715     ;
15716
15717     memory "flash"
15718         size            = 0x00032000;
15719         offset          = 0x0800000;
15720         page_size       = 0x100;
15721         readsize        = 0x100;
15722     ;
15723
15724     memory "prodsig"
15725         size            = 0x200;
15726         offset          = 0x8e0200;
15727         page_size       = 0x100;
15728         readsize        = 0x100;
15729     ;
15730
15731     memory "usersig"
15732         size            = 0x200;
15733         offset          = 0x8e0400;
15734         page_size       = 0x100;
15735         readsize        = 0x100;
15736     ;
15737
15738     memory "signature"
15739         size            = 3;
15740         offset          = 0x1000090;
15741     ;
15742
15743     memory "fuse0"
15744         size            = 1;
15745         offset          = 0x8f0020;
15746     ;
15747
15748     memory "fuse1"
15749         size            = 1;
15750         offset          = 0x8f0021;
15751     ;
15752
15753     memory "fuse2"
15754         size            = 1;
15755         offset          = 0x8f0022;
15756     ;
15757
15758     memory "fuse4"
15759         size            = 1;
15760         offset          = 0x8f0024;
15761     ;
15762
15763     memory "fuse5"
15764         size            = 1;
15765         offset          = 0x8f0025;
15766     ;
15767
15768     memory "lock"
15769         size            = 1;
15770         offset          = 0x8f0027;
15771     ;
15772 ;
15773
15774 #------------------------------------------------------------
15775 # ATXMEGA256A1
15776 #------------------------------------------------------------
15777
15778 part
15779     id          = "x256a1";
15780     desc        = "ATXMEGA256A1";
15781     signature   = 0x1e 0x98 0x46;
15782     has_jtag    = yes;
15783     has_pdi     = yes;
15784     nvm_base    = 0x01c0;
15785
15786     memory "eeprom"
15787         size            = 0x1000;
15788         offset          = 0x08c0000;
15789         page_size       = 0x20;
15790         readsize        = 0x100;
15791     ;
15792
15793     memory "application"
15794         size            = 0x00040000;
15795         offset          = 0x0800000;
15796         page_size       = 0x100;
15797         readsize        = 0x100;
15798     ;
15799
15800     memory "apptable"
15801         size            = 0x00002000;
15802         offset          = 0x0083e000;
15803         page_size       = 0x100;
15804         readsize        = 0x100;
15805     ;
15806
15807     memory "boot"
15808         size            = 0x00002000;
15809         offset          = 0x00840000;
15810         page_size       = 0x100;
15811         readsize        = 0x100;
15812     ;
15813
15814     memory "flash"
15815         size            = 0x00042000;
15816         offset          = 0x0800000;
15817         page_size       = 0x100;
15818         readsize        = 0x100;
15819     ;
15820
15821     memory "prodsig"
15822         size            = 0x200;
15823         offset          = 0x8e0200;
15824         page_size       = 0x100;
15825         readsize        = 0x100;
15826     ;
15827
15828     memory "usersig"
15829         size            = 0x200;
15830         offset          = 0x8e0400;
15831         page_size       = 0x100;
15832         readsize        = 0x100;
15833     ;
15834
15835     memory "signature"
15836         size            = 3;
15837         offset          = 0x1000090;
15838     ;
15839
15840     memory "fuse0"
15841         size            = 1;
15842         offset          = 0x8f0020;
15843     ;
15844
15845     memory "fuse1"
15846         size            = 1;
15847         offset          = 0x8f0021;
15848     ;
15849
15850     memory "fuse2"
15851         size            = 1;
15852         offset          = 0x8f0022;
15853     ;
15854
15855     memory "fuse4"
15856         size            = 1;
15857         offset          = 0x8f0024;
15858     ;
15859
15860     memory "fuse5"
15861         size            = 1;
15862         offset          = 0x8f0025;
15863     ;
15864
15865     memory "lock"
15866         size            = 1;
15867         offset          = 0x8f0027;
15868     ;
15869 ;
15870
15871 #------------------------------------------------------------
15872 # ATXMEGA64A3
15873 #------------------------------------------------------------
15874
15875 part
15876     id          = "x64a3";
15877     desc        = "ATXMEGA64A3";
15878     signature   = 0x1e 0x96 0x42;
15879     has_jtag    = yes;
15880     has_pdi     = yes;
15881     nvm_base    = 0x01c0;
15882
15883     memory "eeprom"
15884         size            = 0x0800;
15885         offset          = 0x08c0000;
15886         page_size       = 0x20;
15887         readsize        = 0x100;
15888     ;
15889
15890     memory "application"
15891         size            = 0x00010000;
15892         offset          = 0x0800000;
15893         page_size       = 0x100;
15894         readsize        = 0x100;
15895     ;
15896
15897     memory "apptable"
15898         size            = 0x00001000;
15899         offset          = 0x0080f000;
15900         page_size       = 0x100;
15901         readsize        = 0x100;
15902     ;
15903
15904     memory "boot"
15905         size            = 0x00001000;
15906         offset          = 0x00810000;
15907         page_size       = 0x100;
15908         readsize        = 0x100;
15909     ;
15910
15911     memory "flash"
15912         size            = 0x00011000;
15913         offset          = 0x0800000;
15914         page_size       = 0x100;
15915         readsize        = 0x100;
15916     ;
15917
15918     memory "prodsig"
15919         size            = 0x200;
15920         offset          = 0x8e0200;
15921         page_size       = 0x100;
15922         readsize        = 0x100;
15923     ;
15924
15925     memory "usersig"
15926         size            = 0x200;
15927         offset          = 0x8e0400;
15928         page_size       = 0x100;
15929         readsize        = 0x100;
15930     ;
15931
15932     memory "signature"
15933         size            = 3;
15934         offset          = 0x1000090;
15935     ;
15936
15937     memory "fuse0"
15938         size            = 1;
15939         offset          = 0x8f0020;
15940     ;
15941
15942     memory "fuse1"
15943         size            = 1;
15944         offset          = 0x8f0021;
15945     ;
15946
15947     memory "fuse2"
15948         size            = 1;
15949         offset          = 0x8f0022;
15950     ;
15951
15952     memory "fuse4"
15953         size            = 1;
15954         offset          = 0x8f0024;
15955     ;
15956
15957     memory "fuse5"
15958         size            = 1;
15959         offset          = 0x8f0025;
15960     ;
15961
15962     memory "lock"
15963         size            = 1;
15964         offset          = 0x8f0027;
15965     ;
15966 ;
15967
15968 #------------------------------------------------------------
15969 # ATXMEGA128A3
15970 #------------------------------------------------------------
15971
15972 part
15973     id          = "x128a3";
15974     desc        = "ATXMEGA128A3";
15975     signature   = 0x1e 0x97 0x42;
15976     has_jtag    = yes;
15977     has_pdi     = yes;
15978     nvm_base    = 0x01c0;
15979
15980     memory "eeprom"
15981         size            = 0x0800;
15982         offset          = 0x08c0000;
15983         page_size       = 0x20;
15984         readsize        = 0x100;
15985     ;
15986
15987     memory "application"
15988         size            = 0x00020000;
15989         offset          = 0x0800000;
15990         page_size       = 0x100;
15991         readsize        = 0x100;
15992     ;
15993
15994     memory "apptable"
15995         size            = 0x00002000;
15996         offset          = 0x0081e000;
15997         page_size       = 0x100;
15998         readsize        = 0x100;
15999     ;
16000
16001     memory "boot"
16002         size            = 0x00002000;
16003         offset          = 0x00820000;
16004         page_size       = 0x100;
16005         readsize        = 0x100;
16006     ;
16007
16008     memory "flash"
16009         size            = 0x00022000;
16010         offset          = 0x0800000;
16011         page_size       = 0x100;
16012         readsize        = 0x100;
16013     ;
16014
16015     memory "prodsig"
16016         size            = 0x200;
16017         offset          = 0x8e0200;
16018         page_size       = 0x100;
16019         readsize        = 0x100;
16020     ;
16021
16022     memory "usersig"
16023         size            = 0x200;
16024         offset          = 0x8e0400;
16025         page_size       = 0x100;
16026         readsize        = 0x100;
16027     ;
16028
16029     memory "signature"
16030         size            = 3;
16031         offset          = 0x1000090;
16032     ;
16033
16034     memory "fuse0"
16035         size            = 1;
16036         offset          = 0x8f0020;
16037     ;
16038
16039     memory "fuse1"
16040         size            = 1;
16041         offset          = 0x8f0021;
16042     ;
16043
16044     memory "fuse2"
16045         size            = 1;
16046         offset          = 0x8f0022;
16047     ;
16048
16049     memory "fuse4"
16050         size            = 1;
16051         offset          = 0x8f0024;
16052     ;
16053
16054     memory "fuse5"
16055         size            = 1;
16056         offset          = 0x8f0025;
16057     ;
16058
16059     memory "lock"
16060         size            = 1;
16061         offset          = 0x8f0027;
16062     ;
16063 ;
16064
16065 #------------------------------------------------------------
16066 # ATXMEGA192A3
16067 #------------------------------------------------------------
16068
16069 part
16070     id          = "x192a3";
16071     desc        = "ATXMEGA192A3";
16072     signature   = 0x1e 0x97 0x44;
16073     has_jtag    = yes;
16074     has_pdi     = yes;
16075     nvm_base    = 0x01c0;
16076
16077     memory "eeprom"
16078         size            = 0x0800;
16079         offset          = 0x08c0000;
16080         page_size       = 0x20;
16081         readsize        = 0x100;
16082     ;
16083
16084     memory "application"
16085         size            = 0x00030000;
16086         offset          = 0x0800000;
16087         page_size       = 0x100;
16088         readsize        = 0x100;
16089     ;
16090
16091     memory "apptable"
16092         size            = 0x00002000;
16093         offset          = 0x0082e000;
16094         page_size       = 0x100;
16095         readsize        = 0x100;
16096     ;
16097
16098     memory "boot"
16099         size            = 0x00002000;
16100         offset          = 0x00830000;
16101         page_size       = 0x100;
16102         readsize        = 0x100;
16103     ;
16104
16105     memory "flash"
16106         size            = 0x00032000;
16107         offset          = 0x0800000;
16108         page_size       = 0x100;
16109         readsize        = 0x100;
16110     ;
16111
16112     memory "prodsig"
16113         size            = 0x200;
16114         offset          = 0x8e0200;
16115         page_size       = 0x100;
16116         readsize        = 0x100;
16117     ;
16118
16119     memory "usersig"
16120         size            = 0x200;
16121         offset          = 0x8e0400;
16122         page_size       = 0x100;
16123         readsize        = 0x100;
16124     ;
16125
16126     memory "signature"
16127         size            = 3;
16128         offset          = 0x1000090;
16129     ;
16130
16131     memory "fuse0"
16132         size            = 1;
16133         offset          = 0x8f0020;
16134     ;
16135
16136     memory "fuse1"
16137         size            = 1;
16138         offset          = 0x8f0021;
16139     ;
16140
16141     memory "fuse2"
16142         size            = 1;
16143         offset          = 0x8f0022;
16144     ;
16145
16146     memory "fuse4"
16147         size            = 1;
16148         offset          = 0x8f0024;
16149     ;
16150
16151     memory "fuse5"
16152         size            = 1;
16153         offset          = 0x8f0025;
16154     ;
16155
16156     memory "lock"
16157         size            = 1;
16158         offset          = 0x8f0027;
16159     ;
16160 ;
16161
16162 #------------------------------------------------------------
16163 # ATXMEGA256A3
16164 #------------------------------------------------------------
16165
16166 part
16167     id          = "x256a3";
16168     desc        = "ATXMEGA256A3";
16169     signature   = 0x1e 0x98 0x42;
16170     has_jtag    = yes;
16171     has_pdi     = yes;
16172     nvm_base    = 0x01c0;
16173
16174     memory "eeprom"
16175         size            = 0x1000;
16176         offset          = 0x08c0000;
16177         page_size       = 0x20;
16178         readsize        = 0x100;
16179     ;
16180
16181     memory "application"
16182         size            = 0x00040000;
16183         offset          = 0x0800000;
16184         page_size       = 0x100;
16185         readsize        = 0x100;
16186     ;
16187
16188     memory "apptable"
16189         size            = 0x00002000;
16190         offset          = 0x0083e000;
16191         page_size       = 0x100;
16192         readsize        = 0x100;
16193     ;
16194
16195     memory "boot"
16196         size            = 0x00002000;
16197         offset          = 0x00840000;
16198         page_size       = 0x100;
16199         readsize        = 0x100;
16200     ;
16201
16202     memory "flash"
16203         size            = 0x00042000;
16204         offset          = 0x0800000;
16205         page_size       = 0x100;
16206         readsize        = 0x100;
16207     ;
16208
16209     memory "prodsig"
16210         size            = 0x200;
16211         offset          = 0x8e0200;
16212         page_size       = 0x100;
16213         readsize        = 0x100;
16214     ;
16215
16216     memory "usersig"
16217         size            = 0x200;
16218         offset          = 0x8e0400;
16219         page_size       = 0x100;
16220         readsize        = 0x100;
16221     ;
16222
16223     memory "signature"
16224         size            = 3;
16225         offset          = 0x1000090;
16226     ;
16227
16228     memory "fuse0"
16229         size            = 1;
16230         offset          = 0x8f0020;
16231     ;
16232
16233     memory "fuse1"
16234         size            = 1;
16235         offset          = 0x8f0021;
16236     ;
16237
16238     memory "fuse2"
16239         size            = 1;
16240         offset          = 0x8f0022;
16241     ;
16242
16243     memory "fuse4"
16244         size            = 1;
16245         offset          = 0x8f0024;
16246     ;
16247
16248     memory "fuse5"
16249         size            = 1;
16250         offset          = 0x8f0025;
16251     ;
16252
16253     memory "lock"
16254         size            = 1;
16255         offset          = 0x8f0027;
16256     ;
16257 ;
16258
16259 #------------------------------------------------------------
16260 # ATXMEGA256A3B
16261 #------------------------------------------------------------
16262
16263 part
16264     id          = "x256a3b";
16265     desc        = "ATXMEGA256A3B";
16266     signature   = 0x1e 0x98 0x43;
16267     has_jtag    = yes;
16268     has_pdi     = yes;
16269     nvm_base    = 0x01c0;
16270
16271     memory "eeprom"
16272         size            = 0x1000;
16273         offset          = 0x08c0000;
16274         page_size       = 0x20;
16275         readsize        = 0x100;
16276     ;
16277
16278     memory "application"
16279         size            = 0x00040000;
16280         offset          = 0x0800000;
16281         page_size       = 0x100;
16282         readsize        = 0x100;
16283     ;
16284
16285     memory "apptable"
16286         size            = 0x00002000;
16287         offset          = 0x0083e000;
16288         page_size       = 0x100;
16289         readsize        = 0x100;
16290     ;
16291
16292     memory "boot"
16293         size            = 0x00002000;
16294         offset          = 0x00840000;
16295         page_size       = 0x100;
16296         readsize        = 0x100;
16297     ;
16298
16299     memory "flash"
16300         size            = 0x00042000;
16301         offset          = 0x0800000;
16302         page_size       = 0x100;
16303         readsize        = 0x100;
16304     ;
16305
16306     memory "prodsig"
16307         size            = 0x200;
16308         offset          = 0x8e0200;
16309         page_size       = 0x100;
16310         readsize        = 0x100;
16311     ;
16312
16313     memory "usersig"
16314         size            = 0x200;
16315         offset          = 0x8e0400;
16316         page_size       = 0x100;
16317         readsize        = 0x100;
16318     ;
16319
16320     memory "signature"
16321         size            = 3;
16322         offset          = 0x1000090;
16323     ;
16324
16325     memory "fuse0"
16326         size            = 1;
16327         offset          = 0x8f0020;
16328     ;
16329
16330     memory "fuse1"
16331         size            = 1;
16332         offset          = 0x8f0021;
16333     ;
16334
16335     memory "fuse2"
16336         size            = 1;
16337         offset          = 0x8f0022;
16338     ;
16339
16340     memory "fuse4"
16341         size            = 1;
16342         offset          = 0x8f0024;
16343     ;
16344
16345     memory "fuse5"
16346         size            = 1;
16347         offset          = 0x8f0025;
16348     ;
16349
16350     memory "lock"
16351         size            = 1;
16352         offset          = 0x8f0027;
16353     ;
16354 ;
16355
16356 #------------------------------------------------------------
16357 # ATXMEGA16A4
16358 #------------------------------------------------------------
16359
16360 part
16361     id          = "x16a4";
16362     desc        = "ATXMEGA16A4";
16363     signature   = 0x1e 0x94 0x41;
16364     has_jtag    = yes;
16365     has_pdi     = yes;
16366     nvm_base    = 0x01c0;
16367
16368     memory "eeprom"
16369         size            = 0x0400;
16370         offset          = 0x08c0000;
16371         page_size       = 0x20;
16372         readsize        = 0x100;
16373     ;
16374
16375     memory "application"
16376         size            = 0x00004000;
16377         offset          = 0x0800000;
16378         page_size       = 0x100;
16379         readsize        = 0x100;
16380     ;
16381
16382     memory "apptable"
16383         size            = 0x00001000;
16384         offset          = 0x00803000;
16385         page_size       = 0x100;
16386         readsize        = 0x100;
16387     ;
16388
16389     memory "boot"
16390         size            = 0x00001000;
16391         offset          = 0x00804000;
16392         page_size       = 0x100;
16393         readsize        = 0x100;
16394     ;
16395
16396     memory "flash"
16397         size            = 0x00005000;
16398         offset          = 0x0800000;
16399         page_size       = 0x100;
16400         readsize        = 0x100;
16401     ;
16402
16403     memory "prodsig"
16404         size            = 0x200;
16405         offset          = 0x8e0200;
16406         page_size       = 0x100;
16407         readsize        = 0x100;
16408     ;
16409
16410     memory "usersig"
16411         size            = 0x200;
16412         offset          = 0x8e0400;
16413         page_size       = 0x100;
16414         readsize        = 0x100;
16415     ;
16416
16417     memory "signature"
16418         size            = 3;
16419         offset          = 0x1000090;
16420     ;
16421
16422     memory "fuse0"
16423         size            = 1;
16424         offset          = 0x8f0020;
16425     ;
16426
16427     memory "fuse1"
16428         size            = 1;
16429         offset          = 0x8f0021;
16430     ;
16431
16432     memory "fuse2"
16433         size            = 1;
16434         offset          = 0x8f0022;
16435     ;
16436
16437     memory "fuse4"
16438         size            = 1;
16439         offset          = 0x8f0024;
16440     ;
16441
16442     memory "fuse5"
16443         size            = 1;
16444         offset          = 0x8f0025;
16445     ;
16446
16447     memory "lock"
16448         size            = 1;
16449         offset          = 0x8f0027;
16450     ;
16451 ;
16452
16453 #------------------------------------------------------------
16454 # ATXMEGA32A4
16455 #------------------------------------------------------------
16456
16457 part
16458     id          = "x32a4";
16459     desc        = "ATXMEGA32A4";
16460     signature   = 0x1e 0x95 0x41;
16461     has_jtag    = yes;
16462     has_pdi     = yes;
16463     nvm_base    = 0x01c0;
16464
16465     memory "eeprom"
16466         size            = 0x0400;
16467         offset          = 0x08c0000;
16468         page_size       = 0x20;
16469         readsize        = 0x100;
16470     ;
16471
16472     memory "application"
16473         size            = 0x00008000;
16474         offset          = 0x0800000;
16475         page_size       = 0x100;
16476         readsize        = 0x100;
16477     ;
16478
16479     memory "apptable"
16480         size            = 0x00001000;
16481         offset          = 0x00807000;
16482         page_size       = 0x100;
16483         readsize        = 0x100;
16484     ;
16485
16486     memory "boot"
16487         size            = 0x00001000;
16488         offset          = 0x00808000;
16489         page_size       = 0x100;
16490         readsize        = 0x100;
16491     ;
16492
16493     memory "flash"
16494         size            = 0x00009000;
16495         offset          = 0x0800000;
16496         page_size       = 0x100;
16497         readsize        = 0x100;
16498     ;
16499
16500     memory "prodsig"
16501         size            = 0x200;
16502         offset          = 0x8e0200;
16503         page_size       = 0x100;
16504         readsize        = 0x100;
16505     ;
16506
16507     memory "usersig"
16508         size            = 0x200;
16509         offset          = 0x8e0400;
16510         page_size       = 0x100;
16511         readsize        = 0x100;
16512     ;
16513
16514     memory "signature"
16515         size            = 3;
16516         offset          = 0x1000090;
16517     ;
16518
16519     memory "fuse0"
16520         size            = 1;
16521         offset          = 0x8f0020;
16522     ;
16523
16524     memory "fuse1"
16525         size            = 1;
16526         offset          = 0x8f0021;
16527     ;
16528
16529     memory "fuse2"
16530         size            = 1;
16531         offset          = 0x8f0022;
16532     ;
16533
16534     memory "fuse4"
16535         size            = 1;
16536         offset          = 0x8f0024;
16537     ;
16538
16539     memory "fuse5"
16540         size            = 1;
16541         offset          = 0x8f0025;
16542     ;
16543
16544     memory "lock"
16545         size            = 1;
16546         offset          = 0x8f0027;
16547     ;
16548 ;
16549
16550 #------------------------------------------------------------
16551 # ATXMEGA64A4
16552 #------------------------------------------------------------
16553
16554 part
16555     id          = "x64a4";
16556     desc        = "ATXMEGA64A4";
16557     signature   = 0x1e 0x96 0x46;
16558     has_jtag    = yes;
16559     has_pdi     = yes;
16560     nvm_base    = 0x01c0;
16561
16562     memory "eeprom"
16563         size            = 0x0800;
16564         offset          = 0x08c0000;
16565         page_size       = 0x20;
16566         readsize        = 0x100;
16567     ;
16568
16569     memory "application"
16570         size            = 0x00010000;
16571         offset          = 0x0800000;
16572         page_size       = 0x100;
16573         readsize        = 0x100;
16574     ;
16575
16576     memory "apptable"
16577         size            = 0x00001000;
16578         offset          = 0x0080f000;
16579         page_size       = 0x100;
16580         readsize        = 0x100;
16581     ;
16582
16583     memory "boot"
16584         size            = 0x00001000;
16585         offset          = 0x00810000;
16586         page_size       = 0x100;
16587         readsize        = 0x100;
16588     ;
16589
16590     memory "flash"
16591         size            = 0x00011000;
16592         offset          = 0x0800000;
16593         page_size       = 0x100;
16594         readsize        = 0x100;
16595     ;
16596
16597     memory "prodsig"
16598         size            = 0x200;
16599         offset          = 0x8e0200;
16600         page_size       = 0x100;
16601         readsize        = 0x100;
16602     ;
16603
16604     memory "usersig"
16605         size            = 0x200;
16606         offset          = 0x8e0400;
16607         page_size       = 0x100;
16608         readsize        = 0x100;
16609     ;
16610
16611     memory "signature"
16612         size            = 3;
16613         offset          = 0x1000090;
16614     ;
16615
16616     memory "fuse0"
16617         size            = 1;
16618         offset          = 0x8f0020;
16619     ;
16620
16621     memory "fuse1"
16622         size            = 1;
16623         offset          = 0x8f0021;
16624     ;
16625
16626     memory "fuse2"
16627         size            = 1;
16628         offset          = 0x8f0022;
16629     ;
16630
16631     memory "fuse4"
16632         size            = 1;
16633         offset          = 0x8f0024;
16634     ;
16635
16636     memory "fuse5"
16637         size            = 1;
16638         offset          = 0x8f0025;
16639     ;
16640
16641     memory "lock"
16642         size            = 1;
16643         offset          = 0x8f0027;
16644     ;
16645 ;
16646
16647 #------------------------------------------------------------
16648 # ATXMEGA128A4
16649 #------------------------------------------------------------
16650
16651 part
16652     id          = "x128a4";
16653     desc        = "ATXMEGA128A4";
16654     signature   = 0x1e 0x97 0x46;
16655     has_jtag    = yes;
16656     has_pdi     = yes;
16657     nvm_base    = 0x01c0;
16658
16659     memory "eeprom"
16660         size            = 0x0800;
16661         offset          = 0x08c0000;
16662         page_size       = 0x20;
16663         readsize        = 0x100;
16664     ;
16665
16666     memory "application"
16667         size            = 0x00020000;
16668         offset          = 0x0800000;
16669         page_size       = 0x100;
16670         readsize        = 0x100;
16671     ;
16672
16673     memory "apptable"
16674         size            = 0x00002000;
16675         offset          = 0x0081e000;
16676         page_size       = 0x100;
16677         readsize        = 0x100;
16678     ;
16679
16680     memory "boot"
16681         size            = 0x00002000;
16682         offset          = 0x00820000;
16683         page_size       = 0x100;
16684         readsize        = 0x100;
16685     ;
16686
16687     memory "flash"
16688         size            = 0x00022000;
16689         offset          = 0x0800000;
16690         page_size       = 0x100;
16691         readsize        = 0x100;
16692     ;
16693
16694     memory "prodsig"
16695         size            = 0x200;
16696         offset          = 0x8e0200;
16697         page_size       = 0x100;
16698         readsize        = 0x100;
16699     ;
16700
16701     memory "usersig"
16702         size            = 0x200;
16703         offset          = 0x8e0400;
16704         page_size       = 0x100;
16705         readsize        = 0x100;
16706     ;
16707
16708     memory "signature"
16709         size            = 3;
16710         offset          = 0x1000090;
16711     ;
16712
16713     memory "fuse0"
16714         size            = 1;
16715         offset          = 0x8f0020;
16716     ;
16717
16718     memory "fuse1"
16719         size            = 1;
16720         offset          = 0x8f0021;
16721     ;
16722
16723     memory "fuse2"
16724         size            = 1;
16725         offset          = 0x8f0022;
16726     ;
16727
16728     memory "fuse4"
16729         size            = 1;
16730         offset          = 0x8f0024;
16731     ;
16732
16733     memory "fuse5"
16734         size            = 1;
16735         offset          = 0x8f0025;
16736     ;
16737
16738     memory "lock"
16739         size            = 1;
16740         offset          = 0x8f0027;
16741     ;
16742 ;
16743
16744
16745 #------------------------------------------------------------
16746 # AVR32UC3A0512
16747 #------------------------------------------------------------
16748
16749 part
16750     id          = "ucr2";
16751     desc        = "32UC3A0512";
16752     signature   = 0xED 0xC0 0x3F;
16753     has_jtag    = yes;
16754     is_avr32    = yes;
16755
16756     memory "flash"
16757         paged           = yes;
16758         page_size               = 512;               # bytes
16759         readsize                = 512;                           # bytes
16760         num_pages       = 1024;              # could be set dynamicly
16761         size                    = 0x00080000;            # could be set dynamicly
16762         offset                  = 0x80000000;
16763     ;
16764 ;
16765
16766 #------------------------------------------------------------
16767 # ATtiny4
16768 #------------------------------------------------------------
16769
16770 part
16771     id          = "t4";
16772     desc        = "ATtiny4";
16773     signature   = 0x1e 0x8f 0x0a;
16774     has_tpi     = yes;
16775
16776     memory "flash"
16777         size            = 512;
16778         offset          = 0x4000;
16779         page_size       = 16;
16780         blocksize       = 128;
16781     ;
16782
16783     memory "signature"
16784         size            = 3;
16785         offset          = 0x3fc0;
16786         page_size       = 16;
16787     ;
16788
16789     memory "fuse"
16790         size            = 1;
16791         offset          = 0x3f40;
16792         page_size       = 16;
16793         blocksize       = 4;
16794     ;
16795
16796     memory "calibration"
16797         size            = 1;
16798         offset          = 0x3f80;
16799         page_size       = 16;
16800     ;
16801
16802     memory "lockbits"
16803         size            = 1;
16804         offset          = 0x3f00;
16805         page_size       = 16;
16806     ;
16807 ;
16808
16809
16810 #------------------------------------------------------------
16811 # ATtiny5
16812 #------------------------------------------------------------
16813
16814 part
16815     id          = "t5";
16816     desc        = "ATtiny5";
16817     signature   = 0x1e 0x8f 0x09;
16818     has_tpi     = yes;
16819
16820     memory "flash"
16821         size            = 512;
16822         offset          = 0x4000;
16823         page_size       = 16;
16824         blocksize       = 128;
16825     ;
16826
16827     memory "signature"
16828         size            = 3;
16829         offset          = 0x3fc0;
16830         page_size       = 16;
16831     ;
16832
16833     memory "fuse"
16834         size            = 1;
16835         offset          = 0x3f40;
16836         page_size       = 16;
16837         blocksize       = 4;
16838     ;
16839
16840     memory "calibration"
16841         size            = 1;
16842         offset          = 0x3f80;
16843         page_size       = 16;
16844     ;
16845
16846     memory "lockbits"
16847         size            = 1;
16848         offset          = 0x3f00;
16849         page_size       = 16;
16850     ;
16851 ;
16852
16853
16854 #------------------------------------------------------------
16855 # ATtiny9
16856 #------------------------------------------------------------
16857
16858 part
16859     id          = "t9";
16860     desc        = "ATtiny9";
16861     signature   = 0x1e 0x90 0x08;
16862     has_tpi     = yes;
16863
16864     memory "flash"
16865         size            = 1024;
16866         offset          = 0x4000;
16867         page_size       = 16;
16868         blocksize       = 128;
16869     ;
16870
16871     memory "signature"
16872         size            = 3;
16873         offset          = 0x3fc0;
16874         page_size       = 16;
16875     ;
16876
16877     memory "fuse"
16878         size            = 1;
16879         offset          = 0x3f40;
16880         page_size       = 16;
16881         blocksize       = 4;
16882     ;
16883
16884     memory "calibration"
16885         size            = 1;
16886         offset          = 0x3f80;
16887         page_size       = 16;
16888     ;
16889
16890     memory "lockbits"
16891         size            = 1;
16892         offset          = 0x3f00;
16893         page_size       = 16;
16894     ;
16895 ;
16896
16897
16898 #------------------------------------------------------------
16899 # ATtiny10
16900 #------------------------------------------------------------
16901
16902 part
16903     id          = "t10";
16904     desc        = "ATtiny10";
16905     signature   = 0x1e 0x90 0x03;
16906     has_tpi     = yes;
16907
16908     memory "flash"
16909         size            = 1024;
16910         offset          = 0x4000;
16911         page_size       = 16;
16912         blocksize       = 128;
16913     ;
16914
16915     memory "signature"
16916         size            = 3;
16917         offset          = 0x3fc0;
16918         page_size       = 16;
16919     ;
16920
16921     memory "fuse"
16922         size            = 1;
16923         offset          = 0x3f40;
16924         page_size       = 16;
16925         blocksize       = 4;
16926     ;
16927
16928     memory "calibration"
16929         size            = 1;
16930         offset          = 0x3f80;
16931         page_size       = 16;
16932     ;
16933
16934     memory "lockbits"
16935         size            = 1;
16936         offset          = 0x3f00;
16937         page_size       = 16;
16938     ;
16939 ;
16940
16941