# $Id$ -*- text -*-
#
# AVRDUDE Configuration File
#
# This file contains configuration data used by AVRDUDE which describes
# the programming hardware pinouts and also provides part definitions.
# AVRDUDE's "-C" command line option specifies the location of the
# configuration file.  The "-c" option names the programmer configuration
# which must match one of the entry's "id" parameter.  The "-p" option
# identifies which part AVRDUDE is going to be programming and must match
# one of the parts' "id" parameter.
#
# DO NOT MODIFY THIS FILE.  Modifications will be overwritten the next
# time a "make install" is run.  For user-specific additions, use the
# "-C +filename" command line option.
#
# Possible entry formats are:
#
#   programmer
#       parent <id>                               # optional parent
#       id       = <id1> [, <id2> ... ] ;         # <idN> are quoted strings
#       desc     = <description> ;                # quoted string
#       type     = <type>;                        # programmer type, quoted string
#                                                 # supported types can be listed by "-c ?type"
#       prog_modes = PM_<i/f> {| PM_<i/f>}        # interfaces, eg, PM_SPM|PM_PDI (1)
#       connection_type = parallel | serial | usb | spi
#       baudrate = <num> ;                        # baudrate for avr910-programmer
#       vcc      = <pin1> [, <pin2> ... ] ;       # pin number(s)
#       buff     = <pin1> [, <pin2> ... ] ;       # pin number(s)
#       reset    = <pin> ;                        # pin number
#       sck      = <pin> ;                        # pin number
#       sdo      = <pin> ;                        # pin number
#       sdi      = <pin> ;                        # pin number
#       errled   = <pin> ;                        # pin number
#       rdyled   = <pin> ;                        # pin number
#       pgmled   = <pin> ;                        # pin number
#       vfyled   = <pin> ;                        # pin number
#       usbvid   = <hexnum> ;                     # USB VID (Vendor ID)
#       usbpid   = <hexnum> [, <hexnum> ...] ;    # USB PID (Product ID) (2)
#       usbdev   = <interface> ;                  # USB interface or other device info
#       usbvendor = <vendorname> ;                # USB Vendor Name
#       usbproduct = <productname> ;              # USB Product Name
#       usbsn    = <serialno> ;                   # USB Serial Number
#       hvupdi_support = <num> [, <num>, ... ] ;  # UPDI HV Variants Support
#   ;
#
#   # To invert a pin use = ~ <num>
#   # To invert a pin list (all pins get inverted) use ~ ( <num1> [, <num2> ... ] )
#   #
#   # (1) The following program modes are known:
#   #  - PM_SPM: Bootloaders, self-programming with SPM opcodes or NVM Controllers
#   #  - PM_TPI: Tiny Programming Interface (t4, t5, t9, t10, t20, t40, t102, t104)
#   #  - PM_ISP: SPI programming for In-System Programming (almost all classic parts)
#   #  - PM_PDI: Program and Debug Interface (xmega parts)
#   #  - PM_UPDI: Unified Program and Debug Interface
#   #  - PM_HVSP: High Voltage Serial Programming (some classic parts)
#   #  - PM_HVPP: High Voltage Parallel Programming (most non-HVSP classic parts)
#   #  - PM_debugWIRE: Simpler alternative to JTAG (a subset of HVPP/HVSP parts)
#   #  - PM_JTAG: Joint Test Action Group standard (some classic parts)
#   #  - PM_JTAGmkI: Subset of PM_JTAG, older parts, Atmel ICE mkI
#   #  - PM_XMEGAJTAG: JTAG, some XMEGA parts
#   #  - PM_AVR32JTAG: JTAG for 32-bit AVRs
#   #  - PM_aWire: AVR32 parts
#   #
#   # (2) Not all programmer types can process a list of PIDs
#
#   part
#       desc             = <description> ;        # quoted string
#       id               = <id> ;                 # quoted string
#       family_id        = <id> ;                 # quoted string, eg, "megaAVR" or "tinyAVR"
#       prog_modes       = PM_<i/f> {| PM_<i/f>}  # interfaces, eg, PM_SPM|PM_ISP|PM_HVPP|PM_debugWIRE
#       mcuid            = <num>;                 # unique id in 0..2039 for 8-bit AVRs
#       n_interrupts     = <num>;                 # number of interrupts, used for vector bootloaders
#       n_page_erase     = <num>;                 # if set, number of pages erased during SPM erase
#       n_boot_sections  = <num>;                 # Number of boot sections
#       boot_section_size = <num>;                # Size of (smallest) boot section, if any
#       hvupdi_variant   = <num> ;                # numeric -1 (n/a) or 0..2
#       devicecode       = <num> ;                # deprecated, use stk500_devcode
#       stk500_devcode   = <num> ;                # numeric
#       avr910_devcode   = <num> ;                # numeric
#       has_jtag         = <yes/no> ;             # part has JTAG i/f (deprecated, use prog_modes)
#       has_debugwire    = <yes/no> ;             # part has debugWire i/f (deprecated, use prog_modes)
#       has_pdi          = <yes/no> ;             # part has PDI i/f (deprecated, use prog_modes)
#       has_updi         = <yes/no> ;             # part has UPDI i/f (deprecated, use prog_modes)
#       has_tpi          = <yes/no> ;             # part has TPI i/f (deprecated, use prog_modes)
#       is_avr32         = <yes/no> ;             # AVR32 part (deprecated, use prog_modes)
#       is_at90s1200     = <yes/no> ;             # AT90S1200 part
#       signature        = <num> <num> <num> ;    # signature bytes
#       usbpid           = <num> ;                # DFU USB PID
#       chip_erase_delay = <num> ;                # micro-seconds
#       reset            = dedicated | io ;
#       retry_pulse      = reset | sck ;
#       chip_erase_delay = <num> ;                # chip erase delay (us)
#       # STK500 parameters (parallel programming IO lines)
#       pagel            = <num> ;                # pin name in hex, i.e., 0xD7
#       bs2              = <num> ;                # pin name in hex, i.e., 0xA0
#       serial           = <yes/no> ;             # can use serial downloading
#       parallel         = <yes/no/pseudo> ;      # can use par. programming
#       # STK500v2 parameters, to be taken from Atmel's ATDF files
#       timeout          = <num> ;
#       stabdelay        = <num> ;
#       cmdexedelay      = <num> ;
#       synchloops       = <num> ;
#       bytedelay        = <num> ;
#       pollvalue        = <num> ;
#       pollindex        = <num> ;
#       predelay         = <num> ;
#       postdelay        = <num> ;
#       pollmethod       = <num> ;
#       hvspcmdexedelay  = <num> ;
#       # STK500v2 HV programming parameters, from ATDFs
#       pp_controlstack  = <num>, <num>, ... ;    # PP only
#       hvsp_controlstack = <num>, <num>, ... ;   # HVSP only
#       flash_instr      = <num>, <num>, <num> ;
#       eeprom_instr     = <num>, <num>, ... ;
#       hventerstabdelay = <num> ;
#       progmodedelay    = <num> ;                # PP only
#       latchcycles      = <num> ;
#       togglevtg        = <num> ;
#       poweroffdelay    = <num> ;
#       resetdelayms     = <num> ;
#       resetdelayus     = <num> ;
#       hvleavestabdelay = <num> ;
#       resetdelay       = <num> ;
#       synchcycles      = <num> ;                # HVSP only
#       chiperasepulsewidth = <num> ;             # PP only
#       chiperasepolltimeout = <num> ;
#       chiperasetime    = <num> ;                # HVSP only
#       programfusepulsewidth = <num> ;           # PP only
#       programfusepolltimeout = <num> ;
#       programlockpulsewidth = <num> ;           # PP only
#       programlockpolltimeout = <num> ;
#       # debugWIRE and/or JTAG ICE mkII parameters, also from ATDF files
#       allowfullpagebitstream = <yes/no> ;
#       enablepageprogramming = <yes/no> ;
#       idr              = <num> ;                # IO addr of IDR (OCD) reg
#       rampz            = <num> ;                # IO addr of RAMPZ reg
#       spmcr            = <num> ;                # mem addr of SPMC[S]R reg
#       eecr             = <num> ;                # mem addr of EECR reg only when != 0x3f
#       eind             = <num> ;                # mem addr of EIND reg
#       mcu_base         = <num> ;
#       nvm_base         = <num> ;
#       ocd_base         = <num> ;
#       ocdrev           = <num> ;
#       pgm_enable       = <instruction format> ;
#       chip_erase       = <instruction format> ;
#       # parameters for bootloaders
#       autobaud_sync    = <num> ;                # autobaud detection byte, default 0x30
#
#       memory <memtype>
#           paged           = <yes/no> ;          # yes/no (flash only, do not use for EEPROM)
#           offset          = <num> ;             # memory offset
#           size            = <num> ;             # bytes
#           page_size       = <num> ;             # bytes
#           num_pages       = <num> ;             # numeric
#           n_word_writes   = <num> ;             # TPI only: if set, number of words to write
#           min_write_delay = <num> ;             # micro-seconds
#           max_write_delay = <num> ;             # micro-seconds
#           readback        = <num> <num> ;       # pair of byte values
#           readback_p1     = <num> ;             # byte value (first component)
#           readback_p2     = <num> ;             # byte value (second component)
#           pwroff_after_write = <yes/no> ;       # yes/no
#           mode            = <num> ;             # STK500 v2 file parameter from ATDF files
#           delay           = <num> ;             #   "
#           blocksize       = <num> ;             #   "
#           readsize        = <num> ;             #   "
#           read            = <instruction format> ;
#           write           = <instruction format> ;
#           read_lo         = <instruction format> ;
#           read_hi         = <instruction format> ;
#           write_lo        = <instruction format> ;
#           write_hi        = <instruction format> ;
#           loadpage_lo     = <instruction format> ;
#           loadpage_hi     = <instruction format> ;
#           writepage       = <instruction format> ;
#       ;
#   ;
#
# If any of the above parameters are not specified, the default value
# of 0 is used for numerics (except for mcuid, hvupdi_variant and
# ocdrev, where the default value is -1, and for autobaud_sync which
# defaults to 0x30), or the empty string "" for string values. If a
# required parameter is left empty, AVRDUDE will complain. Almost all
# occurrences of numbers (with the exception of pin numbers and where
# they are separated by space, eg, in signature and readback) can also
# be given as simple expressions involving arithemtic and bitwise
# operators.
#
# Parts can also inherit parameters from previously defined parts
# using the following syntax. In this case specified integer and
# string values override parameter values from the parent part. New
# memory definitions are added to the definitions inherited from the
# parent. If, however, a new memory definition refers to an existing
# one of the same name for that part then, from v7.1, the existing
# memory definition is extended, and components overwritten with new
# values. Assigning NULL removes an inherited SPI instruction format,
# memory definition, control stack, eeprom or flash instruction, eg,
# as in memory "efuse" = NULL;
#
#   part parent <id>                              # quoted string
#       id               = <id> ;                 # quoted string
#       <any set of other parameters from the list above>
#     ;
#
# NOTES:
#   * 'devicecode' is the device code used by the STK500 (see codes
#       listed below)
#   * Not all memory types will implement all instructions
#   * AVR Fuse bits and Lock bits are implemented as a type of memory
#   * Example memory types are:
#       "flash", "eeprom", "fuse", "lfuse" (low fuse), "hfuse" (high
#       fuse), "signature", "calibration", "lock"
#   * The memory type specified on the avrdude command line must match
#     one of the memory types defined for the specified chip
#   * The pwroff_after_write flag causes avrdude to attempt to
#     power the device off and back on after an unsuccessful write to
#     the affected memory area if VCC programmer pins are defined. If
#     VCC pins are not defined for the programmer, a message
#     indicating that the device needs a power-cycle is printed out.
#     This flag was added to work around a problem with the
#     at90s4433/2333's; see the at90s4433 errata at:
#
#         http://www.atmel.com/dyn/resources/prod_documents/doc1280.pdf
#
# INSTRUCTION FORMATS
#
#    Instruction formats are specified as a comma separated list of
#    string values containing information (bit specifiers) about each
#    of the 32 bits of the instruction.  Bit specifiers may be one of
#    the following formats:
#
#       '1'  = the bit is always set on input as well as output
#
#       '0'  = the bit is always clear on input as well as output
#
#       'x'  = the bit is ignored on input and output and set as 0
#
#       'a'  = the bit is an address bit; from v 7.1 the bit-number
#              is set to match the right bit position for the
#              instruction to "just work"
#
#       'aN' = the bit is the Nth address bit, bit-number = N, i.e., a12
#              is address bit 12 on input, a0 is address bit 0.
#
#       'i'  = the bit is an input data bit
#
#       'o'  = the bit is an output data bit
#
#    Each instruction must be composed of 32 bit specifiers. The
#    instruction specification closely follows the instruction data
#    provided in Atmel's data sheets for their parts. Note that flash
#    addresses always refer to *word* addresses whilst all other
#    memory types specify *byte* addresses.
#
#    Example for signature read on the ATmega328P:
#      read = "0 0 1 1 0 0 0 0",  "0 0 0 x x x x x",
#             "x x x x x x a1 a0",  "o o o o o o o o";
#
#   As the address bit numbers in the SPI opcodes are highly
#   systematic, they don't really need to be specified. A compact
#   version of the format specification neither uses bit-numbers for
#   address lines nor spaces. If such a string is longer than 7
#   characters, then the characters 0, 1, x, a, i and o will be
#   recognised as the corresponding bit, whilst any of the characters
#   ., -, _ or / can act as arbitrary visual separators, which are
#   ignored. Examples:
#
#     loadpage_lo = "0100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii";
#
#     loadpage_lo = "0100.0000", "000x.xxxx", "xxaa.aaaa", "iiii.iiii";
#
#
# The following are STK500 part device codes to use for the
# "devicecode" field of the part.  These came from Atmel's software
# section avr061.zip which accompanies the application note
# AVR061 available from:
#
#      https://ww1.microchip.com/downloads/en/Appnotes/doc2525.pdf
#

#define ATTINY10    0x10  /* the _old_ one that never existed! */
#define ATTINY11    0x11
#define ATTINY12    0x12
#define ATTINY15    0x13
#define ATTINY13    0x14

#define ATTINY22    0x20
#define ATTINY26    0x21
#define ATTINY28    0x22
#define ATTINY2313  0x23

#define AT90S1200   0x33

#define AT90S2313   0x40
#define AT90S2323   0x41
#define AT90S2333   0x42
#define AT90S2343   0x43

#define AT90S4414   0x50
#define AT90S4433   0x51
#define AT90S4434   0x52
#define ATMEGA48    0x59

#define AT90S8515   0x60
#define AT90S8535   0x61
#define AT90C8534   0x62
#define ATMEGA8515  0x63
#define ATMEGA8535  0x64

#define ATMEGA8     0x70
#define ATMEGA88    0x73
#define ATMEGA168   0x86

#define ATMEGA161   0x80
#define ATMEGA163   0x81
#define ATMEGA16    0x82
#define ATMEGA162   0x83
#define ATMEGA169   0x84

#define ATMEGA323   0x90
#define ATMEGA32    0x91

#define ATMEGA64    0xA0

#define ATMEGA103   0xB1
#define ATMEGA128   0xB2
#define AT90CAN128  0xB3
#define AT90CAN64   0xB3
#define AT90CAN32   0xB3

#define AT86RF401   0xD0

#define AT89START   0xE0
#define AT89S51     0xE0
#define AT89S52     0xE1

# The following table lists the devices in the original AVR910
# appnote:
# |Device |Signature | Code |
# +-------+----------+------+
# |tiny12 | 1E 90 05 | 0x55 |
# |tiny15 | 1E 90 06 | 0x56 |
# |       |          |      |
# | S1200 | 1E 90 01 | 0x13 |
# |       |          |      |
# | S2313 | 1E 91 01 | 0x20 |
# | S2323 | 1E 91 02 | 0x48 |
# | S2333 | 1E 91 05 | 0x34 |
# | S2343 | 1E 91 03 | 0x4C |
# |       |          |      |
# | S4414 | 1E 92 01 | 0x28 |
# | S4433 | 1E 92 03 | 0x30 |
# | S4434 | 1E 92 02 | 0x6C |
# |       |          |      |
# | S8515 | 1E 93 01 | 0x38 |
# | S8535 | 1E 93 03 | 0x68 |
# |       |          |      |
# |mega32 | 1E 95 01 | 0x72 |
# |mega83 | 1E 93 05 | 0x65 |
# |mega103| 1E 97 01 | 0x41 |
# |mega161| 1E 94 01 | 0x60 |
# |mega163| 1E 94 02 | 0x64 |

# Appnote AVR109 also has a table of AVR910 device codes, which
# lists:
# dev         avr910   signature
# ATmega8     0x77     0x1E 0x93 0x07
# ATmega8515  0x3B     0x1E 0x93 0x06
# ATmega8535  0x6A     0x1E 0x93 0x08
# ATmega16    0x75     0x1E 0x94 0x03
# ATmega162   0x63     0x1E 0x94 0x04
# ATmega163   0x66     0x1E 0x94 0x02
# ATmega169   0x79     0x1E 0x94 0x05
# ATmega32    0x7F     0x1E 0x95 0x02
# ATmega323   0x73     0x1E 0x95 0x01
# ATmega64    0x46     0x1E 0x96 0x02
# ATmega128   0x44     0x1E 0x97 0x02
#
# These codes refer to "BOOT" device codes which are apparently
# different than standard device codes, for whatever reasons
# (often one above the standard code).

# There are several extended versions of AVR910 implementations around
# in the Internet.  These add the following codes (only devices that
# actually exist are listed):

# ATmega8515    0x3A
# ATmega128     0x43
# ATmega64      0x45
# ATtiny26      0x5E
# ATmega8535    0x69
# ATmega32      0x72
# ATmega16      0x74
# ATmega8       0x76
# ATmega169     0x78

#
# Overall avrdude defaults; suitable for ~/.config/avrdude/avrdude.rc
#
default_parallel   = "lpt1";
default_serial     = "com1";
default_spi        = "";
# default_bitclock = 2.5;







#
# PROGRAMMER DEFINITIONS
#

#------------------------------------------------------------
# wiring
#------------------------------------------------------------

# http://wiring.org.co/
# Basically STK500v2 protocol, with some glue to trigger the bootloader

programmer
    id                     = "wiring";
    desc                   = "Wiring for bootloader using STK500 v2 protocol";
    type                   = "wiring";
    prog_modes             = PM_SPM;
    connection_type        = serial;
;

#------------------------------------------------------------
# arduino
#------------------------------------------------------------

programmer
    id                     = "arduino";
    desc                   = "Arduino for bootloader using STK500 v1 protocol";
    type                   = "arduino";
    prog_modes             = PM_SPM;
    connection_type        = serial;
;

#------------------------------------------------------------
# urclock
#------------------------------------------------------------

# See https://github.com/stefanrueger/urboot
programmer
    id                     = "urclock";
    desc                   = "Urclock programmer for urboot bootloaders using urprotocol";
    type                   = "urclock";
    prog_modes             = PM_SPM;
    connection_type        = serial;
;

#------------------------------------------------------------
# xbee
#------------------------------------------------------------

programmer
    id                     = "xbee";
    desc                   = "XBee for Series 2 Over-The-Air (XBeeBoot) bootloader using STK500 v1 protocol";
    type                   = "xbee";
    prog_modes             = PM_SPM;
    connection_type        = serial;
;

#------------------------------------------------------------
# ft2232h
#------------------------------------------------------------

# this will interface with the chips on these programmers:
#
# http://real.kiev.ua/old/avreal/en/adapters
# http://www.amontec.com/jtagkey.shtml, jtagkey-tiny.shtml
# http://www.olimex.com/dev/arm-usb-ocd.html, arm-usb-tiny.html
# http://www.ethernut.de/en/hardware/turtelizer/index.html
# http://elk.informatik.fh-augsburg.de/hhweb/doc/openocd/usbjtag/usbjtag.html
# http://dangerousprototypes.com/docs/FT2232_breakout_board
# http://www.ftdichip.com/Products/Modules/DLPModules.htm,DLP-2232*,DLP-USB1232H
# http://flashrom.org/FT2232SPI_Programmer
#
# The drivers will look for a specific device and use the first one found.
# If you have mulitple devices, then look for unique information (like SN)
# And fill that in here.
#
# Note that the pin numbers for the main ISP signals (reset, sck,
# sdo, sdi) are fixed and cannot be changed, since they must match
# the way the Multi-Protocol Synchronous Serial Engine (MPSSE) of
# these FTDI ICs has been designed.

programmer
    id                     = "ft2232h";
    desc                   = "FT2232H based generic programmer";
    type                   = "avrftdi";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x0403;
    usbpid                 = 0x6010;
    usbdev                 = "A";
# ISP-signals - lower ADBUS-Nibble (default)
    reset                  = 3; # AD3 (TMS)
    sck                    = 0; # AD0 (TCK)
    sdo                    = 1; # AD1 (TDI)
    sdi                    = 2; # AD2 (TDO)
;

#------------------------------------------------------------
# avrftdi
#------------------------------------------------------------

programmer parent "ft2232h"
    id                     = "avrftdi";
    desc                   = "FT2232D based generic programmer";
;

#------------------------------------------------------------
# 2232HIO
#------------------------------------------------------------

# This is an implementation of the above with a buffer IC (74AC244) and
# 4 LEDs directly attached, all active low.

programmer parent "ft2232h"
    id                     = "2232hio";
    desc                   = "2232hio based on FT2232H with buffer and LEDs";
    buff                   = ~4;
# LED SIGNALs
    errled                 = ~11;
    rdyled                 = ~14;
    pgmled                 = ~13;
    vfyled                 = ~12;
;

#------------------------------------------------------------
# tigard
#------------------------------------------------------------

# Tigard - FT2232H based multi-protocol tool for hardware hacking
# https://github.com/tigard-tools/tigard

programmer parent "ft2232h"
    id                     = "tigard";
    desc                   = "Tigard interface board";
    usbdev                 = "B";
# Reset is different to the FT2232H; sck, sdo, sdi remain at 0, 1, 2
    reset                  = 5; # BD5 (GPIOL1)
;

#------------------------------------------------------------
# ft4232h
#------------------------------------------------------------

#The FT4232H can be treated as FT2232H, but it has a different USB
#device ID of 0x6011.

programmer parent "ft2232h"
    id                     = "ft4232h";
    desc                   = "FT4232H based generic programmer";
    usbpid                 = 0x6011;
;

#------------------------------------------------------------
# 4232h
#------------------------------------------------------------

programmer parent "ft4232h"
    id                     = "4232h";
;

#------------------------------------------------------------
# jtagkey
#------------------------------------------------------------

programmer
    id                     = "jtagkey";
    desc                   = "Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2";
    type                   = "avrftdi";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x0403;
#   Note: This PID is used in all JTAGKey variants
    usbpid                 = 0xcff8;
    usbdev                 = "A";
    buff                   = ~4;
#   ISP-signals => 20 - Pin connector on JTAGKey
    reset                  = 3; # TMS 7 violet
    sck                    = 0; # TCK 9 white
    sdo                    = 1; # TDI 5 green
    sdi                    = 2; # TDO 13 orange
#   VTG           VREF 1 brown with red tip
#   GND           GND 20 black
# The colors are on the 20 pin breakout cable from Amontec
;

#------------------------------------------------------------
# ft232h
#------------------------------------------------------------

programmer
    id                     = "ft232h";
    desc                   = "FT232H based generic programmer";
    type                   = "avrftdi";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x0403;
    usbpid                 = 0x6014;
    usbdev                 = "A";
# ISP-signals
    reset                  = 3; # AD3 (TMS)
    sck                    = 0; # AD0 (TCK)
    sdo                    = 1; # AD1 (TDI)
    sdi                    = 2; # AD2 (TDO)
;

#------------------------------------------------------------
# um232h
#------------------------------------------------------------

# Pin J2-7 (AD0) is SCK
# Pin J2-8 (AD1) is SDO
# Pin J2-9 (AD2) is SDI
# Pin J2-10 (AD3) is RESET
# Pin J2-6 is GND
# Use the -b flag to set the SPI clock rate eg -b 3750000 is the fastest I could get
# a 16MHz Atmega1280 to program reliably.  The 232H is conveniently 5V tolerant.

programmer parent "ft232h"
    id                     = "um232h";
    desc                   = "UM232H module from FTDI";
;

#------------------------------------------------------------
# c232hm
#------------------------------------------------------------

# Orange (Pin 2) is SCK
# Yellow (Pin 3) is SDO
# Green (Pin 4) is SDI
# Brown (Pin 5) is RESET
# Black (Pin 10) is GND
# Use the -b flag to set the SPI clock rate eg -b 3750000 is the fastest I could get
# a 16MHz Atmega1280 to program reliably.  The 232H is conveniently 5V tolerant.

programmer parent "ft232h"
    id                     = "c232hm";
    desc                   = "C232HM cable from FTDI";
;

#------------------------------------------------------------
# o-link
#------------------------------------------------------------

# On the adapter you can read "O-Link". On the PCB is printed "OpenJTAG v3.1"
# You can find it as "OpenJTAG ARM JTAG USB" in the internet.
# (But there are also several projects called Open JTAG, eg.
# http://www.openjtag.org, which are completely different.)
#   http://www.100ask.net/shop/english.html (website seems to be outdated)
#   http://item.taobao.com/item.htm?id=1559277013
#   http://www.micro4you.com/store/openjtag-arm-jtag-usb.html (schematics!)
# some other sources which call it O-Link
#   http://www.andahammer.com/olink/
#   http://www.developmentboard.net/31-o-link-debugger.html
#   http://armwerks.com/catalog/o-link-debugger-copy/
# or just have a look at ebay ...
# It is basically the same entry as jtagkey with different usb ids.

programmer parent "jtagkey"
    id                     = "o-link";
    desc                   = "O-Link, OpenJTAG from www.100ask.net";
    usbvid                 = 0x1457;
    usbpid                 = 0x5118;
    usbvendor              = "www.100ask.net";
    usbproduct             = "USB<=>JTAG&RS232";
;

#------------------------------------------------------------
# openmoko
#------------------------------------------------------------

# http://wiki.openmoko.org/wiki/Debug_Board_v3

programmer
    id                     = "openmoko";
    desc                   = "Openmoko debug board (v3)";
    type                   = "avrftdi";
    prog_modes             = PM_TPI | PM_ISP;
    usbvid                 = 0x1457;
    usbpid                 = 0x5118;
    usbdev                 = "A";
    reset                  = 3; # TMS 7
    sck                    = 0; # TCK 9
    sdo                    = 1; # TDI 5
    sdi                    = 2; # TDO 13
;

#------------------------------------------------------------
# lm3s811
#------------------------------------------------------------

# Only Rev. A boards.
# Schematic and user manual: http://www.cs.put.poznan.pl/wswitala/download/pdf/811EVBK.pdf

programmer
    id                     = "lm3s811";
    desc                   = "Luminary Micro LM3S811 Eval Board (Rev. A)";
    type                   = "avrftdi";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x0403;
    usbpid                 = 0xbcd9;
    usbdev                 = "A";
    usbvendor              = "LMI";
    usbproduct             = "LM3S811 Evaluation Board";
# Enable correct buffers
    buff                   = 7;
# ISP-signals - lower ACBUS-Nibble (default)
    reset                  = 3;
    sck                    = 0;
    sdo                    = 1;
    sdi                    = 2;
;

#------------------------------------------------------------
# tumpa
#------------------------------------------------------------

# submitted as bug #46020

programmer
    id                     = "tumpa";
    desc                   = "TIAO USB Multi-Protocol Adapter";
    type                   = "avrftdi";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x0403;
    usbpid                 = 0x8a98;
    usbdev                 = "A";
    usbvendor              = "TIAO";
    reset                  = 3; # TMS 7
    sck                    = 0; # TCK 9
    sdo                    = 1; # TDI 5
    sdi                    = 2; # TDO 13
;

#------------------------------------------------------------
# ktlink
#------------------------------------------------------------

# Kristech KT-LINK FT2232H interface with IO switching and voltage buffers.
# Created on 20220410 by CeDeROM Tomasz CEDRO (www.cederom.io).
# Interface DataSheet: https://kristech.pl/files/KT-LINK-UM-ENG.pdf
# AVRDUDE FT2232H PIN NUMBER DECODE:
#  | 0      | 1      | .. | 7      | 8      | 9      | .. | 15     |
#  | ADBUS0 | ADBUS1 | .. | ADBUS7 | ACBUS0 | ACBUS1 | .. | ACBUS7 |
# KT-LINK JTAG CONN:
#  1=Vsense(->EXT13), 19=5V(EXT1->EXT3), 20=GND, 3=TPIRST, 9=TPICLK, 7=TPIDATA.
# INTERNALS CONFIGURATION ("~" MEANS ACTIVE LOW):
#  ~TRST_EN=10(ACBUS2), ~CLK_EN=14(ACBUS6), ~SDO_EN=13(ACBUS5),
#  TMS_SEL=5(ADBUS5), ~TMS_EN=12(ACBUS4), LED=~15(ACBUS7).
# CONNECTION NOTES:
#  * Connect EXT connector pin 1 with 3 to get 5V on JTAG connector pin 19.
#  * Connect JTAG connector pin 1 to 5V (i.e. EXT pin 13 or JTAG pin 19).
#  * For TPI connection use resistors: TDO --[470R]-- TPIDATA --[470R]-- TDI.
#  * Powering target from JTAG pin 19 allows KT-LINK current measurement.

programmer
    id                     = "ktlink";
    desc                   = "KT-LINK FT2232H interface with IO switching and voltage buffers.";
    type                   = "avrftdi";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x0403;
    usbpid                 = 0xbbe2;
    usbdev                 = "A";
    buff                   = 5, ~10, ~13, ~14;
    reset                  = 8;
    sck                    = 0;
    sdo                    = 1;
    sdi                    = 2;
    rdyled                 = ~15;
;

#------------------------------------------------------------
# digilent-hs2
#------------------------------------------------------------

# Digilent JTAG HS2 programmer. FT232H-based dongle with buffers.
# https://digilent.com/reference/_media/reference/programmers/jtag-hs2/jtag-hs2_rm.pdf

programmer
    id                     = "digilent-hs2";
    desc                   = "Digilient JTAG HS2 (MPSSE)";
    type                   = "avrftdi";
    connection_type        = usb;
    usbvid                 = 0x0403;
    usbpid                 = 0x6014;
    usbdev                 = "A";
    buff                   = 5, 6, 7;
    reset                  = 3;
    sck                    = 0;
    sdo                    = 1;
    sdi                    = 2;
;

#------------------------------------------------------------
# serialupdi
#------------------------------------------------------------

programmer
    id                     = "serialupdi";
    desc                   = "SerialUPDI";
    type                   = "serialupdi";
    prog_modes             = PM_UPDI;
    connection_type        = serial;
    hvupdi_support         = 1;
;

#------------------------------------------------------------
# avrisp
#------------------------------------------------------------

programmer
    id                     = "avrisp";
    desc                   = "Atmel AVR ISP";
    type                   = "stk500";
    prog_modes             = PM_ISP;
    connection_type        = serial;
;

#------------------------------------------------------------
# avrispv2
#------------------------------------------------------------

programmer
    id                     = "avrispv2";
    desc                   = "Atmel AVR ISP v2";
    type                   = "stk500v2";
    prog_modes             = PM_TPI | PM_ISP | PM_PDI;
    connection_type        = serial;
;

#------------------------------------------------------------
# avrispmkII
#------------------------------------------------------------

programmer
    id                     = "avrispmkII";
    desc                   = "Atmel AVR ISP mkII";
    type                   = "stk500v2";
    prog_modes             = PM_TPI | PM_ISP | PM_PDI;
    connection_type        = usb;
;

#------------------------------------------------------------
# avrisp2
#------------------------------------------------------------

programmer parent "avrispmkII"
    id                     = "avrisp2";
;

#------------------------------------------------------------
# buspirate
#------------------------------------------------------------

programmer
    id                     = "buspirate";
    desc                   = "The Bus Pirate";
    type                   = "buspirate";
    prog_modes             = PM_ISP;
    connection_type        = serial;
;

#------------------------------------------------------------
# buspirate_bb
#------------------------------------------------------------

programmer
    id                     = "buspirate_bb";
    desc                   = "The Bus Pirate (bitbang interface, supports TPI)";
    type                   = "buspirate_bb";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = serial;
  # pins are bits in bitbang byte (numbers are 87654321)
  # 1|POWER|PULLUP|AUX|SDO|CLK|SDI|CS
    reset                  = 1;
    sck                    = 3;
    sdo                    = 4;
    sdi                    = 2;
  # vcc                    = 7; # Internally set independent of this setting
;

#------------------------------------------------------------
# stk500
#------------------------------------------------------------

# This is supposed to be the "default" STK500 entry.
# Attempts to select the correct firmware version
# by probing for it.  Better use one of the entries
# below instead.

programmer
    id                     = "stk500";
    desc                   = "Atmel STK500";
    type                   = "stk500generic";
    prog_modes             = PM_ISP;
    connection_type        = serial;
;

#------------------------------------------------------------
# stk500v1
#------------------------------------------------------------

programmer
    id                     = "stk500v1";
    desc                   = "Atmel STK500 version 1.x firmware";
    type                   = "stk500";
    prog_modes             = PM_ISP;
    connection_type        = serial;
;

#------------------------------------------------------------
# mib510
#------------------------------------------------------------

programmer
    id                     = "mib510";
    desc                   = "Crossbow MIB510 programming board";
    type                   = "stk500";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = serial;
;

#------------------------------------------------------------
# stk500v2
#------------------------------------------------------------

programmer
    id                     = "stk500v2";
    desc                   = "Atmel STK500 version 2.x firmware";
    type                   = "stk500v2";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = serial;
;

#------------------------------------------------------------
# stk500pp
#------------------------------------------------------------

programmer
    id                     = "stk500pp";
    desc                   = "Atmel STK500 v2 in parallel programming mode";
    type                   = "stk500pp";
    prog_modes             = PM_HVPP;
    connection_type        = serial;
;

#------------------------------------------------------------
# stk500hvsp
#------------------------------------------------------------

programmer
    id                     = "stk500hvsp";
    desc                   = "Atmel STK500 v2 in high-voltage serial programming mode";
    type                   = "stk500hvsp";
    prog_modes             = PM_HVSP;
    connection_type        = serial;
;

#------------------------------------------------------------
# stk600
#------------------------------------------------------------

programmer
    id                     = "stk600";
    desc                   = "Atmel STK600";
    type                   = "stk600";
    prog_modes             = PM_TPI | PM_ISP | PM_PDI;
    connection_type        = usb;
;

#------------------------------------------------------------
# stk600pp
#------------------------------------------------------------

programmer
    id                     = "stk600pp";
    desc                   = "Atmel STK600 in parallel programming mode";
    type                   = "stk600pp";
    prog_modes             = PM_HVPP;
    connection_type        = usb;
;

#------------------------------------------------------------
# stk600hvsp
#------------------------------------------------------------

programmer
    id                     = "stk600hvsp";
    desc                   = "Atmel STK600 in high-voltage serial programming mode";
    type                   = "stk600hvsp";
    prog_modes             = PM_HVSP;
    connection_type        = usb;
;

#------------------------------------------------------------
# avr910
#------------------------------------------------------------

programmer
    id                     = "avr910";
    desc                   = "Atmel Low Cost Serial Programmer";
    type                   = "avr910";
    prog_modes             = PM_ISP;
    connection_type        = serial;
;

#------------------------------------------------------------
# ft245r
#------------------------------------------------------------

programmer
    id                     = "ft245r";
    desc                   = "FT245R based generic programmer";
    type                   = "ftdi_syncbb";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    reset                  = 4; # D4
    sck                    = 0; # D0
    sdo                    = 2; # D2
    sdi                    = 1; # D1
;

#------------------------------------------------------------
# ft232r
#------------------------------------------------------------

programmer
    id                     = "ft232r";
    desc                   = "FT232R based generic programmer";
    type                   = "ftdi_syncbb";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    reset                  = 4;  # DTR
    sck                    = 0;  # TxD
    sdo                    = 2;  # RTS
    sdi                    = 1;  # RxD
;

#------------------------------------------------------------
# bwmega
#------------------------------------------------------------

# see http://www.bitwizard.nl/wiki/index.php/FTDI_ATmega

programmer
    id                     = "bwmega";
    desc                   = "BitWizard ftdi_atmega builtin programmer";
    type                   = "ftdi_syncbb";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    reset                  = 7;  # RI
    sck                    = 6;  # DCD
    sdo                    = 3;  # CTS
    sdi                    = 5;  # DSR
;

#------------------------------------------------------------
# arduino-ft232r
#------------------------------------------------------------

# see http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
# Note: pins are numbered from 1!

programmer
    id                     = "arduino-ft232r";
    desc                   = "Arduino: FT232R connected to ISP";
    type                   = "ftdi_syncbb";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    reset                  = 7;  # RI  X3(4)
    sck                    = 5;  # DSR X3(2)
    sdo                    = 6;  # DCD X3(3)
    sdi                    = 3;  # CTS X3(1)
;

#------------------------------------------------------------
# tc2030
#------------------------------------------------------------

programmer
    id                     = "tc2030";
    desc                   = "Tag-Connect TC2030";
    type                   = "ftdi_syncbb";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
  #                      FOR TPI devices:
    reset                  = 3;  # CTS = D3 (wire to ~RESET)
    sck                    = 2;  # RTS = D2 (wire to SCK)
    sdo                    = 0;  # TxD = D0 (wire to TPIDATA via 1k resistor)
    sdi                    = 1;  # RxD = D1 (wire to TPIDATA directly)
;

#------------------------------------------------------------
# diecimila
#------------------------------------------------------------

# website mentioned above uses this id

programmer parent "arduino-ft232r"
    id                     = "diecimila";
    desc                   = "alias for arduino-ft232r";
;

#------------------------------------------------------------
# uncompatino
#------------------------------------------------------------

# There is a ATmega328P kit PCB called "uncompatino".
# This board allows ISP via its on-board FT232R.
# This is designed like Arduino Duemilanove but has no standard ICPS header.
# Its 4 pairs of pins are shorted to enable ftdi_syncbb.
# http://akizukidenshi.com/catalog/g/gP-07487/
# http://akizukidenshi.com/download/ds/akizuki/k6096_manual_20130816.pdf

programmer
    id                     = "uncompatino";
    desc                   = "uncompatino with all pairs of pins shorted";
    type                   = "ftdi_syncbb";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    reset                  = 7; # ri
    sck                    = 5; # dsr
    sdo                    = 6; # dcd
    sdi                    = 3; # cts
;

#------------------------------------------------------------
# ttl232r
#------------------------------------------------------------

# FTDI USB to serial cable TTL-232R-5V with a custom adapter for ICSP
# http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm
# http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232R_CABLES.pdf
# For ICSP pinout see for example http://www.atmel.com/images/doc2562.pdf
# (Figure 1. ISP6PIN header pinout and Table 1. Connections required for ISP ...)
# TTL-232R GND 1 Black  -> ICPS GND   (pin 6)
# TTL-232R CTS 2 Brown  -> ICPS SDO   (pin 4)
# TTL-232R VCC 3 Red    -> ICPS VCC   (pin 2)
# TTL-232R TXD 4 Orange -> ICPS RESET (pin 5)
# TTL-232R RXD 5 Yellow -> ICPS SCK   (pin 3)
# TTL-232R RTS 6 Green  -> ICPS SDI   (pin 1)
# Except for VCC and GND, you can connect arbitual pairs as long as
# the following table is adjusted.

programmer
    id                     = "ttl232r";
    desc                   = "FTDI TTL232R-5V with ICSP adapter";
    type                   = "ftdi_syncbb";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    reset                  = 0; # txd
    sck                    = 1; # rxd
    sdo                    = 3; # cts
    sdi                    = 2; # rts
;

#------------------------------------------------------------
# usbasp
#------------------------------------------------------------

programmer
    id                     = "usbasp";
    desc                   = "USBasp, http://www.fischl.de/usbasp/";
    type                   = "usbasp";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x16c0; # VOTI
    usbpid                 = 0x05dc; # Obdev's free shared PID
    usbvendor              = "www.fischl.de";
    usbproduct             = "USBasp";
  # following variants are autodetected for id "usbasp"

  # original usbasp from fischl.de
  # see above "usbasp"

  # old usbasp from fischl.de
  # usbvid                 = 0x03EB; # ATMEL
  # usbpid                 = 0xC7B4; # (unoffical) USBasp
  # usbvendor              = "www.fischl.de";
  # usbproduct             = "USBasp";

  # NIBObee (only if -P nibobee is given on command line)
  # see below "nibobee"
;

#------------------------------------------------------------
# nibobee
#------------------------------------------------------------

programmer
    id                     = "nibobee";
    desc                   = "NIBObee";
    type                   = "usbasp";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x16c0; # VOTI
    usbpid                 = 0x092f; # NIBObee PID
    usbvendor              = "www.nicai-systems.com";
    usbproduct             = "NIBObee";
;

#------------------------------------------------------------
# usbasp-clone
#------------------------------------------------------------

programmer
    id                     = "usbasp-clone";
    desc                   = "Any usbasp clone with correct VID/PID";
    type                   = "usbasp";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x16c0; # VOTI
    usbpid                 = 0x05dc; # Obdev's free shared PID
;

#------------------------------------------------------------
# usbtiny
#------------------------------------------------------------

# USBtiny can also be used for TPI programming.
# In that case, a resistor of 1 kOhm is needed between SDI and SDO
# pins of the connector, and SDI (pin 1 of the 6-pin connector)
# connects to TPIDATA.

programmer
    id                     = "usbtiny";
    desc                   = "USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyisp";
    type                   = "usbtiny";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x1781;
    usbpid                 = 0x0c9f;
;

#------------------------------------------------------------
# arduino_gemma
#------------------------------------------------------------

# https://github.com/arduino/ArduinoCore-avr/tree/master/bootloaders/gemma

programmer
    id                     = "arduino_gemma";
    desc                   = "Arduino Gemma bootloader disguised as USBtiny";
    type                   = "usbtiny";
    prog_modes             = PM_SPM;
    connection_type        = usb;
    usbvid                 = 0x2341;
    usbpid                 = 0x0c9f;
;

#------------------------------------------------------------
# adafruit_gemma
#------------------------------------------------------------

# https://github.com/adafruit/Adafruit-Trinket-Gemma-Bootloader

programmer
    id                     = "adafruit_gemma";
    desc                   = "Adafruit Trinket Gemma bootloader disguised as USBtiny";
    type                   = "usbtiny";
    prog_modes             = PM_SPM;
    connection_type        = usb;
    usbvid                 = 0x1781;
    usbpid                 = 0x0c9f;
;

#------------------------------------------------------------
# arduinoisp
#------------------------------------------------------------

programmer
    id                     = "arduinoisp";
    desc                   = "Arduino ISP Programmer";
    type                   = "usbtiny";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x2341;
    usbpid                 = 0x0049;
;

#------------------------------------------------------------
# arduinoisporg
#------------------------------------------------------------

programmer
    id                     = "arduinoisporg";
    desc                   = "Arduino ISP Programmer";
    type                   = "usbtiny";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x2a03;
    usbpid                 = 0x0049;
;

#------------------------------------------------------------
# ehajo-isp
#------------------------------------------------------------

# commercial version of USBtiny, using a separate VID/PID

programmer
    id                     = "ehajo-isp";
    desc                   = "avr-isp-programmer from eHaJo, http://www.eHaJo.de";
    type                   = "usbtiny";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x16d0;
    usbpid                 = 0x0ba5;
;

#------------------------------------------------------------
# iseavrprog
#------------------------------------------------------------

# commercial version of USBtiny, using a separate VID/PID
# https://github.com/IowaScaledEngineering/ckt-avrprogrammer

programmer
    id                     = "iseavrprog";
    desc                   = "USBtiny-based programmer, https://iascaled.com";
    type                   = "usbtiny";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    usbvid                 = 0x1209;
    usbpid                 = 0x6570;
;

#------------------------------------------------------------
# micronucleus
#------------------------------------------------------------

programmer
    id                     = "micronucleus";
    desc                   = "Micronucleus for bootloader";
    type                   = "micronucleus";
    prog_modes             = PM_SPM;
    connection_type        = usb;
    usbvid                 = 0x16d0;
    usbpid                 = 0x0753;
;

#------------------------------------------------------------
# teensy
#------------------------------------------------------------

programmer
    id                     = "teensy";
    desc                   = "Teensy for bootloader";
    type                   = "teensy";
    prog_modes             = PM_SPM;
    connection_type        = usb;
    usbvid                 = 0x16c0;
    usbpid                 = 0x0478;
;

#------------------------------------------------------------
# butterfly
#------------------------------------------------------------

programmer
    id                     = "butterfly";
    desc                   = "Atmel for bootloader (Butterfly Development Board)";
    type                   = "butterfly";
    prog_modes             = PM_SPM;
    connection_type        = serial;
;

#------------------------------------------------------------
# avr109
#------------------------------------------------------------

programmer
    id                     = "avr109";
    desc                   = "Atmel for bootloader using AppNote AVR109";
    type                   = "butterfly";
    prog_modes             = PM_SPM;
    connection_type        = serial;
;

#------------------------------------------------------------
# avr911
#------------------------------------------------------------

programmer
    id                     = "avr911";
    desc                   = "Atmel for bootloader using AppNote AVR911 AVROSP";
    type                   = "butterfly";
    prog_modes             = PM_SPM;
    connection_type        = serial;
;

#------------------------------------------------------------
# mkbutterfly
#------------------------------------------------------------

# suggested in http://forum.mikrokopter.de/topic-post48317.html

programmer
    id                     = "mkbutterfly";
    desc                   = "Mikrokopter.de Butterfly for bootloader";
    type                   = "butterfly_mk";
    prog_modes             = PM_SPM;
    connection_type        = serial;
;

#------------------------------------------------------------
# butterfly_mk
#------------------------------------------------------------

programmer parent "mkbutterfly"
    id                     = "butterfly_mk";
;

#------------------------------------------------------------
# jtagmkI
#------------------------------------------------------------

programmer
    id                     = "jtagmkI";
    desc                   = "Atmel JTAG ICE (mkI)";
    type                   = "jtagmki";
    prog_modes             = PM_JTAGmkI;
    connection_type        = serial;
    baudrate               = 115200;    # default is 115200
;

#------------------------------------------------------------
# jtag1
#------------------------------------------------------------

# easier to type

programmer parent "jtagmkI"
    id                     = "jtag1";
;

#------------------------------------------------------------
# jtag1slow
#------------------------------------------------------------

# easier to type

programmer parent "jtag1"
    id                     = "jtag1slow";
    baudrate               = 19200;
;

#------------------------------------------------------------
# jtagmkII
#------------------------------------------------------------

# The JTAG ICE mkII has both, serial and USB connectivity.  As it is
# mostly used through USB these days (AVR Studio 5 only supporting it
# that way), we make connection_type = usb the default.  Users are
# still free to use a serial port with the -P option.

programmer
    id                     = "jtagmkII";
    desc                   = "Atmel JTAG ICE mkII";
    type                   = "jtagmkii";
    prog_modes             = PM_JTAG | PM_XMEGAJTAG | PM_AVR32JTAG;
    connection_type        = usb;
    baudrate               = 19200;    # default is 19200
;

#------------------------------------------------------------
# jtag2slow
#------------------------------------------------------------

# easier to type

programmer parent "jtagmkII"
    id                     = "jtag2slow";
;

#------------------------------------------------------------
# jtag2fast
#------------------------------------------------------------

# JTAG ICE mkII @ 115200 Bd

programmer parent "jtag2slow"
    id                     = "jtag2fast";
    baudrate               = 115200;
;

#------------------------------------------------------------
# jtag2
#------------------------------------------------------------

# make the fast one the default, people will love that

programmer parent "jtag2fast"
    id                     = "jtag2";
;

#------------------------------------------------------------
# jtag2isp
#------------------------------------------------------------

# JTAG ICE mkII in ISP mode

programmer
    id                     = "jtag2isp";
    desc                   = "Atmel JTAG ICE mkII in ISP mode";
    type                   = "jtagmkii_isp";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    baudrate               = 115200;
;

#------------------------------------------------------------
# jtag2dw
#------------------------------------------------------------

# JTAG ICE mkII in debugWire mode

programmer
    id                     = "jtag2dw";
    desc                   = "Atmel JTAG ICE mkII in debugWire mode";
    type                   = "jtagmkii_dw";
    prog_modes             = PM_debugWIRE;
    connection_type        = usb;
    baudrate               = 115200;
;

#------------------------------------------------------------
# jtagmkII_avr32
#------------------------------------------------------------

# JTAG ICE mkII in AVR32 mode

programmer
    id                     = "jtagmkII_avr32";
    desc                   = "Atmel JTAG ICE mkII in AVR32 mode";
    type                   = "jtagmkii_avr32";
    prog_modes             = PM_aWire;
    connection_type        = usb;
    baudrate               = 115200;
;

#------------------------------------------------------------
# jtag2avr32
#------------------------------------------------------------

# JTAG ICE mkII in AVR32 mode

programmer
    id                     = "jtag2avr32";
    desc                   = "Atmel JTAG ICE mkII in AVR32 mode";
    type                   = "jtagmkii_avr32";
    prog_modes             = PM_aWire;
    connection_type        = usb;
    baudrate               = 115200;
;

#------------------------------------------------------------
# jtag2pdi
#------------------------------------------------------------

# JTAG ICE mkII in PDI mode

programmer
    id                     = "jtag2pdi";
    desc                   = "Atmel JTAG ICE mkII in PDI mode";
    type                   = "jtagmkii_pdi";
    prog_modes             = PM_PDI;
    connection_type        = usb;
    baudrate               = 115200;
;

#------------------------------------------------------------
# dragon_jtag
#------------------------------------------------------------

# AVR Dragon in JTAG mode

programmer
    id                     = "dragon_jtag";
    desc                   = "Atmel AVR Dragon in JTAG mode";
    type                   = "dragon_jtag";
    prog_modes             = PM_JTAG | PM_XMEGAJTAG | PM_AVR32JTAG;
    connection_type        = usb;
    baudrate               = 115200;
;

#------------------------------------------------------------
# dragon_isp
#------------------------------------------------------------

# AVR Dragon in ISP mode

programmer
    id                     = "dragon_isp";
    desc                   = "Atmel AVR Dragon in ISP mode";
    type                   = "dragon_isp";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = usb;
    baudrate               = 115200;
;

#------------------------------------------------------------
# dragon_pp
#------------------------------------------------------------

# AVR Dragon in PP mode

programmer
    id                     = "dragon_pp";
    desc                   = "Atmel AVR Dragon in PP mode";
    type                   = "dragon_pp";
    prog_modes             = PM_HVPP;
    connection_type        = usb;
    baudrate               = 115200;
;

#------------------------------------------------------------
# dragon_hvsp
#------------------------------------------------------------

# AVR Dragon in HVSP mode

programmer
    id                     = "dragon_hvsp";
    desc                   = "Atmel AVR Dragon in HVSP mode";
    type                   = "dragon_hvsp";
    prog_modes             = PM_HVSP;
    connection_type        = usb;
    baudrate               = 115200;
;

#------------------------------------------------------------
# dragon_dw
#------------------------------------------------------------

# AVR Dragon in debugWire mode

programmer
    id                     = "dragon_dw";
    desc                   = "Atmel AVR Dragon in debugWire mode";
    type                   = "dragon_dw";
    prog_modes             = PM_debugWIRE;
    connection_type        = usb;
    baudrate               = 115200;
;

#------------------------------------------------------------
# dragon_pdi
#------------------------------------------------------------

# AVR Dragon in PDI mode

programmer
    id                     = "dragon_pdi";
    desc                   = "Atmel AVR Dragon in PDI mode";
    type                   = "dragon_pdi";
    prog_modes             = PM_PDI;
    connection_type        = usb;
    baudrate               = 115200;
;

#------------------------------------------------------------
# jtag3
#------------------------------------------------------------

programmer
    id                     = "jtag3";
    desc                   = "Atmel AVR JTAGICE3 in JTAG mode";
    type                   = "jtagice3";
    prog_modes             = PM_JTAG | PM_XMEGAJTAG | PM_AVR32JTAG;
    connection_type        = usb;
    usbpid                 = 0x2110, 0x2140;
;

#------------------------------------------------------------
# jtag3pdi
#------------------------------------------------------------

programmer
    id                     = "jtag3pdi";
    desc                   = "Atmel AVR JTAGICE3 in PDI mode";
    type                   = "jtagice3_pdi";
    prog_modes             = PM_PDI;
    connection_type        = usb;
    usbpid                 = 0x2110, 0x2140;
;

#------------------------------------------------------------
# jtag3updi
#------------------------------------------------------------

programmer
    id                     = "jtag3updi";
    desc                   = "Atmel AVR JTAGICE3 in UPDI mode";
    type                   = "jtagice3_updi";
    prog_modes             = PM_UPDI;
    connection_type        = usb;
    usbpid                 = 0x2110, 0x2140;
    hvupdi_support         = 1;
;

#------------------------------------------------------------
# jtag3dw
#------------------------------------------------------------

programmer
    id                     = "jtag3dw";
    desc                   = "Atmel AVR JTAGICE3 in debugWIRE mode";
    type                   = "jtagice3_dw";
    prog_modes             = PM_debugWIRE;
    connection_type        = usb;
    usbpid                 = 0x2110, 0x2140;
;

#------------------------------------------------------------
# jtag3isp
#------------------------------------------------------------

programmer
    id                     = "jtag3isp";
    desc                   = "Atmel AVR JTAGICE3 in ISP mode";
    type                   = "jtagice3_isp";
    prog_modes             = PM_ISP;
    connection_type        = usb;
    usbpid                 = 0x2110, 0x2140;
;

#------------------------------------------------------------
# xplainedpro
#------------------------------------------------------------

programmer
    id                     = "xplainedpro";
    desc                   = "Atmel AVR XplainedPro in JTAG mode";
    type                   = "jtagice3";
    prog_modes             = PM_JTAG | PM_XMEGAJTAG | PM_AVR32JTAG;
    connection_type        = usb;
    usbpid                 = 0x2111;
;

#------------------------------------------------------------
# xplainedpro_pdi
#------------------------------------------------------------

programmer
    id                     = "xplainedpro_pdi";
    desc                   = "Atmel AVR XplainedPro in PDI mode";
    type                   = "jtagice3_pdi";
    prog_modes             = PM_PDI;
    connection_type        = usb;
    usbpid                 = 0x2111;
    hvupdi_support         = 1;
;

#------------------------------------------------------------
# xplainedpro_updi
#------------------------------------------------------------

programmer
    id                     = "xplainedpro_updi";
    desc                   = "Atmel AVR XplainedPro in UPDI mode";
    type                   = "jtagice3_updi";
    prog_modes             = PM_UPDI;
    connection_type        = usb;
    usbpid                 = 0x2111;
    hvupdi_support         = 1;
;

#------------------------------------------------------------
# xplainedmini
#------------------------------------------------------------

programmer
    id                     = "xplainedmini";
    desc                   = "Atmel AVR XplainedMini in ISP mode";
    type                   = "jtagice3_isp";
    prog_modes             = PM_ISP;
    connection_type        = usb;
    usbpid                 = 0x2145;
;

#------------------------------------------------------------
# xplainedmini_dw
#------------------------------------------------------------

programmer
    id                     = "xplainedmini_dw";
    desc                   = "Atmel AVR XplainedMini in debugWIRE mode";
    type                   = "jtagice3_dw";
    prog_modes             = PM_debugWIRE;
    connection_type        = usb;
    usbpid                 = 0x2145;
;

#------------------------------------------------------------
# xplainedmini_updi
#------------------------------------------------------------

programmer
    id                     = "xplainedmini_updi";
    desc                   = "Atmel AVR XplainedMini in UPDI mode";
    type                   = "jtagice3_updi";
    prog_modes             = PM_UPDI;
    connection_type        = usb;
    usbpid                 = 0x2145;
    hvupdi_support         = 1;
;

#------------------------------------------------------------
# xplainedmini_tpi
#------------------------------------------------------------

programmer
    id                     = "xplainedmini_tpi";
    desc                   = "Atmel AVR XplainedMini in TPI mode";
    type                   = "jtagice3_tpi";
    prog_modes             = PM_TPI;
    connection_type        = usb;
    usbpid                 = 0x2145;
;

#------------------------------------------------------------
# atmelice
#------------------------------------------------------------

programmer
    id                     = "atmelice";
    desc                   = "Atmel-ICE (ARM/AVR) in JTAG mode";
    type                   = "jtagice3";
    prog_modes             = PM_JTAG | PM_XMEGAJTAG | PM_AVR32JTAG;
    connection_type        = usb;
    usbpid                 = 0x2141;
;

#------------------------------------------------------------
# atmelice_pdi
#------------------------------------------------------------

programmer
    id                     = "atmelice_pdi";
    desc                   = "Atmel-ICE (ARM/AVR) in PDI mode";
    type                   = "jtagice3_pdi";
    prog_modes             = PM_PDI;
    connection_type        = usb;
    usbpid                 = 0x2141;
;

#------------------------------------------------------------
# atmelice_updi
#------------------------------------------------------------

programmer
    id                     = "atmelice_updi";
    desc                   = "Atmel-ICE (ARM/AVR) in UPDI mode";
    type                   = "jtagice3_updi";
    prog_modes             = PM_UPDI;
    connection_type        = usb;
    usbpid                 = 0x2141;
    hvupdi_support         = 1;
;

#------------------------------------------------------------
# atmelice_dw
#------------------------------------------------------------

programmer
    id                     = "atmelice_dw";
    desc                   = "Atmel-ICE (ARM/AVR) in debugWIRE mode";
    type                   = "jtagice3_dw";
    prog_modes             = PM_debugWIRE;
    connection_type        = usb;
    usbpid                 = 0x2141;
;

#------------------------------------------------------------
# atmelice_isp
#------------------------------------------------------------

programmer
    id                     = "atmelice_isp";
    desc                   = "Atmel-ICE (ARM/AVR) in ISP mode";
    type                   = "jtagice3_isp";
    prog_modes             = PM_ISP;
    connection_type        = usb;
    usbpid                 = 0x2141;
;

#------------------------------------------------------------
# atmelice_tpi
#------------------------------------------------------------

programmer
    id                     = "atmelice_tpi";
    desc                   = "Atmel-ICE (ARM/AVR) in TPI mode";
    type                   = "jtagice3_tpi";
    prog_modes             = PM_TPI;
    connection_type        = usb;
    usbpid                 = 0x2141;
;

#------------------------------------------------------------
# powerdebugger
#------------------------------------------------------------

programmer
    id                     = "powerdebugger";
    desc                   = "Atmel PowerDebugger (ARM/AVR) in JTAG mode";
    type                   = "jtagice3";
    prog_modes             = PM_JTAG | PM_XMEGAJTAG | PM_AVR32JTAG;
    connection_type        = usb;
    usbpid                 = 0x2144;
;

#------------------------------------------------------------
# powerdebugger_pdi
#------------------------------------------------------------

programmer
    id                     = "powerdebugger_pdi";
    desc                   = "Atmel PowerDebugger (ARM/AVR) in PDI mode";
    type                   = "jtagice3_pdi";
    prog_modes             = PM_PDI;
    connection_type        = usb;
    usbpid                 = 0x2144;
;

#------------------------------------------------------------
# powerdebugger_updi
#------------------------------------------------------------

programmer
    id                     = "powerdebugger_updi";
    desc                   = "Atmel PowerDebugger (ARM/AVR) in UPDI mode";
    type                   = "jtagice3_updi";
    prog_modes             = PM_UPDI;
    connection_type        = usb;
    usbpid                 = 0x2144;
    hvupdi_support         = 0, 1;
;

#------------------------------------------------------------
# powerdebugger_dw
#------------------------------------------------------------

programmer
    id                     = "powerdebugger_dw";
    desc                   = "Atmel PowerDebugger (ARM/AVR) in debugWire mode";
    type                   = "jtagice3_dw";
    prog_modes             = PM_debugWIRE;
    connection_type        = usb;
    usbpid                 = 0x2144;
;

#------------------------------------------------------------
# powerdebugger_isp
#------------------------------------------------------------

programmer
    id                     = "powerdebugger_isp";
    desc                   = "Atmel PowerDebugger (ARM/AVR) in ISP mode";
    type                   = "jtagice3_isp";
    prog_modes             = PM_ISP;
    connection_type        = usb;
    usbpid                 = 0x2144;
;

#------------------------------------------------------------
# powerdebugger_tpi
#------------------------------------------------------------

programmer
    id                     = "powerdebugger_tpi";
    desc                   = "Atmel PowerDebugger (ARM/AVR) in TPI mode";
    type                   = "jtagice3_tpi";
    prog_modes             = PM_TPI;
    connection_type        = usb;
    usbpid                 = 0x2144;
;

#------------------------------------------------------------
# pickit4
#------------------------------------------------------------

programmer
    id                     = "pickit4";
    desc                   = "MPLAB(R) PICkit 4 in JTAG mode";
    type                   = "jtagice3";
    prog_modes             = PM_JTAG | PM_XMEGAJTAG;
    connection_type        = usb;
    usbpid                 = 0x2177, 0x2178, 0x2179;
;

#------------------------------------------------------------
# pickit4_updi
#------------------------------------------------------------

programmer
    id                     = "pickit4_updi";
    desc                   = "MPLAB(R) PICkit 4 in UPDI mode";
    type                   = "jtagice3_updi";
    prog_modes             = PM_UPDI;
    connection_type        = usb;
    usbpid                 = 0x2177, 0x2178, 0x2179;
    hvupdi_support         = 0, 1, 2;
;

#------------------------------------------------------------
# pickit4_pdi
#------------------------------------------------------------

programmer
    id                     = "pickit4_pdi";
    desc                   = "MPLAB(R) PICkit 4 in PDI mode";
    type                   = "jtagice3_pdi";
    prog_modes             = PM_PDI;
    connection_type        = usb;
    usbpid                 = 0x2177, 0x2178, 0x2179;
;

#------------------------------------------------------------
# pickit4_isp
#------------------------------------------------------------

programmer
    id                     = "pickit4_isp";
    desc                   = "MPLAB(R) PICkit 4 in ISP mode";
    type                   = "jtagice3_isp";
    prog_modes             = PM_ISP;
    connection_type        = usb;
    usbpid                 = 0x2177, 0x2178, 0x2179;
;

#------------------------------------------------------------
# pickit4_tpi
#------------------------------------------------------------

programmer
    id                     = "pickit4_tpi";
    desc                   = "MPLAB(R) PICkit 4 in TPI mode";
    type                   = "jtagice3_tpi";
    prog_modes             = PM_TPI;
    connection_type        = usb;
    usbpid                 = 0x2177, 0x2178, 0x2179;
;

#------------------------------------------------------------
# snap
#------------------------------------------------------------

programmer
    id                     = "snap";
    desc                   = "MPLAB(R) Snap in JTAG mode";
    type                   = "jtagice3";
    prog_modes             = PM_JTAG | PM_XMEGAJTAG;
    connection_type        = usb;
    usbpid                 = 0x2180, 0x217f, 0x2181;
;

#------------------------------------------------------------
# snap_updi
#------------------------------------------------------------

programmer
    id                     = "snap_updi";
    desc                   = "MPLAB(R) SNAP in UPDI mode";
    type                   = "jtagice3_updi";
    prog_modes             = PM_UPDI;
    connection_type        = usb;
    usbpid                 = 0x2180, 0x217f, 0x2181;
    hvupdi_support         = 1;
;

#------------------------------------------------------------
# snap_pdi
#------------------------------------------------------------

programmer
    id                     = "snap_pdi";
    desc                   = "MPLAB(R) SNAP in PDI mode";
    type                   = "jtagice3_pdi";
    prog_modes             = PM_PDI;
    connection_type        = usb;
    usbpid                 = 0x2180, 0x217f, 0x2181;
;

#------------------------------------------------------------
# snap_isp
#------------------------------------------------------------

programmer
    id                     = "snap_isp";
    desc                   = "MPLAB(R) SNAP in ISP mode";
    type                   = "jtagice3_isp";
    prog_modes             = PM_ISP;
    connection_type        = usb;
    usbpid                 = 0x2180, 0x217f, 0x2181;
;

#------------------------------------------------------------
# snap_tpi
#------------------------------------------------------------

programmer
    id                     = "snap_tpi";
    desc                   = "MPLAB(R) SNAP in TPI mode";
    type                   = "jtagice3_tpi";
    prog_modes             = PM_TPI;
    connection_type        = usb;
    usbpid                 = 0x2180, 0x217f, 0x2181;
;

#------------------------------------------------------------
# pkobn_updi
#------------------------------------------------------------

programmer
    id                     = "pkobn_updi";
    desc                   = "Curiosity nano (nEDBG) in UPDI mode";
    type                   = "jtagice3_updi";
    prog_modes             = PM_UPDI;
    connection_type        = usb;
    usbpid                 = 0x2175;
    hvupdi_support         = 1;
;

#------------------------------------------------------------
# pavr
#------------------------------------------------------------

programmer
    id                     = "pavr";
    desc                   = "Jason Kyle's pAVR Serial Programmer";
    type                   = "avr910";
    prog_modes             = PM_ISP;
    connection_type        = serial;
;

#------------------------------------------------------------
# pickit2
#------------------------------------------------------------

programmer
    id                     = "pickit2";
    desc                   = "MicroChip's PICkit2 Programmer";
    type                   = "pickit2";
    prog_modes             = PM_ISP;
    connection_type        = usb;
;

#------------------------------------------------------------
# flip1
#------------------------------------------------------------

programmer
    id                     = "flip1";
    desc                   = "FLIP for bootloader using USB DFU protocol version 1 (doc7618)";
    type                   = "flip1";
    prog_modes             = PM_SPM;
    connection_type        = usb;
;

#------------------------------------------------------------
# flip2
#------------------------------------------------------------

programmer
    id                     = "flip2";
    desc                   = "FLIP for bootloader using USB DFU protocol version 2 (AVR4023)";
    type                   = "flip2";
    prog_modes             = PM_SPM;
    connection_type        = usb;
;

#------------------------------------------------------------
# ponyser
#------------------------------------------------------------

# some ultra cheap programmers use bitbanging on the serialport
#
# PC - DB9 - Pins for RS232:
#
# GND   5   -- |O
#              |   O| <-   9   RI
# DTR   4   <- |O   |
#              |   O| <-   8   CTS
# TXD   3   <- |O   |
#              |   O| ->   7   RTS
# RXD   2   -> |O   |
#              |   O| <-   6   DSR
# DCD   1   -> |O
#
# Using RXD is currently not supported.
# Using RI is not supported under Win32 but is supported under Posix.

# serial ponyprog design (dasa2 in uisp)
# reset=!txd sck=rts sdo=dtr sdi=cts

programmer
    id                     = "ponyser";
    desc                   = "design ponyprog serial, reset=!txd sck=rts sdo=dtr sdi=cts";
    type                   = "serbb";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = serial;
    reset                  = ~3;
    sck                    = 7;
    sdo                    = 4;
    sdi                    = 8;
;

#------------------------------------------------------------
# siprog
#------------------------------------------------------------

# Same as above, different name
# reset=!txd sck=rts sdo=dtr sdi=cts

programmer parent "ponyser"
    id                     = "siprog";
    desc                   = "Lancos SI-Prog <http://www.lancos.com/siprogsch.html>";
;

#------------------------------------------------------------
# dasa
#------------------------------------------------------------

# unknown (dasa in uisp)
# reset=rts sck=dtr sdo=txd sdi=cts

programmer
    id                     = "dasa";
    desc                   = "serial port banging, reset=rts sck=dtr sdo=txd sdi=cts";
    type                   = "serbb";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = serial;
    reset                  = 7;
    sck                    = 4;
    sdo                    = 3;
    sdi                    = 8;
;

#------------------------------------------------------------
# dasa3
#------------------------------------------------------------

# unknown (dasa3 in uisp)
# reset=!dtr sck=rts sdo=txd sdi=cts

programmer
    id                     = "dasa3";
    desc                   = "serial port banging, reset=!dtr sck=rts sdo=txd sdi=cts";
    type                   = "serbb";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = serial;
    reset                  = ~4;
    sck                    = 7;
    sdo                    = 3;
    sdi                    = 8;
;

#------------------------------------------------------------
# C2N232i
#------------------------------------------------------------

# C2N232i (jumper configuration "auto")
# reset=dtr sck=!rts sdo=!txd sdi=!cts

programmer
    id                     = "c2n232i";
    desc                   = "serial port banging, reset=dtr sck=!rts sdo=!txd sdi=!cts";
    type                   = "serbb";
    prog_modes             = PM_TPI | PM_ISP;
    connection_type        = serial;
    reset                  = 4;
    sck                    = ~7;
    sdo                    = ~3;
    sdi                    = ~8;
;

#------------------------------------------------------------
# jtag2updi
#------------------------------------------------------------

# JTAG2UPDI
# https://github.com/ElTangas/jtag2updi

programmer
    id                     = "jtag2updi";
    desc                   = "JTAGv2 to UPDI bridge";
    type                   = "jtagmkii_updi";
    prog_modes             = PM_UPDI;
    connection_type        = serial;
    baudrate               = 115200;
    hvupdi_support         = 1;
;

#
# PART DEFINITIONS
#

#------------------------------------------------------------
# ATtiny11
#------------------------------------------------------------

# This is an HVSP-only device.

part
    desc                   = "ATtiny11";
    id                     = "t11";
    prog_modes             = PM_HVSP;
    mcuid                  = 8;
    n_interrupts           = 5;
    stk500_devcode         = 0x11;
    chip_erase_delay       = 20000;
    signature              = 0x1e 0x90 0x04;
    serial                 = no;
    timeout                = 200;
    hvsp_controlstack      =
        0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x00,
        0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
        0x78, 0x00, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10,
        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 1;
    togglevtg              = 1;
    poweroffdelay          = 25;
    resetdelayus           = 50;
    hvleavestabdelay       = 100;
    resetdelay             = 25;
    chiperasepolltimeout   = 40;
    programfusepolltimeout = 25;
    programlockpolltimeout = 25;
    synchcycles            = 6;

    memory "eeprom"
        size               = 64;
        delay              = 5;
        blocksize          = 64;
        readsize           = 256;
    ;

    memory "flash"
        size               = 1024;
        delay              = 3;
        blocksize          = 128;
        readsize           = 256;
    ;

    memory "fuse"
        size               = 1;
    ;

    memory "lock"
        size               = 1;
    ;

    memory "signature"
        size               = 3;
    ;

    memory "calibration"
        size               = 1;
    ;
;

#------------------------------------------------------------
# ATtiny12
#------------------------------------------------------------

part
    desc                   = "ATtiny12";
    id                     = "t12";
    prog_modes             = PM_ISP | PM_HVSP;
    mcuid                  = 9;
    n_interrupts           = 6;
    stk500_devcode         = 0x12;
    avr910_devcode         = 0x55;
    chip_erase_delay       = 20000;
    signature              = 0x1e 0x90 0x05;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    hvsp_controlstack      =
        0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x00,
        0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
        0x78, 0x00, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10,
        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 1;
    togglevtg              = 1;
    poweroffdelay          = 25;
    resetdelayus           = 50;
    hvleavestabdelay       = 100;
    resetdelay             = 25;
    chiperasepolltimeout   = 40;
    programfusepolltimeout = 25;
    programlockpolltimeout = 25;
    synchcycles            = 6;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 64;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 8;
        blocksize          = 64;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxx--xxaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        size               = 1024;
        min_write_delay    = 4500;
        max_write_delay    = 20000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 5;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        write_lo           = "0100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
        write_hi           = "0100.1000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
    ;

    memory "fuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--xxxx.xxxx--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--101x.xxxx--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xoox";
        write              = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--0000.00aa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny13
#------------------------------------------------------------

part
    desc                   = "ATtiny13";
    id                     = "t13";
    prog_modes             = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE;
    mcuid                  = 10;
    n_interrupts           = 10;
    stk500_devcode         = 0x14;
    chip_erase_delay       = 4000;
    signature              = 0x1e 0x90 0x07;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    hvsp_controlstack      =
        0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66,
        0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78,
        0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10,
        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
    flash_instr            =  0xb4, 0x0e, 0x1e;
    eeprom_instr           =
        0xbb, 0xfe, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xbc, 0x0e, 0xb4, 0x0e, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 1;
    togglevtg              = 1;
    poweroffdelay          = 25;
    resetdelayus           = 90;
    hvleavestabdelay       = 100;
    resetdelay             = 25;
    chiperasepolltimeout   = 40;
    programfusepolltimeout = 25;
    programlockpolltimeout = 25;
    synchcycles            = 6;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    ocdrev                 = 0;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 64;
        page_size          = 4;
        min_write_delay    = 4000;
        max_write_delay    = 4000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 5;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxx--xxaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--xxaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 1024;
        page_size          = 32;
        num_pages          = 32;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 32;
        readsize           = 256;
        read_lo            = "0010.0000--0000.000a--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.000a--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxx.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxx.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.000a--aaaa.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 2;
        read               = "0011.1000--000x.xxxx--0000.000a--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny13A
#------------------------------------------------------------

part parent "t13"
    desc                   = "ATtiny13A";
    id                     = "t13a";
    mcuid                  = 11;
;

#------------------------------------------------------------
# ATtiny15
#------------------------------------------------------------

part
    desc                   = "ATtiny15";
    id                     = "t15";
    prog_modes             = PM_ISP | PM_HVSP;
    mcuid                  = 12;
    n_interrupts           = 9;
    stk500_devcode         = 0x13;
    avr910_devcode         = 0x56;
    chip_erase_delay       = 8200;
    signature              = 0x1e 0x90 0x06;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    hvsp_controlstack      =
        0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x00,
        0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
        0x78, 0x00, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10,
        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 16;
    togglevtg              = 1;
    poweroffdelay          = 25;
    resetdelayus           = 50;
    hvleavestabdelay       = 100;
    resetdelay             = 25;
    chiperasepolltimeout   = 40;
    programfusepolltimeout = 25;
    programlockpolltimeout = 25;
    synchcycles            = 6;
    hvspcmdexedelay        = 5;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 64;
        min_write_delay    = 8200;
        max_write_delay    = 8200;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 10;
        blocksize          = 64;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxx--xxaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        size               = 1024;
        min_write_delay    = 4100;
        max_write_delay    = 4100;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 5;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        write_lo           = "0100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
        write_hi           = "0100.1000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
    ;

    memory "fuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--xxxx.xxxx--xxxx.xxxx--oooo.xxoo";
        write              = "1010.1100--101x.xxxx--xxxx.xxxx--iiii.11ii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xoox";
        write              = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--0000.00aa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90s1200
#------------------------------------------------------------

part
    desc                   = "AT90S1200";
    id                     = "1200";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 183;
    n_interrupts           = 4;
    stk500_devcode         = 0x33;
    avr910_devcode         = 0x13;
    chip_erase_delay       = 20000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x90 0x01;
    is_at90s1200           = yes;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 1;
    pollvalue              = 0xff;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    hvleavestabdelay       = 15;
    chiperasepulsewidth    = 15;
    programfusepulsewidth  = 2;
    programlockpolltimeout = 1;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 64;
        min_write_delay    = 4000;
        max_write_delay    = 9000;
        readback           = 0x00 0xff;
        mode               = 4;
        delay              = 20;
        blocksize          = 32;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxx--xxaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        size               = 1024;
        min_write_delay    = 4000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 2;
        delay              = 15;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        write_lo           = "0100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
        write_hi           = "0100.1000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
    ;

    memory "fuse"
        size               = 1;
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        write              = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90s4414
#------------------------------------------------------------

part
    desc                   = "AT90S4414";
    id                     = "4414";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 190;
    n_interrupts           = 13;
    stk500_devcode         = 0x50;
    avr910_devcode         = 0x28;
    chip_erase_delay       = 20000;
    signature              = 0x1e 0x92 0x01;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
    hventerstabdelay       = 100;
    hvleavestabdelay       = 15;
    chiperasepulsewidth    = 15;
    programfusepulsewidth  = 2;
    programlockpolltimeout = 1;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 256;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0x80 0x7f;
        mode               = 4;
        delay              = 12;
        blocksize          = 64;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        size               = 4096;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0x7f 0x7f;
        mode               = 4;
        delay              = 12;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        write_lo           = "0100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
        write_hi           = "0100.1000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
    ;

    memory "fuse"
        size               = 1;
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        write              = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90s2313
#------------------------------------------------------------

part
    desc                   = "AT90S2313";
    id                     = "2313";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 186;
    n_interrupts           = 11;
    stk500_devcode         = 0x40;
    avr910_devcode         = 0x20;
    chip_erase_delay       = 20000;
    signature              = 0x1e 0x91 0x01;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    hvleavestabdelay       = 15;
    chiperasepulsewidth    = 15;
    programfusepulsewidth  = 2;
    programlockpolltimeout = 1;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 128;
        min_write_delay    = 4000;
        max_write_delay    = 9000;
        readback           = 0x80 0x7f;
        mode               = 4;
        delay              = 12;
        blocksize          = 64;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxx--xaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        size               = 2048;
        min_write_delay    = 4000;
        max_write_delay    = 9000;
        readback           = 0x7f 0x7f;
        mode               = 4;
        delay              = 12;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.xxaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.xxaa--aaaa.aaaa--oooo.oooo";
        write_lo           = "0100.0000--xxxx.xxaa--aaaa.aaaa--iiii.iiii";
        write_hi           = "0100.1000--xxxx.xxaa--aaaa.aaaa--iiii.iiii";
    ;

    memory "fuse"
        size               = 1;
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        write              = "1010.1100--111x.xiix--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90s2333
#------------------------------------------------------------

part
##### WARNING: No XML file for device 'AT90S2333'! #####
    desc                   = "AT90S2333";
    id                     = "2333";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 188;
    n_interrupts           = 14;
    stk500_devcode         = 0x42;
    avr910_devcode         = 0x34;
    chip_erase_delay       = 20000;
    signature              = 0x1e 0x91 0x05;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    hvleavestabdelay       = 15;
    chiperasepulsewidth    = 15;
    programfusepulsewidth  = 2;
    programlockpolltimeout = 1;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 128;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0x00 0xff;
        mode               = 4;
        delay              = 12;
        blocksize          = 128;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxx--xaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        size               = 2048;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 12;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.xxaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.xxaa--aaaa.aaaa--oooo.oooo";
        write_lo           = "0100.0000--xxxx.xxaa--aaaa.aaaa--iiii.iiii";
        write_hi           = "0100.1000--xxxx.xxaa--aaaa.aaaa--iiii.iiii";
    ;

    memory "fuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        pwroff_after_write = yes;
        read               = "0101.0000--xxxx.xxxx--xxxx.xxxx--xxoo.oooo";
        write              = "1010.1100--101i.iiii--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xoox";
        write              = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90s2343 (also AT90s2323 and ATtiny22)
#------------------------------------------------------------

part
    desc                   = "AT90S2343";
    id                     = "2343";
    prog_modes             = PM_SPM | PM_ISP | PM_HVSP;
    mcuid                  = 189;
    n_interrupts           = 3;
    stk500_devcode         = 0x43;
    avr910_devcode         = 0x4c;
    chip_erase_delay       = 18000;
    signature              = 0x1e 0x91 0x03;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    hvsp_controlstack      =
        0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x00,
        0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78,
        0x78, 0x00, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10,
        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 1;
    poweroffdelay          = 25;
    resetdelayus           = 50;
    hvleavestabdelay       = 100;
    resetdelay             = 25;
    chiperasepolltimeout   = 40;
    programfusepolltimeout = 25;
    programlockpolltimeout = 25;
    synchcycles            = 6;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 128;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0x00 0xff;
        mode               = 4;
        delay              = 12;
        blocksize          = 64;
        readsize           = 256;
        read               = "1010.0000--0000.0000--xaaa.aaaa--oooo.oooo";
        write              = "1100.0000--0000.0000--xaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        size               = 2048;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 12;
        blocksize          = 128;
        readsize           = 128;
        read_lo            = "0010.0000--xxxx.xxaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.xxaa--aaaa.aaaa--oooo.oooo";
        write_lo           = "0100.0000--xxxx.xxaa--aaaa.aaaa--iiii.iiii";
        write_hi           = "0100.1000--xxxx.xxaa--aaaa.aaaa--iiii.iiii";
    ;

    memory "fuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--ooox.xxxo";
        write              = "1010.1100--1011.111i--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--ooox.xxxo";
        write              = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90s4433
#------------------------------------------------------------

part
    desc                   = "AT90S4433";
    id                     = "4433";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 191;
    n_interrupts           = 14;
    stk500_devcode         = 0x51;
    avr910_devcode         = 0x30;
    chip_erase_delay       = 20000;
    signature              = 0x1e 0x92 0x03;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    hvleavestabdelay       = 15;
    chiperasepulsewidth    = 15;
    programfusepulsewidth  = 2;
    programlockpolltimeout = 1;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 256;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0x00 0xff;
        mode               = 4;
        delay              = 12;
        blocksize          = 128;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxx--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxx--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        size               = 4096;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 12;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.xaaa--aaaa.aaaa--oooo.oooo";
        write_lo           = "0100.0000--xxxx.xaaa--aaaa.aaaa--iiii.iiii";
        write_hi           = "0100.1000--xxxx.xaaa--aaaa.aaaa--iiii.iiii";
    ;

    memory "fuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        pwroff_after_write = yes;
        read               = "0101.0000--xxxx.xxxx--xxxx.xxxx--xxoo.oooo";
        write              = "1010.1100--101i.iiii--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xoox";
        write              = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90s4434
#------------------------------------------------------------

part
##### WARNING: No XML file for device 'AT90S4434'! #####
    desc                   = "AT90S4434";
    id                     = "4434";
    prog_modes             = PM_SPM | PM_ISP;
    mcuid                  = 192;
    n_interrupts           = 17;
    stk500_devcode         = 0x52;
    avr910_devcode         = 0x6c;
    chip_erase_delay       = 20000;
    signature              = 0x1e 0x92 0x02;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 256;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0x00 0xff;
        read               = "1010.0000--xxxx.xxxx--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxx--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        size               = 4096;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0xff 0xff;
        read_lo            = "0010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.xaaa--aaaa.aaaa--oooo.oooo";
        write_lo           = "0100.0000--xxxx.xaaa--aaaa.aaaa--iiii.iiii";
        write_hi           = "0100.1000--xxxx.xaaa--aaaa.aaaa--iiii.iiii";
    ;

    memory "fuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        read               = "0101.0000--xxxx.xxxx--xxxx.xxxx--xxoo.oooo";
        write              = "1010.1100--101i.iiii--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xoox";
        write              = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90s8515
#------------------------------------------------------------

part
    desc                   = "AT90S8515";
    id                     = "8515";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 193;
    n_interrupts           = 13;
    stk500_devcode         = 0x60;
    avr910_devcode         = 0x38;
    chip_erase_delay       = 20000;
    signature              = 0x1e 0x93 0x01;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepulsewidth    = 15;
    programfusepulsewidth  = 2;
    programlockpolltimeout = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        min_write_delay    = 4000;
        max_write_delay    = 9000;
        readback           = 0x80 0x7f;
        mode               = 4;
        delay              = 12;
        blocksize          = 128;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        size               = 8192;
        min_write_delay    = 4000;
        max_write_delay    = 9000;
        readback           = 0x7f 0x7f;
        mode               = 4;
        delay              = 12;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        write_lo           = "0100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
        write_hi           = "0100.1000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
    ;

    memory "fuse"
        size               = 1;
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        write              = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90s8535
#------------------------------------------------------------

part
    desc                   = "AT90S8535";
    id                     = "8535";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 195;
    n_interrupts           = 17;
    stk500_devcode         = 0x61;
    avr910_devcode         = 0x68;
    chip_erase_delay       = 20000;
    signature              = 0x1e 0x93 0x03;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    hvleavestabdelay       = 15;
    chiperasepulsewidth    = 15;
    programfusepulsewidth  = 2;
    programlockpolltimeout = 1;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0x00 0xff;
        mode               = 4;
        delay              = 12;
        blocksize          = 128;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        size               = 8192;
        min_write_delay    = 9000;
        max_write_delay    = 20000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 12;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        write_lo           = "0100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
        write_hi           = "0100.1000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
    ;

    memory "fuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xxxo";
        write              = "1010.1100--1011.111i--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--ooxx.xxxx";
        write              = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega103
#------------------------------------------------------------

part
    desc                   = "ATmega103";
    id                     = "m103";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 84;
    n_interrupts           = 24;
    stk500_devcode         = 0xb1;
    avr910_devcode         = 0x41;
    chip_erase_delay       = 112000;
    signature              = 0x1e 0x97 0x01;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x8e, 0x9e, 0x2e, 0x3e, 0xae, 0xbe,
        0x4e, 0x5e, 0xce, 0xde, 0x6e, 0x7e, 0xee, 0xde,
        0x66, 0x76, 0xe6, 0xf6, 0x6a, 0x7a, 0xea, 0x7a,
        0x7f, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    hvleavestabdelay       = 15;
    chiperasepulsewidth    = 15;
    programfusepulsewidth  = 2;
    programlockpolltimeout = 10;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 4096;
        min_write_delay    = 4000;
        max_write_delay    = 9000;
        readback           = 0x80 0x7f;
        mode               = 4;
        delay              = 12;
        blocksize          = 64;
        readsize           = 256;
        read               = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x20000;
        page_size          = 256;
        num_pages          = 512;
        min_write_delay    = 22000;
        max_write_delay    = 56000;
        readback           = 0xff 0xff;
        mode               = 17;
        delay              = 70;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "fuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--xxxx.xxxx--xxxx.xxxx--xxox.o1oo";
        write              = "1010.1100--1011.i1ii--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xoox";
        write              = "1010.1100--1111.1ii1--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega64
#------------------------------------------------------------

part
    desc                   = "ATmega64";
    id                     = "m64";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI;
    mcuid                  = 72;
    n_interrupts           = 35;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
    stk500_devcode         = 0xa0;
    avr910_devcode         = 0x45;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x96 0x02;
    reset                  = io;
    allowfullpagebitstream = yes;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 6;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x22;
    spmcr                  = 0x68;
    ocdrev                 = 2;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 2048;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 20;
        blocksize          = 64;
        readsize           = 256;
        read               = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x10000;
        page_size          = 256;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 33;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--xaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 4;
        read               = "0011.1000--xxxx.xxxx--0000.00aa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega64A
#------------------------------------------------------------

part parent "m64"
    desc                   = "ATmega64A";
    id                     = "m64a";
    mcuid                  = 73;
;

#------------------------------------------------------------
# ATmega128
#------------------------------------------------------------

part
    desc                   = "ATmega128";
    id                     = "m128";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI;
    mcuid                  = 85;
    n_interrupts           = 35;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
    stk500_devcode         = 0xb2;
    avr910_devcode         = 0x43;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x97 0x02;
    reset                  = io;
    allowfullpagebitstream = yes;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 6;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x22;
    rampz                  = 0x3b;
    spmcr                  = 0x68;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 4096;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 12;
        blocksize          = 64;
        readsize           = 256;
        read               = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x20000;
        page_size          = 256;
        num_pages          = 512;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 33;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 4;
        read               = "0011.1000--xxxx.xxxx--0000.00aa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega128A
#------------------------------------------------------------

part parent "m128"
    desc                   = "ATmega128A";
    id                     = "m128a";
    mcuid                  = 86;
;

#------------------------------------------------------------
# AT90CAN128
#------------------------------------------------------------

part
    desc                   = "AT90CAN128";
    id                     = "c128";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI;
    mcuid                  = 176;
    n_interrupts           = 37;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
    stk500_devcode         = 0xb3;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
#   avr910_devcode         = 0x43;
    signature              = 0x1e 0x97 0x81;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
    hventerstabdelay       = 100;
    latchcycles            = 6;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    rampz                  = 0x3b;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 4096;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 8;
        readsize           = 256;
        read               = "1010.0000--000x.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.aaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x20000;
        page_size          = 256;
        num_pages          = 512;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90CAN64
#------------------------------------------------------------

part
    desc                   = "AT90CAN64";
    id                     = "c64";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 172;
    n_interrupts           = 37;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
    stk500_devcode         = 0xb3;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
#   avr910_devcode         = 0x43;
    signature              = 0x1e 0x96 0x81;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
    hventerstabdelay       = 100;
    latchcycles            = 6;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    rampz                  = 0x3b;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 2048;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 8;
        readsize           = 256;
        read               = "1010.0000--000x.xaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--00xx.xaaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x10000;
        page_size          = 256;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90CAN32
#------------------------------------------------------------

part
    desc                   = "AT90CAN32";
    id                     = "c32";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 171;
    n_interrupts           = 37;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
    stk500_devcode         = 0xb3;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
#   avr910_devcode         = 0x43;
    signature              = 0x1e 0x95 0x81;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01;
    hventerstabdelay       = 100;
    latchcycles            = 6;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    rampz                  = 0x3b;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 1024;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 8;
        readsize           = 256;
        read               = "1010.0000--000x.xxaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x8000;
        page_size          = 256;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega16
#------------------------------------------------------------

part
    desc                   = "ATmega16";
    id                     = "m16";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI;
    mcuid                  = 49;
    n_interrupts           = 21;
    n_boot_sections        = 4;
    boot_section_size      = 256;
    stk500_devcode         = 0x82;
    avr910_devcode         = 0x74;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x94 0x03;
    reset                  = io;
    allowfullpagebitstream = yes;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    progmodedelay          = 100;
    latchcycles            = 6;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    spmcr                  = 0x57;
    ocdrev                 = 2;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 10;
        blocksize          = 128;
        readsize           = 256;
        read               = "1010.0000--00xx.xxaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--00xx.xxaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxaa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x4000;
        page_size          = 128;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 33;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--00aa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--00xx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--00xx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--00aa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 4;
        read               = "0011.1000--000x.xxxx--0000.00aa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega16A
#------------------------------------------------------------

part parent "m16"
    desc                   = "ATmega16A";
    id                     = "m16a";
    mcuid                  = 50;
;

#------------------------------------------------------------
# ATmega324P
#------------------------------------------------------------

part
    desc                   = "ATmega324P";
    id                     = "m324p";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 111;
    n_interrupts           = 31;
    n_boot_sections        = 4;
    boot_section_size      = 512;
    stk500_devcode         = 0x82; # no STK500v1 support, use the ATmega16 one
    avr910_devcode         = 0x74;
    chip_erase_delay       = 55000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x95 0x08;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 1024;
        page_size          = 4;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 128;
        readsize           = 256;
        read               = "1010.0000--00xx.xaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--00xx.xaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xaaa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x8000;
        page_size          = 128;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 33;
        delay              = 6;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--00xx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--00xx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0aaa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--1111.1iii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega164P
#------------------------------------------------------------

part parent "m324p"
    desc                   = "ATmega164P";
    id                     = "m164p";
    mcuid                  = 93;
    boot_section_size      = 256;
    signature              = 0x1e 0x94 0x0a;

    memory "eeprom"
        size               = 512;
    ;

    memory "flash"
        size               = 0x4000;
        num_pages          = 128;
    ;
;

#------------------------------------------------------------
# ATmega164PA
#------------------------------------------------------------

part parent "m164p"
    desc                   = "ATmega164PA";
    id                     = "m164pa";
    mcuid                  = 94;
;

#------------------------------------------------------------
# ATmega164A
#------------------------------------------------------------

part parent "m164p"
    desc                   = "ATmega164A";
    id                     = "m164a";
    mcuid                  = 92;
    signature              = 0x1e 0x94 0x0f;
;

#------------------------------------------------------------
# ATmega324PB
#------------------------------------------------------------

part parent "m324p"
    desc                   = "ATmega324PB";
    id                     = "m324pb";
    mcuid                  = 113;
    n_interrupts           = 51;
    signature              = 0x1e 0x95 0x17;
;

#------------------------------------------------------------
# ATmega324PA
#------------------------------------------------------------

part parent "m324p"
    desc                   = "ATmega324PA";
    id                     = "m324pa";
    mcuid                  = 112;
    signature              = 0x1e 0x95 0x11;
;

#------------------------------------------------------------
# ATmega324A
#------------------------------------------------------------

part parent "m324p"
    desc                   = "ATmega324A";
    id                     = "m324a";
    mcuid                  = 110;
    signature              = 0x1e 0x95 0x15;
;

#------------------------------------------------------------
# ATmega644
#------------------------------------------------------------

part
    desc                   = "ATmega644";
    id                     = "m644";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 127;
    n_interrupts           = 28;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
    stk500_devcode         = 0x82; # no STK500v1 support, use the ATmega16 one
    avr910_devcode         = 0x74;
    chip_erase_delay       = 55000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x96 0x09;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
    hventerstabdelay       = 100;
    latchcycles            = 6;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 2048;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 128;
        readsize           = 256;
        read               = "1010.0000--00xx.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--00xx.aaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x10000;
        page_size          = 256;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 33;
        delay              = 6;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--00xx.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--00xx.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--1111.1iii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega644A
#------------------------------------------------------------

part parent "m644"
    desc                   = "ATmega644A";
    id                     = "m644a";
    mcuid                  = 128;
    n_interrupts           = 31;
;

#------------------------------------------------------------
# ATmega644P
#------------------------------------------------------------

part parent "m644"
    desc                   = "ATmega644P";
    id                     = "m644p";
    mcuid                  = 129;
    n_interrupts           = 31;
    signature              = 0x1e 0x96 0x0a;
;

#------------------------------------------------------------
# ATmega644PA
#------------------------------------------------------------

part parent "m644"
    desc                   = "ATmega644PA";
    id                     = "m644pa";
    mcuid                  = 130;
    n_interrupts           = 31;
    signature              = 0x1e 0x96 0x0a;
;

#------------------------------------------------------------
# ATmega1284
#------------------------------------------------------------

part
    desc                   = "ATmega1284";
    id                     = "m1284";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 140;
    n_interrupts           = 35;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
    stk500_devcode         = 0x82; # no STK500v1 support, use the ATmega16 one
    avr910_devcode         = 0x74;
    chip_erase_delay       = 55000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x97 0x06;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
    hventerstabdelay       = 100;
    latchcycles            = 6;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 4096;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 128;
        readsize           = 256;
        read               = "1010.0000--00xx.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--00xx.aaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x20000;
        page_size          = 256;
        num_pages          = 512;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--00xx.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--00xx.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--1111.1iii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega1284P
#------------------------------------------------------------

part parent "m1284"
    desc                   = "ATmega1284P";
    id                     = "m1284p";
    mcuid                  = 141;
    signature              = 0x1e 0x97 0x05;
;

#------------------------------------------------------------
# ATmega162
#------------------------------------------------------------

part
    desc                   = "ATmega162";
    id                     = "m162";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI;
    mcuid                  = 90;
    n_interrupts           = 28;
    n_boot_sections        = 4;
    boot_section_size      = 256;
    stk500_devcode         = 0x83;
    avr910_devcode         = 0x63;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x94 0x04;
    reset                  = io;
    allowfullpagebitstream = yes;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 6;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x04;
    spmcr                  = 0x57;
    ocdrev                 = 2;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--00xx.xxaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--00xx.xxaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxaa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x4000;
        page_size          = 128;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--00aa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--00xx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--00xx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--00aa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 16000;
        max_write_delay    = 16000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 16000;
        max_write_delay    = 16000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 16000;
        max_write_delay    = 16000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--1111.1iii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 16000;
        max_write_delay    = 16000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--00xx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--00xx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega163
#------------------------------------------------------------

part
    desc                   = "ATmega163";
    id                     = "m163";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 91;
    n_interrupts           = 18;
    n_boot_sections        = 4;
    boot_section_size      = 256;
    stk500_devcode         = 0x81;
    avr910_devcode         = 0x64;
    chip_erase_delay       = 32000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x94 0x02;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 30;
    programfusepolltimeout = 2;
    programlockpolltimeout = 2;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        min_write_delay    = 4000;
        max_write_delay    = 4000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x4000;
        page_size          = 128;
        num_pages          = 128;
        min_write_delay    = 16000;
        max_write_delay    = 16000;
        readback           = 0xff 0xff;
        mode               = 17;
        delay              = 20;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xxxa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--xxxa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--ooxx.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--ii11.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--xxxx.1ooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--1111.1iii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.1000--0000.0000--xxxx.0xxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega169
#------------------------------------------------------------

part
    desc                   = "ATmega169";
    id                     = "m169";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI;
    mcuid                  = 104;
    n_interrupts           = 23;
    n_boot_sections        = 4;
    boot_section_size      = 256;
    stk500_devcode         = 0x85;
    avr910_devcode         = 0x78;
    chip_erase_delay       = 9000;
    signature              = 0x1e 0x94 0x05;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    spmcr                  = 0x57;
    ocdrev                 = 2;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x4000;
        page_size          = 128;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xxxa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--xxxa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega169A
#------------------------------------------------------------

part parent "m169"
    desc                   = "ATmega169A";
    id                     = "m169a";
    mcuid                  = 105;
    signature              = 0x1e 0x94 0x11;
    reset                  = io;
;

#------------------------------------------------------------
# ATmega169P
#------------------------------------------------------------

part parent "m169"
    desc                   = "ATmega169P";
    id                     = "m169p";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 106;
    reset                  = io;
;

#------------------------------------------------------------
# ATmega169PA
#------------------------------------------------------------

part parent "m169"
    desc                   = "ATmega169PA";
    id                     = "m169pa";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 107;
    reset                  = io;
;

#------------------------------------------------------------
# ATmega329
#------------------------------------------------------------

part
    desc                   = "ATmega329";
    id                     = "m329";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 121;
    n_interrupts           = 23;
    n_boot_sections        = 4;
    boot_section_size      = 512;
#   stk500_devcode         = 0x85; # no STK500 support, only STK500v2
#   avr910_devcode         = 0x?;  # try the ATmega169 one:
    avr910_devcode         = 0x75;
    chip_erase_delay       = 9000;
    signature              = 0x1e 0x95 0x03;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 1024;
        page_size          = 4;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 8;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxaa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x8000;
        page_size          = 128;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--xaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--xaaa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega329A
#------------------------------------------------------------

part parent "m329"
    desc                   = "ATmega329A";
    id                     = "m329a";
    mcuid                  = 122;
;

#------------------------------------------------------------
# ATmega329P
#------------------------------------------------------------

part parent "m329"
    desc                   = "ATmega329P";
    id                     = "m329p";
    mcuid                  = 123;
    signature              = 0x1e 0x95 0x0b;
;

#------------------------------------------------------------
# ATmega329PA
#------------------------------------------------------------

part parent "m329"
    desc                   = "ATmega329PA";
    id                     = "m329pa";
    mcuid                  = 124;
    signature              = 0x1e 0x95 0x0b;
;

#------------------------------------------------------------
# ATmega3290
#------------------------------------------------------------

part parent "m329"
    desc                   = "ATmega3290";
    id                     = "m3290";
    mcuid                  = 150;
    n_interrupts           = 25;
    signature              = 0x1e 0x95 0x04;
;

#------------------------------------------------------------
# ATmega3290A
#------------------------------------------------------------

part parent "m329"
    desc                   = "ATmega3290A";
    id                     = "m3290a";
    mcuid                  = 151;
    n_interrupts           = 25;
    signature              = 0x1e 0x95 0x04;
;

#------------------------------------------------------------
# ATmega3290P
#------------------------------------------------------------

part parent "m329"
    desc                   = "ATmega3290P";
    id                     = "m3290p";
    mcuid                  = 152;
    n_interrupts           = 25;
    signature              = 0x1e 0x95 0x0c;
;

#------------------------------------------------------------
# ATmega3290PA
#------------------------------------------------------------

part parent "m329"
    desc                   = "ATmega3290PA";
    id                     = "m3290pa";
    mcuid                  = 153;
    n_interrupts           = 25;
    signature              = 0x1e 0x95 0x0c;
;

#------------------------------------------------------------
# ATmega649
#------------------------------------------------------------

part
    desc                   = "ATmega649";
    id                     = "m649";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 135;
    n_interrupts           = 23;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
#   stk500_devcode         = 0x85; # no STK500 support, only STK500v2
#   avr910_devcode         = 0x?;  # try the ATmega169 one:
    avr910_devcode         = 0x75;
    chip_erase_delay       = 9000;
    signature              = 0x1e 0x96 0x03;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 2048;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 8;
        readsize           = 256;
        read               = "1010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--00xx.xaaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x10000;
        page_size          = 256;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega649A
#------------------------------------------------------------

part parent "m649"
    desc                   = "ATmega649A";
    id                     = "m649a";
    mcuid                  = 136;
;

#------------------------------------------------------------
# ATmega649P
#------------------------------------------------------------

part parent "m649"
    desc                   = "ATmega649P";
    id                     = "m649p";
    mcuid                  = 137;
    signature              = 0x1e 0x96 0x0b;
;

#------------------------------------------------------------
# ATmega6490
#------------------------------------------------------------

part parent "m649"
    desc                   = "ATmega6490";
    id                     = "m6490";
    mcuid                  = 157;
    n_interrupts           = 25;
    signature              = 0x1e 0x96 0x04;
;

#------------------------------------------------------------
# ATmega6490A
#------------------------------------------------------------

part parent "m649"
    desc                   = "ATmega6490A";
    id                     = "m6490a";
    mcuid                  = 158;
    n_interrupts           = 25;
    signature              = 0x1e 0x96 0x04;
;

#------------------------------------------------------------
# ATmega6490P
#------------------------------------------------------------

part parent "m649"
    desc                   = "ATmega6490P";
    id                     = "m6490p";
    mcuid                  = 159;
    n_interrupts           = 25;
    signature              = 0x1e 0x96 0x0c;
;

#------------------------------------------------------------
# ATmega32
#------------------------------------------------------------

part
    desc                   = "ATmega32";
    id                     = "m32";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG | PM_JTAGmkI;
    mcuid                  = 58;
    n_interrupts           = 21;
    n_boot_sections        = 4;
    boot_section_size      = 512;
    stk500_devcode         = 0x91;
    avr910_devcode         = 0x72;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x95 0x02;
    reset                  = io;
    allowfullpagebitstream = yes;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 6;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    spmcr                  = 0x57;
    ocdrev                 = 2;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 1024;
        page_size          = 4;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 10;
        blocksize          = 64;
        readsize           = 256;
        read               = "1010.0000--00xx.xxaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--00xx.xxaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxaa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x8000;
        page_size          = 128;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 33;
        delay              = 6;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--00aa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--00xx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--00xx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--00aa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 4;
        read               = "0011.1000--00xx.xxxx--0000.00aa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega161
#------------------------------------------------------------

part
    desc                   = "ATmega161";
    id                     = "m161";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 89;
    n_interrupts           = 21;
    n_boot_sections        = 1;
    boot_section_size      = 1024;
    stk500_devcode         = 0x80;
    avr910_devcode         = 0x60;
    chip_erase_delay       = 28000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x94 0x01;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 30;
    programfusepolltimeout = 2;
    programlockpolltimeout = 2;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        min_write_delay    = 3400;
        max_write_delay    = 3400;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 5;
        blocksize          = 128;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x4000;
        page_size          = 128;
        num_pages          = 128;
        min_write_delay    = 14000;
        max_write_delay    = 14000;
        readback           = 0xff 0xff;
        mode               = 33;
        delay              = 16;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xxxa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--xxxa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "fuse"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.0000--xxxx.xxxx--xxxx.xxxx--xoxo.oooo";
        write              = "1010.1100--101x.xxxx--xxxx.xxxx--1i1i.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega32A
#------------------------------------------------------------

part parent "m32"
    desc                   = "ATmega32A";
    id                     = "m32a";
    mcuid                  = 59;
;

#------------------------------------------------------------
# ATmega8
#------------------------------------------------------------

part
    desc                   = "ATmega8";
    id                     = "m8";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 45;
    n_interrupts           = 19;
    n_boot_sections        = 4;
    boot_section_size      = 256;
    stk500_devcode         = 0x70;
    avr910_devcode         = 0x76;
    chip_erase_delay       = 10000;
    pagel                  = 0xd7;
    bs2                    = 0xc2;
    signature              = 0x1e 0x93 0x07;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 2;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 20;
        blocksize          = 128;
        readsize           = 256;
        read               = "1010.0000--00xx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--00xx.xxxa--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 64;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0x00;
        mode               = 33;
        delay              = 10;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--0000.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--0000.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 4;
        read               = "0011.1000--00xx.xxxx--0000.00aa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega8A
#------------------------------------------------------------

part parent "m8"
    desc                   = "ATmega8A";
    id                     = "m8a";
    mcuid                  = 46;
;

#------------------------------------------------------------
# ATmega8515
#------------------------------------------------------------

part
    desc                   = "ATmega8515";
    id                     = "m8515";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 160;
    n_interrupts           = 17;
    n_boot_sections        = 4;
    boot_section_size      = 256;
    stk500_devcode         = 0x63;
    avr910_devcode         = 0x3a;
    chip_erase_delay       = 9000;
    signature              = 0x1e 0x93 0x06;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 6;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 20;
        blocksize          = 128;
        readsize           = 256;
        read               = "1010.0000--00xx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--00xx.xxxa--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 64;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 33;
        delay              = 6;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--0000.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--0000.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 4;
        read               = "0011.1000--00xx.xxxx--0000.00aa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega8535
#------------------------------------------------------------

part
    desc                   = "ATmega8535";
    id                     = "m8535";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP;
    mcuid                  = 161;
    n_interrupts           = 21;
    n_boot_sections        = 4;
    boot_section_size      = 256;
    stk500_devcode         = 0x64;
    avr910_devcode         = 0x69;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x93 0x08;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 6;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 20;
        blocksize          = 128;
        readsize           = 256;
        read               = "1010.0000--00xx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--00xx.xxxa--aaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 64;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 33;
        delay              = 6;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--0000.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--0000.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 2000;
        max_write_delay    = 2000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 4;
        read               = "0011.1000--00xx.xxxx--0000.00aa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny26
#------------------------------------------------------------

part
    desc                   = "ATtiny26";
    id                     = "t26";
    prog_modes             = PM_ISP | PM_HVPP;
    mcuid                  = 17;
    n_interrupts           = 12;
    stk500_devcode         = 0x21;
    avr910_devcode         = 0x5e;
    chip_erase_delay       = 9000;
    pagel                  = 0xb3;
    bs2                    = 0xb2;
    signature              = 0x1e 0x91 0x09;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0xc4, 0xe4, 0xc4, 0xe4, 0xcc, 0xec, 0xcc, 0xec,
        0xd4, 0xf4, 0xd4, 0xf4, 0xdc, 0xfc, 0xdc, 0xfc,
        0xc8, 0xe8, 0xd8, 0xf8, 0x4c, 0x6c, 0x5c, 0x7c,
        0xec, 0xbc, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 2;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 128;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 4;
        delay              = 10;
        blocksize          = 64;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxx--xaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
    ;

    memory "flash"
        paged              = yes;
        size               = 2048;
        page_size          = 32;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 33;
        delay              = 6;
        blocksize          = 16;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.xxaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.xxaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxxx.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxxx.aaaa--iiii.iiii";
        writepage          = "0100.1100--xxxx.xxaa--aaaa.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--xxxi.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xxoo";
        write              = "1010.1100--1111.11ii--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--0000.00aa--oooo.oooo";
    ;

    memory "calibration"
        size               = 4;
        read               = "0011.1000--xxxx.xxxx--0000.00aa--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny261
#------------------------------------------------------------

part
    desc                   = "ATtiny261";
    id                     = "t261";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 30;
    n_interrupts           = 19;
    chip_erase_delay       = 4000;
    pagel                  = 0xb3;
    bs2                    = 0xb2;
#   stk500_devcode         = 0x21;
#   avr910_devcode         = 0x5e;
    signature              = 0x1e 0x91 0x0c;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0xc4, 0xe4, 0xc4, 0xe4, 0xcc, 0xec, 0xcc, 0xec,
        0xd4, 0xf4, 0xd4, 0xf4, 0xdc, 0xfc, 0xdc, 0xfc,
        0xc8, 0xe8, 0xd8, 0xf8, 0x4c, 0x6c, 0x5c, 0x7c,
        0xec, 0xbc, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb4, 0x00, 0x10;
    eeprom_instr           =
        0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xbc, 0x00, 0xb4, 0x00, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 2;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 128;
        page_size          = 4;
        num_pages          = 32;
        min_write_delay    = 4000;
        max_write_delay    = 4000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxx--xaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--xaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 2048;
        page_size          = 32;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 32;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.xxaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.xxaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxxx.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxxx.aaaa--iiii.iiii";
        writepage          = "0100.1100--xxxx.xxaa--aaaa.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xxoo";
        write              = "1010.1100--1111.11ii--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--0000.00aa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny261A
#------------------------------------------------------------

part parent "t261"
    desc                   = "ATtiny261A";
    id                     = "t261a";
    mcuid                  = 31;
;

#------------------------------------------------------------
# ATtiny461
#------------------------------------------------------------

part
    desc                   = "ATtiny461";
    id                     = "t461";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 33;
    n_interrupts           = 19;
    chip_erase_delay       = 4000;
    pagel                  = 0xb3;
    bs2                    = 0xb2;
#   stk500_devcode         = 0x21;
#   avr910_devcode         = 0x5e;
    signature              = 0x1e 0x92 0x08;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0xc4, 0xe4, 0xc4, 0xe4, 0xcc, 0xec, 0xcc, 0xec,
        0xd4, 0xf4, 0xd4, 0xf4, 0xdc, 0xfc, 0xdc, 0xfc,
        0xc8, 0xe8, 0xd8, 0xf8, 0x4c, 0x6c, 0x5c, 0x7c,
        0xec, 0xbc, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb4, 0x00, 0x10;
    eeprom_instr           =
        0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xbc, 0x00, 0xb4, 0x00, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 2;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 256;
        page_size          = 4;
        num_pages          = 64;
        min_write_delay    = 4000;
        max_write_delay    = 4000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxx--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxx--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 4096;
        page_size          = 64;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.xaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--xxxx.xaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xxoo";
        write              = "1010.1100--1111.11ii--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--0000.00aa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny461A
#------------------------------------------------------------

part parent "t461"
    desc                   = "ATtiny461A";
    id                     = "t461a";
    mcuid                  = 34;
;

#------------------------------------------------------------
# ATtiny861
#------------------------------------------------------------

part
    desc                   = "ATtiny861";
    id                     = "t861";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 38;
    n_interrupts           = 19;
    chip_erase_delay       = 4000;
    pagel                  = 0xb3;
    bs2                    = 0xb2;
#   stk500_devcode         = 0x21;
#   avr910_devcode         = 0x5e;
    signature              = 0x1e 0x93 0x0d;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0xc4, 0xe4, 0xc4, 0xe4, 0xcc, 0xec, 0xcc, 0xec,
        0xd4, 0xf4, 0xd4, 0xf4, 0xdc, 0xfc, 0xdc, 0xfc,
        0xc8, 0xe8, 0xd8, 0xf8, 0x4c, 0x6c, 0x5c, 0x7c,
        0xec, 0xbc, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb4, 0x00, 0x10;
    eeprom_instr           =
        0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xbc, 0x00, 0xb4, 0x00, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 2;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        num_pages          = 128;
        min_write_delay    = 4000;
        max_write_delay    = 4000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 64;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--xxxx.aaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--xxxx.xxxx--xxxx.xxxx--xxxx.xxoo";
        write              = "1010.1100--1111.11ii--xxxx.xxxx--xxxx.xxxx";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--0000.00aa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny861A
#------------------------------------------------------------

part parent "t861"
    desc                   = "ATtiny861A";
    id                     = "t861a";
    mcuid                  = 39;
;

#------------------------------------------------------------
# ATtiny28
#------------------------------------------------------------

# This is an HVPP-only device.

part
    desc                   = "ATtiny28";
    id                     = "t28";
    prog_modes             = PM_HVPP;
    mcuid                  = 18;
    n_interrupts           = 6;
    stk500_devcode         = 0x22;
    avr910_devcode         = 0x5c;
    signature              = 0x1e 0x91 0x07;
    serial                 = no;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;

    memory "flash"
        size               = 2048;
        page_size          = 2;
        delay              = 5;
        readsize           = 256;
    ;

    memory "fuse"
        size               = 1;
    ;

    memory "lock"
        size               = 1;
    ;

    memory "signature"
        size               = 3;
    ;

    memory "calibration"
        size               = 1;
    ;
;

#------------------------------------------------------------
# ATmega48
#------------------------------------------------------------

part
    desc                   = "ATmega48";
    id                     = "m48";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 67;
    n_interrupts           = 26;
    stk500_devcode         = 0x59;
    chip_erase_delay       = 45000;
    pagel                  = 0xd7;
    bs2                    = 0xc2;
#   avr910_devcode         = 0x??;
    signature              = 0x1e 0x92 0x05;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb6, 0x01, 0x11;
    eeprom_instr           =
        0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00,
        0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf,
        0x99, 0xf9, 0xbb, 0xaf;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 256;
        page_size          = 4;
        min_write_delay    = 3600;
        max_write_delay    = 3600;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxx--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxx--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 4096;
        page_size          = 64;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 6;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--0000.0aaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.0aaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.0aaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega48A
#------------------------------------------------------------

part parent "m48"
    desc                   = "ATmega48A";
    id                     = "m48a";
    mcuid                  = 68;
;

#------------------------------------------------------------
# ATmega48P
#------------------------------------------------------------

part parent "m48"
    desc                   = "ATmega48P";
    id                     = "m48p";
    mcuid                  = 69;
    signature              = 0x1e 0x92 0x0a;
;

#------------------------------------------------------------
# ATmega48PA
#------------------------------------------------------------

part parent "m48"
    desc                   = "ATmega48PA";
    id                     = "m48pa";
    mcuid                  = 70;
    signature              = 0x1e 0x92 0x0a;
;

#------------------------------------------------------------
# ATmega48PB
#------------------------------------------------------------

part parent "m48"
    desc                   = "ATmega48PB";
    id                     = "m48pb";
    mcuid                  = 71;
    n_interrupts           = 27;
    chip_erase_delay       = 10500;
    signature              = 0x1e 0x92 0x10;
;

#------------------------------------------------------------
# ATmega88
#------------------------------------------------------------

part
    desc                   = "ATmega88";
    id                     = "m88";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 79;
    n_interrupts           = 26;
    n_boot_sections        = 4;
    boot_section_size      = 256;
    stk500_devcode         = 0x73;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xc2;
#   avr910_devcode         = 0x??;
    signature              = 0x1e 0x93 0x0a;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb6, 0x01, 0x11;
    eeprom_instr           =
        0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00,
        0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf,
        0x99, 0xf9, 0xbb, 0xaf;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        min_write_delay    = 3600;
        max_write_delay    = 3600;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 64;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega88A
#------------------------------------------------------------

part parent "m88"
    desc                   = "ATmega88A";
    id                     = "m88a";
    mcuid                  = 80;
;

#------------------------------------------------------------
# ATmega88P
#------------------------------------------------------------

part parent "m88"
    desc                   = "ATmega88P";
    id                     = "m88p";
    mcuid                  = 81;
    signature              = 0x1e 0x93 0x0f;
;

#------------------------------------------------------------
# ATmega88PA
#------------------------------------------------------------

part parent "m88"
    desc                   = "ATmega88PA";
    id                     = "m88pa";
    mcuid                  = 82;
    signature              = 0x1e 0x93 0x0f;
;

#------------------------------------------------------------
# ATmega88PB
#------------------------------------------------------------

part parent "m88"
    desc                   = "ATmega88PB";
    id                     = "m88pb";
    mcuid                  = 83;
    n_interrupts           = 27;
    chip_erase_delay       = 10500;
    signature              = 0x1e 0x93 0x16;
;

#------------------------------------------------------------
# ATmega168
#------------------------------------------------------------

part
    desc                   = "ATmega168";
    id                     = "m168";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 99;
    n_interrupts           = 26;
    n_boot_sections        = 4;
    boot_section_size      = 256;
    stk500_devcode         = 0x86;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xc2;
#   avr910_devcode         = 0x??;
    signature              = 0x1e 0x94 0x06;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb6, 0x01, 0x11;
    eeprom_instr           =
        0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00,
        0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf,
        0x99, 0xf9, 0xbb, 0xaf;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        min_write_delay    = 3600;
        max_write_delay    = 3600;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x4000;
        page_size          = 128;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--000a.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--000a.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--000a.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega168A
#------------------------------------------------------------

part parent "m168"
    desc                   = "ATmega168A";
    id                     = "m168a";
    mcuid                  = 100;
;

#------------------------------------------------------------
# ATmega168P
#------------------------------------------------------------

part parent "m168"
    desc                   = "ATmega168P";
    id                     = "m168p";
    mcuid                  = 101;
    signature              = 0x1e 0x94 0x0b;
;

#------------------------------------------------------------
# ATmega168PA
#------------------------------------------------------------

part parent "m168"
    desc                   = "ATmega168PA";
    id                     = "m168pa";
    mcuid                  = 102;
    signature              = 0x1e 0x94 0x0b;
;

#------------------------------------------------------------
# ATmega168PB
#------------------------------------------------------------

part parent "m168"
    desc                   = "ATmega168PB";
    id                     = "m168pb";
    mcuid                  = 103;
    n_interrupts           = 27;
    chip_erase_delay       = 10500;
    signature              = 0x1e 0x94 0x15;
;

#------------------------------------------------------------
# ATtiny828
#------------------------------------------------------------

part
    desc                   = "ATtiny828";
    id                     = "t828";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 35;
    n_interrupts           = 26;
    n_boot_sections        = 4;
    boot_section_size      = 256;
    stk500_devcode         = 0x86;
    chip_erase_delay       = 15000;
    pagel                  = 0xd7;
    bs2                    = 0xc2;
#   avr910_devcode         = 0x??;
    signature              = 0x1e 0x93 0x14;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb6, 0x01, 0x11;
    eeprom_instr           =
        0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00,
        0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf,
        0x99, 0xf9, 0xbb, 0xaf;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 256;
        page_size          = 4;
        min_write_delay    = 3600;
        max_write_delay    = 3600;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 5;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 64;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--111i.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny828R
#------------------------------------------------------------

part parent "t828"
    desc                   = "ATtiny828R";
    id                     = "t828r";
    mcuid                  = 36;
;

#------------------------------------------------------------
# ATtiny87
#------------------------------------------------------------

part
    desc                   = "ATtiny87";
    id                     = "t87";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 27;
    n_interrupts           = 20;
#   no STK500 devcode in XML file, use the ATtiny45 one
    stk500_devcode         = 0x14;
#   Try the AT90S2313 devcode:
    avr910_devcode         = 0x20;
    chip_erase_delay       = 15000;
    signature              = 0x1e 0x93 0x87;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0e, 0x1e, 0x2e, 0x3e, 0x2e, 0x3e,
        0x4e, 0x5e, 0x4e, 0x5e, 0x6e, 0x7e, 0x6e, 0x7e,
        0x06, 0x16, 0x46, 0x56, 0x0a, 0x1a, 0x4a, 0x5a,
        0x1e, 0x7c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb6, 0x01, 0x11;
    eeprom_instr           =
        0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00,
        0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf,
        0x99, 0xf9, 0xbb, 0xaf;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 20;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        min_write_delay    = 4000;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--00xx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--00xx.xxxa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 128;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--000a.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--000a.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--0000.0000--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--xxxx.xxii";
    ;
#   ATtiny87 has Signature Bytes: 0x1E 0x93 0x87.
    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.000a--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny167
#------------------------------------------------------------

part
    desc                   = "ATtiny167";
    id                     = "t167";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 29;
    n_interrupts           = 20;
#   no STK500 devcode in XML file, use the ATtiny45 one
    stk500_devcode         = 0x14;
#   avr910_devcode         = 0x??;
#   Try the AT90S2313 devcode:
    avr910_devcode         = 0x20;
    chip_erase_delay       = 15000;
    signature              = 0x1e 0x94 0x87;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0e, 0x1e, 0x2e, 0x3e, 0x2e, 0x3e,
        0x4e, 0x5e, 0x4e, 0x5e, 0x6e, 0x7e, 0x6e, 0x7e,
        0x06, 0x16, 0x46, 0x56, 0x0a, 0x1a, 0x4a, 0x5a,
        0x1e, 0x7c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb6, 0x01, 0x11;
    eeprom_instr           =
        0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00,
        0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf,
        0x99, 0xf9, 0xbb, 0xaf;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 20;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        min_write_delay    = 4000;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--00xx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--00xx.xxxa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x4000;
        page_size          = 128;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--000a.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--000a.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--000a.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--0000.0000--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--xxxx.xxii";
    ;
#   ATtiny167 has Signature Bytes: 0x1E 0x94 0x87.
    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.000a--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny48
#------------------------------------------------------------

part
    desc                   = "ATtiny48";
    id                     = "t48";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 23;
    n_interrupts           = 20;
    stk500_devcode         = 0x73;
    chip_erase_delay       = 15000;
    pagel                  = 0xd7;
    bs2                    = 0xc2;
#   avr910_devcode         = 0x??;
    signature              = 0x1e 0x92 0x09;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb6, 0x01, 0x11;
    eeprom_instr           =
        0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00,
        0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf,
        0x99, 0xf9, 0xbb, 0xaf;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 64;
        page_size          = 4;
        min_write_delay    = 3600;
        max_write_delay    = 3600;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 64;
        read               = "1010.0000--000x.xxxx--xaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--xaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 4096;
        page_size          = 64;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--1111.111i";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny88
#------------------------------------------------------------

part
    desc                   = "ATtiny88";
    id                     = "t88";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 28;
    n_interrupts           = 20;
    stk500_devcode         = 0x73;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xc2;
#   avr910_devcode         = 0x??;
    signature              = 0x1e 0x93 0x11;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb6, 0x01, 0x11;
    eeprom_instr           =
        0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00,
        0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf,
        0x99, 0xf9, 0xbb, 0xaf;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 64;
        page_size          = 4;
        min_write_delay    = 3600;
        max_write_delay    = 3600;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 64;
        read               = "1010.0000--000x.xxxx--xaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--xaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 64;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega328
#------------------------------------------------------------

part
    desc                   = "ATmega328";
    id                     = "m328";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 118;
    n_interrupts           = 26;
    n_boot_sections        = 4;
    boot_section_size      = 512;
    stk500_devcode         = 0x86;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xc2;
#   avr910_devcode         = 0x??;
    signature              = 0x1e 0x95 0x14;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb6, 0x01, 0x11;
    eeprom_instr           =
        0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00,
        0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf,
        0x99, 0xf9, 0xbb, 0xaf;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 1024;
        page_size          = 4;
        min_write_delay    = 3600;
        max_write_delay    = 3600;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxaa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x8000;
        page_size          = 128;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--00aa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--00aa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega328P
#------------------------------------------------------------

part parent "m328"
    desc                   = "ATmega328P";
    id                     = "m328p";
    mcuid                  = 119;
    signature              = 0x1e 0x95 0x0f;
;

#------------------------------------------------------------
# ATmega328PB
#------------------------------------------------------------

part parent "m328"
    desc                   = "ATmega328PB";
    id                     = "m328pb";
    mcuid                  = 120;
    n_interrupts           = 45;
    chip_erase_delay       = 10500;
    signature              = 0x1e 0x95 0x16;

    memory "efuse"
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii";
    ;
;

#------------------------------------------------------------
# ATmega32m1
#------------------------------------------------------------

part parent "m328"
    desc                   = "ATmega32M1";
    id                     = "m32m1";
    mcuid                  = 63;
    n_interrupts           = 31;
    bs2                    = 0xe2;
#   stk500_devcode         = 0x??;
#   avr910_devcode         = 0x??;
    signature              = 0x1e 0x95 0x84;

    memory "efuse"
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxii.iiii";
    ;
;

#------------------------------------------------------------
# ATmega64m1
#------------------------------------------------------------

part parent "m328"
    desc                   = "ATmega64M1";
    id                     = "m64m1";
    mcuid                  = 76;
    n_interrupts           = 31;
    boot_section_size      = 1024;
    bs2                    = 0xe2;
#   stk500_devcode         = 0x??;
#   avr910_devcode         = 0x??;
    signature              = 0x1e 0x96 0x84;

    memory "eeprom"
        size               = 2048;
        page_size          = 8;
        read               = "1010.0000--000x.xaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--00xx.xaaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "efuse"
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxii.iiii";
    ;
;

#------------------------------------------------------------
# ATtiny2313
#------------------------------------------------------------

part
    desc                   = "ATtiny2313";
    id                     = "t2313";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 42;
    n_interrupts           = 19;
    stk500_devcode         = 0x23;
#   Use the ATtiny26 devcode:
    avr910_devcode         = 0x5e;
    chip_erase_delay       = 9000;
    pagel                  = 0xd4;
    bs2                    = 0xd6;
    signature              = 0x1e 0x91 0x0a;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0e, 0x1e, 0x2e, 0x3e, 0x2e, 0x3e,
        0x4e, 0x5e, 0x4e, 0x5e, 0x6e, 0x7e, 0x6e, 0x7e,
        0x26, 0x36, 0x66, 0x76, 0x2a, 0x3a, 0x6a, 0x7a,
        0x2e, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb2, 0x0f, 0x1f;
    eeprom_instr           =
        0xbb, 0xfe, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xba, 0x0f, 0xb2, 0x0f, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    ocdrev                 = 0;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 128;
        page_size          = 4;
        min_write_delay    = 4000;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxx--xaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--xaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 2048;
        page_size          = 32;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 32;
        readsize           = 256;
        read_lo            = "0010.0000--0000.00aa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.00aa--aaaa.aaaa--oooo.oooo";
# The information in the data sheet of April/2004 is wrong, this works:
        loadpage_lo        = "0100.0000--000x.xxxx--xxxx.aaaa--iiii.iiii";
# The information in the data sheet of April/2004 is wrong, this works:
        loadpage_hi        = "0100.1000--000x.xxxx--xxxx.aaaa--iiii.iiii";
# The information in the data sheet of April/2004 is wrong, this works:
        writepage          = "0100.1100--0000.00aa--aaaa.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;
#   ATtiny2313 has Signature Bytes: 0x1E 0x91 0x0A.
    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;
# The Tiny2313 has calibration data for both 4 MHz and 8 MHz.
# The information in the data sheet of April/2004 is wrong, this works:

    memory "calibration"
        size               = 2;
        read               = "0011.1000--000x.xxxx--0000.000a--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny2313A
#------------------------------------------------------------

part parent "t2313"
    desc                   = "ATtiny2313A";
    id                     = "t2313a";
    mcuid                  = 43;
    n_interrupts           = 21;
;

#------------------------------------------------------------
# ATtiny4313
#------------------------------------------------------------

part
    desc                   = "ATtiny4313";
    id                     = "t4313";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 44;
    n_interrupts           = 21;
    stk500_devcode         = 0x23;
#   Use the ATtiny26 devcode:
    avr910_devcode         = 0x5e;
    chip_erase_delay       = 9000;
    pagel                  = 0xd4;
    bs2                    = 0xd6;
    signature              = 0x1e 0x92 0x0d;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0e, 0x1e, 0x2e, 0x3e, 0x2e, 0x3e,
        0x4e, 0x5e, 0x4e, 0x5e, 0x6e, 0x7e, 0x6e, 0x7e,
        0x26, 0x36, 0x66, 0x76, 0x2a, 0x3a, 0x6a, 0x7a,
        0x2e, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb2, 0x0f, 0x1f;
    eeprom_instr           =
        0xbb, 0xfe, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xba, 0x0f, 0xb2, 0x0f, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    ocdrev                 = 0;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 256;
        page_size          = 4;
        min_write_delay    = 4000;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxx--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxx--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 4096;
        page_size          = 64;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 32;
        readsize           = 256;
        read_lo            = "0010.0000--0000.0aaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.0aaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.0aaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;
#   ATtiny4313 has Signature Bytes: 0x1E 0x92 0x0D.
    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 2;
        read               = "0011.1000--000x.xxxx--0000.000a--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90PWM2
#------------------------------------------------------------

part
    desc                   = "AT90PWM2";
    id                     = "pwm2";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 167;
    n_interrupts           = 32;
    n_boot_sections        = 4;
    boot_section_size      = 256;
    stk500_devcode         = 0x65;
    chip_erase_delay       = 9000;
    pagel                  = 0xd8;
    bs2                    = 0xe2;
#   avr910_devcode         = ?;
    signature              = 0x1e 0x93 0x81;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb6, 0x01, 0x11;
    eeprom_instr           =
        0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00,
        0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf,
        0x99, 0xf9, 0xbb, 0xaf;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        min_write_delay    = 4000;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 64;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;
#   AT90PWM2 has Signature Bytes: 0x1E 0x93 0x81.
    memory "signature"
        size               = 3;
        read               = "0011.0000--00xx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90PWM3
#------------------------------------------------------------

# Completely identical to AT90PWM2 (including the signature!)

part parent "pwm2"
    desc                   = "AT90PWM3";
    id                     = "pwm3";
    mcuid                  = 169;
;

#------------------------------------------------------------
# AT90PWM2B
#------------------------------------------------------------
# Same as AT90PWM2 but different signature.

part parent "pwm2"
    desc                   = "AT90PWM2B";
    id                     = "pwm2b";
    mcuid                  = 168;
    signature              = 0x1e 0x93 0x83;
    ocdrev                 = 1;
;

#------------------------------------------------------------
# AT90PWM3B
#------------------------------------------------------------

# Completely identical to AT90PWM2B (including the signature!)

part parent "pwm2b"
    desc                   = "AT90PWM3B";
    id                     = "pwm3b";
    mcuid                  = 170;
;

#------------------------------------------------------------
# AT90PWM316
#------------------------------------------------------------

# Similar to AT90PWM3B, but with 16 kiB flash, 512 B EEPROM, and 1024 B SRAM.

part parent "pwm3b"
    desc                   = "AT90PWM316";
    id                     = "pwm316";
    mcuid                  = 180;
    boot_section_size      = 512;
    signature              = 0x1e 0x94 0x83;

    memory "flash"
        size               = 0x4000;
        page_size          = 128;
        mode               = 33;
        blocksize          = 128;
        read_lo            = "0010.0000--00aa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--00xx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--00xx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--00aa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;
;

#------------------------------------------------------------
# AT90PWM216
#------------------------------------------------------------
# Completely identical to AT90PWM316 (including the signature!)

part parent "pwm316"
    desc                   = "AT90PWM216";
    id                     = "pwm216";
    mcuid                  = 179;
;

#------------------------------------------------------------
# ATtiny25
#------------------------------------------------------------

part
    desc                   = "ATtiny25";
    id                     = "t25";
    prog_modes             = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE;
    mcuid                  = 16;
    n_interrupts           = 15;
#  no STK500 devcode in XML file, use the ATtiny45 one
    stk500_devcode         = 0x14;
#   avr910_devcode         = ?;
#   Try the AT90S2313 devcode:
    avr910_devcode         = 0x20;
    chip_erase_delay       = 4500;
    signature              = 0x1e 0x91 0x08;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    hvsp_controlstack      =
        0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66,
        0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78,
        0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10,
        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
    flash_instr            =  0xb4, 0x02, 0x12;
    eeprom_instr           =
        0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xbc, 0x02, 0xb4, 0x02, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 1;
    togglevtg              = 1;
    poweroffdelay          = 25;
    resetdelayms           = 1;
    hvleavestabdelay       = 100;
    resetdelay             = 25;
    chiperasepolltimeout   = 40;
    programfusepolltimeout = 25;
    programlockpolltimeout = 25;
    synchcycles            = 6;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 128;
        page_size          = 4;
        min_write_delay    = 4000;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxx--xaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--xaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 2048;
        page_size          = 32;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 32;
        readsize           = 256;
        read_lo            = "0010.0000--0000.00aa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.00aa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxx.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxx.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.00aa--aaaa.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--0000.0000--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;
#   ATtiny25 has Signature Bytes: 0x1E 0x91 0x08.
    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.000a--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny45
#------------------------------------------------------------

part
    desc                   = "ATtiny45";
    id                     = "t45";
    prog_modes             = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE;
    mcuid                  = 22;
    n_interrupts           = 15;
    stk500_devcode         = 0x14;
#   avr910_devcode         = ?;
#   Try the AT90S2313 devcode:
    avr910_devcode         = 0x20;
    chip_erase_delay       = 4500;
    signature              = 0x1e 0x92 0x06;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    hvsp_controlstack      =
        0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66,
        0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78,
        0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10,
        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
    flash_instr            =  0xb4, 0x02, 0x12;
    eeprom_instr           =
        0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xbc, 0x02, 0xb4, 0x02, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 1;
    togglevtg              = 1;
    poweroffdelay          = 25;
    resetdelayms           = 1;
    hvleavestabdelay       = 100;
    resetdelay             = 25;
    chiperasepolltimeout   = 40;
    programfusepolltimeout = 25;
    programlockpolltimeout = 25;
    synchcycles            = 6;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 256;
        page_size          = 4;
        min_write_delay    = 4000;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxx--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxx--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 4096;
        page_size          = 64;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 32;
        readsize           = 256;
        read_lo            = "0010.0000--0000.0aaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.0aaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.0aaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--0000.0000--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;
#   ATtiny45 has Signature Bytes: 0x1E 0x92 0x08. (Data sheet 2586C-AVR-06/05 (doc2586.pdf) indicates otherwise!)
    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.000a--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny85
#------------------------------------------------------------

part
    desc                   = "ATtiny85";
    id                     = "t85";
    prog_modes             = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE;
    mcuid                  = 26;
    n_interrupts           = 15;
#   no STK500 devcode in XML file, use the ATtiny45 one
    stk500_devcode         = 0x14;
#   avr910_devcode         = ?;
#   Try the AT90S2313 devcode:
    avr910_devcode         = 0x20;
    chip_erase_delay       = 4500;
    signature              = 0x1e 0x93 0x0b;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    hvsp_controlstack      =
        0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66,
        0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78,
        0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10,
        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00;
    flash_instr            =  0xb4, 0x02, 0x12;
    eeprom_instr           =
        0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xbc, 0x02, 0xb4, 0x02, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 1;
    togglevtg              = 1;
    poweroffdelay          = 25;
    resetdelayms           = 1;
    hvleavestabdelay       = 100;
    resetdelay             = 25;
    chiperasepolltimeout   = 40;
    programfusepolltimeout = 25;
    programlockpolltimeout = 25;
    synchcycles            = 6;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        min_write_delay    = 4000;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 64;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 32;
        readsize           = 256;
        read_lo            = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--0000.0000--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;
#   ATtiny85 has Signature Bytes: 0x1E 0x93 0x08.
    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.000a--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega640
#------------------------------------------------------------
# Almost same as ATmega1280, except for different memory sizes

part
    desc                   = "ATmega640";
    id                     = "m640";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 126;
    n_interrupts           = 57;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
#   stk500_devcode         = 0xB2;
#   avr910_devcode         = 0x43;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x96 0x08;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    rampz                  = 0x3b;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 4096;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        mode               = 65;
        delay              = 10;
        blocksize          = 8;
        readsize           = 256;
        read               = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x10000;
        page_size          = 256;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 10;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0aaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega1280
#------------------------------------------------------------

part
    desc                   = "ATmega1280";
    id                     = "m1280";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 138;
    n_interrupts           = 57;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
#   stk500_devcode         = 0xB2;
#   avr910_devcode         = 0x43;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x97 0x03;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    rampz                  = 0x3b;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 4096;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        mode               = 65;
        delay              = 10;
        blocksize          = 8;
        readsize           = 256;
        read               = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x20000;
        page_size          = 256;
        num_pages          = 512;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 10;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega1281
#------------------------------------------------------------
# Identical to ATmega1280

part parent "m1280"
    desc                   = "ATmega1281";
    id                     = "m1281";
    mcuid                  = 139;
    signature              = 0x1e 0x97 0x04;
;

#------------------------------------------------------------
# ATmega2560
#------------------------------------------------------------

part
    desc                   = "ATmega2560";
    id                     = "m2560";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 143;
    n_interrupts           = 57;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
    stk500_devcode         = 0xb2;
#   avr910_devcode         = 0x43;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x98 0x01;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    rampz                  = 0x3b;
    spmcr                  = 0x57;
    ocdrev                 = 4;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 4096;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        mode               = 65;
        delay              = 10;
        blocksize          = 8;
        readsize           = 256;
        read               = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x40000;
        page_size          = 256;
        num_pages          = 1024;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 10;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        load_ext_addr      = "0100.1101--0000.0000--0000.000a--0000.0000";
        writepage          = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega2561
#------------------------------------------------------------

part parent "m2560"
    desc                   = "ATmega2561";
    id                     = "m2561";
    mcuid                  = 144;
    signature              = 0x1e 0x98 0x02;
;

#------------------------------------------------------------
# ATmega128RFA1
#------------------------------------------------------------
# Identical to ATmega2561 but half the ROM

part parent "m2561"
    desc                   = "ATmega128RFA1";
    id                     = "m128rfa1";
    mcuid                  = 87;
    n_interrupts           = 72;
    chip_erase_delay       = 55000;
    bs2                    = 0xe2;
    signature              = 0x1e 0xa7 0x01;
    ocdrev                 = 3;

    memory "flash"
        size               = 0x20000;
        num_pages          = 512;
        min_write_delay    = 50000;
        max_write_delay    = 50000;
        delay              = 20;
        load_ext_addr      = NULL;
    ;
;

#------------------------------------------------------------
# ATmega256RFR2
#------------------------------------------------------------

part parent "m2561"
    desc                   = "ATmega256RFR2";
    id                     = "m256rfr2";
    mcuid                  = 108;
    n_interrupts           = 77;
    chip_erase_delay       = 18500;
    bs2                    = 0xe2;
    signature              = 0x1e 0xa8 0x02;

    memory "eeprom"
        size               = 8192;
        min_write_delay    = 13000;
        max_write_delay    = 13000;
        read               = "1010.0000--xxxa.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxa.aaaa--aaaa.aaaa--iiii.iiii";
        writepage          = "1100.0010--00xa.aaaa--aaaa.a000--xxxx.xxxx";
    ;
;

#------------------------------------------------------------
# ATmega128RFR2
#------------------------------------------------------------

part parent "m128rfa1"
    desc                   = "ATmega128RFR2";
    id                     = "m128rfr2";
    mcuid                  = 88;
    n_interrupts           = 77;
    signature              = 0x1e 0xa7 0x02;
;

#------------------------------------------------------------
# ATmega64RFR2
#------------------------------------------------------------

part parent "m128rfa1"
    desc                   = "ATmega64RFR2";
    id                     = "m64rfr2";
    mcuid                  = 78;
    n_interrupts           = 77;
    signature              = 0x1e 0xa6 0x02;

    memory "eeprom"
        size               = 2048;
        min_write_delay    = 13000;
        max_write_delay    = 13000;
        read               = "1010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xaaa--aaaa.aaaa--iiii.iiii";
        writepage          = "1100.0010--00xx.xaaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        size               = 0x10000;
        num_pages          = 256;
        read_lo            = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        writepage          = "0100.1100--0aaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;
;

#------------------------------------------------------------
# ATmega2564RFR2
#------------------------------------------------------------

part parent "m256rfr2"
    desc                   = "ATmega2564RFR2";
    id                     = "m2564rfr2";
    mcuid                  = 145;
    signature              = 0x1e 0xa8 0x03;
;

#------------------------------------------------------------
# ATmega1284RFR2
#------------------------------------------------------------

part parent "m128rfr2"
    desc                   = "ATmega1284RFR2";
    id                     = "m1284rfr2";
    mcuid                  = 142;
    signature              = 0x1e 0xa7 0x03;
;

#------------------------------------------------------------
# ATmega644RFR2
#------------------------------------------------------------

part parent "m64rfr2"
    desc                   = "ATmega644RFR2";
    id                     = "m644rfr2";
    mcuid                  = 131;
    signature              = 0x1e 0xa6 0x03;
;

#------------------------------------------------------------
# ATtiny24
#------------------------------------------------------------

part
    desc                   = "ATtiny24";
    id                     = "t24";
    prog_modes             = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE;
    mcuid                  = 14;
    n_interrupts           = 17;
#   no STK500 devcode in XML file, use the ATtiny45 one
    stk500_devcode         = 0x14;
#   avr910_devcode         = ?;
#   Try the AT90S2313 devcode:
    avr910_devcode         = 0x20;
    chip_erase_delay       = 4500;
    signature              = 0x1e 0x91 0x0b;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    hvsp_controlstack      =
        0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66,
        0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78,
        0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10,
        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0f;
    flash_instr            =  0xb4, 0x07, 0x17;
    eeprom_instr           =
        0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xbc, 0x07, 0xb4, 0x07, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 1;
    togglevtg              = 1;
    poweroffdelay          = 25;
    resetdelayus           = 70;
    hvleavestabdelay       = 100;
    resetdelay             = 25;
    chiperasepolltimeout   = 40;
    programfusepolltimeout = 25;
    programlockpolltimeout = 25;
    synchcycles            = 6;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 128;
        page_size          = 4;
        min_write_delay    = 4000;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxx--xaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--xaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 2048;
        page_size          = 32;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 32;
        readsize           = 256;
        read_lo            = "0010.0000--0000.00aa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.00aa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxx.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxx.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.00aa--aaaa.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--0000.0000--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--xxxx.xxii";
    ;
#   ATtiny24 has Signature Bytes: 0x1E 0x91 0x0B.
    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.000a--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny24A
#------------------------------------------------------------

part parent "t24"
    desc                   = "ATtiny24A";
    id                     = "t24a";
    mcuid                  = 15;
;

#------------------------------------------------------------
# ATtiny44
#------------------------------------------------------------

part
    desc                   = "ATtiny44";
    id                     = "t44";
    prog_modes             = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE;
    mcuid                  = 20;
    n_interrupts           = 17;
#   no STK500 devcode in XML file, use the ATtiny45 one
    stk500_devcode         = 0x14;
#   avr910_devcode         = ?;
#   Try the AT90S2313 devcode:
    avr910_devcode         = 0x20;
    chip_erase_delay       = 4500;
    signature              = 0x1e 0x92 0x07;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    hvsp_controlstack      =
        0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66,
        0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78,
        0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10,
        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0f;
    flash_instr            =  0xb4, 0x07, 0x17;
    eeprom_instr           =
        0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xbc, 0x07, 0xb4, 0x07, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 1;
    togglevtg              = 1;
    poweroffdelay          = 25;
    resetdelayus           = 70;
    hvleavestabdelay       = 100;
    resetdelay             = 25;
    chiperasepolltimeout   = 40;
    programfusepolltimeout = 25;
    programlockpolltimeout = 25;
    synchcycles            = 6;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 256;
        page_size          = 4;
        min_write_delay    = 4000;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxx--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxx--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 4096;
        page_size          = 64;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 32;
        readsize           = 256;
        read_lo            = "0010.0000--0000.0aaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.0aaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.0aaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--0000.0000--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--xxxx.xxii";
    ;
#   ATtiny44 has Signature Bytes: 0x1E 0x92 0x07.
    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.000a--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny44A
#------------------------------------------------------------

part parent "t44"
    desc                   = "ATtiny44A";
    id                     = "t44a";
    mcuid                  = 21;
;

#------------------------------------------------------------
# ATtiny84
#------------------------------------------------------------

part
    desc                   = "ATtiny84";
    id                     = "t84";
    prog_modes             = PM_SPM | PM_ISP | PM_HVSP | PM_debugWIRE;
    mcuid                  = 24;
    n_interrupts           = 17;
#   no STK500 devcode in XML file, use the ATtiny45 one
    stk500_devcode         = 0x14;
#   avr910_devcode         = ?;
#   Try the AT90S2313 devcode:
    avr910_devcode         = 0x20;
    chip_erase_delay       = 4500;
    signature              = 0x1e 0x93 0x0c;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    hvsp_controlstack      =
        0x4c, 0x0c, 0x1c, 0x2c, 0x3c, 0x64, 0x74, 0x66,
        0x68, 0x78, 0x68, 0x68, 0x7a, 0x6a, 0x68, 0x78,
        0x78, 0x7d, 0x6d, 0x0c, 0x80, 0x40, 0x20, 0x10,
        0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0f;
    flash_instr            =  0xb4, 0x07, 0x17;
    eeprom_instr           =
        0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xbc, 0x07, 0xb4, 0x07, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 1;
    togglevtg              = 1;
    poweroffdelay          = 25;
    resetdelayus           = 70;
    hvleavestabdelay       = 100;
    resetdelay             = 25;
    chiperasepolltimeout   = 40;
    programfusepolltimeout = 25;
    programlockpolltimeout = 25;
    synchcycles            = 6;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        min_write_delay    = 4000;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 64;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 32;
        readsize           = 256;
        read_lo            = "0010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.aaaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--0000.0000--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--xxxx.xxii";
    ;
#   ATtiny84 has Signature Bytes: 0x1E 0x93 0x0C.
    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.000a--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny84A
#------------------------------------------------------------

part parent "t84"
    desc                   = "ATtiny84A";
    id                     = "t84a";
    mcuid                  = 25;
;

#------------------------------------------------------------
# ATtiny441
#------------------------------------------------------------

part parent "t44"
    desc                   = "ATtiny441";
    id                     = "t441";
    mcuid                  = 32;
    n_interrupts           = 30;
    n_page_erase           = 4;
    signature              = 0x1e 0x92 0x15;

    memory "flash"
        page_size          = 16;
        num_pages          = 256;
        blocksize          = 16;
        loadpage_lo        = "0100.0000--000x.xxxx--xxxx.xaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxx.xaaa--iiii.iiii";
        writepage          = "0100.1100--0000.0aaa--aaaa.axxx--xxxx.xxxx";
    ;

    memory "efuse"
        write              = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii";
    ;
;

#------------------------------------------------------------
# ATtiny841
#------------------------------------------------------------

part parent "t84"
    desc                   = "ATtiny841";
    id                     = "t841";
    mcuid                  = 37;
    n_interrupts           = 30;
    n_page_erase           = 4;
    signature              = 0x1e 0x93 0x15;

    memory "flash"
        page_size          = 16;
        num_pages          = 512;
        blocksize          = 16;
        loadpage_lo        = "0100.0000--000x.xxxx--xxxx.xaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxx.xaaa--iiii.iiii";
        writepage          = "0100.1100--0000.aaaa--aaaa.axxx--xxxx.xxxx";
    ;

    memory "efuse"
        write              = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii";
    ;
;

#------------------------------------------------------------
# ATtiny43U
#------------------------------------------------------------

part
    desc                   = "ATtiny43U";
    id                     = "t43u";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 19;
    n_interrupts           = 16;
    stk500_devcode         = 0x14;
#   avr910_devcode         = ?;
#   Try the AT90S2313 devcode:
    avr910_devcode         = 0x20;
    chip_erase_delay       = 1000;
    signature              = 0x1e 0x92 0x0c;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0e, 0x1e, 0x2e, 0x3e, 0x2e, 0x3e,
        0x4e, 0x5e, 0x4e, 0x5e, 0x6e, 0x7e, 0x6e, 0x7e,
        0x06, 0x16, 0x46, 0x56, 0x0a, 0x1a, 0x4a, 0x5a,
        0x1e, 0x7c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb4, 0x07, 0x17;
    eeprom_instr           =
        0xbb, 0xff, 0xbb, 0xee, 0xbb, 0xcc, 0xb2, 0x0d,
        0xbc, 0x07, 0xb4, 0x07, 0xba, 0x0d, 0xbb, 0xbc,
        0x99, 0xe1, 0xbb, 0xac;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 20;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        paged              = yes;
        size               = 64;
        page_size          = 4;
        num_pages          = 16;
        min_write_delay    = 4000;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 5;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxx--00aa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxx--00aa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxx--00aa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 4096;
        page_size          = 64;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 64;
        readsize           = 256;
        read_lo            = "0010.0000--0000.0aaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0000.0aaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0000.0aaa--aaax.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.xxxi";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.000a--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega16u4
#------------------------------------------------------------

part
    desc                   = "ATmega16U4";
    id                     = "m16u4";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 57;
    n_interrupts           = 43;
    n_boot_sections        = 4;
    boot_section_size      = 512;
#   stk500_devcode         = 0xB2;
#   avr910_devcode         = 0x43;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x94 0x88;
    usbpid                 = 0x2ff4;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    rampz                  = 0x3b;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--xxxx.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xxxa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x4000;
        page_size          = 128;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--1111.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--00oo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega32u4
#------------------------------------------------------------

part
    desc                   = "ATmega32U4";
    id                     = "m32u4";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 65;
    n_interrupts           = 43;
    n_boot_sections        = 4;
    boot_section_size      = 512;
#   stk500_devcode         = 0xB2;
#   avr910_devcode         = 0x43;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x95 0x87;
    usbpid                 = 0x2ff4;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    rampz                  = 0x3b;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 1024;
        page_size          = 4;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xaaa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x8000;
        page_size          = 128;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--1111.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90USB646
#------------------------------------------------------------

part
    desc                   = "AT90USB646";
    id                     = "usb646";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 181;
    n_interrupts           = 38;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
#   stk500_devcode         = 0xB2;
#   avr910_devcode         = 0x43;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x96 0x82;
    usbpid                 = 0x2ff9;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    rampz                  = 0x3b;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 2048;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        mode               = 65;
        delay              = 10;
        blocksize          = 8;
        readsize           = 256;
        read               = "1010.0000--xxxx.xaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.xaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--00xx.xaaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x10000;
        page_size          = 256;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 6;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0aaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90USB647
#------------------------------------------------------------
# identical to AT90USB646

part parent "usb646"
    desc                   = "AT90USB647";
    id                     = "usb647";
    mcuid                  = 182;
;

#------------------------------------------------------------
# AT90USB1286
#------------------------------------------------------------

part
    desc                   = "AT90USB1286";
    id                     = "usb1286";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 184;
    n_interrupts           = 38;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
#   stk500_devcode         = 0xB2;
#   avr910_devcode         = 0x43;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x97 0x82;
    usbpid                 = 0x2ffb;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    rampz                  = 0x3b;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--1000.0000--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 4096;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        mode               = 65;
        delay              = 10;
        blocksize          = 8;
        readsize           = 256;
        read               = "1010.0000--xxxx.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--xxxx.aaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--00xx.aaaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x20000;
        page_size          = 256;
        num_pages          = 512;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 6;
        blocksize          = 256;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--axxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90USB1287
#------------------------------------------------------------
# identical to AT90USB1286

part parent "usb1286"
    desc                   = "AT90USB1287";
    id                     = "usb1287";
    mcuid                  = 185;
;

#------------------------------------------------------------
# AT90USB162
#------------------------------------------------------------

part
    desc                   = "AT90USB162";
    id                     = "usb162";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 178;
    n_interrupts           = 29;
    n_boot_sections        = 4;
    boot_section_size      = 512;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xc6;
    signature              = 0x1e 0x94 0x82;
    usbpid                 = 0x2ffa;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    eind                   = 0x5c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        num_pages          = 128;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--0000.aaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--0000.aaaa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x4000;
        page_size          = 128;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# AT90USB82
#------------------------------------------------------------

part
    desc                   = "AT90USB82";
    id                     = "usb82";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 174;
    n_interrupts           = 29;
    n_boot_sections        = 4;
    boot_section_size      = 512;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xc6;
    signature              = 0x1e 0x93 0x82;
    usbpid                 = 0x2ff7;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    eind                   = 0x5c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        num_pages          = 128;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--0000.aaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--0000.aaaa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 128;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega32U2
#------------------------------------------------------------

part
    desc                   = "ATmega32U2";
    id                     = "m32u2";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 64;
    n_interrupts           = 29;
    n_boot_sections        = 4;
    boot_section_size      = 512;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xc6;
    signature              = 0x1e 0x95 0x8a;
    usbpid                 = 0x2ff0;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    eind                   = 0x5c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 1024;
        page_size          = 4;
        num_pages          = 256;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--0000.aaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--0000.aaaa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x8000;
        page_size          = 128;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega16U2
#------------------------------------------------------------

part
    desc                   = "ATmega16U2";
    id                     = "m16u2";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 56;
    n_interrupts           = 29;
    n_boot_sections        = 4;
    boot_section_size      = 512;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xc6;
    signature              = 0x1e 0x94 0x89;
    usbpid                 = 0x2fef;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    eind                   = 0x5c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        num_pages          = 128;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--0000.aaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--0000.aaaa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x4000;
        page_size          = 128;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega8U2
#------------------------------------------------------------

part
    desc                   = "ATmega8U2";
    id                     = "m8u2";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 48;
    n_interrupts           = 29;
    n_boot_sections        = 4;
    boot_section_size      = 512;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xc6;
    signature              = 0x1e 0x93 0x89;
    usbpid                 = 0x2fee;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    eind                   = 0x5c;
    ocdrev                 = 1;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        num_pages          = 128;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--0000.aaaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--0000.aaaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--0000.aaaa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 8192;
        page_size          = 128;
        num_pages          = 64;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--xxxx.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega165
#------------------------------------------------------------

part
    desc                   = "ATmega165";
    id                     = "m165";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 95;
    n_interrupts           = 22;
    n_boot_sections        = 4;
    boot_section_size      = 256;
#   stk500_devcode         = 0x??;
#   avr910_devcode         = 0x??;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x94 0x10;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 6;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    spmcr                  = 0x57;
    eecr                   = 0x3f;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        num_pages          = 128;
        min_write_delay    = 3600;
        max_write_delay    = 3600;
        mode               = 65;
        delay              = 20;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--0000.00xa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--0000.00xa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--0000.00xa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x4000;
        page_size          = 128;
        num_pages          = 128;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        mode               = 65;
        delay              = 10;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--xxxa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--xxxa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--0000.xxxx--xxaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--0000.xxxx--xxaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--xxxa.aaaa--aaxx.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxx.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--0000.0000--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--0000.0000--xxxx.xxxx--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega165A
#------------------------------------------------------------

part parent "m165"
    desc                   = "ATmega165A";
    id                     = "m165a";
    mcuid                  = 96;
;

#------------------------------------------------------------
# ATmega165P
#------------------------------------------------------------

part parent "m165"
    desc                   = "ATmega165P";
    id                     = "m165p";
    mcuid                  = 97;
    signature              = 0x1e 0x94 0x07;
;

#------------------------------------------------------------
# ATmega165PA
#------------------------------------------------------------

part parent "m165"
    desc                   = "ATmega165PA";
    id                     = "m165pa";
    mcuid                  = 98;
    signature              = 0x1e 0x94 0x07;
;

#------------------------------------------------------------
# ATmega325
#------------------------------------------------------------

part
    desc                   = "ATmega325";
    id                     = "m325";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 114;
    n_interrupts           = 22;
    n_boot_sections        = 4;
    boot_section_size      = 512;
#   stk500_devcode         = 0x??; # No STK500v1 support?
#   avr910_devcode         = 0x??; # Try the ATmega16 one
    avr910_devcode         = 0x74;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x95 0x05;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--1000.0000--0000.0000--0000.0000";
    pgm_enable             = "1010.1100--0101.0011--0000.0000--0000.0000";

    memory "eeprom"
        size               = 1024;
        page_size          = 4;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--0000.00aa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--0000.00aa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--0000.00aa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x8000;
        page_size          = 128;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--0000.0000--aaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--0000.0000--aaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--0aaa.aaaa--aaaa.aaaa--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--0000.0000--oooo.oooo";
        write              = "1010.1100--1010.0000--0000.0000--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--0000.0000--oooo.oooo";
        write              = "1010.1100--1010.1000--0000.0000--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--0000.0000--oooo.oooo";
        write              = "1010.1100--1010.0100--0000.0000--1111.1iii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1110.0000--0000.0000--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--0000.0000--0000.00aa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--0000.0000--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega325A
#------------------------------------------------------------

part parent "m325"
    desc                   = "ATmega325A";
    id                     = "m325a";
    mcuid                  = 115;
;

#------------------------------------------------------------
# ATmega325P
#------------------------------------------------------------

part parent "m325"
    desc                   = "ATmega325P";
    id                     = "m325p";
    mcuid                  = 116;
    signature              = 0x1e 0x95 0x0d;
;

#------------------------------------------------------------
# ATmega325PA
#------------------------------------------------------------

part parent "m325"
    desc                   = "ATmega325PA";
    id                     = "m325pa";
    mcuid                  = 117;
    signature              = 0x1e 0x95 0x0d;
;

#------------------------------------------------------------
# ATmega645
#------------------------------------------------------------

part
    desc                   = "ATmega645";
    id                     = "m645";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_JTAG;
    mcuid                  = 132;
    n_interrupts           = 22;
    n_boot_sections        = 4;
    boot_section_size      = 1024;
#   stk500_devcode         = 0x??; # No STK500v1 support?
#   avr910_devcode         = 0x??; # Try the ATmega16 one
    avr910_devcode         = 0x74;
    chip_erase_delay       = 9000;
    pagel                  = 0xd7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x96 0x05;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay       = 100;
    latchcycles            = 5;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    idr                    = 0x31;
    spmcr                  = 0x57;
    ocdrev                 = 3;
    chip_erase             = "1010.1100--1000.0000--0000.0000--0000.0000";
    pgm_enable             = "1010.1100--0101.0011--0000.0000--0000.0000";

    memory "eeprom"
        size               = 2048;
        page_size          = 8;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 8;
        readsize           = 256;
        read               = "1010.0000--0000.0aaa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--0000.0aaa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.0aaa--iiii.iiii";
        writepage          = "1100.0010--0000.0aaa--aaaa.a000--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x10000;
        page_size          = 256;
        num_pages          = 256;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 10;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--aaaa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--0000.0000--aaaa.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--0000.0000--aaaa.aaaa--iiii.iiii";
        writepage          = "0100.1100--aaaa.aaaa--aaaa.aaaa--0000.0000";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.0000--0000.0000--oooo.oooo";
        write              = "1010.1100--1010.0000--0000.0000--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.1000--0000.0000--oooo.oooo";
        write              = "1010.1100--1010.1000--0000.0000--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.0000--0000.1000--0000.0000--oooo.oooo";
        write              = "1010.1100--1010.0100--0000.0000--1111.1iii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 9000;
        max_write_delay    = 9000;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1110.0000--0000.0000--11ii.iiii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--0000.0000--0000.00aa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--0000.0000--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATmega645A
#------------------------------------------------------------

part parent "m645"
    desc                   = "ATmega645A";
    id                     = "m645a";
    mcuid                  = 133;
;

#------------------------------------------------------------
# ATmega645P
#------------------------------------------------------------

part parent "m645"
    desc                   = "ATmega645P";
    id                     = "m645p";
    mcuid                  = 134;
    signature              = 0x1e 0x96 0x0d;
;

#------------------------------------------------------------
# ATmega3250
#------------------------------------------------------------

part parent "m325"
    desc                   = "ATmega3250";
    id                     = "m3250";
    mcuid                  = 146;
    n_interrupts           = 25;
    signature              = 0x1e 0x95 0x06;
;

#------------------------------------------------------------
# ATmega3250A
#------------------------------------------------------------

part parent "m325"
    desc                   = "ATmega3250A";
    id                     = "m3250a";
    mcuid                  = 147;
    n_interrupts           = 25;
    signature              = 0x1e 0x95 0x06;
;

#------------------------------------------------------------
# ATmega3250P
#------------------------------------------------------------

part parent "m325"
    desc                   = "ATmega3250P";
    id                     = "m3250p";
    mcuid                  = 148;
    n_interrupts           = 25;
    signature              = 0x1e 0x95 0x0e;
;

#------------------------------------------------------------
# ATmega3250PA
#------------------------------------------------------------

part parent "m325"
    desc                   = "ATmega3250PA";
    id                     = "m3250pa";
    mcuid                  = 149;
    n_interrupts           = 25;
    signature              = 0x1e 0x95 0x0e;
;

#------------------------------------------------------------
# ATmega6450
#------------------------------------------------------------

part parent "m645"
    desc                   = "ATmega6450";
    id                     = "m6450";
    mcuid                  = 154;
    n_interrupts           = 25;
    signature              = 0x1e 0x96 0x06;
;

#------------------------------------------------------------
# ATmega6450A
#------------------------------------------------------------

part parent "m645"
    desc                   = "ATmega6450A";
    id                     = "m6450a";
    mcuid                  = 155;
    n_interrupts           = 25;
    signature              = 0x1e 0x96 0x06;
;

#------------------------------------------------------------
# ATmega6450P
#------------------------------------------------------------

part parent "m645"
    desc                   = "ATmega6450P";
    id                     = "m6450p";
    mcuid                  = 156;
    n_interrupts           = 25;
    signature              = 0x1e 0x96 0x0e;
;

#------------------------------------------------------------
# AVR XMEGA family common values
#------------------------------------------------------------

part
    desc                   = "AVR XMEGA family common values";
    id                     = ".xmega";
    prog_modes             = PM_SPM | PM_PDI;
    n_boot_sections        = 1;
    mcu_base               = 0x0090;
    nvm_base               = 0x01c0;
    autobaud_sync          = 0x20;

    memory "fuse1"
        size               = 1;
        offset             = 0x8f0021;
    ;

    memory "fuse2"
        size               = 1;
        offset             = 0x8f0022;
    ;

    memory "fuse4"
        size               = 1;
        offset             = 0x8f0024;
    ;

    memory "fuse5"
        size               = 1;
        offset             = 0x8f0025;
    ;

    memory "lock"
        size               = 1;
        offset             = 0x8f0027;
    ;

    memory "signature"
        size               = 3;
        offset             = 0x1000090;
    ;

    memory "prodsig"
        size               = 50;
        page_size          = 50;
        offset             = 0x8e0200;
        readsize           = 50;
    ;

    memory "data"
        # SRAM, only used to supply the offset
        offset             = 0x1000000;
    ;
;

#------------------------------------------------------------
# ATxmega16A4U
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega16A4U";
    id                     = "x16a4u";
    mcuid                  = 232;
    n_interrupts           = 127;
    boot_section_size      = 4096;
    signature              = 0x1e 0x94 0x41;
    usbpid                 = 0x2fe3;

    memory "eeprom"
        size               = 1024;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x5000;
        page_size          = 256;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 0x4000;
        page_size          = 256;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 4096;
        page_size          = 256;
        offset             = 0x803000;
        readsize           = 256;
    ;

    memory "boot"
        size               = 4096;
        page_size          = 256;
        offset             = 0x804000;
        readsize           = 256;
    ;

    memory "usersig"
        size               = 256;
        page_size          = 256;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATxmega16C4
#------------------------------------------------------------

part parent "x16a4u"
    desc                   = "ATxmega16C4";
    id                     = "x16c4";
    mcuid                  = 233;
    signature              = 0x1e 0x94 0x43;
;

#------------------------------------------------------------
# ATxmega16D4
#------------------------------------------------------------

part parent "x16a4u"
    desc                   = "ATxmega16D4";
    id                     = "x16d4";
    mcuid                  = 234;
    n_interrupts           = 91;
    signature              = 0x1e 0x94 0x42;
;

#------------------------------------------------------------
# ATxmega16A4
#------------------------------------------------------------

part parent "x16a4u"
    desc                   = "ATxmega16A4";
    id                     = "x16a4";
    mcuid                  = 231;
    n_interrupts           = 94;

    memory "fuse0"
        size               = 1;
        offset             = 0x8f0020;
    ;
;

#------------------------------------------------------------
# ATxmega32A4U
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega32A4U";
    id                     = "x32a4u";
    mcuid                  = 239;
    n_interrupts           = 127;
    boot_section_size      = 4096;
    signature              = 0x1e 0x95 0x41;
    usbpid                 = 0x2fe4;

    memory "eeprom"
        size               = 1024;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x9000;
        page_size          = 256;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 0x8000;
        page_size          = 256;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 4096;
        page_size          = 256;
        offset             = 0x807000;
        readsize           = 256;
    ;

    memory "boot"
        size               = 4096;
        page_size          = 256;
        offset             = 0x808000;
        readsize           = 256;
    ;

    memory "usersig"
        size               = 256;
        page_size          = 256;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATxmega32C4
#------------------------------------------------------------

part parent "x32a4u"
    desc                   = "ATxmega32C4";
    id                     = "x32c4";
    mcuid                  = 240;
    signature              = 0x1e 0x95 0x44;
;

#------------------------------------------------------------
# ATxmega32D4
#------------------------------------------------------------

part parent "x32a4u"
    desc                   = "ATxmega32D4";
    id                     = "x32d4";
    mcuid                  = 241;
    n_interrupts           = 91;
    signature              = 0x1e 0x95 0x42;
;

#------------------------------------------------------------
# ATxmega32A4
#------------------------------------------------------------

part parent "x32a4u"
    desc                   = "ATxmega32A4";
    id                     = "x32a4";
    mcuid                  = 238;
    n_interrupts           = 94;

    memory "fuse0"
        size               = 1;
        offset             = 0x8f0020;
    ;
;

#------------------------------------------------------------
# ATxmega64A4U
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega64A4U";
    id                     = "x64a4u";
    mcuid                  = 252;
    n_interrupts           = 127;
    boot_section_size      = 4096;
    signature              = 0x1e 0x96 0x46;
    usbpid                 = 0x2fe5;

    memory "eeprom"
        size               = 2048;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x11000;
        page_size          = 256;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 0x10000;
        page_size          = 256;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 4096;
        page_size          = 256;
        offset             = 0x80f000;
        readsize           = 256;
    ;

    memory "boot"
        size               = 4096;
        page_size          = 256;
        offset             = 0x810000;
        readsize           = 256;
    ;

    memory "usersig"
        size               = 256;
        page_size          = 256;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATxmega64C3
#------------------------------------------------------------

part parent "x64a4u"
    desc                   = "ATxmega64C3";
    id                     = "x64c3";
    mcuid                  = 249;
    signature              = 0x1e 0x96 0x49;
    usbpid                 = 0x2fd6;
;

#------------------------------------------------------------
# ATxmega64D3
#------------------------------------------------------------

part parent "x64a4u"
    desc                   = "ATxmega64D3";
    id                     = "x64d3";
    mcuid                  = 250;
    n_interrupts           = 114;
    signature              = 0x1e 0x96 0x4a;
;

#------------------------------------------------------------
# ATxmega64D4
#------------------------------------------------------------

part parent "x64a4u"
    desc                   = "ATxmega64D4";
    id                     = "x64d4";
    mcuid                  = 253;
    n_interrupts           = 91;
    signature              = 0x1e 0x96 0x47;
;

#------------------------------------------------------------
# ATxmega64A1
#------------------------------------------------------------

part parent "x64a4u"
    desc                   = "ATxmega64A1";
    id                     = "x64a1";
    prog_modes             = PM_SPM | PM_PDI | PM_XMEGAJTAG;
    mcuid                  = 243;
    n_interrupts           = 125;
    signature              = 0x1e 0x96 0x4e;

    memory "fuse0"
        size               = 1;
        offset             = 0x8f0020;
    ;
;

#------------------------------------------------------------
# ATxmega64A1U
#------------------------------------------------------------

part parent "x64a1"
    desc                   = "ATxmega64A1U";
    id                     = "x64a1u";
    mcuid                  = 244;
    n_interrupts           = 127;
    usbpid                 = 0x2fe8;
;

#------------------------------------------------------------
# ATxmega64A3
#------------------------------------------------------------

part parent "x64a1"
    desc                   = "ATxmega64A3";
    id                     = "x64a3";
    mcuid                  = 246;
    n_interrupts           = 122;
    signature              = 0x1e 0x96 0x42;
;

#------------------------------------------------------------
# ATxmega64A3U
#------------------------------------------------------------

part parent "x64a1"
    desc                   = "ATxmega64A3U";
    id                     = "x64a3u";
    mcuid                  = 247;
    n_interrupts           = 127;
    signature              = 0x1e 0x96 0x42;
;

#------------------------------------------------------------
# ATxmega64A4
#------------------------------------------------------------

part parent "x64a1"
    desc                   = "ATxmega64A4";
    id                     = "x64a4";
    mcuid                  = 251;
    signature              = 0x1e 0x96 0x46;
;

#------------------------------------------------------------
# ATxmega64B1
#------------------------------------------------------------

part parent "x64a1"
    desc                   = "ATxmega64B1";
    id                     = "x64b1";
    mcuid                  = 245;
    n_interrupts           = 81;
    signature              = 0x1e 0x96 0x52;
    usbpid                 = 0x2fe1;
;

#------------------------------------------------------------
# ATxmega64B3
#------------------------------------------------------------

part parent "x64a1"
    desc                   = "ATxmega64B3";
    id                     = "x64b3";
    mcuid                  = 248;
    n_interrupts           = 54;
    signature              = 0x1e 0x96 0x51;
    usbpid                 = 0x2fdf;
;

#------------------------------------------------------------
# ATxmega128C3
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega128C3";
    id                     = "x128c3";
    mcuid                  = 261;
    n_interrupts           = 127;
    boot_section_size      = 8192;
    signature              = 0x1e 0x97 0x52;
    usbpid                 = 0x2fd7;

    memory "eeprom"
        size               = 2048;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x22000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 0x20000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 8192;
        page_size          = 512;
        offset             = 0x81e000;
        readsize           = 256;
    ;

    memory "boot"
        size               = 8192;
        page_size          = 512;
        offset             = 0x820000;
        readsize           = 256;
    ;

    memory "usersig"
        size               = 512;
        page_size          = 512;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATxmega128D3
#------------------------------------------------------------

part parent "x128c3"
    desc                   = "ATxmega128D3";
    id                     = "x128d3";
    mcuid                  = 262;
    n_interrupts           = 114;
    signature              = 0x1e 0x97 0x48;
;

#------------------------------------------------------------
# ATxmega128D4
#------------------------------------------------------------

part parent "x128c3"
    desc                   = "ATxmega128D4";
    id                     = "x128d4";
    mcuid                  = 265;
    n_interrupts           = 91;
    signature              = 0x1e 0x97 0x47;

    memory "flash"
        page_size          = 256;
    ;
;

#------------------------------------------------------------
# ATxmega128A1
#------------------------------------------------------------

part parent "x128c3"
    desc                   = "ATxmega128A1";
    id                     = "x128a1";
    prog_modes             = PM_SPM | PM_PDI | PM_XMEGAJTAG;
    mcuid                  = 254;
    n_interrupts           = 125;
    signature              = 0x1e 0x97 0x4c;

    memory "fuse0"
        size               = 1;
        offset             = 0x8f0020;
    ;
;

#------------------------------------------------------------
# ATxmega128A1 revision D
#------------------------------------------------------------

part parent "x128a1"
    desc                   = "ATxmega128A1revD";
    id                     = "x128a1d";
    mcuid                  = 255;
    signature              = 0x1e 0x97 0x41;
;

#------------------------------------------------------------
# ATxmega128A1U
#------------------------------------------------------------

part parent "x128a1"
    desc                   = "ATxmega128A1U";
    id                     = "x128a1u";
    mcuid                  = 256;
    n_interrupts           = 127;
    usbpid                 = 0x2fed;
;

#------------------------------------------------------------
# ATxmega128A3
#------------------------------------------------------------

part parent "x128a1"
    desc                   = "ATxmega128A3";
    id                     = "x128a3";
    mcuid                  = 258;
    n_interrupts           = 122;
    signature              = 0x1e 0x97 0x42;
;

#------------------------------------------------------------
# ATxmega128A3U
#------------------------------------------------------------

part parent "x128a1"
    desc                   = "ATxmega128A3U";
    id                     = "x128a3u";
    mcuid                  = 259;
    n_interrupts           = 127;
    signature              = 0x1e 0x97 0x42;
    usbpid                 = 0x2fe6;
;

#------------------------------------------------------------
# ATxmega128A4
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega128A4";
    id                     = "x128a4";
    prog_modes             = PM_SPM | PM_PDI | PM_XMEGAJTAG;
    mcuid                  = 263;
    signature              = 0x1e 0x97 0x46;

    memory "eeprom"
        size               = 2048;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x22000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 0x20000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 4096;
        page_size          = 512;
        offset             = 0x81f000;
        readsize           = 256;
    ;

    memory "boot"
        size               = 8192;
        page_size          = 512;
        offset             = 0x820000;
        readsize           = 256;
    ;

    memory "fuse0"
        size               = 1;
        offset             = 0x8f0020;
    ;

    memory "usersig"
        size               = 512;
        page_size          = 512;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATxmega128A4U
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega128A4U";
    id                     = "x128a4u";
    mcuid                  = 264;
    n_interrupts           = 127;
    boot_section_size      = 8192;
    signature              = 0x1e 0x97 0x46;
    usbpid                 = 0x2fde;

    memory "eeprom"
        size               = 2048;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x22000;
        page_size          = 256;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 0x20000;
        page_size          = 256;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 4096;
        page_size          = 256;
        offset             = 0x81f000;
        readsize           = 256;
    ;

    memory "boot"
        size               = 8192;
        page_size          = 256;
        offset             = 0x820000;
        readsize           = 256;
    ;

    memory "usersig"
        size               = 256;
        page_size          = 256;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATxmega128B1
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega128B1";
    id                     = "x128b1";
    prog_modes             = PM_SPM | PM_PDI | PM_XMEGAJTAG;
    mcuid                  = 257;
    n_interrupts           = 81;
    boot_section_size      = 8192;
    signature              = 0x1e 0x97 0x4d;
    usbpid                 = 0x2fea;

    memory "eeprom"
        size               = 2048;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x22000;
        page_size          = 256;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 0x20000;
        page_size          = 256;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 8192;
        page_size          = 256;
        offset             = 0x81e000;
        readsize           = 256;
    ;

    memory "boot"
        size               = 8192;
        page_size          = 256;
        offset             = 0x820000;
        readsize           = 256;
    ;

    memory "fuse0"
        size               = 1;
        offset             = 0x8f0020;
    ;

    memory "usersig"
        size               = 256;
        page_size          = 256;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATxmega128B3
#------------------------------------------------------------

part parent "x128b1"
    desc                   = "ATxmega128B3";
    id                     = "x128b3";
    mcuid                  = 260;
    n_interrupts           = 54;
    signature              = 0x1e 0x97 0x4b;
    usbpid                 = 0x2fe0;
;

#------------------------------------------------------------
# ATxmega192C3
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega192C3";
    id                     = "x192c3";
    mcuid                  = 269;
    n_interrupts           = 127;
    boot_section_size      = 8192;
    signature              = 0x1e 0x97 0x51;
#   usbpid                 = 0x2f??;

    memory "eeprom"
        size               = 2048;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x32000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 0x30000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 8192;
        page_size          = 512;
        offset             = 0x82e000;
        readsize           = 256;
    ;

    memory "boot"
        size               = 8192;
        page_size          = 512;
        offset             = 0x830000;
        readsize           = 256;
    ;

    memory "usersig"
        size               = 512;
        page_size          = 512;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATxmega192D3
#------------------------------------------------------------

part parent "x192c3"
    desc                   = "ATxmega192D3";
    id                     = "x192d3";
    mcuid                  = 270;
    n_interrupts           = 114;
    signature              = 0x1e 0x97 0x49;
;

#------------------------------------------------------------
# ATxmega192A1
#------------------------------------------------------------

part parent "x192c3"
    desc                   = "ATxmega192A1";
    id                     = "x192a1";
    prog_modes             = PM_SPM | PM_PDI | PM_XMEGAJTAG;
    mcuid                  = 266;
    signature              = 0x1e 0x97 0x4e;

    memory "fuse0"
        size               = 1;
        offset             = 0x8f0020;
    ;
;

#------------------------------------------------------------
# ATxmega192A3
#------------------------------------------------------------

part parent "x192a1"
    desc                   = "ATxmega192A3";
    id                     = "x192a3";
    mcuid                  = 267;
    n_interrupts           = 122;
    signature              = 0x1e 0x97 0x44;
;

#------------------------------------------------------------
# ATxmega192A3U
#------------------------------------------------------------

part parent "x192a1"
    desc                   = "ATxmega192A3U";
    id                     = "x192a3u";
    mcuid                  = 268;
    signature              = 0x1e 0x97 0x44;
    usbpid                 = 0x2fe7;
;

#------------------------------------------------------------
# ATxmega256C3
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega256C3";
    id                     = "x256c3";
    mcuid                  = 276;
    n_interrupts           = 127;
    boot_section_size      = 8192;
    signature              = 0x1e 0x98 0x46;
    usbpid                 = 0x2fda;

    memory "eeprom"
        size               = 4096;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x42000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 0x40000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 8192;
        page_size          = 512;
        offset             = 0x83e000;
        readsize           = 256;
    ;

    memory "boot"
        size               = 8192;
        page_size          = 512;
        offset             = 0x840000;
        readsize           = 256;
    ;

    memory "usersig"
        size               = 512;
        page_size          = 512;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATxmega256D3
#------------------------------------------------------------

part parent "x256c3"
    desc                   = "ATxmega256D3";
    id                     = "x256d3";
    mcuid                  = 277;
    n_interrupts           = 114;
    signature              = 0x1e 0x98 0x44;
;

#------------------------------------------------------------
# ATxmega256A1
#------------------------------------------------------------

part parent "x256c3"
    desc                   = "ATxmega256A1";
    id                     = "x256a1";
    prog_modes             = PM_SPM | PM_PDI | PM_XMEGAJTAG;
    mcuid                  = 271;

    memory "fuse0"
        size               = 1;
        offset             = 0x8f0020;
    ;
;

#------------------------------------------------------------
# ATxmega256A3
#------------------------------------------------------------

part parent "x256a1"
    desc                   = "ATxmega256A3";
    id                     = "x256a3";
    mcuid                  = 272;
    n_interrupts           = 122;
    signature              = 0x1e 0x98 0x42;
;

#------------------------------------------------------------
# ATxmega256A3U
#------------------------------------------------------------

part parent "x256a1"
    desc                   = "ATxmega256A3U";
    id                     = "x256a3u";
    mcuid                  = 275;
    signature              = 0x1e 0x98 0x42;
    usbpid                 = 0x2fec;
;

#------------------------------------------------------------
# ATxmega256A3B
#------------------------------------------------------------

part parent "x256a1"
    desc                   = "ATxmega256A3B";
    id                     = "x256a3b";
    mcuid                  = 273;
    n_interrupts           = 122;
    signature              = 0x1e 0x98 0x43;
;

#------------------------------------------------------------
# ATxmega256A3BU
#------------------------------------------------------------

part parent "x256a1"
    desc                   = "ATxmega256A3BU";
    id                     = "x256a3bu";
    mcuid                  = 274;
    signature              = 0x1e 0x98 0x43;
    usbpid                 = 0x2fe2;
;

#------------------------------------------------------------
# ATxmega384C3
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega384C3";
    id                     = "x384c3";
    mcuid                  = 278;
    n_interrupts           = 127;
    boot_section_size      = 8192;
    signature              = 0x1e 0x98 0x45;
    usbpid                 = 0x2fdb;

    memory "eeprom"
        size               = 4096;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x62000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 0x60000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 8192;
        page_size          = 512;
        offset             = 0x85e000;
        readsize           = 256;
    ;

    memory "boot"
        size               = 8192;
        page_size          = 512;
        offset             = 0x860000;
        readsize           = 256;
    ;

    memory "usersig"
        size               = 512;
        page_size          = 512;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATxmega384D3
#------------------------------------------------------------

part parent "x384c3"
    desc                   = "ATxmega384D3";
    id                     = "x384d3";
    mcuid                  = 279;
    n_interrupts           = 114;
    signature              = 0x1e 0x98 0x47;
;

#------------------------------------------------------------
# ATxmega8E5
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega8E5";
    id                     = "x8e5";
    mcuid                  = 230;
    n_interrupts           = 43;
    boot_section_size      = 2048;
    signature              = 0x1e 0x93 0x41;

    memory "eeprom"
        size               = 512;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x2800;
        page_size          = 128;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 8192;
        page_size          = 128;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 2048;
        page_size          = 128;
        offset             = 0x801800;
        readsize           = 256;
    ;

    memory "boot"
        size               = 2048;
        page_size          = 128;
        offset             = 0x802000;
        readsize           = 256;
    ;

    memory "usersig"
        size               = 128;
        page_size          = 128;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATxmega16E5
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega16E5";
    id                     = "x16e5";
    mcuid                  = 235;
    n_interrupts           = 43;
    boot_section_size      = 4096;
    signature              = 0x1e 0x94 0x45;

    memory "eeprom"
        size               = 512;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x5000;
        page_size          = 128;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 0x4000;
        page_size          = 128;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 4096;
        page_size          = 128;
        offset             = 0x803000;
        readsize           = 256;
    ;

    memory "boot"
        size               = 4096;
        page_size          = 128;
        offset             = 0x804000;
        readsize           = 256;
    ;

    memory "usersig"
        size               = 128;
        page_size          = 128;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATxmega32E5
#------------------------------------------------------------

part parent ".xmega"
    desc                   = "ATxmega32E5";
    id                     = "x32e5";
    mcuid                  = 242;
    n_interrupts           = 43;
    boot_section_size      = 4096;
    signature              = 0x1e 0x95 0x4c;

    memory "eeprom"
        size               = 1024;
        page_size          = 32;
        offset             = 0x8c0000;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x9000;
        page_size          = 128;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "application"
        size               = 0x8000;
        page_size          = 128;
        offset             = 0x800000;
        readsize           = 256;
    ;

    memory "apptable"
        size               = 4096;
        page_size          = 128;
        offset             = 0x807000;
        readsize           = 256;
    ;

    memory "boot"
        size               = 4096;
        page_size          = 128;
        offset             = 0x808000;
        readsize           = 256;
    ;

    memory "usersig"
        size               = 128;
        page_size          = 128;
        offset             = 0x8e0400;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32UC3A0512
#------------------------------------------------------------

part
    desc                   = "AT32UC3A0512";
    id                     = "uc3a0512";
    prog_modes             = PM_AVR32JTAG | PM_aWire;
    signature              = 0xed 0xc0 0x3f;

    memory "flash"
        paged              = yes;
        size               = 0x80000;    # could be set dynamicly
        page_size          = 512;           # bytes
        num_pages          = 1024;          # could be set dynamicly
        offset             = 0x80000000;
        readsize           = 512;           # bytes
    ;
;

#------------------------------------------------------------
# deprecated, use 'uc3a0512'
#------------------------------------------------------------

part parent "uc3a0512"
    desc                   = "deprecated, use 'uc3a0512'";
    id                     = "ucr2";
;

#------------------------------------------------------------
# ATtiny1634
#------------------------------------------------------------

part
    desc                   = "ATtiny1634";
    id                     = "t1634";
    prog_modes             = PM_SPM | PM_ISP | PM_HVPP | PM_debugWIRE;
    mcuid                  = 40;
    n_interrupts           = 28;
    n_page_erase           = 4;
    stk500_devcode         = 0x86;
    chip_erase_delay       = 9000;
    pagel                  = 0xb3;
    bs2                    = 0xb1;
#   avr910_devcode         = 0x??;
    signature              = 0x1e 0x94 0x12;
    reset                  = io;
    timeout                = 200;
    stabdelay              = 100;
    cmdexedelay            = 25;
    synchloops             = 32;
    pollindex              = 3;
    pollvalue              = 0x53;
    predelay               = 1;
    postdelay              = 1;
    pollmethod             = 1;
    pp_controlstack        =
        0x0e, 0x1e, 0x0e, 0x1e, 0x2e, 0x3e, 0x2e, 0x3e,
        0x4e, 0x5e, 0x4e, 0x5e, 0x6e, 0x7e, 0x6e, 0x7e,
        0x26, 0x36, 0x66, 0x76, 0x2a, 0x3a, 0x6a, 0x7a,
        0x2e, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    flash_instr            =  0xb6, 0x01, 0x11;
    eeprom_instr           =
        0xbd, 0xf2, 0xbd, 0xe1, 0xbb, 0xcf, 0xb4, 0x00,
        0xbe, 0x01, 0xb6, 0x01, 0xbc, 0x00, 0xbb, 0xbf,
        0x99, 0xf9, 0xbb, 0xaf;
    hventerstabdelay       = 100;
    togglevtg              = 1;
    poweroffdelay          = 15;
    resetdelayms           = 1;
    hvleavestabdelay       = 15;
    resetdelay             = 15;
    chiperasepolltimeout   = 10;
    programfusepolltimeout = 5;
    programlockpolltimeout = 5;
    spmcr                  = 0x57;
    eecr                   = 0x3c;
    chip_erase             = "1010.1100--100x.xxxx--xxxx.xxxx--xxxx.xxxx";
    pgm_enable             = "1010.1100--0101.0011--xxxx.xxxx--xxxx.xxxx";

    memory "eeprom"
        size               = 256;
        page_size          = 4;
        min_write_delay    = 3600;
        max_write_delay    = 3600;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 5;
        blocksize          = 4;
        readsize           = 256;
        read               = "1010.0000--000x.xxxa--aaaa.aaaa--oooo.oooo";
        write              = "1100.0000--000x.xxxa--aaaa.aaaa--iiii.iiii";
        loadpage_lo        = "1100.0001--0000.0000--0000.00aa--iiii.iiii";
        writepage          = "1100.0010--00xx.xxxa--aaaa.aa00--xxxx.xxxx";
    ;

    memory "flash"
        paged              = yes;
        size               = 0x4000;
        page_size          = 32;
        num_pages          = 512;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        readback           = 0xff 0xff;
        mode               = 65;
        delay              = 6;
        blocksize          = 128;
        readsize           = 256;
        read_lo            = "0010.0000--00aa.aaaa--aaaa.aaaa--oooo.oooo";
        read_hi            = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo";
        loadpage_lo        = "0100.0000--000x.xxxx--xxxx.aaaa--iiii.iiii";
        loadpage_hi        = "0100.1000--000x.xxxx--xxxx.aaaa--iiii.iiii";
        writepage          = "0100.1100--00aa.aaaa--aaaa.xxxx--xxxx.xxxx";
    ;

    memory "lfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0000--xxxx.xxxx--iiii.iiii";
    ;

    memory "hfuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.1000--xxxx.xxxx--iiii.iiii";
    ;

    memory "efuse"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.0000--0000.1000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--1010.0100--xxxx.xxxx--xxxi.iiii";
    ;

    memory "lock"
        size               = 1;
        min_write_delay    = 4500;
        max_write_delay    = 4500;
        read               = "0101.1000--0000.0000--xxxx.xxxx--oooo.oooo";
        write              = "1010.1100--111x.xxxx--xxxx.xxxx--1111.11ii";
    ;

    memory "signature"
        size               = 3;
        read               = "0011.0000--000x.xxxx--xxxx.xxaa--oooo.oooo";
    ;

    memory "calibration"
        size               = 1;
        read               = "0011.1000--000x.xxxx--0000.0000--oooo.oooo";
    ;
;

#------------------------------------------------------------
# ATtiny1634R
#------------------------------------------------------------

part parent "t1634"
    desc                   = "ATtiny1634R";
    id                     = "t1634r";
    mcuid                  = 41;
;

#------------------------------------------------------------
# Common values for reduced core tinys (4/5/9/10/20/40)
#------------------------------------------------------------

part
    desc                   = "Common values for reduced core tinys";
    id                     = ".reduced_core_tiny";
    prog_modes             = PM_TPI;

    memory "fuse"
        size               = 1;
        page_size          = 16;
        offset             = 0x3f40;
        blocksize          = 4;
    ;

    memory "lockbits"
        size               = 1;
        page_size          = 16;
        offset             = 0x3f00;
    ;

    memory "signature"
        size               = 3;
        page_size          = 16;
        offset             = 0x3fc0;
    ;

    memory "calibration"
        size               = 1;
        page_size          = 16;
        offset             = 0x3f80;
    ;
;

#------------------------------------------------------------
# ATtiny4
#------------------------------------------------------------

part parent ".reduced_core_tiny"
    desc                   = "ATtiny4";
    id                     = "t4";
    mcuid                  = 0;
    n_interrupts           = 10;
    signature              = 0x1e 0x8f 0x0a;

    memory "flash"
        size               = 512;
        page_size          = 16;
        offset             = 0x4000;
        blocksize          = 128;
    ;
;

#------------------------------------------------------------
# ATtiny5
#------------------------------------------------------------

part parent "t4"
    desc                   = "ATtiny5";
    id                     = "t5";
    mcuid                  = 1;
    n_interrupts           = 11;
    signature              = 0x1e 0x8f 0x09;
;

#------------------------------------------------------------
# ATtiny9
#------------------------------------------------------------

part parent ".reduced_core_tiny"
    desc                   = "ATtiny9";
    id                     = "t9";
    mcuid                  = 2;
    n_interrupts           = 10;
    signature              = 0x1e 0x90 0x08;

    memory "flash"
        size               = 1024;
        page_size          = 16;
        offset             = 0x4000;
        blocksize          = 128;
    ;
;

#------------------------------------------------------------
# ATtiny10
#------------------------------------------------------------

part parent "t9"
    desc                   = "ATtiny10";
    id                     = "t10";
    mcuid                  = 3;
    n_interrupts           = 11;
    signature              = 0x1e 0x90 0x03;
;

#------------------------------------------------------------
# ATtiny20
#------------------------------------------------------------

part parent ".reduced_core_tiny"
    desc                   = "ATtiny20";
    id                     = "t20";
    mcuid                  = 4;
    n_interrupts           = 17;
    signature              = 0x1e 0x91 0x0f;

    memory "flash"
        size               = 2048;
        page_size          = 16;
        n_word_writes      = 2;
        offset             = 0x4000;
        blocksize          = 128;
    ;

    memory "fuse"
        n_word_writes      = 2;
    ;
;

#------------------------------------------------------------
# ATtiny40
#------------------------------------------------------------

part parent ".reduced_core_tiny"
    desc                   = "ATtiny40";
    id                     = "t40";
    mcuid                  = 5;
    n_interrupts           = 18;
    signature              = 0x1e 0x92 0x0e;

    memory "flash"
        size               = 4096;
        page_size          = 64;
        n_word_writes      = 4;
        offset             = 0x4000;
        blocksize          = 128;
    ;

    memory "fuse"
        n_word_writes      = 4;
    ;
;

#------------------------------------------------------------
# ATtiny102
#------------------------------------------------------------

part parent ".reduced_core_tiny"
    desc                   = "ATtiny102";
    id                     = "t102";
    mcuid                  = 6;
    n_interrupts           = 16;
    signature              = 0x1e 0x90 0x0c;

    memory "flash"
        size               = 1024;
        page_size          = 16;
        offset             = 0x4000;
        blocksize          = 128;
    ;

    memory "sigrow"
        size               = 16;
        page_size          = 16;
        offset             = 0x3fc6;
    ;
;

#------------------------------------------------------------
# ATtiny104
#------------------------------------------------------------

part parent ".reduced_core_tiny"
    desc                   = "ATtiny104";
    id                     = "t104";
    mcuid                  = 7;
    n_interrupts           = 16;
    signature              = 0x1e 0x90 0x0b;

    memory "flash"
        size               = 1024;
        page_size          = 16;
        offset             = 0x4000;
        blocksize          = 128;
    ;

    memory "sigrow"
        size               = 16;
        page_size          = 16;
        offset             = 0x3fc6;
    ;
;

#------------------------------------------------------------
# ATmega406
#------------------------------------------------------------

part
    desc                   = "ATmega406";
    id                     = "m406";
    prog_modes             = PM_SPM | PM_HVPP | PM_JTAG;
    mcuid                  = 125;
    n_interrupts           = 23;
    n_boot_sections        = 4;
    boot_section_size      = 512;
    # STK500 parameters (parallel programming IO lines)
    pagel                  = 0xa7;
    bs2                    = 0xa0;
    signature              = 0x1e 0x95 0x07;
    reset                  = io;
    serial                 = no;
    # STK500v2 HV programming parameters, from XML
    pp_controlstack        =
        0x0e, 0x1e, 0x0f, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f,
        0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f,
        0x66, 0x76, 0x67, 0x77, 0x6a, 0x7a, 0x6b, 0x7b,
        0xbe, 0xfd, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    idr                    = 0x51;
    spmcr                  = 0x57;
    eecr                   = 0x3f;

    memory "eeprom"
        size               = 512;
        page_size          = 4;
        num_pages          = 128;
        blocksize          = 4;
        readsize           = 4;
    ;

    memory "flash"
        paged              = yes;
        size               = 0xa000;
        page_size          = 128;
        num_pages          = 320;
        blocksize          = 128;
        readsize           = 128;
    ;

    memory "lfuse"
        size               = 1;
    ;

    memory "hfuse"
        size               = 1;
    ;

    memory "lockbits"
        size               = 1;
    ;

    memory "signature"
        size               = 3;
    ;
;

#------------------------------------------------------------
# AVR8X family common values
#------------------------------------------------------------

part
    desc                   = "AVR8X family common values";
    id                     = ".avr8x";
    prog_modes             = PM_SPM | PM_UPDI;
    n_boot_sections        = 1;
    nvm_base               = 0x1000;
    ocd_base               = 0x0f80;

    memory "fuse0"
        size               = 1;
        offset             = 0x1280;
        readsize           = 1;
    ;

    memory "wdtcfg"
        alias "fuse0";
    ;

    memory "fuse1"
        size               = 1;
        offset             = 0x1281;
        readsize           = 1;
    ;

    memory "bodcfg"
        alias "fuse1";
    ;

    memory "fuse2"
        size               = 1;
        offset             = 0x1282;
        readsize           = 1;
    ;

    memory "osccfg"
        alias "fuse2";
    ;

    memory "fuse4"
        size               = 1;
        offset             = 0x1284;
        readsize           = 1;
    ;

    memory "tcd0cfg"
        alias "fuse4";
    ;

    memory "fuse5"
        size               = 1;
        offset             = 0x1285;
        readsize           = 1;
    ;

    memory "syscfg0"
        alias "fuse5";
    ;

    memory "fuse6"
        size               = 1;
        offset             = 0x1286;
        readsize           = 1;
    ;

    memory "syscfg1"
        alias "fuse6";
    ;

    memory "fuse7"
        size               = 1;
        offset             = 0x1287;
        readsize           = 1;
    ;

    memory "append"
        alias "fuse7";
    ;

    memory "codesize"
        alias "fuse7";
    ;

    memory "fuse8"
        size               = 1;
        offset             = 0x1288;
        readsize           = 1;
    ;

    memory "bootend"
        alias "fuse8";
    ;

    memory "bootsize"
        alias "fuse8";
    ;

    memory "fuses"
        size               = 9;
        page_size          = 10;
        offset             = 0x1280;
        readsize           = 10;
    ;

    memory "lock"
        size               = 1;
        offset             = 0x128a;
        readsize           = 1;
    ;

    memory "tempsense"
        size               = 2;
        offset             = 0x1120;
        readsize           = 1;
    ;

    memory "signature"
        size               = 3;
        offset             = 0x1100;
        readsize           = 3;
    ;

    memory "prodsig"
        size               = 61;
        page_size          = 61;
        offset             = 0x1103;
        readsize           = 61;
    ;

    memory "sernum"
        size               = 10;
        offset             = 0x1104;
        readsize           = 1;
    ;

    memory "osccal16"
        size               = 2;
        offset             = 0x1118;
        readsize           = 1;
    ;

    memory "osccal20"
        size               = 2;
        offset             = 0x111a;
        readsize           = 1;
    ;

    memory "osc16err"
        size               = 2;
        offset             = 0x1122;
        readsize           = 1;
    ;

    memory "osc20err"
        size               = 2;
        offset             = 0x1124;
        readsize           = 1;
    ;

    memory "data"
        # SRAM, only used to supply the offset
        offset             = 0x1000000;
    ;
;

#------------------------------------------------------------
# AVR8X tiny family common values
#------------------------------------------------------------

part parent ".avr8x"
    desc                   = "AVR8X tiny family common values";
    id                     = ".avr8x_tiny";
    family_id              = "tinyAVR";
    # Shared UPDI pin, HV on UPDI pin
    hvupdi_variant         = 0;

    memory "userrow"
        size               = 32;
        page_size          = 32;
        offset             = 0x1300;
        readsize           = 256;
    ;

    memory "usersig"
        alias "userrow";
    ;
;

#------------------------------------------------------------
# AVR8X mega family common values
#------------------------------------------------------------

part parent ".avr8x"
    desc                   = "AVR8X mega family common values";
    id                     = ".avr8x_mega";
    family_id              = "megaAVR";
    # Dedicated UPDI pin, no HV
    hvupdi_variant         = 1;

    memory "userrow"
        size               = 64;
        page_size          = 64;
        offset             = 0x1300;
        readsize           = 256;
    ;

    memory "usersig"
        alias "userrow";
    ;
;

#------------------------------------------------------------
# ATtiny202
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny202";
    id                     = "t202";
    mcuid                  = 280;
    n_interrupts           = 26;
    signature              = 0x1e 0x91 0x23;

    memory "eeprom"
        size               = 64;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 2048;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny204
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny204";
    id                     = "t204";
    mcuid                  = 281;
    n_interrupts           = 26;
    signature              = 0x1e 0x91 0x22;

    memory "eeprom"
        size               = 64;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 2048;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny402
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny402";
    id                     = "t402";
    mcuid                  = 284;
    n_interrupts           = 26;
    signature              = 0x1e 0x92 0x27;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 4096;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny404
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny404";
    id                     = "t404";
    mcuid                  = 285;
    n_interrupts           = 26;
    signature              = 0x1e 0x92 0x26;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 4096;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny406
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny406";
    id                     = "t406";
    mcuid                  = 286;
    n_interrupts           = 26;
    signature              = 0x1e 0x92 0x25;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 4096;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny804
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny804";
    id                     = "t804";
    mcuid                  = 295;
    n_interrupts           = 31;
    signature              = 0x1e 0x93 0x25;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny806
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny806";
    id                     = "t806";
    mcuid                  = 296;
    n_interrupts           = 31;
    signature              = 0x1e 0x93 0x24;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny807
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny807";
    id                     = "t807";
    mcuid                  = 297;
    n_interrupts           = 31;
    signature              = 0x1e 0x93 0x23;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny1604
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny1604";
    id                     = "t1604";
    mcuid                  = 304;
    n_interrupts           = 31;
    signature              = 0x1e 0x94 0x25;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny1606
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny1606";
    id                     = "t1606";
    mcuid                  = 305;
    n_interrupts           = 31;
    signature              = 0x1e 0x94 0x24;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny1607
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny1607";
    id                     = "t1607";
    mcuid                  = 306;
    n_interrupts           = 31;
    signature              = 0x1e 0x94 0x23;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny212
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny212";
    id                     = "t212";
    mcuid                  = 282;
    n_interrupts           = 26;
    signature              = 0x1e 0x91 0x21;

    memory "eeprom"
        size               = 64;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 2048;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny214
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny214";
    id                     = "t214";
    mcuid                  = 283;
    n_interrupts           = 26;
    signature              = 0x1e 0x91 0x20;

    memory "eeprom"
        size               = 64;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 2048;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny412
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny412";
    id                     = "t412";
    mcuid                  = 287;
    n_interrupts           = 26;
    signature              = 0x1e 0x92 0x23;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 4096;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny414
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny414";
    id                     = "t414";
    mcuid                  = 288;
    n_interrupts           = 26;
    signature              = 0x1e 0x92 0x22;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 4096;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny416
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny416";
    id                     = "t416";
    mcuid                  = 289;
    n_interrupts           = 26;
    signature              = 0x1e 0x92 0x21;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 4096;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny417
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny417";
    id                     = "t417";
    mcuid                  = 291;
    n_interrupts           = 26;
    signature              = 0x1e 0x92 0x20;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 4096;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny814
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny814";
    id                     = "t814";
    mcuid                  = 298;
    n_interrupts           = 26;
    signature              = 0x1e 0x93 0x22;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny816
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny816";
    id                     = "t816";
    mcuid                  = 299;
    n_interrupts           = 26;
    signature              = 0x1e 0x93 0x21;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny817
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny817";
    id                     = "t817";
    mcuid                  = 300;
    n_interrupts           = 26;
    signature              = 0x1e 0x93 0x20;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny1614
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny1614";
    id                     = "t1614";
    mcuid                  = 307;
    n_interrupts           = 31;
    signature              = 0x1e 0x94 0x22;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny1616
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny1616";
    id                     = "t1616";
    mcuid                  = 308;
    n_interrupts           = 31;
    signature              = 0x1e 0x94 0x21;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny1617
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny1617";
    id                     = "t1617";
    mcuid                  = 309;
    n_interrupts           = 31;
    signature              = 0x1e 0x94 0x20;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny3216
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny3216";
    id                     = "t3216";
    mcuid                  = 314;
    n_interrupts           = 31;
    signature              = 0x1e 0x95 0x21;

    memory "eeprom"
        size               = 256;
        page_size          = 64;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 128;
        offset             = 0x8000;
        readsize           = 256;
    ;

    memory "userrow"
        size               = 64;
        page_size          = 64;
    ;

    memory "usersig"
        alias "userrow";
    ;
;

#------------------------------------------------------------
# ATtiny3217
#------------------------------------------------------------

part parent "t3216"
    desc                   = "ATtiny3217";
    id                     = "t3217";
    mcuid                  = 315;
    signature              = 0x1e 0x95 0x22;
;

#------------------------------------------------------------
# ATtiny424
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny424";
    id                     = "t424";
    mcuid                  = 292;
    n_interrupts           = 30;
    signature              = 0x1e 0x92 0x2c;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 4096;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny426
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny426";
    id                     = "t426";
    mcuid                  = 293;
    n_interrupts           = 30;
    signature              = 0x1e 0x92 0x2b;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 4096;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny427
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny427";
    id                     = "t427";
    mcuid                  = 294;
    n_interrupts           = 30;
    signature              = 0x1e 0x92 0x2a;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 4096;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny824
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny824";
    id                     = "t824";
    mcuid                  = 301;
    n_interrupts           = 30;
    signature              = 0x1e 0x93 0x29;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny826
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny826";
    id                     = "t826";
    mcuid                  = 302;
    n_interrupts           = 30;
    signature              = 0x1e 0x93 0x28;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny827
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny827";
    id                     = "t827";
    mcuid                  = 303;
    n_interrupts           = 30;
    signature              = 0x1e 0x93 0x27;

    memory "eeprom"
        size               = 128;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny1624
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny1624";
    id                     = "t1624";
    mcuid                  = 310;
    n_interrupts           = 30;
    signature              = 0x1e 0x94 0x2a;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny1626
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny1626";
    id                     = "t1626";
    mcuid                  = 311;
    n_interrupts           = 30;
    signature              = 0x1e 0x94 0x29;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny1627
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny1627";
    id                     = "t1627";
    mcuid                  = 312;
    n_interrupts           = 30;
    signature              = 0x1e 0x94 0x28;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny3224
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny3224";
    id                     = "t3224";
    mcuid                  = 316;
    n_interrupts           = 30;
    signature              = 0x1e 0x95 0x28;

    memory "eeprom"
        size               = 256;
        page_size          = 64;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 128;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny3226
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny3226";
    id                     = "t3226";
    mcuid                  = 317;
    n_interrupts           = 30;
    signature              = 0x1e 0x95 0x27;

    memory "eeprom"
        size               = 256;
        page_size          = 64;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 128;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATtiny3227
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATtiny3227";
    id                     = "t3227";
    mcuid                  = 318;
    n_interrupts           = 30;
    signature              = 0x1e 0x95 0x26;

    memory "eeprom"
        size               = 256;
        page_size          = 64;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 128;
        offset             = 0x8000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATmega808
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATmega808";
    id                     = "m808";
    mcuid                  = 319;
    n_interrupts           = 36;
    signature              = 0x1e 0x93 0x26;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x4000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATmega809
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATmega809";
    id                     = "m809";
    mcuid                  = 320;
    n_interrupts           = 40;
    signature              = 0x1e 0x93 0x2a;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x4000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATmega1608
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATmega1608";
    id                     = "m1608";
    mcuid                  = 321;
    n_interrupts           = 36;
    signature              = 0x1e 0x94 0x27;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x4000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATmega1609
#------------------------------------------------------------

part parent ".avr8x_tiny"
    desc                   = "ATmega1609";
    id                     = "m1609";
    mcuid                  = 322;
    n_interrupts           = 40;
    signature              = 0x1e 0x94 0x26;

    memory "eeprom"
        size               = 256;
        page_size          = 32;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x4000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATmega3208
#------------------------------------------------------------

part parent ".avr8x_mega"
    desc                   = "ATmega3208";
    id                     = "m3208";
    mcuid                  = 323;
    n_interrupts           = 36;
    signature              = 0x1e 0x95 0x30;

    memory "eeprom"
        size               = 256;
        page_size          = 64;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 128;
        offset             = 0x4000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATmega3209
#------------------------------------------------------------

part parent ".avr8x_mega"
    desc                   = "ATmega3209";
    id                     = "m3209";
    mcuid                  = 324;
    n_interrupts           = 40;
    signature              = 0x1e 0x95 0x31;

    memory "eeprom"
        size               = 256;
        page_size          = 64;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 128;
        offset             = 0x4000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATmega4808
#------------------------------------------------------------

part parent ".avr8x_mega"
    desc                   = "ATmega4808";
    id                     = "m4808";
    mcuid                  = 325;
    n_interrupts           = 36;
    signature              = 0x1e 0x96 0x50;

    memory "eeprom"
        size               = 256;
        page_size          = 64;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0xc000;
        page_size          = 128;
        offset             = 0x4000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# ATmega4809
#------------------------------------------------------------

part parent ".avr8x_mega"
    desc                   = "ATmega4809";
    id                     = "m4809";
    mcuid                  = 326;
    n_interrupts           = 40;
    signature              = 0x1e 0x96 0x51;

    memory "eeprom"
        size               = 256;
        page_size          = 64;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0xc000;
        page_size          = 128;
        offset             = 0x4000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR-Dx family common values
#------------------------------------------------------------

part
    desc                   = "AVR-Dx family common values";
    id                     = ".avrdx";
    family_id              = "AVR    ";
    prog_modes             = PM_SPM | PM_UPDI;
    n_boot_sections        = 1;
    # Dedicated UPDI pin, no HV
    hvupdi_variant         = 1;
    nvm_base               = 0x1000;
    ocd_base               = 0x0f80;

    memory "fuse0"
        size               = 1;
        offset             = 0x1050;
        readsize           = 1;
    ;

    memory "wdtcfg"
        alias "fuse0";
    ;

    memory "fuse1"
        size               = 1;
        offset             = 0x1051;
        readsize           = 1;
    ;

    memory "bodcfg"
        alias "fuse1";
    ;

    memory "fuse2"
        size               = 1;
        offset             = 0x1052;
        readsize           = 1;
    ;

    memory "osccfg"
        alias "fuse2";
    ;

    memory "fuse4"
        size               = 1;
        offset             = 0x1054;
        readsize           = 1;
    ;

    memory "tcd0cfg"
        alias "fuse4";
    ;

    memory "fuse5"
        size               = 1;
        offset             = 0x1055;
        readsize           = 1;
    ;

    memory "syscfg0"
        alias "fuse5";
    ;

    memory "fuse6"
        size               = 1;
        offset             = 0x1056;
        readsize           = 1;
    ;

    memory "syscfg1"
        alias "fuse6";
    ;

    memory "fuse7"
        size               = 1;
        offset             = 0x1057;
        readsize           = 1;
    ;

    memory "codesize"
        alias "fuse7";
    ;

    memory "append"
        alias "fuse7";
    ;

    memory "fuse8"
        size               = 1;
        offset             = 0x1058;
        readsize           = 1;
    ;

    memory "bootsize"
        alias "fuse8";
    ;

    memory "bootend"
        alias "fuse8";
    ;

    memory "fuses"
        size               = 9;
        page_size          = 16;
        offset             = 0x1050;
        readsize           = 16;
    ;

    memory "lock"
        size               = 4;
        offset             = 0x1040;
        readsize           = 4;
    ;

    memory "tempsense"
        size               = 2;
        offset             = 0x1104;
        readsize           = 1;
    ;

    memory "signature"
        size               = 3;
        offset             = 0x1100;
        readsize           = 3;
    ;

    memory "prodsig"
        size               = 125;
        page_size          = 125;
        offset             = 0x1103;
        readsize           = 125;
    ;

    memory "sernum"
        size               = 16;
        offset             = 0x1110;
        readsize           = 1;
    ;

    memory "userrow"
        size               = 32;
        page_size          = 32;
        offset             = 0x1080;
        readsize           = 32;
    ;

    memory "usersig"
        alias "userrow";
    ;

    memory "data"
        # SRAM, only used to supply the offset
        offset             = 0x1000000;
    ;
;

#------------------------------------------------------------
# AVR32DA28
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR32DA28";
    id                     = "avr32da28";
    family_id              = "    AVR";
    mcuid                  = 338;
    n_interrupts           = 41;
    signature              = 0x1e 0x95 0x34;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32DA32
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR32DA32";
    id                     = "avr32da32";
    family_id              = "    AVR";
    mcuid                  = 342;
    n_interrupts           = 44;
    signature              = 0x1e 0x95 0x33;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32DA48
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR32DA48";
    id                     = "avr32da48";
    family_id              = "    AVR";
    mcuid                  = 346;
    n_interrupts           = 58;
    signature              = 0x1e 0x95 0x32;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64DA28
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR64DA28";
    id                     = "avr64da28";
    family_id              = "    AVR";
    mcuid                  = 351;
    n_interrupts           = 41;
    signature              = 0x1e 0x96 0x15;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64DA32
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR64DA32";
    id                     = "avr64da32";
    family_id              = "    AVR";
    mcuid                  = 355;
    n_interrupts           = 44;
    signature              = 0x1e 0x96 0x14;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64DA48
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR64DA48";
    id                     = "avr64da48";
    family_id              = "    AVR";
    mcuid                  = 359;
    n_interrupts           = 58;
    signature              = 0x1e 0x96 0x13;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64DA64
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR64DA64";
    id                     = "avr64da64";
    family_id              = "    AVR";
    mcuid                  = 362;
    n_interrupts           = 64;
    signature              = 0x1e 0x96 0x12;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR128DA28
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR128DA28";
    id                     = "avr128da28";
    family_id              = "    AVR";
    mcuid                  = 364;
    n_interrupts           = 41;
    signature              = 0x1e 0x97 0x0a;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x20000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR128DA32
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR128DA32";
    id                     = "avr128da32";
    family_id              = "    AVR";
    mcuid                  = 366;
    n_interrupts           = 44;
    signature              = 0x1e 0x97 0x09;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x20000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR128DA48
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR128DA48";
    id                     = "avr128da48";
    family_id              = "    AVR";
    mcuid                  = 368;
    n_interrupts           = 58;
    signature              = 0x1e 0x97 0x08;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x20000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR128DA64
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR128DA64";
    id                     = "avr128da64";
    family_id              = "    AVR";
    mcuid                  = 370;
    n_interrupts           = 64;
    signature              = 0x1e 0x97 0x07;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x20000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32DB28
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR32DB28";
    id                     = "avr32db28";
    mcuid                  = 339;
    n_interrupts           = 42;
    signature              = 0x1e 0x95 0x37;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32DB32
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR32DB32";
    id                     = "avr32db32";
    mcuid                  = 343;
    n_interrupts           = 44;
    signature              = 0x1e 0x95 0x36;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32DB48
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR32DB48";
    id                     = "avr32db48";
    mcuid                  = 347;
    n_interrupts           = 61;
    signature              = 0x1e 0x95 0x35;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64DB28
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR64DB28";
    id                     = "avr64db28";
    mcuid                  = 352;
    n_interrupts           = 42;
    signature              = 0x1e 0x96 0x19;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64DB32
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR64DB32";
    id                     = "avr64db32";
    mcuid                  = 356;
    n_interrupts           = 44;
    signature              = 0x1e 0x96 0x18;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64DB48
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR64DB48";
    id                     = "avr64db48";
    mcuid                  = 360;
    n_interrupts           = 61;
    signature              = 0x1e 0x96 0x17;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64DB64
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR64DB64";
    id                     = "avr64db64";
    mcuid                  = 363;
    n_interrupts           = 65;
    signature              = 0x1e 0x96 0x16;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR128DB28
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR128DB28";
    id                     = "avr128db28";
    mcuid                  = 365;
    n_interrupts           = 42;
    signature              = 0x1e 0x97 0x0e;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x20000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR128DB32
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR128DB32";
    id                     = "avr128db32";
    mcuid                  = 367;
    n_interrupts           = 44;
    signature              = 0x1e 0x97 0x0d;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x20000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR128DB48
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR128DB48";
    id                     = "avr128db48";
    mcuid                  = 369;
    n_interrupts           = 61;
    signature              = 0x1e 0x97 0x0c;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x20000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR128DB64
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR128DB64";
    id                     = "avr128db64";
    mcuid                  = 371;
    n_interrupts           = 65;
    signature              = 0x1e 0x97 0x0b;

    memory "eeprom"
        size               = 512;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x20000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR16DD14
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR16DD14";
    id                     = "avr16dd14";
    mcuid                  = 329;
    n_interrupts           = 36;
    hvupdi_variant         = 2;
    signature              = 0x1e 0x94 0x34;

    memory "eeprom"
        size               = 256;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR16DD20
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR16DD20";
    id                     = "avr16dd20";
    mcuid                  = 330;
    n_interrupts           = 36;
    hvupdi_variant         = 2;
    signature              = 0x1e 0x94 0x33;

    memory "eeprom"
        size               = 256;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR16DD28
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR16DD28";
    id                     = "avr16dd28";
    mcuid                  = 331;
    n_interrupts           = 36;
    hvupdi_variant         = 2;
    signature              = 0x1e 0x94 0x32;

    memory "eeprom"
        size               = 256;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR16DD32
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR16DD32";
    id                     = "avr16dd32";
    mcuid                  = 333;
    n_interrupts           = 36;
    hvupdi_variant         = 2;
    signature              = 0x1e 0x94 0x31;

    memory "eeprom"
        size               = 256;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32DD14
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR32DD14";
    id                     = "avr32dd14";
    mcuid                  = 336;
    n_interrupts           = 36;
    hvupdi_variant         = 2;
    signature              = 0x1e 0x95 0x3b;

    memory "eeprom"
        size               = 256;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32DD20
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR32DD20";
    id                     = "avr32dd20";
    mcuid                  = 337;
    n_interrupts           = 36;
    hvupdi_variant         = 2;
    signature              = 0x1e 0x95 0x3a;

    memory "eeprom"
        size               = 256;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32DD28
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR32DD28";
    id                     = "avr32dd28";
    mcuid                  = 340;
    n_interrupts           = 36;
    hvupdi_variant         = 2;
    signature              = 0x1e 0x95 0x39;

    memory "eeprom"
        size               = 256;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32DD32
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR32DD32";
    id                     = "avr32dd32";
    mcuid                  = 344;
    n_interrupts           = 36;
    hvupdi_variant         = 2;
    signature              = 0x1e 0x95 0x38;

    memory "eeprom"
        size               = 256;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64DD14
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR64DD14";
    id                     = "avr64dd14";
    mcuid                  = 349;
    n_interrupts           = 36;
    hvupdi_variant         = 2;
    signature              = 0x1e 0x96 0x1d;

    memory "eeprom"
        size               = 256;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64DD20
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR64DD20";
    id                     = "avr64dd20";
    mcuid                  = 350;
    n_interrupts           = 36;
    hvupdi_variant         = 2;
    signature              = 0x1e 0x96 0x1c;

    memory "eeprom"
        size               = 256;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64DD28
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR64DD28";
    id                     = "avr64dd28";
    mcuid                  = 353;
    n_interrupts           = 36;
    hvupdi_variant         = 2;
    signature              = 0x1e 0x96 0x1b;

    memory "eeprom"
        size               = 256;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64DD32
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR64DD32";
    id                     = "avr64dd32";
    mcuid                  = 357;
    n_interrupts           = 36;
    hvupdi_variant         = 2;
    signature              = 0x1e 0x96 0x1a;

    memory "eeprom"
        size               = 256;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 512;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR-Ex family common values
#------------------------------------------------------------

part parent ".avrdx"
    desc                   = "AVR-Ex family common values";
    id                     = ".avrex";
    # Shared UPDI pin, HV on _RESET
    hvupdi_variant         = 2;

    memory "userrow"
        size               = 64;
        page_size          = 64;
        readsize           = 64;
    ;

    memory "usersig"
        alias "userrow";
    ;
;

#------------------------------------------------------------
# AVR8EA28
#------------------------------------------------------------

part parent ".avrex"
    desc                   = "AVR8EA28";
    id                     = "avr8ea28";
    mcuid                  = 327;
    signature              = 0x1e 0x93 0x2c;

    memory "eeprom"
        size               = 512;
        page_size          = 8;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR8EA32
#------------------------------------------------------------

part parent ".avrex"
    desc                   = "AVR8EA32";
    id                     = "avr8ea32";
    mcuid                  = 328;
    signature              = 0x1e 0x93 0x2b;

    memory "eeprom"
        size               = 512;
        page_size          = 8;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 8192;
        page_size          = 64;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR16EA28
#------------------------------------------------------------

part parent ".avrex"
    desc                   = "AVR16EA28";
    id                     = "avr16ea28";
    mcuid                  = 332;
    signature              = 0x1e 0x94 0x37;

    memory "eeprom"
        size               = 512;
        page_size          = 8;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR16EA32
#------------------------------------------------------------

part parent ".avrex"
    desc                   = "AVR16EA32";
    id                     = "avr16ea32";
    mcuid                  = 334;
    signature              = 0x1e 0x94 0x36;

    memory "eeprom"
        size               = 512;
        page_size          = 8;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR16EA48
#------------------------------------------------------------

part parent ".avrex"
    desc                   = "AVR16EA48";
    id                     = "avr16ea48";
    mcuid                  = 335;
    signature              = 0x1e 0x94 0x35;

    memory "eeprom"
        size               = 512;
        page_size          = 8;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x4000;
        page_size          = 64;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32EA28
#------------------------------------------------------------

part parent ".avrex"
    desc                   = "AVR32EA28";
    id                     = "avr32ea28";
    mcuid                  = 341;
    signature              = 0x1e 0x95 0x3e;

    memory "eeprom"
        size               = 512;
        page_size          = 8;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 64;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32EA32
#------------------------------------------------------------

part parent ".avrex"
    desc                   = "AVR32EA32";
    id                     = "avr32ea32";
    mcuid                  = 345;
    signature              = 0x1e 0x95 0x3d;

    memory "eeprom"
        size               = 512;
        page_size          = 8;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 64;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR32EA48
#------------------------------------------------------------

part parent ".avrex"
    desc                   = "AVR32EA48";
    id                     = "avr32ea48";
    mcuid                  = 348;
    signature              = 0x1e 0x95 0x3c;

    memory "eeprom"
        size               = 512;
        page_size          = 8;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x8000;
        page_size          = 64;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64EA28
#------------------------------------------------------------

part parent ".avrex"
    desc                   = "AVR64EA28";
    id                     = "avr64ea28";
    mcuid                  = 354;
    n_interrupts           = 37;
    signature              = 0x1e 0x96 0x20;

    memory "eeprom"
        size               = 512;
        page_size          = 8;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 128;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64EA32
#------------------------------------------------------------

part parent ".avrex"
    desc                   = "AVR64EA32";
    id                     = "avr64ea32";
    mcuid                  = 358;
    n_interrupts           = 37;
    signature              = 0x1e 0x96 0x1f;

    memory "eeprom"
        size               = 512;
        page_size          = 8;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 128;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# AVR64EA48
#------------------------------------------------------------

part parent ".avrex"
    desc                   = "AVR64EA48";
    id                     = "avr64ea48";
    mcuid                  = 361;
    n_interrupts           = 45;
    signature              = 0x1e 0x96 0x1e;

    memory "eeprom"
        size               = 512;
        page_size          = 8;
        offset             = 0x1400;
        readsize           = 256;
    ;

    memory "flash"
        size               = 0x10000;
        page_size          = 128;
        offset             = 0x800000;
        readsize           = 256;
    ;
;

#------------------------------------------------------------
# Logic Green parts
#------------------------------------------------------------

part parent "m88"
    desc                   = "LGT8F88P";
    id                     = "lgt8f88p";
    mcuid                  = 227;
    signature              = 0x1e 0x93 0x0f;
    autobaud_sync          = 0x1c;
;

#------------------------------------------------------------
# LGT8F168P
#------------------------------------------------------------

part parent "m168"
    desc                   = "LGT8F168P";
    id                     = "lgt8f168p";
    mcuid                  = 228;
    signature              = 0x1e 0x94 0x0b;
    autobaud_sync          = 0x1c;
;

#------------------------------------------------------------
# LGT8F328P
#------------------------------------------------------------

part parent "m328"
    desc                   = "LGT8F328P";
    id                     = "lgt8f328p";
    mcuid                  = 229;
    signature              = 0x1e 0x95 0x0f;
    autobaud_sync          = 0x1c;
;
