<!DOCTYPE SimulIDE>

<parts>
    <port name="PORTB" pins="8" outreg="PORTB" inreg="PINB" dirreg="DDRB">
        <interrupt name="PCINT0" />
    </port>
    
    <port name="PORTC" pins="7" outreg="PORTC" inreg="PINC" dirreg="DDRC">
        <interrupt name="PCINT1" />
    </port>
    
    <port name="PORTD" pins="8" outreg="PORTD" inreg="PIND" dirreg="DDRD">
        <interrupt name="PCINT2" />
    </port>
    
    <timer name="TIMER0" type="800" counter="TCNT0" configregsA="TCCR0A" configregsB="TCCR0B"
                                    clockpin="PORTD4">
        <prescaler select="CS00,CS01,CS02" values="0,1,8,64,256,1024,EXT_F,EXT_R"/>
        
        <ocunit name="OC0A" pin="PORTD6" ocreg="OCR0A" configbits="COM0A0,COM0A1">
            <interrupt name="T0COA" />
        </ocunit>
        
        <ocunit name="OC0B" pin="PORTD5" ocreg="OCR0B" configbits="COM0B0,COM0B1">
            <interrupt name="T0COB" />
        </ocunit>
        
        <interrupt name="T0_OVF" />
    </timer>
    
    <timer name="TIMER1" type="160" counter="TCNT1L,TCNT1H" configregsA="TCCR1A" configregsB="TCCR1B"
                                    clockpin="PORTD5">
        <prescaler select="CS10,CS11,CS12" values="0,1,8,64,256,1024,EXT_F,EXT_R"/>
        
        <ocunit name="OC1A" pin="PORTB1" ocreg="OCR1AL,OCR1AH" configbits="COM1A0,COM1A1">
            <interrupt name="T1COA" />
        </ocunit>
        
        <ocunit name="OC1B" pin="PORTB2" ocreg="OCR1BL,OCR1BH" configbits="COM1B0,COM1B1">
            <interrupt name="T1COB" />
        </ocunit>
        
        <interrupt name="T1_OVF" />
    </timer>
    
    <timer name="TIMER2" type="820" counter="TCNT2" configregsA="TCCR2A" configregsB="TCCR2B">
        <prescaler select="CS20,CS21,CS22" values="0,1,8,32,64,128,256,1024"/>
        
        <ocunit name="OC2A" pin="PORTB3" ocreg="OCR2A" configbits="COM2A0,COM2A1">
            <interrupt name="T2COA" />
        </ocunit>
        
        <ocunit name="OC2B" pin="PORTD3" ocreg="OCR2B" configbits="COM2B0,COM2B1">
            <interrupt name="T2COB" />
        </ocunit>
        
        <interrupt name="T2_OVF" />
    </timer>
    
    <usart name="USART0"  number="1" configregsA="UCSR0C" configregsB="UCSR0B">
        <trunit type="tx" pin="PORTD1" register="UDR0">
            <interrupt name="USART_T" />
        </trunit>
        
        <trunit type="rx" pin="PORTD0" >
            <interrupt name="USART_R" />
        </trunit>
        
        <interrupt name="USART_U" />
    </usart>
    
    <port name="PORTV" pins="4"/> <!-- Fake Port for aVcc, aRef, ADC6, ADC7 -->
    <adc name="ADC" type="00" bits="10" dataregs="ADCL,ADCH" configregsA="ADCSRA"
                    configregsB="ADCSRB" multiplex="ADMUX">
        <prescaler select="" values="2,2,4,8,16,32,64,128"/>
        <pins inputs="PORTC0,PORTC1,PORTC2,PORTC3,PORTC4,PORTC5,PORTV2,PORTV3" />
        
        <interrupt name="ADC" />
    </adc>
    
    <twi name="TWI0" dataregs="TWDR" addressreg="TWAR" statusreg="TWSR" 
                     configregsA="TWCR" configregsB="TWBR">
        <prescaler select="" values="1,4,16,64"/>
        
        <inputpin name="sda" pin="PORTC4" />
        <inputpin name="scl" pin="PORTC5" />
        
        <interrupt name="TWI" />
    </twi>
    
    <spi name="SPI0" dataregs="SPDR" statusreg="SPSR" configregsA="SPCR">
        <prescaler select="" values="4,16,64,128,2,8,32,64"/>
        
        <inputpin name="mosi" pin="PORTB3" />
        <inputpin name="miso" pin="PORTB4" />
        <inputpin name="sck"  pin="PORTB5" />
        <inputpin name="ss"   pin="PORTB2" />
        
        <interrupt name="SPI" />
    </spi>
    
    <wdt name="WatchDog" configregsA="WDTCSR">
        <prescaler select="" values="512,256,128,64,32,16,8,4,2,1,1,1,1,1,1,1"/>
        <interrupt name="WDT" />
    </wdt>
    
    <eeprom name="EEPROM" dataregs="EEDR" addressreg="EEARL,EEARH" configregsA="EECR">
        <interrupt name="EEPR" />
    </eeprom>
    
    <acomp name="Comp" configregsA="ACSR" configbitsB="AIN0D,AIN1D" pins="PORTD6,PORTD7">
        <interrupt name="ACOMP" />
    </acomp>
</parts>
