<root>
<document schema='101' license='1,Jan Lichtenbelt,9HXPGG' title='' description='' target='PIC.16F.16F1847' >
	<config data='!0,9a4!10,1cff%0,4%3,0%5,1%6,0%7,1%8,1%9,0%b,1%c,0%d,0%10,3%14,1%18,0%19,0%1a,1%1c,1%1d,0' clkspd='16000000' simspd='1' usewdt='0' constif='0' />
	<plugins >
		<dll_dbg_icd enabled='0' >
			<data name='debug' value='1' />
			<data name='userpins' value='0' />
			<data name='speed' value='0' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='1' />
			<data name='clkbit' value='6' />
			<data name='dataport' value='1' />
			<data name='databit' value='7' />
			<data name='ghostype' value='0' />
			<data name='monitor' value='1' />
			<data name='ictloop' value='0' />
			<data name='ictrate' value='20000' />
			<data name='ictmask' value='0' />
			<data name='anlpres' value='255' />
			<data name='digmask1' value='-1' />
			<data name='digmask2' value='-1' />
		</dll_dbg_icd>
		<dll_models enabled='1' />
		<dll_upgrader enabled='1' />
		<dll_webhelp enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='ScrollOneLeft.StringIn' />
		<watch expr='ScrollOneLeft.StrTemp' />
		<watch expr='ScrollOneLeft.StrLength' />
		<watch expr='ScrollOneLeft.Counter' />
		<watch expr='ScrollOneLeft.NumberOfPlaces' />
	</debug>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='0' iconpath='' />
		<component class_type='root' codename='panel' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='FV0' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LEDs' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Rshunt_220mOhm' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Rshunt_50mOhm' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Even' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FR_internal' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Vmin' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Timer0_Counter' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Current' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Vshunt_on' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FVshunt_topside' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Temp' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FVshunt_bottomside' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Rshunt_mOhm' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='HighTemperature' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='StrTemp' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='5' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADC_Counter' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FVshunt_on' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Change_seconds' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FirstTime' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Rshunt' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ErrorNumber' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Seconds' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Part6' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Vshunt_off' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FVshunt_off' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Vmax' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Rshunt_number' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='CycleTimeSeconds' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FV_terminal' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Init' description='' >
						<command class_type='comment' title='' comment='A3: LED Discharge
A4: Discharge (gate MOSFET)' textarea='12,0,12,0' />
						<command class_type='call' title='Start LCD' component='lcd_eb005' macro='Start' />
						<command class_type='native' title='16 MHZ internal oscillator' ccode='osccon= 0x78;' language='C' />
						<command class_type='native' title='Set fixed reference voltage on 2.048 Volt' ccode='//fvrcon= (fvrcon &amp; 0x70)| 0x88;  // clear bits 1-3 and 7, set bits 3 and 7
set_bit(fvrcon,FVREN);      // enable Fixed Voltage Reference 
set_bit(fvrcon,CDAFVR1);    // 2x 1.024 Volt
clear_bit(fvrcon,CDAFVR0);  // 2x 1.024 Volt' language='C' />
						<command class_type='native' title='Enable comparator interrupt' ccode='//cm1con0 = (cm1con0 &amp; 0x6B)| 0x84;  // clear bits 2,4 and 7. Set bits 2 and 7
set_bit(cm1con0,C1ON);     // enable comparator
clear_bit(cm1con0,C1POL);  // non-inverting
set_bit(cm1con0,C1SP);     // high speed mode

//cm1con1= (cm1con1 &amp; 0x0C) | 0x6E; //clear all bits except 4,5; set bits 1,5,6 and 7
set_bit(cm1con1,C1PCH1);   // FVR as in+
clear_bit(cm1con1,C1PCH0); // FVR as in+
set_bit(cm1con1,C1NCH1);   // pin C12IN2- as input (port A2)
clear_bit(cm1con1,C1NCH0); // pin C12IN2- as input (port A2)' language='C' />
						<command class_type='native' title='Set port A2 as analog input' ccode='TRISA=TRISA|0x04;   // Set A2 as input
ANSELA= ANSELA | 0x04; // Set A2 as analog input' language='C' />
						<command class_type='interrupt' title='Start interrupt Compare A2 with 2.048 Volt' enable='1' name='' call='Compare_B4_Input' >
							<custom name='COMPARE' handler='if (pir1 &amp; (1&lt;&lt; CCP1IF))    // Check to see if interrupt flag is set
{
FCM_%n();   // Call Flowcode Macro
pir1.CCP1IF=0;   // Clear interrupt flag
}' enable='intcon.PEIE=1;  // Enable peripheral interrupts
intcon.GIE=1;  // Enable global interrupts
pie2.CCP1IE=1;  // enable capture Compare interrupts. (pie2 instead of pie1 for PIC16F1847)' disable='' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Compare_B4_Input' description='' >
						<command class_type='call' title='Clear LCD' component='lcd_eb005' macro='Clear' />
						<command class_type='call' title='print text' component='lcd_eb005' macro='PrintString' >
							<argument exp='&quot;&gt;100 oC !!!!&quot;' />
						</command>
						<command class_type='delay' title='Vertraging' exp='1' type='2' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<command class_type='comment' title='' comment='1. Initialise
' textarea='12,0,12,0' />
						<command class_type='call' title='Initialise' textarea='36,2,511,302' macro='Init' />
						<command class_type='loop' title='Lus' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Clear LCD' component='lcd_eb005' macro='Clear' />
								<command class_type='call' title='Show string' component='lcd_eb005' macro='PrintString' >
									<argument exp='&quot;&lt;100 oC&quot;' />
								</command>
								<command class_type='delay' title='Vertraging' exp='255' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='d29dda88-17de-4008-991a-c881890d4c57' vmin='1' vmaj='1' codename='lcd_eb005' x='0' y='0' z='3.575' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Pin_Data_0' data='$PORTA.3' />
					<value target='Pin_Data_1' data='$PORTA.5' />
					<value target='Pin_Data_2' data='$PORTB.0' />
					<value target='Pin_Data_3' data='$PORTB.1' />
					<value target='Pin_RS' data='$PORTB.3' />
					<value target='Pin_E' data='$PORTA.4' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7aad74d6-b24e-4dab-91eb-5d72a973f12d' vmin='3' vmaj='1' codename='adc_base1' x='-80' y='-40' z='0' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='6' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='005' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
					<value target='ScopeTraces' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7aad74d6-b24e-4dab-91eb-5d72a973f12d' vmin='3' vmaj='1' codename='adc_base2' x='-40' y='-40' z='0' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='0' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='005' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
					<value target='ScopeTraces' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7aad74d6-b24e-4dab-91eb-5d72a973f12d' vmin='3' vmaj='1' codename='adc_base3' x='0' y='-40' z='0' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='1' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='005' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
					<value target='ScopeTraces' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7aad74d6-b24e-4dab-91eb-5d72a973f12d' vmin='3' vmaj='1' codename='adc_base4' x='40' y='-40' z='0' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='8' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='005' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
					<value target='ScopeTraces' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='9737364' img='' style='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='25' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel3d>
	<layout >
		<view type='0' name='Init' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAFQUAADECAAA' zoom='75' scrollx='0' scrolly='167' flags='0' />
		<view type='0' name='Compare_B4_Input' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAFQUAADECAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAFQUAADECAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
