<root>
<device name='30F2010' product='PIC16' family='30F' bits='16' >
    <clock max_speed='120000000' master_divider='4' default='12000000' />
    <memory >
        <flash bytes='12288' />
        <ram bytes='512' />
    </memory>
    <configuration address='0xF80000' mult='2' >
        <format >
            <word address='_FOSC' value='0x8712' />
            <word address='_FWDT' value='0x3f' />
            <word address='_FBORPOR' value='0x87b3' />
            <word address='_FGS' value='0x7' />
            <word address='_FICD' value='0xc003' />
        </format>
        <setting />
        <settings >
            <setting name='FPR' offset='0' mask='15' bits='4' hint='Primary Oscillator Mode' >
                <option name='ECIO w/ PLL 16x' value='15' />
                <option name='ECIO w/ PLL 8x' value='14' />
                <option name='ECIO w/ PLL 4x' value='13' />
                <option name='ECIO' value='12' />
                <option name='EC' value='11' />
                <option name='ERC' value='9' />
                <option name='ERCIO' value='8' />
                <option name='XT w/PLL 16x' value='7' />
                <option name='XT w/PLL 8x' value='6' />
                <option name='XT w/PLL 4x' value='5' />
                <option name='XT' value='4' />
                <option name='HS' value='2' />
                <option name='XTL' value='0' />
            </setting>
            <setting name='FOS' offset='8' mask='3' bits='2' hint='Oscillator Source' >
                <option name='Primary Oscillator' value='3' />
                <option name='Internal Low-Power RC' value='2' />
                <option name='Internal Fast RC' value='1' />
                <option name='Low-Power 32KHz Osc &lt;TMR1 Osc&gt;' value='0' />
            </setting>
            <setting name='FCKSMEN' offset='14' mask='3' bits='2' hint='Clock Switching and Monitor' >
                <option name='Sw Disabled, Mon Disabled' value='2' />
                <option name='Sw Enabled, Mon Disabled' value='1' />
                <option name='Sw Enabled, Mon Enabled' value='0' />
            </setting>
            <setting name='FWPSB' offset='16' mask='15' bits='4' hint='WDT Prescaler B' >
                <option name='1:1' value='0' />
                <option name='1:2' value='1' />
                <option name='1:3' value='2' />
                <option name='1:4' value='3' />
                <option name='1:5' value='4' />
                <option name='1:6' value='5' />
                <option name='1:7' value='6' />
                <option name='1:8' value='7' />
                <option name='1:9' value='8' />
                <option name='1:10' value='9' />
                <option name='1:11' value='10' />
                <option name='1:12' value='11' />
                <option name='1:13' value='12' />
                <option name='1:14' value='13' />
                <option name='1:15' value='14' />
                <option name='1:16' value='15' />
            </setting>
            <setting name='FWPSA' offset='20' mask='3' bits='2' hint='WDT Prescaler A' >
                <option name='1:1' value='0' />
                <option name='1:8' value='1' />
                <option name='1:64' value='2' />
                <option name='1:512' value='3' />
            </setting>
            <setting name='WDT' offset='31' mask='1' bits='1' hint='Watchdog Timer' >
                <option name='Enabled' value='1' />
                <option name='Disabled' value='0' />
            </setting>
            <setting name='FPWRT' offset='32' mask='3' bits='2' hint='POR Timer Value' >
                <option name='Timer Disabled' value='0' />
                <option name='4ms' value='1' />
                <option name='16ms' value='2' />
                <option name='64ms' value='3' />
            </setting>
            <setting name='BODENV' offset='36' mask='3' bits='2' hint='Brown Out Voltage' >
                <option name='4.5V' value='0' />
                <option name='4.2V' value='1' />
                <option name='2.7V' value='2' />
                <option name='Reserved' value='3' />
            </setting>
            <setting name='BOREN' offset='39' mask='1' bits='1' hint='PBOR Enable' >
                <option name='Enabled' value='1' />
                <option name='Disabled' value='0' />
            </setting>
            <setting name='LPOL' offset='40' mask='1' bits='1' hint='Low-side PWM Output Polarity' >
                <option name='Active High' value='1' />
                <option name='Active Low' value='0' />
            </setting>
            <setting name='HPOL' offset='41' mask='1' bits='1' hint='High-side PWM Output Polarity' >
                <option name='Active High' value='1' />
                <option name='Active Low' value='0' />
            </setting>
            <setting name='PWMPIN' offset='42' mask='1' bits='1' hint='PWM Output Pin Reset' >
                <option name='Control with PORT/TRIS regs' value='1' />
                <option name='Control with HPOL/LPOL bits' value='0' />
            </setting>
            <setting name='MCLRE' offset='47' mask='1' bits='1' hint='Master Clear Enable' >
                <option name='Enabled' value='1' />
                <option name='Disabled' value='0' />
            </setting>
            <setting name='GWRP' offset='48' mask='1' bits='1' hint='General Code Segment Write Protect' >
                <option name='Disabled' value='1' />
                <option name='Enabled' value='0' />
            </setting>
            <setting name='GCP' offset='49' mask='1' bits='1' hint='General Segment Code Protection' >
                <option name='Disabled' value='1' />
                <option name='Enabled' value='0' />
            </setting>
            <setting name='ICS' offset='64' mask='3' bits='2' hint='Comm Channel Select' >
                <option name='Use PGC/EMUC and PGD/EMUD' value='3' />
                <option name='Use EMUC1 and EMUD1' value='2' />
                <option name='Use EMUC2 and EMUD2' value='1' />
                <option name='Use EMUC3 and EMUD3' value='0' />
            </setting>
            <setting name='COE' offset='78' mask='1' bits='1' hint='Set Clip On Emulation Mode' >
                <option name='Reset Into Operational Mode' value='1' />
                <option name='Reset Into Clip On Emulation Mode' value='0' />
            </setting>
            <setting name='BACKBUG' offset='79' mask='1' bits='1' hint='Background Debug' >
                <option name='Disabled' value='1' />
                <option name='Enabled' value='0' />
            </setting>
        </settings>
    </configuration>
    <pins sides='2' smd='1' >
        <pin name='MCLR' />
        <pin name='AN0 / VREF+ / RB0' port='1' bit='0' adc='0' />
        <pin name='AN1 / RB1' port='1' bit='1' adc='1' />
        <pin name='AN2 / RB2' port='1' bit='2' adc='2' />
        <pin name='AN3 / RB3' port='1' bit='3' adc='3' />
        <pin name='AN4 / RB4' port='1' bit='4' adc='4' />
        <pin name='AN5 / RB5' port='1' bit='5' adc='5' />
        <pin name='VSS' />
        <pin name='OSC1' />
        <pin name='OSC2 / RC15' port='2' bit='15' />
        <pin name='RC13' port='2' bit='13' />
        <pin name='RC14' port='2' bit='14' />
        <pin name='VDD' />
        <pin name='INT2 / OC2 / RD1' port='3' bit='1' />
        <pin name='INT1 / OC1 / RD0' port='3' bit='0' />
        <pin name='INT0 / SCK1 / RE8' port='4' bit='8' />
        <pin name='PGD / SDO1 / SCL1 / TX1 / RF3' port='5' bit='3' />
        <pin name='PGC / SDI1 / SDA1 / RX1 / RF2' port='5' bit='2' />
        <pin name='VSS' />
        <pin name='VDD' />
        <pin name='RE5' port='4' bit='5' />
        <pin name='RE4' port='4' bit='4' />
        <pin name='RE3' port='4' bit='3' />
        <pin name='RE2' port='4' bit='2' />
        <pin name='RE1' port='4' bit='1' />
        <pin name='RE0' port='4' bit='0' />
        <pin name='AVSS' />
        <pin name='AVDD' />
    </pins>
    <adc type='3' bits='10' >
        <speed >
            <option name='FRC' value='64' />
            <option name='Tcy' value='0' />
            <option name='Tcy * 2' value='1' />
            <option name='Tcy * 4' value='3' />
            <option name='Tcy * 8' value='7' />
            <option name='Tcy * 16' value='15' />
            <option name='Tcy * 32' value='31' />
            <option name='Tcy * 64' value='63' />
        </speed>
    </adc>
    <eeprom type='1' bytes='1024' />
    <spi >
        <miso port='5' pin='2' />
        <mosi port='5' pin='3' />
        <clk port='5' pin='8' />
    </spi>
    <uart >
        <tx port='5' pin='3' />
        <rx port='5' pin='2' />
    </uart>
    <i2c master='1' >
        <sda port='5' pin='2' />
        <scl port='5' pin='3' />
    </i2c>
    <pwm>
    	<timer>
    	    <option name='Timer2' value='2' />
    	    <option name='Timer3' value='3' />
    	</timer>
        <prescaler >
            <option name='1' value='0' />
            <option name='8' value='1' />
            <option name='64' value='2' />
            <option name='256' value='3' />
        </prescaler>
        <out port='3' pin='0' />
        <out port='3' pin='1' />
        <nout port='4' pin='0' />
        <nout port='4' pin='1' />
        <nout port='4' pin='2' />
        <nout port='4' pin='3' />
        <nout port='4' pin='4' />
        <nout port='4' pin='5' />
    </pwm>
    <interrupts >
        <interrupt ident='INT0' type='pin' name='INT0/RE8' handler='#ifndef MX_ISR_I0\n#define MX_ISR_I0\nvoid _ISR _INT0Interrupt(void)\n{\n\tIFS0bits.INT0IF = 0;\n\tFCM_%n();\n}\n#else\n#warning &quot;This interrupt has previously been enabled, so the macro &lt;%n&gt; may never get called.&quot;\n#endif\n' enable='IEC0bits.INT0IE = 1;' disable='IEC0bits.INT0IE = 0;' >
            <ioc config='3' >
                <rising port='4' mask='0x0100' />
                <falling port='4' mask='0x0100' />
            </ioc>
            <options >
                <edge name='Interrupt Edge Select' >
                    <entry name='Rising edge of INT' value='INTCON2bits.INT0EP = 0;\n' />
                    <entry name='Falling edge of INT' value='INTCON2bits.INT0EP = 1;\n' />
                </edge>
            </options>
        </interrupt>
        <interrupt ident='INT1' type='pin' name='INT1/RD0' handler='#ifndef MX_ISR_I1\n#define MX_ISR_I1\nvoid _ISR _INT1Interrupt(void)\n{\n\tIFS1bits.INT1IF = 0;\n\tFCM_%n();\n}\n#else\n#warning &quot;This interrupt has previously been enabled, so the macro &lt;%n&gt; may never get called.&quot;\n#endif\n' enable='IEC1bits.INT1IE = 1;' disable='IEC1bits.INT1IE = 0;' >
            <ioc config='3' >
                <rising port='3' mask='0x01' />
                <falling port='3' mask='0x01' />
            </ioc>
            <options >
                <edge name='Interrupt Edge Select' >
                    <entry name='Rising edge of INT' value='INTCON2bits.INT1EP = 0;\n' />
                    <entry name='Falling edge of INT' value='INTCON2bits.INT1EP = 1;\n' />
                </edge>
            </options>
        </interrupt>
        <interrupt ident='INT2' type='pin' name='INT2/RD1' handler='#ifndef MX_ISR_I2\n#define MX_ISR_I2\nvoid _ISR _INT2Interrupt(void)\n{\n\tIFS1bits.INT2IF = 0;\n\tFCM_%n();\n}\n#else\n#warning &quot;This interrupt has previously been enabled, so the macro &lt;%n&gt; may never get called.&quot;\n#endif\n' enable='IEC1bits.INT2IE = 1;' disable='IEC1bits.INT2IE = 0;' >
            <ioc config='3' >
                <rising port='3' mask='0x02' />
                <falling port='3' mask='0x02' />
            </ioc>
            <options >
                <edge name='Interrupt Edge Select' >
                    <entry name='Rising edge of INT' value='INTCON2bits.INT2EP = 0;\n' />
                    <entry name='Falling edge of INT' value='INTCON2bits.INT2EP = 1;\n' />
                </edge>
            </options>
        </interrupt>
        <interrupt ident='IOC0' type='multipin' name='IOC PORT' handler='#ifndef MX_ISR_CN\n#define MX_ISR_CN\nvoid _ISR _CNInterrupt(void)\n{\n\tIFS0bits.CNIF = 0;\n\tFCM_%n();\n}\n#else\n#warning &quot;This interrupt has previously been enabled, so the macro &lt;%n&gt; may never get called.&quot;\n#endif\n' enable='CNEN1 = %pA0v | (%pA1v << 8);\nIEC0bits.CNIE = 1;\n' disable='IEC0bits.CNIE = 0;\n' >
            <map >
                <pin port='2' bit='14' ident='0' />
                <pin port='2' bit='13' ident='1' />
                <pin port='1' bit='0' ident='2' />
                <pin port='1' bit='1' ident='3' />
                <pin port='1' bit='2' ident='4' />
                <pin port='1' bit='3' ident='5' />
                <pin port='1' bit='4' ident='6' />
                <pin port='1' bit='5' ident='7' />
            </map>
            <ioc config='0x0C' >
                <rising port='1' mask='0x3F' />
                <rising port='2' mask='0x6000' />
                <falling port='1' mask='0x3F' />
                <falling port='2' mask='0x6000' />
            </ioc>
        </interrupt>
        <interrupt ident='RXINT0' type='comms' name='UART RXINT 1' handler='#ifndef MX_ISR_RX1\n#define MX_ISR_RX1\nvoid _ISR _U1RXInterrupt(void)\n{\n\tIFS0bits.U1RXIF = 0;\n\tFCM_%n();\n}\n#else\n#warning &quot;This interrupt has previously been enabled, so the macro &lt;%n&gt; may never get called.&quot;\n#endif\n' enable='IEC0bits.U1RXIE = 1;\n' disable='IEC0bits.U1RXIE = 0;\n' />
        <interrupt ident='TMR1' reg='TMR1' type='timer16' name='Timer 1' handler='#ifndef MX_ISR_T1\n#define MX_ISR_T1\nvoid _ISR _T1Interrupt(void)\n{\n\tIFS0bits.T1IF = 0;\n\tFCM_%n();\n}\n#else\n#warning &quot;This interrupt has previously been enabled, so the macro &lt;%n&gt; may never get called.&quot;\n#endif\n' enable='IEC0bits.T1IE = 1;\n' disable='IEC0bits.T1IE = 0;\n' >
            <timer overflow='65536' extrange='0' />
            <options >
                <option name='Clock Source Select' >
                    <entry name='Internal (Fosc / 4)' clkdiv='4' value='T1CON = ((T1CON &amp; 0xfffd) | 0x8000);\n' />
                    <entry name='External' clkdiv='0' value='T1CON |= 0x8002;\n' />
                </option>
                <prescale name='Prescaler Rate' >
                    <entry name='1:1' value='T1CON &amp;= 0xff0f;\n' />
                    <entry name='1:8' value='T1CON = ((T1CON &amp; 0xff0f) | 0x0010);\n' />
                    <entry name='1:64' value='T1CON = ((T1CON &amp; 0xff0f) | 0x0020);\n' />
                    <entry name='1:256' value='T1CON = ((T1CON &amp; 0xff0f) | 0x0030);\n' />
                </prescale>
                <rollover name='Rollover Value' >
                    <entry name='65536' min='1' max='65536' value='PR1=%d-1;\n' />
                </rollover>
            </options>
        </interrupt>
        <interrupt ident='TMR2' reg='TMR2' type='timer16' name='Timer 2' handler='#ifndef MX_ISR_T2\n#define MX_ISR_T2\nvoid _ISR _T2Interrupt(void)\n{\n\tIFS0bits.T2IF = 0;\n\tFCM_%n();\n}\n#else\n#warning &quot;This interrupt has previously been enabled, so the macro &lt;%n&gt; may never get called.&quot;\n#endif\n' enable='IEC0bits.T2IE = 1;\n' disable='IEC0bits.T2IE = 0;\n' >
            <timer overflow='65536' extrange='0' />
            <options >
                <option name='Clock Source Select' >
                    <entry name='Internal (Fosc / 4)' clkdiv='4' value='T2CON = ((T2CON &amp; 0xfffd) | 0x8000);\n' />
                    <entry name='External' clkdiv='0' value='T2CON |= 0x8002;\n' />
                </option>
                <prescale name='Prescaler Rate' >
                    <entry name='1:1' value='T2CON &amp;= 0xff0f;\n' />
                    <entry name='1:8' value='T2CON = ((T2CON &amp; 0xff0f) | 0x0010);\n' />
                    <entry name='1:64' value='T2CON = ((T2CON &amp; 0xff0f) | 0x0020);\n' />
                    <entry name='1:256' value='T2CON = ((T2CON &amp; 0xff0f) | 0x0030);\n' />
                </prescale>
                <rollover name='Rollover Value' >
                    <entry name='65536' min='1' max='65536' value='PR2=%d-1;\n' />
                </rollover>
            </options>
        </interrupt>
        <interrupt ident='TMR3' reg='TMR3' type='timer16' name='Timer 3' handler='#ifndef MX_ISR_T3\n#define MX_ISR_T3\nvoid _ISR _T3Interrupt(void)\n{\n\tIFS0bits.T3IF = 0;\n\tFCM_%n();\n}\n#else\n#warning &quot;This interrupt has previously been enabled, so the macro &lt;%n&gt; may never get called.&quot;\n#endif\n' enable='IEC0bits.T3IE = 1;\n' disable='IEC0bits.T3IE = 0;\n' >
            <timer overflow='65536' extrange='0' />
            <options >
                <option name='Clock Source Select' >
                    <entry name='Internal (Fosc / 4)' clkdiv='4' value='T3CON = ((T3CON &amp; 0xfffd) | 0x8000);\n' />
                    <entry name='External' clkdiv='0' value='T3CON |= 0x8002;\n' />
                </option>
                <prescale name='Prescaler Rate' >
                    <entry name='1:1' value='T3CON &amp;= 0xff0f;\n' />
                    <entry name='1:8' value='T3CON = ((T3CON &amp; 0xff0f) | 0x0010);\n' />
                    <entry name='1:64' value='T3CON = ((T3CON &amp; 0xff0f) | 0x0020);\n' />
                    <entry name='1:256' value='T3CON = ((T3CON &amp; 0xff0f) | 0x0030);\n' />
                </prescale>
                <rollover name='Rollover Value' >
                    <entry name='65536' min='1' max='65536' value='PR3=%d-1;\n' />
                </rollover>
            </options>
        </interrupt>
    </interrupts>
</device>
<inline >
    <defines code='#define MX_CLKS_PER_INST 4\n#define MX_SPI1CON\n\n' />
    <directives code='#include &lt;xc.h&gt;\n#include &lt;math.h&gt;\n#include &lt;stdlib.h&gt;\n#include &quot;p30Fxxxx.h&quot;\n\n' />
    <main >
        <start code='int main()\n{\n' />
        <end code='\tmainendloop: goto mainendloop;\n\treturn 0;\n}\n\n' />
        <init code='ADPCFG = 0xffff;\n' />
    </main>
    <interrupt >
        <enable code='' />
        <start code='' />
        <end code='' />
        <init code='' />
    </interrupt>
    <config >
        <start code='//Configuration Start\n' />
        <body code='$(address)($(value));\n' />
        <end code='//Configuration End\n' />
    </config>
</inline>
<test >
    <icd >
        <clock port='1' pin='6' />
        <data port='1' pin='7' />
    </icd>
</test>
</root>
