<!DOCTYPE SimulIDE>

<parts>
  <port name="PORTB" pins="8" outreg="PORTB" inreg="PINB" dirreg="DDRB"
        clockpins="PORTB6,PORTB7">
  </port>

  <port name="PORTC" pins="7" outreg="PORTC" inreg="PINC" dirreg="DDRC" 
        resetpin="PORTC6">
  </port>

  <port name="PORTD" pins="8" outreg="PORTD" inreg="PIND" dirreg="DDRD">
    <extint    name="INT0" pin="PORTD2" configbits="ISC00,ISC01"/>
    <extint    name="INT1" pin="PORTD3" configbits="ISC10,ISC11"/>
  </port>

  <timer name="TIMER0" type="801" configregsA="TCCR0"
                       counter="TCNT0"
                       clockpin="PORTD4"
                       interrupt="T0_OVF"
                       prescalers="0,1,8,64,256,1024,EXT_F,EXT_R" 
                       prselect="CS00,CS01,CS02" >
  </timer>

  <timer name="TIMER1"  type="160" configregsA="TCCR1A" configregsB="TCCR1B"
                        counter="TCNT1L,TCNT1H"
                        clockpin="PORTD5"
                        interrupt="T1_OVF"
                        prescalers="0,1,8,64,256,1024,EXT_F,EXT_R" 
                        prselect="CS10,CS11,CS12" >
    
    <ocunit name="OC1A" pin="PORTB1" ocreg="OCR1AL,OCR1AH" bits="COM1A0,COM1A1" interrupt="T1COA" />
    <ocunit name="OC1B" pin="PORTB2" ocreg="OCR1BL,OCR1BH" bits="COM1B0,COM1B1" interrupt="T1COB" />
  </timer>

  <timer name="TIMER2"  type="821" configregsA="TCCR2"
                        counter="TCNT2"
                        interrupt="T2_OVF"
                        prescalers="0,1,8,32,64,128,256,1024" 
                        prselect="CS20,CS21,CS22" >
    
    <ocunit name="OC2A" pin="PORTB3" ocreg="OCR2" bits="COM20,COM21" interrupt="T2CO" />
  </timer>

  <usart name="USART" number="1" configregsA="UCSRA" configregsB="UCSRB" configregsC="UCSRC"
                      interrupt="USART_U">

    <trunit type="tx" pin="PORTD1" register="UDR" interrupt="USART_T" />
    <trunit type="rx" pin="PORTD0"                interrupt="USART_R" />
  </usart>

  <port name="PORTV" pins="4"/> <!-- Fake Port for aVcc, aRef, ADC6, ADC7 -->
  <adc name="ADC" type="01" bits="10" configregsA="ADCSRA"
                  dataregs="ADCL,ADCH"
                  multiplex="ADMUX"
                  interrupt="ADC"
                  prescalers="2,2,4,8,16,32,64,128"
                  adcpins="PORTC0,PORTC1,PORTC2,PORTC3,PORTC4,PORTC5,PORTV2,PORTV3" />

  <twi name="TWI"   configregsA="TWCR" configregsB="TWBR"
                    dataregs="TWDR"
                    addressreg="TWAR"
                    statusreg="TWSR"
                    interrupt="TWI"
                    prescalers="1,4,16,64"
                    pins="PORTC4,PORTC5" /><!-- "SDA,SCL" -->

  <spi name="SPI"   configregsA="SPCR"
                    dataregs="SPDR"
                    statusreg="SPSR"
                    interrupt="SPI"
                    prescalers="4,16,64,128,2,8,32,64"
                    pins="PORTB3,PORTB4,PORTB5,PORTB2" /><!-- "MOSI,MISO,SCK,SS" -->

  <wdt name="WDT01" configregsA="WDTCR"
                    interrupt="WDT"
                    prescalers="128,64,32,16,8,4,2,1"/>

  <rom  name="ROM"  configregsA="EECR"
                    dataregs="EEDR"
                    addressreg="EEARL,EEARH"
                    interrupt="EEPR" />

  <comp name="COMP" configregsA="ACSR" 
                    interrupt="ACOMP"
                    pins="PORTD6,PORTD7"/>
</parts>
