<?xml version="1.0" encoding="UTF-8"?>
<target-description-file>
    <variants>
        <variant ordercode="ATmega406-1AAU" package="LQFP48" pinout="QFP48" tempmax="85" tempmin="-40"/>
    </variants>
    <device name="ATmega406" architecture="AVR8" family="megaAVR">
        <address-spaces>
            <address-space endianness="little" name="prog" id="prog" start="0x0000" size="0xa000">
                <memory-segment start="0x0000" size="0xa000" type="flash" rw="RW" exec="1" name="FLASH"
                                pagesize="0x80"/>
                <memory-segment start="0x9e00" size="0x0200" type="flash" rw="RW" exec="1" name="BOOT_SECTION_1"
                                pagesize="0x80"/>
                <memory-segment start="0x9c00" size="0x0400" type="flash" rw="RW" exec="1" name="BOOT_SECTION_2"
                                pagesize="0x80"/>
                <memory-segment start="0x9800" size="0x0800" type="flash" rw="RW" exec="1" name="BOOT_SECTION_3"
                                pagesize="0x80"/>
                <memory-segment start="0x9000" size="0x1000" type="flash" rw="RW" exec="1" name="BOOT_SECTION_4"
                                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="0x0002">
                <memory-segment start="0" size="0x0002" 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="0x0900">
                <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="0x0800" type="ram" external="false"/>
            </address-space>
            <address-space endianness="little" name="eeprom" id="eeprom" start="0x0000" size="0x0200">
                <memory-segment start="0x0000" size="0x0200" 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="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="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>
            </module>
            <module name="WAKEUP_TIMER">
                <instance name="WAKEUP_TIMER" caption="Wakeup Timer">
                    <register-group name="WAKEUP_TIMER" name-in-module="WAKEUP_TIMER" offset="0x00"
                                    address-space="data" caption="Wakeup Timer"/>
                </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="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="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="CELL_BALANCING">
                <instance name="CELL_BALANCING" caption="Cell Balancing">
                    <register-group name="CELL_BALANCING" name-in-module="CELL_BALANCING" offset="0x00"
                                    address-space="data" caption="Cell Balancing"/>
                </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"/>
                    <parameters>
                        <param name="CORE_VERSION" value="V2E"/>
                    </parameters>
                </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="TC8">
                <instance name="TC0" caption="Timer/Counter, 8-bit">
                    <register-group name="TC0" name-in-module="TC0" offset="0x00" address-space="data"
                                    caption="Timer/Counter, 8-bit"/>
                </instance>
            </module>
            <module name="PORT">
                <instance name="PORTA" caption="I/O Port">
                    <register-group name="PORTA" name-in-module="PORTA" offset="0x00" address-space="data"
                                    caption="I/O Port"/>
                    <signals>
                        <signal function="PORTA" group="P" index="0" pad="PA0"/>
                        <signal function="PORTA" group="P" index="1" pad="PA1"/>
                        <signal function="PORTA" group="P" index="2" pad="PA2"/>
                        <signal function="PORTA" group="P" index="3" pad="PA3"/>
                        <signal function="PORTA" group="P" index="4" pad="PA4"/>
                        <signal function="PORTA" group="P" index="5" pad="PA5"/>
                        <signal function="PORTA" group="P" index="6" pad="PA6"/>
                        <signal function="PORTA" group="P" index="7" pad="PA7"/>
                    </signals>
                </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"/>
                    <signals>
                        <signal function="PORTB" group="P" index="0" pad="PB0"/>
                        <signal function="PORTB" group="P" index="1" pad="PB1"/>
                        <signal function="PORTB" group="P" index="2" pad="PB2"/>
                        <signal function="PORTB" group="P" index="3" pad="PB3"/>
                        <signal function="PORTB" group="P" index="4" pad="PB4"/>
                        <signal function="PORTB" group="P" index="5" pad="PB5"/>
                        <signal function="PORTB" group="P" index="6" pad="PB6"/>
                        <signal function="PORTB" group="P" index="7" pad="PB7"/>
                    </signals>
                </instance>
                <instance name="PORTC" caption="I/O Port">
                    <register-group name="PORTC" name-in-module="PORTC" offset="0x00" address-space="data"
                                    caption="I/O Port"/>
                    <signals>
                        <signal function="PORTC" group="P" index="0" pad="PC0"/>
                    </signals>
                </instance>
                <instance name="PORTD" caption="I/O Port">
                    <register-group name="PORTD" name-in-module="PORTD" offset="0x00" address-space="data"
                                    caption="I/O Port"/>
                    <signals>
                        <signal function="PORTD" group="P" index="0" pad="PD0"/>
                        <signal function="PORTD" group="P" index="1" pad="PD1"/>
                    </signals>
                </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="TWI">
                <instance name="TWI" caption="Two Wire Serial Interface">
                    <register-group name="TWI" name-in-module="TWI" offset="0x00" address-space="data"
                                    caption="Two Wire Serial Interface"/>
                </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="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="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="INT0" caption="External Interrupt Request 0"/>
            <interrupt index="3" name="INT1" caption="External Interrupt Request 1"/>
            <interrupt index="4" name="INT2" caption="External Interrupt Request 2"/>
            <interrupt index="5" name="INT3" caption="External Interrupt Request 3"/>
            <interrupt index="6" name="PCINT0" caption="Pin Change Interrupt 0"/>
            <interrupt index="7" name="PCINT1" caption="Pin Change Interrupt 1"/>
            <interrupt index="8" name="WDT" caption="Watchdog Timeout Interrupt"/>
            <interrupt index="9" name="WAKE_UP" caption="Wakeup timer overflow"/>
            <interrupt index="10" name="TIM1_COMP" caption="Timer/Counter 1 Compare Match"/>
            <interrupt index="11" name="TIM1_OVF" caption="Timer/Counter 1 Overflow"/>
            <interrupt index="12" name="TIM0_COMPA" caption="Timer/Counter0 Compare A Match"/>
            <interrupt index="13" name="TIM0_COMPB" caption="Timer/Counter0 Compare B Match"/>
            <interrupt index="14" name="TIM0_OVF" caption="Timer/Counter0 Overflow"/>
            <interrupt index="15" name="TWI_BUS_CD" caption="Two-Wire Bus Connect/Disconnect"/>
            <interrupt index="16" name="TWI" caption="Two-Wire Serial Interface"/>
            <interrupt index="17" name="VADC" caption="Voltage ADC Conversion Complete"/>
            <interrupt index="18" name="CCADC_CONV" caption="Coulomb Counter ADC Conversion Complete"/>
            <interrupt index="19" name="CCADC_REG_CUR" caption="Coloumb Counter ADC Regular Current"/>
            <interrupt index="20" name="CCADC_ACC" caption="Coloumb Counter ADC Accumulator"/>
            <interrupt index="21" name="EE_READY" caption="EEPROM Ready"/>
            <interrupt index="22" name="SPM_READY" caption="Store Program Memory Ready"/>
        </interrupts>
        <interfaces>
            <interface name="HVPP" type="hvpp"/>
            <interface name="JTAG" type="megajtag"/>
        </interfaces>
        <property-groups>
            <property-group name="SIGNATURES">
                <property name="JTAGID" value="0x0950703F"/>
                <property name="SIGNATURE0" value="0x1e"/>
                <property name="SIGNATURE1" value="0x95"/>
                <property name="SIGNATURE2" value="0x07"/>
            </property-group>
            <property-group name="OCD">
                <property name="OCD_REVISION" value="3"/>
                <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="PP_INTERFACE">
                <property name="PpControlStack"
                          value="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"/>
                <property name="PpEnterProgMode_stabDelay" value="100"/>
                <property name="PpEnterProgMode_progModeDelay" value="0"/>
                <property name="PpEnterProgMode_latchCycles" value="6"/>
                <property name="PpEnterProgMode_toggleVtg" value="0"/>
                <property name="PpEnterProgMode_powerOffDelay" value="0"/>
                <property name="PpEnterProgMode_resetDelayMs" value="0"/>
                <property name="PpEnterProgMode_resetDelayUs" value="0"/>
                <property name="PpLeaveProgMode_stabDelay" value="15"/>
                <property name="PpLeaveProgMode_resetDelay" value="15"/>
                <property name="PpChipErase_pulseWidth" value="0"/>
                <property name="PpChipErase_pollTimeout" value="10"/>
                <property name="PpProgramFlash_pollTimeout" value="5"/>
                <property name="PpProgramFlash_mode" value="0x0F"/>
                <property name="PpProgramFlash_blockSize" value="256"/>
                <property name="PpReadFlash_blockSize" value="256"/>
                <property name="PpProgramEeprom_pollTimeout" value="5"/>
                <property name="PpProgramEeprom_mode" value="0x07"/>
                <property name="PpProgramEeprom_blockSize" value="256"/>
                <property name="PpReadEeprom_blockSize" value="256"/>
                <property name="PpProgramFuse_pulseWidth" value="0"/>
                <property name="PpProgramFuse_pollTimeout" value="5"/>
                <property name="PpProgramLock_pulseWidth" value="0"/>
                <property name="PpProgramLock_pollTimeout" value="5"/>
            </property-group>
        </property-groups>
    </device>
    <modules>
        <module caption="Fuses" name="FUSE">
            <register-group caption="Fuses" name="FUSE">
                <register caption="" name="HIGH" offset="0x01" size="1" initval="0xFE">
                    <bitfield caption="On-Chip Debug Enabled" mask="0x02" name="OCDEN"/>
                    <bitfield caption="JTAG Interface Enabled" mask="0x01" name="JTAGEN"/>
                </register>
                <register caption="" name="LOW" offset="0x00" size="1" initval="0xCD">
                    <bitfield caption="Watchdog timer always on" mask="0x80" name="WDTON"/>
                    <bitfield caption="Preserve EEPROM through the Chip Erase cycle" mask="0x40" name="EESAVE"/>
                    <bitfield caption="Select boot size" mask="0x30" name="BOOTSZ" values="ENUM_BOOTSZ"/>
                    <bitfield caption="Boot Reset vector Enabled" mask="0x08" name="BOOTRST"/>
                    <bitfield caption="Clock Selection" mask="0x07" name="SUT_CKSEL" values="ENUM_SUT_CKSEL"/>
                </register>
            </register-group>
            <value-group caption="" name="ENUM_BOOTSZ">
                <value caption="Boot Flash size=256 words Boot address=$4F00" name="256W_4F00" value="0x03"/>
                <value caption="Boot Flash size=512 words Boot address=$4E00" name="512W_4E00" value="0x02"/>
                <value caption="Boot Flash size=1024 words Boot address=$4C00" name="1024W_4C00" value="0x01"/>
                <value caption="Boot Flash size=2048 words Boot address=$4800" name="2048W_4800" value="0x00"/>
            </value-group>
            <value-group caption="" name="ENUM_SUT_CKSEL">
                <value caption="Start-up time: 14 CK + 0 ms" name="14CK_0MS" value="0x00"/>
                <value caption="Start-up time: 14 CK + 3.9 ms" name="14CK_3MS9" value="0x02"/>
                <value caption="Start-up time: 14 CK + 62.5 ms" name="14CK_62MS5" value="0x04"/>
                <value caption="Start-up time: 14 CK + 0 ms" name="14CK_0MS" value="0x01"/>
                <value caption="Start-up time: 14 CK + 3.9 ms" name="14CK_3MS9" value="0x03"/>
                <value caption="Start-up time: 14 CK + 62.5 ms" name="14CK_62MS5" value="0x05"/>
            </value-group>
        </module>
        <module caption="Lockbits" name="LOCKBIT">
            <register-group caption="Lockbits" name="LOCKBIT">
                <register caption="" name="LOCKBIT" offset="0x00" size="1" initval="0xFF">
                    <bitfield caption="Memory Lock" mask="0x03" name="LB" values="ENUM_LB"/>
                    <bitfield caption="Boot Loader Protection Mode" mask="0x0C" name="BLB0" values="ENUM_BLB"/>
                    <bitfield caption="Boot Loader Protection Mode" mask="0x30" name="BLB1" values="ENUM_BLB2"/>
                </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>
            <value-group caption="" name="ENUM_BLB">
                <value caption="LPM and SPM prohibited in Application Section" name="LPM_SPM_DISABLE" value="0x00"/>
                <value caption="LPM prohibited in Application Section" name="LPM_DISABLE" value="0x01"/>
                <value caption="SPM prohibited in Application Section" name="SPM_DISABLE" value="0x02"/>
                <value caption="No lock on SPM and LPM in Application Section" name="NO_LOCK" value="0x03"/>
            </value-group>
            <value-group caption="" name="ENUM_BLB2">
                <value caption="LPM and SPM prohibited in Boot Section" name="LPM_SPM_DISABLE" value="0x00"/>
                <value caption="LPM prohibited in Boot Section" name="LPM_DISABLE" value="0x01"/>
                <value caption="SPM prohibited in Boot Section" name="SPM_DISABLE" value="0x02"/>
                <value caption="No lock on SPM and LPM in Boot Section" 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="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 3 Bits" mask="0xC0" name="ISC3"
                              values="INTERRUPT_SENSE_CONTROL"/>
                    <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 1 Enable" mask="0x0F" name="INT"/>
                </register>
                <register caption="External Interrupt Flag Register" name="EIFR" offset="0x3C" size="1" ocd-rw="R">
                    <bitfield caption="External Interrupt Flags" mask="0x0F" name="INTF"/>
                </register>
                <register caption="Pin Change Interrupt Control Register" name="PCICR" offset="0x68" size="1">
                    <bitfield caption="Pin Change Interrupt Enables" mask="0x03" name="PCIE"/>
                </register>
                <register caption="Pin Change Interrupt Flag Register" name="PCIFR" offset="0x3B" size="1" ocd-rw="R">
                    <bitfield caption="Pin Change Interrupt Flags" mask="0x03" name="PCIF"/>
                </register>
                <register caption="Pin Change Enable Mask Register 1" name="PCMSK1" offset="0x6C" size="1" mask="0xFF"/>
                <register caption="Pin Change Enable Mask Register 0" name="PCMSK0" offset="0x6B" size="1" mask="0xFF"/>
            </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="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="Clear Timer/Counter on Compare Match" mask="0x08" name="CTC1"/>
                    <bitfield caption="Clock Select1 bits" mask="0x07" name="CS1" values="CLK_SEL_3BIT"/>
                </register>
                <register caption="Timer Counter 1 Bytes" name="TCNT1" offset="0x84" size="2" mask="0xFFFF"/>
                <register caption="Output Compare Register 1A Low byte" name="OCR1AL" offset="0x88" size="1"
                          mask="0xFF"/>
                <register caption="Output Compare Register 1A High byte" name="OCR1AH" offset="0x89" size="1"
                          mask="0xFF"/>
                <register caption="Timer/Counter Interrupt Mask Register" name="TIMSK1" offset="0x6F" size="1">
                    <bitfield caption="Timer/Counter1 Output Compare 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/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>
            <value-group caption="" name="CLK_SEL_3BIT">
                <value caption="No Clock Source (Stopped)" name="VAL_0x00" value="0x00"/>
                <value caption="Running, No Prescaling" name="VAL_0x01" value="0x01"/>
                <value caption="Running, CLK/8" name="VAL_0x02" value="0x02"/>
                <value caption="Running, CLK/32" name="VAL_0x03" value="0x03"/>
                <value caption="Running, CLK/64" name="VAL_0x04" value="0x04"/>
                <value caption="Running, CLK/128" name="VAL_0x05" value="0x05"/>
                <value caption="Running, CLK/256" name="VAL_0x06" value="0x06"/>
                <value caption="Running, CLK/1024" name="VAL_0x07" value="0x07"/>
            </value-group>
        </module>
        <module caption="Wakeup Timer" name="WAKEUP_TIMER">
            <register-group caption="Wakeup Timer" name="WAKEUP_TIMER">
                <register caption="Wake-up Timer Control Register" name="WUTCSR" offset="0x62" size="1" ocd-rw="R">
                    <bitfield caption="Wake-up Timer Interrupt Flag" mask="0x80" name="WUTIF"/>
                    <bitfield caption="Wake-up Timer Interrupt Enable" mask="0x40" name="WUTIE"/>
                    <bitfield caption="Wake-up timer Calibration Flag" mask="0x20" name="WUTCF"/>
                    <bitfield caption="Wake-up Timer Reset" mask="0x10" name="WUTR"/>
                    <bitfield caption="Wake-up Timer Enable" mask="0x08" name="WUTE"/>
                    <bitfield caption="Wake-up Timer Prescaler Bits" mask="0x07" name="WUTP"
                              values="CLK_SEL_3BIT_ONLY_PRESCALE"/>
                </register>
            </register-group>
            <value-group caption="" name="CLK_SEL_3BIT_ONLY_PRESCALE">
                <value caption="4K(Slow RC) / 1K (32kHz)" name="VAL_0x00" value="0x00"/>
                <value caption="8K(Slow RC) / 2K (32kHz)" name="VAL_0x01" value="0x01"/>
                <value caption="16K(Slow RC) / 4K (32kHz)" name="VAL_0x02" value="0x02"/>
                <value caption="32K(Slow RC) / 8K (32kHz)" name="VAL_0x03" value="0x03"/>
                <value caption="64K(Slow RC) / 16K (32kHz)" name="VAL_0x04" value="0x04"/>
                <value caption="128K(Slow RC) / 32K (32kHz)" name="VAL_0x05" value="0x05"/>
                <value caption="256K(Slow RC) / 64K (32kHz)" name="VAL_0x06" value="0x06"/>
                <value caption="512K(Slow RC) / 128K (32kHz)" name="VAL_0x07" value="0x07"/>
            </value-group>
        </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="0xF8" 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="0xF7" size="1">
                    <bitfield caption="" mask="0x08" name="DUVD"/>
                    <bitfield caption="" mask="0x04" name="SCD"/>
                    <bitfield caption="" mask="0x02" name="DCD"/>
                    <bitfield caption="" mask="0x01" name="CCD"/>
                </register>
                <register caption="Current Battery Protection Timing Register" name="CBPTR" offset="0xF6" size="1">
                    <bitfield caption="" mask="0xF0" name="SCPT" values="BAT_SHORT_CIRC_DELAY"/>
                    <bitfield caption="" mask="0x0F" name="OCPT" values="BAT_OVER_CURRENT_DELAY"/>
                </register>
                <register caption="Battery Protection OverCurrent Detection Level Register" name="BPOCD" offset="0xF5"
                          size="1">
                    <bitfield caption="" mask="0xF0" name="DCDL" values="BAT_VOLT_SENSE"/>
                    <bitfield caption="" mask="0x0F" name="CCDL" values="BAT_VOLT_SENSE"/>
                </register>
                <register caption="Battery Protection Short-Circuit Detection Level Register" name="BPSCD" offset="0xF4"
                          size="1">
                    <bitfield caption="" mask="0x0F" name="SCDL" values="BAT_VOLT_SENSE2"/>
                </register>
                <register caption="Battery Protection Deep Under Voltage Register" name="BPDUV" offset="0xF3" size="1">
                    <bitfield caption="" mask="0x30" name="DUVT" values="BAT_DEEP_UNDER_DELAY"/>
                    <bitfield caption="" mask="0x0F" name="DUDL" values="BAT_DEEP_UNDER_LEVEL"/>
                </register>
                <register caption="Battery Protection Interrupt Register" name="BPIR" offset="0xF2" size="1" ocd-rw="R">
                    <bitfield caption="Deep Under-voltage Early Warning Interrupt Flag" mask="0x80" name="DUVIF"/>
                    <bitfield caption="Charge Over-current Protection Activated Interrupt Flag" mask="0x40"
                              name="COCIF"/>
                    <bitfield caption="" mask="0x20" name="DOCIF"/>
                    <bitfield caption="" mask="0x10" name="SCIF"/>
                    <bitfield caption="Deep Under-voltage Early Warning Interrupt Enable" mask="0x08" name="DUVIE"/>
                    <bitfield caption="" mask="0x04" name="COCIE"/>
                    <bitfield caption="" mask="0x02" name="DOCIE"/>
                    <bitfield caption="" mask="0x01" name="SCIE"/>
                </register>
            </register-group>
            <value-group caption="" name="BAT_SHORT_CIRC_DELAY">
                <value caption="61 us" name="VAL_0x00" value="0x00"/>
                <value caption="122 us" name="VAL_0x01" value="0x01"/>
                <value caption="183 us" name="VAL_0x02" value="0x02"/>
                <value caption="244 us" name="VAL_0x03" value="0x03"/>
                <value caption="305 us" name="VAL_0x04" value="0x04"/>
                <value caption="366 us" name="VAL_0x05" value="0x05"/>
                <value caption="427 us" name="VAL_0x06" value="0x06"/>
                <value caption="488 us" name="VAL_0x07" value="0x07"/>
                <value caption="610 us" name="VAL_0x08" value="0x08"/>
                <value caption="732 us" name="VAL_0x09" value="0x09"/>
                <value caption="854 us" name="VAL_0x0A" value="0x0A"/>
                <value caption="976 us" name="VAL_0x0B" value="0x0B"/>
                <value caption="1098 us" name="VAL_0x0C" value="0x0C"/>
                <value caption="1220 us" name="VAL_0x0D" value="0x0D"/>
                <value caption="1342 us" name="VAL_0x0E" value="0x0E"/>
                <value caption="1464 us" name="VAL_0x0F" value="0x0F"/>
            </value-group>
            <value-group caption="" name="BAT_OVER_CURRENT_DELAY">
                <value caption="1 ms" name="VAL_0x00" value="0x00"/>
                <value caption="2 ms" name="VAL_0x01" value="0x01"/>
                <value caption="4 ms" name="VAL_0x02" value="0x02"/>
                <value caption="6 ms" name="VAL_0x03" value="0x03"/>
                <value caption="8 ms" name="VAL_0x04" value="0x04"/>
                <value caption="10 ms" name="VAL_0x05" value="0x05"/>
                <value caption="12 ms" name="VAL_0x06" value="0x06"/>
                <value caption="14 ms" name="VAL_0x07" value="0x07"/>
                <value caption="16 ms" name="VAL_0x08" value="0x08"/>
                <value caption="18 ms" name="VAL_0x09" value="0x09"/>
                <value caption="20 ms" name="VAL_0x0A" value="0x0A"/>
                <value caption="22 ms" name="VAL_0x0B" value="0x0B"/>
                <value caption="24 ms" name="VAL_0x0C" value="0x0C"/>
                <value caption="26 ms" name="VAL_0x0D" value="0x0D"/>
                <value caption="28 ms" name="VAL_0x0E" value="0x0E"/>
                <value caption="30 ms" name="VAL_0x0F" value="0x0F"/>
            </value-group>
            <value-group caption="" name="BAT_VOLT_SENSE">
                <value caption="0.050V" name="VAL_0x00" value="0x00"/>
                <value caption="0.055V" name="VAL_0x01" value="0x01"/>
                <value caption="0.060V" name="VAL_0x02" value="0x02"/>
                <value caption="0.065V" name="VAL_0x03" value="0x03"/>
                <value caption="0.070V" name="VAL_0x04" value="0x04"/>
                <value caption="0.080V" name="VAL_0x05" value="0x05"/>
                <value caption="0.090V" name="VAL_0x06" value="0x06"/>
                <value caption="0.100V" name="VAL_0x07" value="0x07"/>
                <value caption="0.110V" name="VAL_0x08" value="0x08"/>
                <value caption="0.120V" name="VAL_0x09" value="0x09"/>
                <value caption="0.130V" name="VAL_0x0A" value="0x0A"/>
                <value caption="0.140V" name="VAL_0x0B" value="0x0B"/>
                <value caption="0.160V" name="VAL_0x0C" value="0x0C"/>
                <value caption="0.180V" name="VAL_0x0D" value="0x0D"/>
                <value caption="0.200V" name="VAL_0x0E" value="0x0E"/>
                <value caption="0.220V" name="VAL_0x0F" value="0x0F"/>
            </value-group>
            <value-group caption="" name="BAT_VOLT_SENSE2">
                <value caption="0.100V" name="VAL_0x00" value="0x00"/>
                <value caption="0.110V" name="VAL_0x01" value="0x01"/>
                <value caption="0.120V" name="VAL_0x02" value="0x02"/>
                <value caption="0.130V" name="VAL_0x03" value="0x03"/>
                <value caption="0.140V" name="VAL_0x04" value="0x04"/>
                <value caption="0.160V" name="VAL_0x05" value="0x05"/>
                <value caption="0.180V" name="VAL_0x06" value="0x06"/>
                <value caption="0.200V" name="VAL_0x07" value="0x07"/>
                <value caption="0.220V" name="VAL_0x08" value="0x08"/>
                <value caption="0.240V" name="VAL_0x09" value="0x09"/>
                <value caption="0.260V" name="VAL_0x0A" value="0x0A"/>
                <value caption="0.280V" name="VAL_0x0B" value="0x0B"/>
                <value caption="0.320V" name="VAL_0x0C" value="0x0C"/>
                <value caption="0.360V" name="VAL_0x0D" value="0x0D"/>
                <value caption="0.400V" name="VAL_0x0E" value="0x0E"/>
                <value caption="0.440V" name="VAL_0x0F" value="0x0F"/>
            </value-group>
            <value-group caption="" name="BAT_DEEP_UNDER_DELAY">
                <value caption="750ms" name="VAL_0x00" value="0x00"/>
                <value caption="1000ms" name="VAL_0x01" value="0x01"/>
                <value caption="1250ms" name="VAL_0x02" value="0x02"/>
                <value caption="1500ms" name="VAL_0x03" value="0x03"/>
            </value-group>
            <value-group caption="" name="BAT_DEEP_UNDER_LEVEL">
                <value caption="4.71V" name="VAL_0x00" value="0x00"/>
                <value caption="5.03V" name="VAL_0x01" value="0x01"/>
                <value caption="5.34V" name="VAL_0x02" value="0x02"/>
                <value caption="5.66V" name="VAL_0x03" value="0x03"/>
                <value caption="5.97V" name="VAL_0x04" value="0x04"/>
                <value caption="6.29V" name="VAL_0x05" value="0x05"/>
                <value caption="6.60V" name="VAL_0x06" value="0x06"/>
                <value caption="6.91V" name="VAL_0x07" value="0x07"/>
                <value caption="7.23V" name="VAL_0x08" value="0x08"/>
                <value caption="7.54V" name="VAL_0x09" value="0x09"/>
                <value caption="7.86V" name="VAL_0x0A" value="0x0A"/>
                <value caption="8.17V" name="VAL_0x0B" value="0x0B"/>
                <value caption="8.49V" name="VAL_0x0C" value="0x0C"/>
                <value caption="8.80V" name="VAL_0x0D" value="0x0D"/>
                <value caption="9.11V" name="VAL_0x0E" value="0x0E"/>
                <value caption="9.43V" name="VAL_0x0F" value="0x0F"/>
            </value-group>
        </module>
        <module caption="FET Control" name="FET">
            <register-group caption="FET Control" name="FET">
                <register caption="" name="FCSR" offset="0xF0" size="1">
                    <bitfield caption="Pulse Width Modulation of OC output" mask="0x20" name="PWMOC"/>
                    <bitfield caption="Pulse Width Modulation Modulation of OPC output" mask="0x10" name="PWMOPC"/>
                    <bitfield caption="Current Protection Status" mask="0x08" name="CPS"/>
                    <bitfield caption="Discharge FET Enable" mask="0x04" name="DFE"/>
                    <bitfield caption="Charge FET Enable" mask="0x02" name="CFE"/>
                    <bitfield caption="Precharge FET disable" mask="0x01" name="PFD"/>
                </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="CC_ADC Update Busy" mask="0x20" name="CADUB"/>
                    <bitfield caption="CC_ADC Accumulate Current Select Bits" mask="0x18" name="CADAS"
                              values="ANALOG_CADA_ACC_TIME"/>
                    <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" values="ANALOG_CADA_ACC_TIME"/>
                    <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"
                          ocd-rw="R">
                    <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 Charge Current" name="CADRCC" offset="0xE6" size="1" mask="0xFF"/>
                <register caption="CC-ADC Regular Discharge Current" name="CADRDC" offset="0xE7" size="1" mask="0xFF"/>
            </register-group>
            <value-group caption="" name="ANALOG_CADA_ACC_TIME">
                <value caption="125ms" name="VAL_0x00" value="0x00"/>
                <value caption="250ms" name="VAL_0x01" value="0x01"/>
                <value caption="500ms" name="VAL_0x02" value="0x02"/>
                <value caption="1000ms" name="VAL_0x03" value="0x03"/>
            </value-group>
        </module>
        <module caption="Cell Balancing" name="CELL_BALANCING">
            <register-group caption="Cell Balancing" name="CELL_BALANCING">
                <register caption="Cell Balancing Control Register" name="CBCR" offset="0xF1" size="1">
                    <bitfield caption="Cell Balancing Enables" mask="0x0F" name="CBE" lsb="1"/>
                </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="0xFFFF"/>
                <register caption="MCU Control Register" name="MCUCR" offset="0x55" size="1">
                    <bitfield caption="JTAG Disable" mask="0x80" name="JTD"/>
                    <bitfield caption="Pull-up disable" mask="0x10" name="PUD"/>
                    <bitfield caption="Interrupt Vector Select" mask="0x02" name="IVSEL"/>
                    <bitfield caption="Interrupt Vector Change Enable" mask="0x01" name="IVCE"/>
                </register>
                <register caption="MCU Status Register" name="MCUSR" offset="0x54" size="1">
                    <bitfield caption="JTAG Reset Flag" mask="0x10" name="JTRF"/>
                    <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="Sleep Mode Control Register" name="SMCR" offset="0x53" size="1">
                    <bitfield caption="Sleep Mode Select bits" mask="0x0E" name="SM" values="CPU_SLEEP_MODE_3BITS3"/>
                    <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="Clock Control and Status Register" name="CCSR" offset="0xC0" size="1">
                    <bitfield caption="32 kHz Crystal Oscillator Enable" mask="0x02" name="XOE"/>
                    <bitfield caption="Asynchronous Clock Select" mask="0x01" name="ACS"/>
                </register>
                <register caption="Digital Input Disable Register" name="DIDR0" offset="0x7E" size="1" mask="0x0F"/>
                <register caption="Power Reduction Register 0" name="PRR0" offset="0x64" size="1">
                    <bitfield caption="Power Reduction TWI" mask="0x08" name="PRTWI"/>
                    <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-group>
            <value-group caption="" name="CPU_SLEEP_MODE_3BITS3">
                <value caption="Idle" name="IDLE" value="0x00"/>
                <value caption="ADC Noise Reduction (If Available)" name="ADC" value="0x01"/>
                <value caption="Power Down" name="PDOWN" 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>
        </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="Timer/Counter, 8-bit" name="TC8">
            <register-group caption="Timer/Counter, 8-bit" name="TC0">
                <register caption="Timer/Counter0 Control Register" name="TCCR0A" offset="0x44" size="1">
                    <bitfield caption="Force Output Compare" mask="0xC0" name="COM0A"/>
                    <bitfield caption="" mask="0x30" name="COM0B"/>
                    <bitfield caption="Clock Select0 bits" mask="0x03" name="WGM0"/>
                </register>
                <register caption="Timer/Counter0 Control Register" name="TCCR0B" offset="0x45" size="1">
                    <bitfield caption="Force Output Compare" mask="0x80" name="FOC0A"/>
                    <bitfield caption="Waveform Generation Mode" mask="0x40" name="FOC0B"/>
                    <bitfield caption="" mask="0x08" name="WGM02"/>
                    <bitfield caption="Clock Select0 bits" mask="0x07" name="CS0" values="CLK_SEL_3BIT_EXT"/>
                </register>
                <register caption="Timer Counter 0" name="TCNT0" offset="0x46" size="1" mask="0xFF"/>
                <register caption="Output compare Register A" name="OCR0A" offset="0x47" size="1">
                    <bitfield caption="" mask="0xFF" name="OCR0A"/>
                </register>
                <register caption="Output compare Register B" name="OCR0B" offset="0x48" size="1">
                    <bitfield caption="" mask="0xFF" name="OCR0B"/>
                </register>
                <register caption="Timer/Counter Interrupt Mask Register" name="TIMSK0" offset="0x6E" size="1">
                    <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="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>
            <value-group caption="" name="CLK_SEL_3BIT_EXT">
                <value caption="No Clock Source (Stopped)" name="VAL_0x00" value="0x00"/>
                <value caption="Running, No Prescaling" name="VAL_0x01" value="0x01"/>
                <value caption="Running, CLK/8" name="VAL_0x02" value="0x02"/>
                <value caption="Running, CLK/64" name="VAL_0x03" value="0x03"/>
                <value caption="Running, CLK/256" name="VAL_0x04" value="0x04"/>
                <value caption="Running, CLK/1024" name="VAL_0x05" value="0x05"/>
                <value caption="Running, ExtClk Tn Falling Edge" name="VAL_0x06" value="0x06"/>
                <value caption="Running, ExtClk Tn Rising Edge" name="VAL_0x07" value="0x07"/>
            </value-group>
        </module>
        <module caption="I/O Port" name="PORT">
            <register-group caption="I/O Port" name="PORTA">
                <register caption="Port A Data Register" name="PORTA" offset="0x22" size="1" mask="0xFF"/>
                <register caption="Port A Data Direction Register" name="DDRA" offset="0x21" size="1" mask="0xFF"/>
                <register caption="Port A Input Pins" name="PINA" offset="0x20" size="1" mask="0xFF" ocd-rw="R"/>
            </register-group>
            <register-group caption="I/O Port" name="PORTB">
                <register caption="Port B Data Register" name="PORTB" offset="0x25" size="1" mask="0xFF"/>
                <register caption="Port B Data Direction Register" name="DDRB" offset="0x24" size="1" mask="0xFF"/>
                <register caption="Port B Input Pins" name="PINB" offset="0x23" size="1" mask="0xFF" ocd-rw="R"/>
            </register-group>
            <register-group caption="I/O Port" name="PORTC">
                <register caption="Port C Data Register" name="PORTC" offset="0x28" size="1" mask="0x01"/>
            </register-group>
            <register-group caption="I/O Port" name="PORTD">
                <register caption="Data Register, Port D" name="PORTD" offset="0x2B" size="1" mask="0x03"/>
                <register caption="Data Direction Register, Port D" name="DDRD" offset="0x2A" size="1" mask="0x03"/>
                <register caption="Input Pins, Port D" name="PIND" offset="0x29" size="1" mask="0x03"/>
            </register-group>
        </module>
        <module caption="Bootloader" name="BOOT_LOAD">
            <register-group caption="Bootloader" name="BOOT_LOAD">
                <register caption="Store Program Memory Control Register" name="SPMCSR" offset="0x57" size="1">
                    <bitfield caption="SPM Interrupt Enable" mask="0x80" name="SPMIE"/>
                    <bitfield caption="Read While Write Section Busy" mask="0x40" name="RWWSB"/>
                    <bitfield caption="Signature Row Read" mask="0x20" name="SIGRD"/>
                    <bitfield caption="Read While Write section read enable" mask="0x10" name="RWWSRE"/>
                    <bitfield caption="Boot Lock Bit Set" mask="0x08" name="BLBSET"/>
                    <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="Two Wire Serial Interface" name="TWI">
            <register-group caption="Two Wire Serial Interface" name="TWI">
                <register caption="TWI Bus Control and Status Register" name="TWBCSR" offset="0xBE" size="1">
                    <bitfield caption="TWI Bus Connect/Disconnect Interrupt Flag" mask="0x80" name="TWBCIF"/>
                    <bitfield caption="TWI Bus Connect/Disconnect Interrupt Enable" mask="0x40" name="TWBCIE"/>
                    <bitfield caption="TWI Bus Disconnect Time-out Period" mask="0x06" name="TWBDT"
                              values="COMM_TW_BUS_TIMEOUT"/>
                    <bitfield caption="TWI Bus Connect/Disconnect Interrupt Polarity" mask="0x01" name="TWBCIP"/>
                </register>
                <register caption="TWI (Slave) Address Mask Register" name="TWAMR" offset="0xBD" size="1">
                    <bitfield caption="" mask="0xFE" name="TWAM"/>
                </register>
                <register caption="TWI Bit Rate register" name="TWBR" offset="0xB8" size="1" mask="0xFF"/>
                <register caption="TWI Control Register" name="TWCR" offset="0xBC" size="1" ocd-rw="R">
                    <bitfield caption="TWI Interrupt Flag" mask="0x80" name="TWINT"/>
                    <bitfield caption="TWI Enable Acknowledge Bit" mask="0x40" name="TWEA"/>
                    <bitfield caption="TWI Start Condition Bit" mask="0x20" name="TWSTA"/>
                    <bitfield caption="TWI Stop Condition Bit" mask="0x10" name="TWSTO"/>
                    <bitfield caption="TWI Write Collition Flag" mask="0x08" name="TWWC"/>
                    <bitfield caption="TWI Enable Bit" mask="0x04" name="TWEN"/>
                    <bitfield caption="TWI Interrupt Enable" mask="0x01" name="TWIE"/>
                </register>
                <register caption="TWI Status Register" name="TWSR" offset="0xB9" size="1" ocd-rw="R">
                    <bitfield caption="TWI Status" mask="0xF8" name="TWS" lsb="3"/>
                    <bitfield caption="TWI Prescaler" mask="0x03" name="TWPS" values="COMM_TWI_PRESACLE"/>
                </register>
                <register caption="TWI Data register" name="TWDR" offset="0xBB" size="1" mask="0xFF"/>
                <register caption="TWI (Slave) Address register" name="TWAR" offset="0xBA" size="1">
                    <bitfield caption="TWI (Slave) Address register Bits" mask="0xFE" name="TWA"/>
                    <bitfield caption="TWI General Call Recognition Enable Bit" mask="0x01" name="TWGCE"/>
                </register>
            </register-group>
            <value-group caption="" name="COMM_TW_BUS_TIMEOUT">
                <value caption="250ms" name="VAL_0x00" value="0x00"/>
                <value caption="500ms" name="VAL_0x01" value="0x01"/>
                <value caption="1000ms" name="VAL_0x02" value="0x02"/>
                <value caption="2000ms" name="VAL_0x03" value="0x03"/>
            </value-group>
            <value-group caption="" name="COMM_TWI_PRESACLE">
                <value caption="1" name="VAL_0x00" value="0x00"/>
                <value caption="4" name="VAL_0x01" value="0x01"/>
                <value caption="16" name="VAL_0x02" value="0x02"/>
                <value caption="64" name="VAL_0x03" value="0x03"/>
            </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"/>
                <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="EEPROM" name="EEPROM">
            <register-group caption="EEPROM" name="EEPROM">
                <register caption="EEPROM Address Register Bytes" name="EEAR" offset="0x41" size="2" mask="0x01FF"/>
                <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="EEPROM Programming Mode Bits" mask="0x30" name="EEPM" values="EEP_MODE"/>
                    <bitfield caption="EEPROM Ready Interrupt Enable" mask="0x08" name="EERIE"/>
                    <bitfield caption="EEPROM Master Programming Enable" mask="0x04" name="EEMPE"/>
                    <bitfield caption="EEPROM Programming 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>
    </modules>
    <pinouts>
        <pinout name="QFP48">
            <pin pad="SGND" position="1"/>
            <pin pad="PA0" position="2"/>
            <pin pad="PA1" position="3"/>
            <pin pad="PA2" position="4"/>
            <pin pad="PA3" position="5"/>
            <pin pad="VREG" position="6"/>
            <pin pad="VCC" position="7"/>
            <pin pad="GND" position="8"/>
            <pin pad="PA4" position="9"/>
            <pin pad="PA5" position="10"/>
            <pin pad="PA6" position="11"/>
            <pin pad="PA7" position="12"/>
            <pin pad="RESET" position="13"/>
            <pin pad="XTAL1" position="14"/>
            <pin pad="XTAL2" position="15"/>
            <pin pad="GND" position="16"/>
            <pin pad="PB0" position="17"/>
            <pin pad="PB1" position="18"/>
            <pin pad="PB2" position="19"/>
            <pin pad="PB3" position="20"/>
            <pin pad="PB4" position="21"/>
            <pin pad="PB5" position="22"/>
            <pin pad="SCL" position="23"/>
            <pin pad="SDA" position="24"/>
            <pin pad="PB6" position="25"/>
            <pin pad="PB7" position="26"/>
            <pin pad="PD0" position="27"/>
            <pin pad="PD1" position="28"/>
            <pin pad="GND" position="29"/>
            <pin pad="PC0" position="30"/>
            <pin pad="BATT" position="31"/>
            <pin pad="OPC" position="32"/>
            <pin pad="OC" position="33"/>
            <pin pad="VFET" position="34"/>
            <pin pad="OD" position="35"/>
            <pin pad="PVT1" position="36"/>
            <pin pad="GND" position="37"/>
            <pin pad="PV4" position="38"/>
            <pin pad="PV3" position="39"/>
            <pin pad="PV2" position="40"/>
            <pin pad="PV1" position="41"/>
            <pin pad="NV" position="42"/>
            <pin pad="VREF" position="43"/>
            <pin pad="VREFGND" position="44"/>
            <pin pad="PPI" position="45"/>
            <pin pad="PI" position="46"/>
            <pin pad="NI" position="47"/>
            <pin pad="NNI" position="48"/>
        </pinout>
    </pinouts>
</target-description-file>
