[Device] Pins=32 Ports=4 ADCPins=8 ADCBits=10 MaxClock=20000000 PrescalerBits=3 ClockDivider=1 ConfigAddress=0x0000 ConfigCount=2 PortBits=8 PWMCount=3 UARTCount=1 SPICount=1 I2CCount=1 CANCount=0 ComparatorCount=1 TimerCount8=2 TimerCount16=1 EepromSize=512 HasAltPWM=0 DefaultPackageType=1 FlowcodeProduct=AVR ChipName=atmega8 AltChipName=m8 FlashSize=8192 RamSize=1024 [ICD] ClockPort=1 ClockPin=6 DataPort=1 DataPin=7 [Pins] Pin29="(/RESET) PC6" Pin30="(RXD) PD0" Pin31="(TXD) PD1" Pin32="(INT0) PD2" Pin1="(INT1) PD3" Pin2="(XCK/T0) PD4" Pin4="Vcc" Pin6="Vcc" Pin3="Gnd" Pin5="Gnd" Pin21="Gnd" Pin7="(XTAL1/TOSC1) PB6" Pin8="(XTAL2/TOSC2) PB7" Pin9="(T1) PD5" Pin10="(AIN0) PD6" Pin11="(AIN1) PD7" Pin12="(ICP1) PB0" Pin13="PB1 (OC1A)" Pin14="PB2 (/SS/OC1B)" Pin15="PB3 (MOSI/OC2)" Pin16="PB4 (MISO)" Pin17="PB5 (SCK)" Pin18="AVcc" Pin20="ARef" Pin23="PC0 (ADC0)" Pin24="PC1 (ADC1)" Pin25="PC2 (ADC2)" Pin26="PC3 (ADC3)" Pin27="PC4 (ADC4/SDA)" Pin28="PC5 (ADC5/SCL)" Pin19="PC6 (ADC6)" Pin22="PC7 (ADC7)" [Ports] PortPin29=0x0206 PortPin30=0x0300 PortPin31=0x0301 PortPin32=0x0302 PortPin1=0x0303 PortPin2=0x0304 PortPin7=0x0106 PortPin8=0x0107 PortPin9=0x0305 PortPin10=0x0306 PortPin11=0x0307 PortPin12=0x0100 PortPin13=0x0101 PortPin14=0x0102 PortPin15=0x0103 PortPin16=0x0104 PortPin17=0x0105 PortPin23=0x0200 PortPin24=0x0201 PortPin25=0x0202 PortPin26=0x0203 PortPin27=0x0204 PortPin28=0x0205 PortPin19=0x0206 PortPin22=0x0207 [PortMasks] PortMask0=0x00 PortMask1=0xFF PortMask2=0x7F PortMask3=0xFF [ADCPins] ADC0=23 ADC1=24 ADC2=25 ADC3=26 ADC4=27 ADC5=28 ADC6=19 ADC7=22 [Code] ;Substitute macros ;%c Clock Speed ;%o Operand ;%s Prescaler ;%p PortID ;%m MaskBits ;%i Inverse Mask ;%a ADC channel ;%a Config Address ;%v Config Value ;%r Interrupt Flag Register ;%b Interrupt Flag Bit ;%n Interrupt Macro Name Directives="#define F_CPU %cUL\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n" MainStart="int main()\n{\n" MainEnd="\tmainendloop: goto mainendloop;\n}\n\n" IntStart="" IntEnd="" Initialise="MCUCSR=0x00;\n\twdt_disable();\n" IntInit="" InputCmdFull="DDR%p = DDR%p & %i;\n%o = PIN%p;\n" InputCmdOneBit="DDR%p = DDR%p & %i;\n%o = ((PIN%p & %m) == %m);\n" InputCmdMask="DDR%p = DDR%p & %i;\n%o = PIN%p & %m;\n" OutputCmdFull="DDR%p = 0xFF;\nPORT%p = %o;\n" OutputCmdOneBit="DDR%p = DDR%p | %m;\nif (%o)\n\tPORT%p = (PORT%p & %i) | %m;\nelse\n\tPORT%p = PORT%p & %i;\n" OutputCmdMask="DDR%p = DDR%p | %m;\nPORT%p = (PORT%p & %i) | %o;\n" DelayCmdS="delay_s(%o);\n" DelayCmdMs="delay_ms(%o);\n" DelayCmdUs="delay_us(%o);\n" WdtDelayCmdS="Wdt_Delay_S(%o);\n" WdtDelayCmdMs="Wdt_Delay_Ms(%o);\n" InitialPortLetter="A" ConfigData="#pragma DATA %a, %v\n" IntHandler="" [Defines] Define1=#define FC_CAL_AVR Define2=#define MX_ADC Define3=#define MX_ADC_TYPE_2 Define4=#define MX_ADC_BITS_10 Define5=#define MX_EE Define6=#define MX_EE_SIZE 512 Define7=#define MX_SPI_1 Define8=#define MX_SPI_1_MISO_PORT PORTB Define9=#define MX_SPI_1_MISO_TRIS DDRB Define10=#define MX_SPI_1_MISO_PIN 4 Define11=#define MX_SPI_1_MOSI_PORT PORTB Define12=#define MX_SPI_1_MOSI_TRIS DDRB Define13=#define MX_SPI_1_MOSI_PIN 3 Define14=#define MX_SPI_1_CLK_PORT PORTB Define15=#define MX_SPI_1_CLK_TRIS DDRB Define16=#define MX_SPI_1_CLK_PIN 5 Define17=#define MX_SPI_1_SS_PORT PORTB Define18=#define MX_SPI_1_SS_TRIS DDRB Define19=#define MX_SPI_1_SS_PIN 2 Define20=#define MX_UART_1 Define21=#define MX_UART_1_TX_PORT PORTD Define22=#define MX_UART_1_TX_TRIS DDRD Define23=#define MX_UART_1_TX_PIN 1 Define24=#define MX_UART_1_RX_PORT PORTD Define25=#define MX_UART_1_RX_TRIS DDRD Define26=#define MX_UART_1_RX_PIN 0 Define27=#define MX_MI2C Define28=#define MX_I2C_1 Define29=#define MX_I2C_1_SDA_PORT PORTC Define30=#define MX_I2C_1_SDA_TRIS DDRC Define31=#define MX_I2C_1_SDA_PIN 4 Define32=#define MX_I2C_1_SCL_PORT PORTC Define33=#define MX_I2C_1_SCL_TRIS DDRC Define34=#define MX_I2C_1_SCL_PIN 5 Define35=#define MX_PWM Define36=#define MX_PWMTYPE 1 Define37=#define MX_PWM_CNT 3 Define38=#define MX_PWM_TMR0_CNT 0 Define39=#define MX_PWM_TMR1_CNT 2 Define40=#define MX_PWM_TMR2_CNT 1 Define41=#define MX_PWM_PSCA1 Define42=#define MX_PWM_PSCA8 Define43=#define MX_PWM_PSCA64 Define44=#define MX_PWM_PSCA256 Define45=#define MX_PWM_PSCA1024 Define46=#define MX_PWM_1_PORT PORTB Define47=#define MX_PWM_1_TRIS DDRB Define48=#define MX_PWM_1_PIN 1 Define49=#define MX_PWM_2_PORT PORTB Define50=#define MX_PWM_2_TRIS DDRB Define51=#define MX_PWM_2_PIN 2 Define52=#define MX_PWM_3_PORT PORTB Define53=#define MX_PWM_3_TRIS DDRB Define54=#define MX_PWM_3_PIN 3 [Interrupts] GeneralInit="sei();\n" Count=9 1=TMR0 2=TMR1 3=TMR2 4=INT0 5=INT1 6=RXINT0 7=TMR2A 8=ADC 9=Analog_Comp [TMR0] Name="TMR0 Overflow" HandlerCode="#ifndef MX_TIMER0OVF_HANDLER\n#define MX_TIMER0OVF_HANDLER\nISR(TIMER0_OVF_vect)\n{\n\tFCM_%n();\n}\n#else\n#warning The interrupt has previously been enabled, so the macro <%n> may never get called.\n#endif\n" EnableCode="TIMSK |= (1 << TOIE0);\n" DisableCode="TIMSK &= ~(1 << TOIE0);\n" OptCnt=1 PrescaleOpt=1 MaxTimerOverflow=256 Opt1="Clock Source & Prescaler Select" Opt1Cnt=8 Opt1_1="no clock" Opt1_1Val="TCCR0 &= 0xf8;\n" Opt1_2="1:1" Opt1_2Val="TCCR0 &= 0xf8;\nTCCR0 |= 0x01;\n" Opt1_3="1:8" Opt1_3Val="TCCR0 &= 0xf8;\nTCCR0 |= 0x02;\n" Opt1_4="1:64" Opt1_4Val="TCCR0 &= 0xf8;\nTCCR0 |= 0x03;\n" Opt1_5="1:256" Opt1_5Val="TCCR0 &= 0xf8;\nTCCR0 |= 0x04;\n" Opt1_6="1:1024" Opt1_6Val="TCCR0 &= 0xf8;\nTCCR0 |= 0x05;\n" Opt1_7="T0 pin, -ve edge" Opt1_7Val="TCCR0 &= 0xf8;\nTCCR0 |= 0x06;\n" Opt1_8="T0 pin, +ve edge" Opt1_8Val="TCCR0 &= 0xf8;\nTCCR0 |= 0x07;\n" [TMR1] Name="TMR1 Overflow" HandlerCode="#ifndef MX_TIMER1OVF_HANDLER\n#define MX_TIMER1OVF_HANDLER\nISR(TIMER1_OVF_vect)\n{\n\tFCM_%n();\n}\n#else\n#warning The interrupt has previously been enabled, so the macro <%n> may never get called.\n#endif\n" EnableCode="TIMSK1 |= (1 << TOIE1);\n" DisableCode="TIMSK1 &= ~(1 << TOIE1);\n" OptCnt=1 PrescaleOpt=1 MaxTimerOverflow=65536 Opt1="Clock Source & Prescaler Select" Opt1Cnt=8 Opt1_1="no clock" Opt1_1Val="TCCR1B &= 0xf8;\n" Opt1_2="1:1" Opt1_2Val="TCCR1B &= 0xf8;\nTCCR1B |= 0x01;\n" Opt1_3="1:8" Opt1_3Val="TCCR1B &= 0xf8;\nTCCR1B |= 0x02;\n" Opt1_4="1:64" Opt1_4Val="TCCR1B &= 0xf8;\nTCCR1B |= 0x03;\n" Opt1_5="1:256" Opt1_5Val="TCCR1B &= 0xf8;\nTCCR1B |= 0x04;\n" Opt1_6="1:1024" Opt1_6Val="TCCR1B &= 0xf8;\nTCCR1B |= 0x05;\n" Opt1_7="T1 pin, -ve edge" Opt1_7Val="TCCR1B &= 0xf8;\nTCCR1B |= 0x06;\n" Opt1_8="T1 pin, +ve edge" Opt1_8Val="TCCR1B &= 0xf8;\nTCCR1B |= 0x07;\n" [TMR2A] Name="TMR2 Asynchronous" HandlerCode="#ifndef MX_TIMER2OVF_HANDLER\n#define MX_TIMER2OVF_HANDLER\nISR(TIMER2_OVF_vect)\n{\n\tFCM_%n();\n}\n#else\n#warning The interrupt has previously been enabled, so the macro <%n> may never get called.\n#endif\n" EnableCode="TIMSK |= (1 << TOIE2);\n ASSR = (1<