<root>
<device name='16F1503' product='PIC' family='16F' bits='8' >
    <clock max_speed='20000000' master_divider='4' default='19660800' />
    <memory >
        <flash bytes='3584' />
        <ram bytes='128' />
    </memory>
    <configuration address='0x8007' mult='2' >
	<format >
	  <word value='0x3FFF' />
	  <word value='0x3FFF' />
        </format>
        <setting />
        <settings >
            <setting name='FOSC' offset='0' mask='3' bits='2' hint='Oscillator' >
                <option name='ECH, External Clock, High Power Mode: CLKIN on RA5/OSC1/CLKIN' value='3' />
                <option name='ECM, External Clock, Medium Power Mode: CLKIN on RA5/OSC1/CLKIN' value='2' />
                <option name='ECL, External Clock, Low Power Mode: CLKIN on RA5/OSC1/CLKIN' value='1' />
                <option name='INTOSC Oscillator, I/O function on RA5/OSC1/CLKIN' value='0' />
            </setting>
            <setting name='WDTE' offset='3' mask='3' bits='2' hint='Watchdog Timer Enable bit' >
                <option name='Enabled' value='3' />
                <option name='WDT enabled while running and disabled in Sleep' value='2' />
                <option name='WDT controlled by the SWDTEN bit in the WDTCON register' value='1' />
                <option name='Disabled' value='0' />
            </setting>
            <setting name='PWRTE' offset='5' mask='1' bits='1' hint='Power-up Timer Enable bit' >
                <option name='Disabled' value='1' />
                <option name='Enabled' value='0' />
            </setting>
            <setting name='MCLRE' offset='6' mask='1' bits='1' hint='MCLR Pin Function Select' >
                <option name='Enabled' value='1' />
                <option name='Disabled' value='0' />
            </setting>
            <setting name='CP' offset='7' mask='1' bits='1' hint='Flash Program Memory Code Protection bit' >
                <option name='Disabled' value='1' />
                <option name='Enabled' value='0' />
            </setting>
            <setting name='BOREN' offset='9' mask='3' bits='2' hint='Brown-out Reset Enable bits' >
                <option name='Enabled' value='3' />
                <option name='Brown-out Reset enabled while running and disabled in Sleep' value='2' />
                <option name='Brown-out Reset controlled by the SBOREN bit in the PCON register' value='1' />
                <option name='Disabled' value='0' />
            </setting>
            <setting name='CLKOUTEN' offset='11' mask='1' bits='1' hint='Clock Out Enable bit' >
                <option name='Disabled' value='1' />
                <option name='Enabled' value='0' />
            </setting>
            <setting name='WRT' offset='16' mask='3' bits='2' hint='Flash memory self-write protection bits' >
                <option name='Disabled' value='3' />
                <option name='000h to 1FFh write protected, 200h to 7FFh may be modified by EECON control' value='2' />
                <option name='000h to 3FFh write protected, 400h to 7FFh may be modified by EECON control' value='1' />
                <option name='000h to 7FFh write protected, no addresses may be modified by EECON control' value='0' />
            </setting>
            <setting name='STVREN' offset='25' mask='1' bits='1' hint='Stack Overflow/Underflow Reset Enable bit' >
                <option name='Enabled' value='1' />
                <option name='Disabled' value='0' />
            </setting>
            <setting name='BORV' offset='26' mask='1' bits='1' hint='Brown-out Reset Voltage selection' >
                <option name='Brown-out Reset Voltage (VBOR) set to 1.9 V' value='1' />
                <option name='Brown-out Reset Voltage (VBOR) set to 2.7 V' value='0' />
            </setting>
            <setting name='LPBOR' offset='28' mask='1' bits='1' hint='Low Power BOR Mode' >
                <option name='Disabled' value='1' />
                <option name='Enabled' value='0' />
            </setting>
            <setting name='LVP' offset='29' mask='1' bits='1' hint='Low Voltage Programming Enable bit' >
                <option name='Enabled' value='1' />
                <option name='Disabled' value='0' />
            </setting>
        </settings>
    </configuration>
    <pins sides='2' smd='0' >
        <pin name='VDD' />
        <pin name='RA5/OSC1/CLKIN' port='0' bit='5' />
        <pin name='RA4/AN3/OSC2/CLKOUT' port='0' bit='4' adc='3' />
        <pin name='RA3/MCLR/VPP' port='0' bit='3' />
        <pin name='RC5' port='2' bit='5' />
        <pin name='RC4' port='2' bit='4' />
        <pin name='RC3/AN7' port='2' bit='3' adc='7' />
        <pin name='RC2/AN6/SDO' port='2' bit='2' adc='6' />
        <pin name='RC1/AN5/SDA/SDI' port='2' bit='1' adc='5' />
        <pin name='RC0/AN4/SCL/SCK' port='2' bit='0' adc='4' />
        <pin name='RA2/AN2/T0CKI' port='0' bit='2' adc='2' />
        <pin name='RA1/AN1/VREF/ICSPCLK' port='0' bit='1' adc='1' />
        <pin name='RA0/AN0/ICSPDAT' port='0' bit='0' adc='0' />
        <pin name='VSS' />
    </pins>
    <adc type='26' bits='10' >
        <speed >
            <option name='Fosc / 2' value='0' />
            <option name='Fosc / 8' value='1' />
            <option name='Fosc / 32' value='2' />
            <option name='FRC' value='3' />
            <option name='Fosc / 4' value='4' />
            <option name='Fosc / 16' value='5' />
            <option name='Fosc / 64' value='6' />
        </speed>
    </adc>
    <spi >
        <miso port='2' pin='1' />
        <mosi port='2' pin='2' />
        <clk port='2' pin='0' />
    </spi>
    <i2c master='1' >
        <sda port='2' pin='1' />
        <scl port='2' pin='0' />
    </i2c>
    <pwm >
        <prescaler >
            <option name='1' value='1' />
            <option name='4' value='4' />
            <option name='16' value='16' />
        </prescaler>
        <out port='2' pin='5' />
        <out port='2' pin='3' />
        <out port='0' pin='2' />
        <out port='2' pin='1' />
    </pwm>
    <interrupts >
        <interrupt ident='TMR0' regl='tmr0' regh='' type='timer8' name='Timer 0' handler='#ifndef MX_INTHANDLER_intcon_TMR0IF\n#define MX_INTHANDLER_intcon_TMR0IF\nif (ts_bit(intcon, TMR0IF) &amp;&amp; ts_bit(intcon, TMR0IE))\n{\n\t#ifdef USE_FLOWCODE_ICD\n\t\textern char ICD_Interrupt_Enable = 1;\n\t#endif\t\n\tFCM_%n();\n\tcr_bit(intcon, TMR0IF);\n\t#ifdef USE_FLOWCODE_ICD\n\t\textern char ICD_Interrupt_Enable = 0;\n\t#endif\t\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='st_bit(intcon, TMR0IE);\n' disable='cr_bit(intcon, TMR0IE);\n' >
            <timer overflow='256' extrange='0' />
            <options >
                <option name='Clock Source Select' >
                    <entry name='Transition on T0CKI pin' clkdiv='0' value='st_bit(option_reg,T0CS);\n' />
                    <entry name='Internal clock (CLKO)' clkdiv='4' value='cr_bit(option_reg,T0CS);\n' />
                </option>
                <option name='Source Edge Select' >
                    <entry name='high-to-low transition on TMR0 Clock' value='st_bit(option_reg,T0SE);\n' />
                    <entry name='low-to-high transition on TMR0 Clock' value='cr_bit(option_reg,T0SE);\n' />
                </option>
                <prescale name='Prescaler Rate' >
                    <entry name='1:1' value='option_reg = (option_reg &amp; 0xF0) | 0x08;\n' />
                    <entry name='1:2' value='option_reg = (option_reg &amp; 0xF0) | 0x00;\n' />
                    <entry name='1:4' value='option_reg = (option_reg &amp; 0xF0) | 0x01;\n' />
                    <entry name='1:8' value='option_reg = (option_reg &amp; 0xF0) | 0x02;\n' />
                    <entry name='1:16' value='option_reg = (option_reg &amp; 0xF0) | 0x03;\n' />
                    <entry name='1:32' value='option_reg = (option_reg &amp; 0xF0) | 0x04;\n' />
                    <entry name='1:64' value='option_reg = (option_reg &amp; 0xF0) | 0x05;\n' />
                    <entry name='1:128' value='option_reg = (option_reg &amp; 0xF0) | 0x06;\n' />
                    <entry name='1:256' value='option_reg = (option_reg &amp; 0xF0) | 0x07;\n' />
                </prescale>
            </options>
        </interrupt>
        <interrupt ident='INT0' type='pin' name='INT0 Pin' handler='#ifndef MX_INTHANDLER_intcon_INTF\n#define MX_INTHANDLER_intcon_INTF\nif (ts_bit(intcon, INTF) &amp;&amp; ts_bit(intcon, INTE))\n{\n\t#ifdef USE_FLOWCODE_ICD\n\t\textern char ICD_Interrupt_Enable = 1;\n\t#endif\t\n\tFCM_%n();\n\tcr_bit(intcon, INTF);\n\t#ifdef USE_FLOWCODE_ICD\n\t\textern char ICD_Interrupt_Enable = 0;\n\t#endif\t\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='st_bit(intcon, INTE);\n' disable='cr_bit(intcon, INTE);\n' >
            <ioc config='3' >
                <rising port='1' mask='1' />
                <falling port='1' mask='1' />
            </ioc>
            <options >
                <edge name='Interrupt Edge Select' >
                    <entry name='Rising edge of INT' value='st_bit(option_reg,INTEDG);\n' />
                    <entry name='Falling edge of INT' value='cr_bit(option_reg,INTEDG);\n' />
                </edge>
            </options>
        </interrupt>
        <interrupt ident='IOC0' type='multipin' name='IOC PORTA' handler='#ifndef MX_INTHANDLER_intcon_IOCIF\n#define MX_INTHANDLER_intcon_IOCIF\nchar mxtmp;\nif (ts_bit(intcon, IOCIF) &amp;&amp; ts_bit(intcon, IOCIE))\n{\n\t#ifdef USE_FLOWCODE_ICD\n\t\textern char ICD_Interrupt_Enable = 1;\n\t#endif\t\n\tFCM_%n();\n\tmxtmp=porta;\n\tcr_bit(intcon, IOCIF);\n\tiocaf=0;\n\t#ifdef USE_FLOWCODE_ICD\n\t\textern char ICD_Interrupt_Enable = 0;\n\t#endif\t\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='iocap=%pA0h;\niocan=%pA0l;\nst_bit(intcon, IOCIE);\n' disable='cr_bit(intcon, IOCIE);\n' >
            <ioc config='0x0F' >
                <rising port='0' mask='0x3F' />
                <falling port='0' mask='0x3F' />
            </ioc>
        </interrupt>
        <interrupt ident='TMR2' regl='tmr2' regh='' type='timer8' name='Timer 2' handler='#ifndef MX_INTHANDLER_pir1_TMR2IF\n#define MX_INTHANDLER_pir1_TMR2IF\nif (ts_bit(pir1, TMR2IF) &amp;&amp; ts_bit(pie1, TMR2IE))\n{\n\t#ifdef USE_FLOWCODE_ICD\n\t\textern char ICD_Interrupt_Enable = 1;\n\t#endif\t\n\tFCM_%n();\n\tcr_bit(pir1, TMR2IF);\n\t#ifdef USE_FLOWCODE_ICD\n\t\textern char ICD_Interrupt_Enable = 0;\n\t#endif\t\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='st_bit(pie1, TMR2IE);\n' disable='cr_bit(pie1, TMR2IE);\n' >
            <timer overflow='256' extrange='0' />
            <options >
                <prescale name='Prescaler Rate' >
                    <entry name='1:1' value='st_bit(intcon,PEIE);\ncr_bit(t2con,T2CKPS0);\ncr_bit(t2con,T2CKPS1);\nst_bit(t2con,TMR2ON);\n' />
                    <entry name='1:4' value='st_bit(intcon,PEIE);\nst_bit(t2con,T2CKPS0);\ncr_bit(t2con,T2CKPS1);\nst_bit(t2con,TMR2ON);\n' />
                    <entry name='1:16' value='st_bit(intcon,PEIE);\ncr_bit(t2con,T2CKPS0);\nst_bit(t2con,T2CKPS1);\nst_bit(t2con,TMR2ON);\n' />
                </prescale>
                <postscale name='Postscaler Rate' >
                    <entry name='1:1' value='t2con = t2con &amp; 0x07;\n' />
                    <entry name='1:2' value='t2con = (t2con &amp; 0x07) | 0x08;\n' />
                    <entry name='1:3' value='t2con = (t2con &amp; 0x07) | 0x10;\n' />
                    <entry name='1:4' value='t2con = (t2con &amp; 0x07) | 0x18;\n' />
                    <entry name='1:5' value='t2con = (t2con &amp; 0x07) | 0x20;\n' />
                    <entry name='1:6' value='t2con = (t2con &amp; 0x07) | 0x28;\n' />
                    <entry name='1:7' value='t2con = (t2con &amp; 0x07) | 0x30;\n' />
                    <entry name='1:8' value='t2con = (t2con &amp; 0x07) | 0x38;\n' />
                    <entry name='1:9' value='t2con = (t2con &amp; 0x07) | 0x40;\n' />
                    <entry name='1:10' value='t2con = (t2con &amp; 0x07) | 0x48;\n' />
                    <entry name='1:11' value='t2con = (t2con &amp; 0x07) | 0x50;\n' />
                    <entry name='1:12' value='t2con = (t2con &amp; 0x07) | 0x58;\n' />
                    <entry name='1:13' value='t2con = (t2con &amp; 0x07) | 0x60;\n' />
                    <entry name='1:14' value='t2con = (t2con &amp; 0x07) | 0x68;\n' />
                    <entry name='1:15' value='t2con = (t2con &amp; 0x07) | 0x70;\n' />
                    <entry name='1:16' value='t2con = (t2con &amp; 0x07) | 0x78;\n' />
                </postscale>
                <rollover name='Rollover Value' >
                    <entry name='256' min='1' max='256' value='pr2=%d-1;\n' />
                </rollover>
            </options>
        </interrupt>
        <interrupt ident='TMR1' regl='tmr1l' regh='tmr1h' type='timer16' name='Timer 1' handler='#ifndef MX_INTHANDLER_pir1_TMR1IF\n#define MX_INTHANDLER_pir1_TMR1IF\nif (ts_bit(pir1, TMR1IF) &amp;&amp; ts_bit(pie1, TMR1IE))\n{\n\t#ifdef USE_FLOWCODE_ICD\n\t\textern char ICD_Interrupt_Enable = 1;\n\t#endif\t\n\tFCM_%n();\n\tcr_bit(pir1, TMR1IF);\n\t#ifdef USE_FLOWCODE_ICD\n\t\textern char ICD_Interrupt_Enable = 0;\n\t#endif\t\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='st_bit(pie1, TMR1IE);\n' disable='cr_bit(pie1, TMR1IE);\n' >
            <timer overflow='65536' extrange='0' />
            <options >
                <option name='Clock Source Select' >
                    <entry name='Transition on T1CKI pin' clkdiv='0' value='st_bit(intcon,PEIE);\ncr_bit(t1con,T1OSCEN);\nst_bit(t1con,TMR1ON);\nst_bit(t1con,TMR1CS1);\n' />
                    <entry name='Internal clock (Fosc/4)' clkdiv='4' value='st_bit(intcon,PEIE);\ncr_bit(t1con,T1OSCEN);\nst_bit(t1con,TMR1ON);\ncr_bit(t1con,TMR1CS1);\n' />
                    <entry name='32.768KHz XTAL T1CKI/T1CKO' clkdiv='0' value='st_bit(intcon,PEIE);\nst_bit(t1con,T1OSCEN);\nst_bit(t1con,TMR1ON);\nst_bit(t1con,TMR1CS1);\n' />
                </option>
                <prescale name='Prescaler Rate' >
                    <entry name='1:1' value='t1con = t1con &amp; 0x0F;\n' />
                    <entry name='1:2' value='t1con = (t1con &amp; 0x0F) | 0x10;\n' />
                    <entry name='1:4' value='t1con = (t1con &amp; 0x0F) | 0x20;\n' />
                    <entry name='1:8' value='t1con = (t1con &amp; 0x0F) | 0x30;\n' />
                </prescale>
            </options>
        </interrupt>
    </interrupts>
</device>
<inline >
    <main >
        <start code='\nvoid main()\n{\n' />
        <end code='\tmainendloop: goto mainendloop;\n}\n\n' />
        <init code='ansela = 0x00;\nanselc = 0x00;\n' />
    </main>
    <interrupt >
        <enable code='st_bit(intcon,GIE);\n' />
        <start code='void MX_INTERRUPT_MACRO(void)\n{\n' />
        <end code='}\n\n' />
        <init code='option_reg = 0xC0;\n\n' />
    </interrupt>
    <config >
        <body code='#ifdef _BOOSTC\n#pragma DATA $(address), 0x$(value:x)\n#endif\n#ifdef HI_TECH_C\n__CONFIG(0x$(value:x));\n#endif\n' />
    </config>
</inline>
<test >
    <icd >
        <clock port='0' pin='1' />
        <data port='0' pin='0' />
    </icd>
</test>
</root>
