<?xml version="1.0" encoding="UTF-8"?>
<avr-tools-device-file xmlns:xalan="http://xml.apache.org/xalan" xmlns:NumHelper="NumHelper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schema-version="0.3" xsi:noNamespaceSchemaLocation="../../schema/avr_tools_device_file.xsd">
  <variants>
    <variant tempmin="0" tempmax="0" speedmax="0" package="" ordercode="standard" vccmin="1.8" vccmax="4.5"/>
  </variants>
  <devices>
    <device name="ATmega16HVA" architecture="AVR8" family="megaAVR">
      <address-spaces>
        <address-space endianness="little" name="prog" id="prog" start="0x0000" size="0x4000">
          <memory-segment start="0x0000" size="0x4000" type="flash" rw="RW" exec="1" name="FLASH" pagesize="0x80"/>
        </address-space>
        <address-space endianness="little" name="signatures" id="signatures" start="0" size="3">
          <memory-segment start="0" size="3" type="signatures" rw="R" exec="0" name="SIGNATURES"/>
        </address-space>
        <address-space endianness="little" name="fuses" id="fuses" start="0" size="0x0001">
          <memory-segment start="0" size="0x0001" type="fuses" rw="RW" exec="0" name="FUSES"/>
        </address-space>
        <address-space endianness="little" name="lockbits" id="lockbits" start="0" size="0x0001">
          <memory-segment start="0" size="0x0001" type="lockbits" rw="RW" exec="0" name="LOCKBITS"/>
        </address-space>
        <address-space endianness="little" name="data" id="data" start="0x0000" size="0x0300">
          <memory-segment external="false" type="regs" size="0x0020" start="0x0000" name="REGISTERS"/>
          <memory-segment name="MAPPED_IO" start="0x0020" size="0x00e0" type="io" external="false"/>
          <memory-segment name="IRAM" start="0x0100" size="0x0200" type="ram" external="false"/>
        </address-space>
        <address-space endianness="little" name="eeprom" id="eeprom" start="0x0000" size="0x0100">
          <memory-segment start="0x0000" size="0x0100" type="eeprom" rw="RW" exec="0" name="EEPROM" pagesize="0x04"/>
        </address-space>
        <address-space size="0x40" start="0x00" endianness="little" name="io" id="io"/>
      </address-spaces>
      <peripherals>
        <module name="ADC">
          <instance name="ADC" caption="Analog-to-Digital Converter">
            <register-group name="ADC" name-in-module="ADC" offset="0x00" address-space="data" caption="Analog-to-Digital Converter"/>
          </instance>
        </module>
        <module name="WDT">
          <instance name="WDT" caption="Watchdog Timer">
            <register-group name="WDT" name-in-module="WDT" offset="0x00" address-space="data" caption="Watchdog Timer"/>
          </instance>
        </module>
        <module name="BANDGAP">
          <instance name="BANDGAP" caption="Bandgap">
            <register-group name="BANDGAP" name-in-module="BANDGAP" offset="0x00" address-space="data" caption="Bandgap"/>
          </instance>
        </module>
        <module name="EXINT">
          <instance name="EXINT" caption="External Interrupts">
            <register-group name="EXINT" name-in-module="EXINT" offset="0x00" address-space="data" caption="External Interrupts"/>
          </instance>
        </module>
        <module name="PORT">
          <instance name="PORTC" caption="I/O Port">
            <register-group name="PORTC" name-in-module="PORTC" offset="0x00" address-space="data" caption="I/O Port"/>
          </instance>
          <instance name="PORTA" caption="I/O Port">
            <register-group name="PORTA" name-in-module="PORTA" offset="0x00" address-space="data" caption="I/O Port"/>
          </instance>
          <instance name="PORTB" caption="I/O Port">
            <register-group name="PORTB" name-in-module="PORTB" offset="0x00" address-space="data" caption="I/O Port"/>
          </instance>
        </module>
        <module name="FET">
          <instance name="FET" caption="FET Control">
            <register-group name="FET" name-in-module="FET" offset="0x00" address-space="data" caption="FET Control"/>
          </instance>
        </module>
        <module name="SPI">
          <instance name="SPI" caption="Serial Peripheral Interface">
            <register-group name="SPI" name-in-module="SPI" offset="0x00" address-space="data" caption="Serial Peripheral Interface"/>
          </instance>
        </module>
        <module name="BOOT_LOAD">
          <instance name="BOOT_LOAD" caption="Bootloader">
            <register-group name="BOOT_LOAD" name-in-module="BOOT_LOAD" offset="0x00" address-space="data" caption="Bootloader"/>
          </instance>
        </module>
        <module name="CPU">
          <instance name="CPU" caption="CPU Registers">
            <register-group name="CPU" name-in-module="CPU" offset="0x00" address-space="data" caption="CPU Registers"/>
          </instance>
        </module>
        <module name="BATTERY_PROTECTION">
          <instance name="BATTERY_PROTECTION" caption="Battery Protection">
            <register-group name="BATTERY_PROTECTION" name-in-module="BATTERY_PROTECTION" offset="0x00" address-space="data" caption="Battery Protection"/>
          </instance>
        </module>
        <module name="EEPROM">
          <instance name="EEPROM" caption="EEPROM">
            <register-group name="EEPROM" name-in-module="EEPROM" offset="0x00" address-space="data" caption="EEPROM"/>
          </instance>
        </module>
        <module name="TC16">
          <instance name="TC1" caption="Timer/Counter, 16-bit">
            <register-group name="TC1" name-in-module="TC1" offset="0x00" address-space="data" caption="Timer/Counter, 16-bit"/>
          </instance>
          <instance name="TC0" caption="Timer/Counter, 16-bit">
            <register-group name="TC0" name-in-module="TC0" offset="0x00" address-space="data" caption="Timer/Counter, 16-bit"/>
          </instance>
        </module>
        <module name="COULOMB_COUNTER">
          <instance name="COULOMB_COUNTER" caption="Coulomb Counter">
            <register-group name="COULOMB_COUNTER" name-in-module="COULOMB_COUNTER" offset="0x00" address-space="data" caption="Coulomb Counter"/>
          </instance>
        </module>
        <module name="VOLTAGE_REGULATOR">
          <instance name="VOLTAGE_REGULATOR" caption="Voltage Regulator">
            <register-group name="VOLTAGE_REGULATOR" name-in-module="VOLTAGE_REGULATOR" offset="0x00" address-space="data" caption="Voltage Regulator"/>
          </instance>
        </module>
        <module name="FUSE">
          <instance name="FUSE" caption="Fuses">
            <register-group name="FUSE" name-in-module="FUSE" offset="0" address-space="fuses" caption="Fuses"/>
          </instance>
        </module>
        <module name="LOCKBIT">
          <instance name="LOCKBIT" caption="Lockbits">
            <register-group name="LOCKBIT" name-in-module="LOCKBIT" offset="0" address-space="lockbits" caption="Lockbits"/>
          </instance>
        </module>
      </peripherals>


      <interrupts>
        <interrupt index="0" name="RESET" caption="External Pin, Power-on Reset, Brown-out Reset and Watchdog Reset"/>
        <interrupt index="1" name="BPINT" caption="Battery Protection Interrupt"/>
        <interrupt index="2" name="VREGMON" caption="Voltage regulator monitor interrupt"/>
        <interrupt index="3" name="INT0" caption="External Interrupt Request 0"/>
        <interrupt index="4" name="INT1" caption="External Interrupt Request 1"/>
        <interrupt index="5" name="INT2" caption="External Interrupt Request 2"/>
        <interrupt index="6" name="WDT" caption="Watchdog Timeout Interrupt"/>
        <interrupt index="7" name="TIMER1_IC" caption="Timer 1 Input capture"/>
        <interrupt index="8" name="TIMER1_COMPA" caption="Timer 1 Compare Match A"/>
        <interrupt index="9" name="TIMER1_COMPB" caption="Timer 1 Compare Match B"/>
        <interrupt index="10" name="TIMER1_OVF" caption="Timer 1 overflow"/>
        <interrupt index="11" name="TIMER0_IC" caption="Timer 0 Input Capture"/>
        <interrupt index="12" name="TIMER0_COMPA" caption="Timer 0 Comapre Match A"/>
        <interrupt index="13" name="TIMER0_COMPB" caption="Timer 0 Compare Match B"/>
        <interrupt index="14" name="TIMER0_OVF" caption="Timer 0 Overflow"/>
        <interrupt index="15" name="SPI_STC" caption="SPI Serial transfer complete"/>
        <interrupt index="16" name="VADC" caption="Voltage ADC Conversion Complete"/>
        <interrupt index="17" name="CCADC_CONV" caption="Coulomb Counter ADC Conversion Complete"/>
        <interrupt index="18" name="CCADC_REG_CUR" caption="Coloumb Counter ADC Regular Current"/>
        <interrupt index="19" name="CCADC_ACC" caption="Coloumb Counter ADC Accumulator"/>
        <interrupt index="20" name="EE_READY" caption="EEPROM Ready"/>
      </interrupts>
      <interfaces>
        <interface name="ISP" type="isp"/>
        <interface name="HVSP" type="hvsp"/>
        <interface name="debugWIRE" type="dw"/>
      </interfaces>
      <property-groups>
        <property-group name="SIGNATURES">
          <property name="JTAGID" value="0x940C"/>
          <property name="SIGNATURE0" value="0x1e"/>
          <property name="SIGNATURE1" value="0x94"/>
          <property name="SIGNATURE2" value="0x0c"/>
        </property-group>
        <property-group name="OCD">
          <property name="OCD_REVISION" value="1"/>
          <property name="OCD_DATAREG" value="0x31"/>
          <property name="PROGBASE" value="0x0000"/>
        </property-group>
        <property-group name="JTAG_INTERFACE">
          <property name="ALLOWFULLPAGESTREAM" value="0x00"/>
        </property-group>
        <property-group name="ISP_INTERFACE">
          <property name="IspEnterProgMode_timeout" value="200"/>
          <property name="IspEnterProgMode_stabDelay" value="100"/>
          <property name="IspEnterProgMode_cmdexeDelay" value="25"/>
          <property name="IspEnterProgMode_synchLoops" value="32"/>
          <property name="IspEnterProgMode_byteDelay" value="0"/>
          <property name="IspEnterProgMode_pollIndex" value="3"/>
          <property name="IspEnterProgMode_pollValue" value="0x53"/>
          <property name="IspLeaveProgMode_preDelay" value="1"/>
          <property name="IspLeaveProgMode_postDelay" value="1"/>
          <property name="IspChipErase_eraseDelay" value="20"/>
          <property name="IspChipErase_pollMethod" value="1"/>
          <property name="IspProgramFlash_mode" value="0x41"/>
          <property name="IspProgramFlash_blockSize" value="128"/>
          <property name="IspProgramFlash_delay" value="10"/>
          <property name="IspProgramFlash_cmd1" value="0x40"/>
          <property name="IspProgramFlash_cmd2" value="0x4C"/>
          <property name="IspProgramFlash_cmd3" value="0x00"/>
          <property name="IspProgramFlash_pollVal1" value="0x00"/>
          <property name="IspProgramFlash_pollVal2" value="0x00"/>
          <property name="IspProgramEeprom_mode" value="0x41"/>
          <property name="IspProgramEeprom_blockSize" value="4"/>
          <property name="IspProgramEeprom_delay" value="20"/>
          <property name="IspProgramEeprom_cmd1" value="0xC1"/>
          <property name="IspProgramEeprom_cmd2" value="0xC2"/>
          <property name="IspProgramEeprom_cmd3" value="0x00"/>
          <property name="IspProgramEeprom_pollVal1" value="0x00"/>
          <property name="IspProgramEeprom_pollVal2" value="0x00"/>
          <property name="IspReadFlash_blockSize" value="256"/>
          <property name="IspReadEeprom_blockSize" value="256"/>
          <property name="IspReadFuse_pollIndex" value="4"/>
          <property name="IspReadLock_pollIndex" value="4"/>
          <property name="IspReadSign_pollIndex" value="4"/>
          <property name="IspReadOsccal_pollIndex" value="4"/>
        </property-group>
        <property-group name="HVSP_INTERFACE">
          <property name="HvspControlStack" value="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"/>
          <property name="HvspEnterProgMode_stabDelay" value="100"/>
          <property name="HvspEnterProgMode_cmdexeDelay" value="0"/>
          <property name="HvspEnterProgMode_synchCycles" value="6"/>
          <property name="HvspEnterProgMode_latchCycles" value="1"/>
          <property name="HvspEnterProgMode_toggleVtg" value="1"/>
          <property name="HvspEnterProgMode_powoffDelay" value="25"/>
          <property name="HvspEnterProgMode_resetDelay1" value="1"/>
          <property name="HvspEnterProgMode_resetDelay2" value="70"/>
          <property name="HvspLeaveProgMode_stabDelay" value="101"/>
          <property name="HvspLeaveProgMode_resetDelay" value="26"/>
          <property name="HvspChipErase_pollTimeout" value="40"/>
          <property name="HvspChipErase_eraseTime" value="1"/>
          <property name="HvspProgramFlash_mode" value="0x0D"/>
          <property name="HvspProgramFlash_blockSize" value="256"/>
          <property name="HvspProgramFlash_pollTimeout" value="6"/>
          <property name="HvspReadFlash_blockSize" value="256"/>
          <property name="HvspProgramEeprom_mode" value="0x05"/>
          <property name="HvspProgramEeprom_blockSize" value="256"/>
          <property name="HvspProgramEeprom_pollTimeout" value="5"/>
          <property name="HvspReadEeprom_blockSize" value="256"/>
          <property name="HvspProgramFuse_pollTimeout" value="25"/>
          <property name="HvspProgramLock_pollTimeout" value="25"/>
        </property-group>
      </property-groups>
    </device>
  </devices>
  <modules>
    <module caption="Fuses" name="FUSE">
      <register-group caption="Fuses" name="FUSE">
        <register caption="" name="LOW" offset="0x00" size="1" initval="0xDF">
          <bitfield caption="Watch-dog Timer always on" mask="0x80" name="WDTON"/>
          <bitfield caption="Preserve EEPROM through the Chip Erase cycle" mask="0x40" name="EESAVE"/>
          <bitfield caption="Serial program downloading (SPI) enabled" mask="0x20" name="SPIEN"/>
          <bitfield caption="Debug Wire enable" mask="0x10" name="DWEN"/>
          <bitfield caption="Self Programming enable" mask="0x08" name="SELFPRGEN"/>
          <bitfield caption="Select start-up time" mask="0x07" name="SUT" values="ENUM_SUT"/>
        </register>
      </register-group>
      <value-group caption="" name="ENUM_SUT">
        <value caption="Start-up time 6 CK/14 CK + 4 ms" name="6CK_14CK_4MS" value="0x00"/>
        <value caption="Start-up time 6 CK/14 CK + 8 ms" name="6CK_14CK_8MS" value="0x01"/>
        <value caption="Start-up time 6 CK/14 CK + 16 ms" name="6CK_14CK_16MS" value="0x02"/>
        <value caption="Start-up time 6 CK/14 CK + 32 ms" name="6CK_14CK_32MS" value="0x03"/>
        <value caption="Start-up time 6 CK/14 CK + 64 ms" name="6CK_14CK_64MS" value="0x04"/>
        <value caption="Start-up time 6 CK/14 CK + 128 ms" name="6CK_14CK_128MS" value="0x05"/>
        <value caption="Start-up time 6 CK/14 CK + 256 ms" name="6CK_14CK_256MS" value="0x06"/>
        <value caption="Start-up time 6 CK/14 CK + 512 ms" name="6CK_14CK_512MS" value="0x07"/>
      </value-group>
    </module>
    <module caption="Lockbits" name="LOCKBIT">
      <register-group caption="Lockbits" name="LOCKBIT">
        <register caption="" name="LOCKBIT" offset="0x00" size="1">
          <bitfield caption="Memory Lock" mask="0x03" name="LB" values="ENUM_LB"/>
        </register>
      </register-group>
      <value-group caption="" name="ENUM_LB">
        <value caption="Further programming and verification disabled" name="PROG_VER_DISABLED" value="0x00"/>
        <value caption="Further programming disabled" name="PROG_DISABLED" value="0x02"/>
        <value caption="No memory lock features enabled" name="NO_LOCK" value="0x03"/>
      </value-group>
    </module>
    <module caption="Analog-to-Digital Converter" name="ADC">
      <register-group caption="Analog-to-Digital Converter" name="ADC">
        <register caption="The VADC multiplexer Selection Register" name="VADMUX" offset="0x7C" size="1">
          <bitfield caption="Analog Channel and Gain Selection Bits" mask="0x0F" name="VADMUX"/>
        </register>
        <register caption="VADC Data Register  Bytes" name="VADC" offset="0x78" size="2" mask="0x0FFF"/>
        <register caption="The VADC Control and Status register" name="VADCSR" offset="0x7A" size="1" ocd-rw="R">
          <bitfield caption="VADC Enable" mask="0x08" name="VADEN"/>
          <bitfield caption="VADC Satrt Conversion" mask="0x04" name="VADSC"/>
          <bitfield caption="VADC Conversion Complete Interrupt Flag" mask="0x02" name="VADCCIF"/>
          <bitfield caption="VADC Conversion Complete Interrupt Enable" mask="0x01" name="VADCCIE"/>
        </register>
      </register-group>
    </module>
    <module caption="Watchdog Timer" name="WDT">
      <register-group caption="Watchdog Timer" name="WDT">
        <register caption="Watchdog Timer Control Register" name="WDTCSR" offset="0x60" size="1" ocd-rw="R">
          <bitfield caption="Watchdog Timeout Interrupt Flag" mask="0x80" name="WDIF"/>
          <bitfield caption="Watchdog Timeout Interrupt Enable" mask="0x40" name="WDIE"/>
          <bitfield caption="Watchdog Timer Prescaler Bits" mask="0x27" name="WDP" values="WDOG_TIMER_PRESCALE_4BITS"/>
          <bitfield caption="Watchdog Change Enable" mask="0x10" name="WDCE"/>
          <bitfield caption="Watch Dog Enable" mask="0x08" name="WDE"/>
        </register>
      </register-group>
      <value-group caption="" name="WDOG_TIMER_PRESCALE_4BITS">
        <value caption="Oscillator Cycles 2K" name="VAL_0x00" value="0x00"/>
        <value caption="Oscillator Cycles 4K" name="VAL_0x01" value="0x01"/>
        <value caption="Oscillator Cycles 8K" name="VAL_0x02" value="0x02"/>
        <value caption="Oscillator Cycles 16K" name="VAL_0x03" value="0x03"/>
        <value caption="Oscillator Cycles 32K" name="VAL_0x04" value="0x04"/>
        <value caption="Oscillator Cycles 64K" name="VAL_0x05" value="0x05"/>
        <value caption="Oscillator Cycles 128K" name="VAL_0x06" value="0x06"/>
        <value caption="Oscillator Cycles 256K" name="VAL_0x07" value="0x07"/>
        <value caption="Oscillator Cycles 512K" name="VAL_0x08" value="0x08"/>
        <value caption="Oscillator Cycles 1024K" name="VAL_0x09" value="0x09"/>
      </value-group>
    </module>
    <module caption="Bandgap" name="BANDGAP">
      <register-group caption="Bandgap" name="BANDGAP">
        <register caption="Bandgap Calibration of Resistor Ladder" name="BGCRR" offset="0xD1" size="1" mask="0xFF">
          <bitfield caption="Bandgap calibration bits" mask="0xFF" name="BGCR"/>
        </register>
        <register caption="Bandgap Calibration Register" name="BGCCR" offset="0xD0" size="1">
          <bitfield caption="Setting the BGD bit to one will disable the bandgap voltage reference. This bit must be cleared before enabling CC-ADC or V-ADC, and must remain unset while either ADC is enabled." mask="0x80" name="BGD"/>
          <bitfield caption="BG Calibration of PTAT Current Bits" mask="0x3F" name="BGCC"/>
        </register>
      </register-group>
    </module>
    <module caption="External Interrupts" name="EXINT">
      <register-group caption="External Interrupts" name="EXINT">
        <register caption="External Interrupt Control Register" name="EICRA" offset="0x69" size="1">
          <bitfield caption="External Interrupt Sense Control 2 Bits" mask="0x30" name="ISC2" values="INTERRUPT_SENSE_CONTROL"/>
          <bitfield caption="External Interrupt Sense Control 1 Bits" mask="0x0C" name="ISC1" values="INTERRUPT_SENSE_CONTROL"/>
          <bitfield caption="External Interrupt Sense Control 0 Bits" mask="0x03" name="ISC0" values="INTERRUPT_SENSE_CONTROL"/>
        </register>
        <register caption="External Interrupt Mask Register" name="EIMSK" offset="0x3D" size="1">
          <bitfield caption="External Interrupt Request 2 Enable" mask="0x07" name="INT"/>
        </register>
        <register caption="External Interrupt Flag Register" name="EIFR" offset="0x3C" size="1" ocd-rw="R">
          <bitfield caption="External Interrupt Flags" mask="0x07" name="INTF"/>
        </register>
      </register-group>
      <value-group caption="Interrupt Sense Control" name="INTERRUPT_SENSE_CONTROL">
        <value caption="Low Level of INTX" name="VAL_0x00" value="0x00"/>
        <value caption="Any Logical Change of INTX" name="VAL_0x01" value="0x01"/>
        <value caption="Falling Edge of INTX" name="VAL_0x02" value="0x02"/>
        <value caption="Rising Edge of INTX" name="VAL_0x03" value="0x03"/>
      </value-group>
    </module>
    <module caption="I/O Port" name="PORT">
      <register-group caption="I/O Port" name="PORTC">
        <register caption="Port C Data Register" name="PORTC" offset="0x28" size="1" mask="0x01"/>
        <register caption="Port C Input Pins" name="PINC" offset="0x26" size="1" mask="0x01" ocd-rw="R"/>
      </register-group>
      <register-group caption="I/O Port" name="PORTA">
        <register caption="Port A Data Register" name="PORTA" offset="0x22" size="1" mask="0x03"/>
        <register caption="Port A Data Direction Register" name="DDRA" offset="0x21" size="1" mask="0x03"/>
        <register caption="Port A Input Pins" name="PINA" offset="0x20" size="1" mask="0x03" ocd-rw="R"/>
      </register-group>
      <register-group caption="I/O Port" name="PORTB">
        <register caption="Data Register, Port B" name="PORTB" offset="0x25" size="1" mask="0x0F"/>
        <register caption="Data Direction Register, Port B" name="DDRB" offset="0x24" size="1" mask="0x0F"/>
        <register caption="Input Pins, Port B" name="PINB" offset="0x23" size="1" mask="0x0F" ocd-rw="R"/>
      </register-group>
    </module>
    <module caption="FET Control" name="FET">
      <register-group caption="FET Control" name="FET">
        <register caption="FET Control and Status Register" name="FCSR" offset="0xF0" size="1">
          <bitfield caption="Deep Under-Voltage Recovery Disable" mask="0x08" name="DUVRD"/>
          <bitfield caption="Current Protection Status" mask="0x04" name="CPS"/>
          <bitfield caption="Discharge FET Enable" mask="0x02" name="DFE"/>
          <bitfield caption="Charge FET Enable" mask="0x01" name="CFE"/>
        </register>
      </register-group>
    </module>
    <module caption="Serial Peripheral Interface" name="SPI">
      <register-group caption="Serial Peripheral Interface" name="SPI">
        <register caption="SPI Control Register" name="SPCR" offset="0x4c" size="1">
          <bitfield caption="SPI Interrupt Enable" mask="0x80" name="SPIE"/>
          <bitfield caption="SPI Enable" mask="0x40" name="SPE"/>
          <bitfield caption="Data Order" mask="0x20" name="DORD"/>
          <bitfield caption="Master/Slave Select" mask="0x10" name="MSTR"/>
          <bitfield caption="Clock polarity" mask="0x08" name="CPOL"/>
          <bitfield caption="Clock Phase" mask="0x04" name="CPHA"/>
          <bitfield caption="SPI Clock Rate Selects" mask="0x03" name="SPR" values="COMM_SCK_RATE_3BIT"/>
        </register>
        <register caption="SPI Status Register" name="SPSR" offset="0x4d" size="1" ocd-rw="R">
          <bitfield caption="SPI Interrupt Flag" mask="0x80" name="SPIF"/>
          <bitfield caption="Write Collision Flag" mask="0x40" name="WCOL"/>
          <bitfield caption="Double SPI Speed Bit" mask="0x01" name="SPI2X"/>
        </register>
        <register caption="SPI Data Register" name="SPDR" offset="0x4e" size="1" mask="0xFF" ocd-rw=""/>
      </register-group>
      <value-group caption="" name="COMM_SCK_RATE_3BIT">
        <value caption="fosc/4" name="VAL_0x00" value="0x00"/>
        <value caption="fosc/16" name="VAL_0x01" value="0x01"/>
        <value caption="fosc/64" name="VAL_0x02" value="0x02"/>
        <value caption="fosc/128" name="VAL_0x03" value="0x03"/>
        <value caption="fosc/2" name="VAL_0x04" value="0x04"/>
        <value caption="fosc/8" name="VAL_0x05" value="0x05"/>
        <value caption="fosc/32" name="VAL_0x06" value="0x06"/>
        <value caption="fosc/64" name="VAL_0x07" value="0x07"/>
      </value-group>
    </module>
    <module caption="Bootloader" name="BOOT_LOAD">
      <register-group caption="Bootloader" name="BOOT_LOAD">
        <register caption="Store Program Memory Control and Status Register" name="SPMCSR" offset="0x57" size="1">
          <bitfield caption="Signature Row Read" mask="0x20" name="SIGRD"/>
          <bitfield caption="Clear Temporary Page Buffer" mask="0x10" name="CTPB"/>
          <bitfield caption="Read Fuse and Lock Bits" mask="0x08" name="RFLB"/>
          <bitfield caption="Page Write" mask="0x04" name="PGWRT"/>
          <bitfield caption="Page Erase" mask="0x02" name="PGERS"/>
          <bitfield caption="Store Program Memory Enable" mask="0x01" name="SPMEN"/>
        </register>
      </register-group>
    </module>
    <module caption="CPU Registers" name="CPU">
      <register-group caption="CPU Registers" name="CPU">
        <register caption="Status Register" name="SREG" offset="0x5F" size="1">
          <bitfield caption="Global Interrupt Enable" mask="0x80" name="I"/>
          <bitfield caption="Bit Copy Storage" mask="0x40" name="T"/>
          <bitfield caption="Half Carry Flag" mask="0x20" name="H"/>
          <bitfield caption="Sign Bit" mask="0x10" name="S"/>
          <bitfield caption="Two's Complement Overflow Flag" mask="0x08" name="V"/>
          <bitfield caption="Negative Flag" mask="0x04" name="N"/>
          <bitfield caption="Zero Flag" mask="0x02" name="Z"/>
          <bitfield caption="Carry Flag" mask="0x01" name="C"/>
        </register>
        <register caption="Stack Pointer " name="SP" offset="0x5D" size="2" mask="0x03FF"/>
        <register caption="MCU Control Register" name="MCUCR" offset="0x55" size="1">
          <bitfield caption="Clock Output Enable" mask="0x20" name="CKOE"/>
          <bitfield caption="Pull-up disable" mask="0x10" name="PUD"/>
        </register>
        <register caption="MCU Status Register" name="MCUSR" offset="0x54" size="1" ocd-rw="R">
          <bitfield caption="OCD Reset Flag" mask="0x10" name="OCDRF"/>
          <bitfield caption="Watchdog Reset Flag" mask="0x08" name="WDRF"/>
          <bitfield caption="Brown-out Reset Flag" mask="0x04" name="BODRF"/>
          <bitfield caption="External Reset Flag" mask="0x02" name="EXTRF"/>
          <bitfield caption="Power-on reset flag" mask="0x01" name="PORF"/>
        </register>
        <register caption="Fast Oscillator Calibration Value" name="FOSCCAL" offset="0x66" size="1" mask="0xFF"/>
        <register caption="Oscillator Sampling Interface Control and Status Register" name="OSICSR" offset="0x37" size="1" ocd-rw="R">
          <bitfield caption="Oscillator Sampling Interface Select 0" mask="0x10" name="OSISEL0"/>
          <bitfield caption="Oscillator Sampling Interface Status" mask="0x02" name="OSIST"/>
          <bitfield caption="Oscillator Sampling Interface Enable" mask="0x01" name="OSIEN"/>
        </register>
        <register caption="Sleep Mode Control Register" name="SMCR" offset="0x53" size="1">
          <bitfield caption="Sleep Mode Select bits" mask="0x0E" name="SM" values="CPU_SLEEP_MODE_3BITS"/>
          <bitfield caption="Sleep Enable" mask="0x01" name="SE"/>
        </register>
        <register caption="General Purpose IO Register 2" name="GPIOR2" offset="0x4B" size="1" mask="0xFF"/>
        <register caption="General Purpose IO Register 1" name="GPIOR1" offset="0x4A" size="1" mask="0xFF"/>
        <register caption="General Purpose IO Register 0" name="GPIOR0" offset="0x3E" size="1" mask="0xFF"/>
        <register caption="Digital Input Disable Register" name="DIDR0" offset="0x7E" size="1">
          <bitfield caption="When this bit is written logic one, the digital input buffer of the corresponding V_ADC pin is disabled." mask="0x02" name="PA1DID"/>
          <bitfield caption="When this bit is written logic one, the digital input buffer of the corresponding V_ADC pin is disabled." mask="0x01" name="PA0DID"/>
        </register>
        <register caption="Power Reduction Register 0" name="PRR0" offset="0x64" size="1">
          <bitfield caption="Power Reduction Voltage Regulator Monitor" mask="0x20" name="PRVRM"/>
          <bitfield caption="Power reduction SPI" mask="0x08" name="PRSPI"/>
          <bitfield caption="Power Reduction Timer/Counter1" mask="0x04" name="PRTIM1"/>
          <bitfield caption="Power Reduction Timer/Counter0" mask="0x02" name="PRTIM0"/>
          <bitfield caption="Power Reduction V-ADC" mask="0x01" name="PRVADC"/>
        </register>
        <register caption="Clock Prescale Register" name="CLKPR" offset="0x61" size="1" ocd-rw="R">
          <bitfield caption="Clock Prescaler Change Enable" mask="0x80" name="CLKPCE"/>
          <bitfield caption="Clock Prescaler Select Bits" mask="0x03" name="CLKPS"/>
        </register>
      </register-group>
      <value-group name="CPU_SLEEP_MODE_3BITS" caption="">
        <value caption="Idle" name="IDLE" value="0x00"/>
        <value caption="ADC Noise Reduction (If Available)" name="ADC" value="0x01"/>
        <value caption="Reserved" name="VAL_0x02" value="0x02"/>
        <value caption="Power Save" name="PSAVE" value="0x03"/>
        <value caption="Power Off" name="POFF" value="0x04"/>
        <value caption="Reserved" name="VAL_0x05" value="0x05"/>
        <value caption="Reserved" name="VAL_0x06" value="0x06"/>
        <value caption="Reserved" name="VAL_0x07" value="0x07"/>
      </value-group>
      <parameters>
        <param name="CORE_VERSION" value="V2E"/>
      </parameters>
    </module>
    <module caption="Battery Protection" name="BATTERY_PROTECTION">
      <register-group caption="Battery Protection" name="BATTERY_PROTECTION">
        <register caption="Battery Protection Parameter Lock Register" name="BPPLR" offset="0xFE" size="1" ocd-rw="R">
          <bitfield caption="Battery Protection Parameter Lock Enable" mask="0x02" name="BPPLE"/>
          <bitfield caption="Battery Protection Parameter Lock" mask="0x01" name="BPPL"/>
        </register>
        <register caption="Battery Protection Control Register" name="BPCR" offset="0xFD" size="1">
          <bitfield caption="Short Circuit Protection Disabled" mask="0x10" name="SCD"/>
          <bitfield caption="Discharge Over-current Protection Disabled" mask="0x08" name="DOCD"/>
          <bitfield caption="Charge Over-current Protection Disabled" mask="0x04" name="COCD"/>
          <bitfield caption="Discharge High-current Protection Disable" mask="0x02" name="DHCD"/>
          <bitfield caption="Charge High-current Protection Disable" mask="0x01" name="CHCD"/>
        </register>
        <register caption="Battery Protection Short-current Timing Register" name="BPHCTR" offset="0xFC" size="1" mask="0x3F"/>
        <register caption="Battery Protection Over-current Timing Register" name="BPOCTR" offset="0xFB" size="1" mask="0x3F"/>
        <register caption="Battery Protection Short-current Timing Register" name="BPSCTR" offset="0xFA" size="1" mask="0x7F"/>
        <register caption="Battery Protection Charge-High-current Detection Level Register" name="BPCHCD" offset="0xF9" size="1" mask="0xFF"/>
        <register caption="Battery Protection Discharge-High-current Detection Level Register" name="BPDHCD" offset="0xF8" size="1" mask="0xFF"/>
        <register caption="Battery Protection Charge-Over-current Detection Level Register" name="BPCOCD" offset="0xF7" size="1" mask="0xFF"/>
        <register caption="Battery Protection Discharge-Over-current Detection Level Register" name="BPDOCD" offset="0xF6" size="1" mask="0xFF"/>
        <register caption="Battery Protection Short-Circuit Detection Level Register" name="BPSCD" offset="0xF5" size="1" mask="0xFF"/>
        <register caption="Battery Protection Interrupt Flag Register" name="BPIFR" offset="0xF3" size="1">
          <bitfield caption="Short-circuit Protection Activated Interrupt Flag" mask="0x10" name="SCIF"/>
          <bitfield caption="Discharge Over-current Protection Activated Interrupt Flag" mask="0x08" name="DOCIF"/>
          <bitfield caption="Charge Over-current Protection Activated Interrupt Flag" mask="0x04" name="COCIF"/>
          <bitfield caption="Disharge High-current Protection Activated Interrupt" mask="0x02" name="DHCIF"/>
          <bitfield caption="Charge High-current Protection Activated Interrupt" mask="0x01" name="CHCIF"/>
        </register>
        <register caption="Battery Protection Interrupt Mask Register" name="BPIMSK" offset="0xF2" size="1">
          <bitfield caption="Short-circuit Protection Activated Interrupt Enable" mask="0x10" name="SCIE"/>
          <bitfield caption="Discharge Over-current Protection Activated Interrupt Enable" mask="0x08" name="DOCIE"/>
          <bitfield caption="Charge Over-current Protection Activated Interrupt Enable" mask="0x04" name="COCIE"/>
          <bitfield caption="Discharger High-current Protection Activated Interrupt" mask="0x02" name="DHCIE"/>
          <bitfield caption="Charger High-current Protection Activated Interrupt" mask="0x01" name="CHCIE"/>
        </register>
      </register-group>
    </module>
    <module caption="EEPROM" name="EEPROM">
      <register-group caption="EEPROM" name="EEPROM">
        <register caption="EEPROM Read/Write Access" name="EEAR" offset="0x41" size="1" mask="0xFF"/>
        <register caption="EEPROM Data Register" name="EEDR" offset="0x40" size="1" mask="0xFF"/>
        <register caption="EEPROM Control Register" name="EECR" offset="0x3F" size="1">
          <bitfield caption="" mask="0x30" name="EEPM" values="EEP_MODE"/>
          <bitfield caption="EEProm Ready Interrupt Enable" mask="0x08" name="EERIE"/>
          <bitfield caption="EEPROM Master Write Enable" mask="0x04" name="EEMPE"/>
          <bitfield caption="EEPROM Write Enable" mask="0x02" name="EEPE"/>
          <bitfield caption="EEPROM Read Enable" mask="0x01" name="EERE"/>
        </register>
      </register-group>
      <value-group caption="" name="EEP_MODE">
        <value caption="Erase and Write in one operation" name="VAL_0x00" value="0x00"/>
        <value caption="Erase Only" name="VAL_0x01" value="0x01"/>
        <value caption="Write Only" name="VAL_0x02" value="0x02"/>
      </value-group>
    </module>
    <module caption="Timer/Counter, 16-bit" name="TC16">
      <register-group caption="Timer/Counter, 16-bit" name="TC1">
        <register caption="Timer/Counter1 Control Register B" name="TCCR1B" offset="0x81" size="1">
          <bitfield caption="Clock Select1 bis" mask="0x07" name="CS" lsb="10"/>
        </register>
        <register caption="Timer/Counter 1 Control Register A" name="TCCR1A" offset="0x80" size="1">
          <bitfield caption="Timer/Counter Width" mask="0x80" name="TCW1"/>
          <bitfield caption="Input Capture Mode Enable" mask="0x40" name="ICEN1"/>
          <bitfield caption="Input Capture Noise Canceler" mask="0x20" name="ICNC1"/>
          <bitfield caption="Input Capture Edge Select" mask="0x10" name="ICES1"/>
          <bitfield caption="Input Capture Select" mask="0x08" name="ICS1"/>
          <bitfield caption="Waveform Generation Mode" mask="0x01" name="WGM10"/>
        </register>
        <register caption="Timer Counter 1  Bytes" name="TCNT1" offset="0x84" size="2" mask="0xFFFF"/>
        <register caption="Output Compare Register 1A" name="OCR1A" offset="0x88" size="1" mask="0xFF"/>
        <register caption="Output Compare Register B" name="OCR1B" offset="0x89" size="1" mask="0xFF"/>
        <register caption="Timer/Counter Interrupt Mask Register" name="TIMSK1" offset="0x6F" size="1">
          <bitfield caption="Timer/Counter n Input Capture Interrupt Enable" mask="0x08" name="ICIE1"/>
          <bitfield caption="Timer/Counter1 Output Compare B Interrupt Enable" mask="0x04" name="OCIE1B"/>
          <bitfield caption="Timer/Counter1 Output Compare A Interrupt Enable" mask="0x02" name="OCIE1A"/>
          <bitfield caption="Timer/Counter1 Overflow Interrupt Enable" mask="0x01" name="TOIE1"/>
        </register>
        <register caption="Timer/Counter Interrupt Flag register" name="TIFR1" offset="0x36" size="1" ocd-rw="R">
          <bitfield caption="Timer/Counter 1 Input Capture Flag" mask="0x08" name="ICF1"/>
          <bitfield caption="Timer/Counter1 Output Compare Flag B" mask="0x04" name="OCF1B"/>
          <bitfield caption="Timer/Counter1 Output Compare Flag A" mask="0x02" name="OCF1A"/>
          <bitfield caption="Timer/Counter1 Overflow Flag" mask="0x01" name="TOV1"/>
        </register>
        <register caption="General Timer/Counter Control Register" name="GTCCR" offset="0x43" size="1">
          <bitfield caption="Timer/Counter Synchronization Mode" mask="0x80" name="TSM"/>
          <bitfield caption="Prescaler Reset" mask="0x01" name="PSRSYNC"/>
        </register>
      </register-group>
      <register-group caption="Timer/Counter, 16-bit" name="TC0">
        <register caption="Timer/Counter0 Control Register" name="TCCR0A" offset="0x44" size="1">
          <bitfield caption="Timer/Counter Width" mask="0x80" name="TCW0"/>
          <bitfield caption="Input Capture Mode Enable" mask="0x40" name="ICEN0"/>
          <bitfield caption="Input Capture Noise Canceler" mask="0x20" name="ICNC0"/>
          <bitfield caption="Input Capture Edge Select" mask="0x10" name="ICES0"/>
          <bitfield caption="Input Capture Select" mask="0x08" name="ICS0"/>
          <bitfield caption="Clock Select0 bit 0" mask="0x01" name="WGM00"/>
        </register>
        <register caption="Timer/Counter0 Control Register" name="TCCR0B" offset="0x45" size="1">
          <bitfield caption="Clock Select0 bit 2" mask="0x04" name="CS02"/>
          <bitfield caption="Clock Select0 bit 1" mask="0x02" name="CS01"/>
          <bitfield caption="Clock Select0 bit 0" mask="0x01" name="CS00"/>
        </register>
        <register caption="Timer Counter 0  Bytes" name="TCNT0" offset="0x46" size="2" mask="0xFFFF"/>
        <register caption="Output compare Register A" name="OCR0A" offset="0x48" size="1" mask="0xFF"/>
        <register caption="Output compare Register B" name="OCR0B" offset="0x49" size="1" mask="0xFF"/>
        <register caption="Timer/Counter Interrupt Mask Register" name="TIMSK0" offset="0x6E" size="1">
          <bitfield caption="Timer/Counter n Input Capture Interrupt Enable" mask="0x08" name="ICIE0"/>
          <bitfield caption="Output Compare Interrupt Enable" mask="0x04" name="OCIE0B"/>
          <bitfield caption="Output Compare Interrupt Enable" mask="0x02" name="OCIE0A"/>
          <bitfield caption="Overflow Interrupt Enable" mask="0x01" name="TOIE0"/>
        </register>
        <register caption="Timer/Counter Interrupt Flag register" name="TIFR0" offset="0x35" size="1" ocd-rw="R">
          <bitfield caption="Timer/Counter Interrupt Flag Register" mask="0x08" name="ICF0"/>
          <bitfield caption="Output Compare Flag" mask="0x04" name="OCF0B"/>
          <bitfield caption="Output Compare Flag" mask="0x02" name="OCF0A"/>
          <bitfield caption="Overflow Flag" mask="0x01" name="TOV0"/>
        </register>
      </register-group>
    </module>
    <module caption="Coulomb Counter" name="COULOMB_COUNTER">
      <register-group caption="Coulomb Counter" name="COULOMB_COUNTER">
        <register caption="CC-ADC Control and Status Register A" name="CADCSRA" offset="0xE4" size="1">
          <bitfield caption="When the CADEN bit is cleared (zero), the CC-ADC is disabled. When the CADEN bit is set (one), the CC-ADC will continuously measure the voltage drop over the external sense resistor RSENSE. In Power-down, only the Regular Current detection is active. In Power-off, the CC-ADC is always disabled." mask="0x80" name="CADEN"/>
          <bitfield caption="" mask="0x40" name="CADPOL"/>
          <bitfield caption="CC_ADC Update Busy" mask="0x20" name="CADUB"/>
          <bitfield caption="CC_ADC Accumulate Current Select Bits" mask="0x18" name="CADAS"/>
          <bitfield caption="The CADSI bits determine the current sampling interval for the Regular Current detection in Power-down mode. The actual settings remain to be determined." mask="0x06" name="CADSI"/>
          <bitfield caption="When the CADSE bit is written to one, the ongoing CC-ADC conversion is aborted, and the CC-ADC enters Regular Current detection mode." mask="0x01" name="CADSE"/>
        </register>
        <register caption="CC-ADC Control and Status Register B" name="CADCSRB" offset="0xE5" size="1">
          <bitfield caption="" mask="0x40" name="CADACIE"/>
          <bitfield caption="Regular Current Interrupt Enable" mask="0x20" name="CADRCIE"/>
          <bitfield caption="CAD Instantenous Current Interrupt Enable" mask="0x10" name="CADICIE"/>
          <bitfield caption="CC-ADC Accumulate Current Interrupt Flag" mask="0x04" name="CADACIF"/>
          <bitfield caption="CC-ADC Accumulate Current Interrupt Flag" mask="0x02" name="CADRCIF"/>
          <bitfield caption="CC-ADC Instantaneous Current Interrupt Flag" mask="0x01" name="CADICIF"/>
        </register>
        <register caption="CC-ADC Instantaneous Current" name="CADIC" offset="0xE8" size="2" mask="0xFFFF"/>
        <register caption="ADC Accumulate Current" name="CADAC3" offset="0xE3" size="1" mask="0xFF" ocd-rw="R"/>
        <register caption="ADC Accumulate Current" name="CADAC2" offset="0xE2" size="1" mask="0xFF" ocd-rw="R"/>
        <register caption="ADC Accumulate Current" name="CADAC1" offset="0xE1" size="1" mask="0xFF" ocd-rw="R"/>
        <register caption="ADC Accumulate Current" name="CADAC0" offset="0xE0" size="1" mask="0xFF" ocd-rw="R"/>
        <register caption="CC-ADC Regular Current" name="CADRC" offset="0xE6" size="1" mask="0xFF"/>
      </register-group>
    </module>
    <module caption="Voltage Regulator" name="VOLTAGE_REGULATOR">
      <register-group caption="Voltage Regulator" name="VOLTAGE_REGULATOR">
        <register caption="Regulator Operating Condition Register" name="ROCR" offset="0xC8" size="1" ocd-rw="R">
          <bitfield caption="ROC Status" mask="0x80" name="ROCS"/>
          <bitfield caption="ROC Warning Interrupt Flag" mask="0x02" name="ROCWIF"/>
          <bitfield caption="ROC Warning Interrupt Enable" mask="0x01" name="ROCWIE"/>
        </register>
      </register-group>
    </module>
  </modules>
</avr-tools-device-file>
