<root>
<document schema='101' license='1,Jan Lichtenbelt,C5EM4X' 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='19660800' 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='19' />
			<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 />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='1' />
			<data name='ClockPin' value='6' />
			<data name='DataPort' value='1' />
			<data name='DataPin' value='7' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='9' />
			<data name='CalculatedCommsDelay' value='9' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='dd3cb5d2-0750-424a-a23b-81c6dd6e22c6' 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='Read_Databyte_L' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Write_Calibration_Reg_L' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Read_Databyte_H' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Write_Calibration_Reg_H' type='u8' description='' isconst='0' isinit='0' usrinit='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='Flowcode_Read_Slave_Address' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Shunt_Current' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='I2C_Slave_Address' type='u8' description='' isconst='0' isinit='1' usrinit='64' setinit='0x40' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Configuration_Register_L' type='u8' description='' isconst='0' isinit='1' usrinit='159' setinit='0x9F' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Flowcode_Write_Slave_Address' type='u8' description='Slave address' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Current_Negative_Sign' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Configuration_Register_H' type='u8' description='' isconst='0' isinit='1' usrinit='25' setinit='0x19' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Pointer_Address_Conf_Reg' type='u8' description='Register' isconst='0' isinit='1' usrinit='0' setinit='0x00' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Version' 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='Bus_Voltage' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Counter_Flickering' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Enable_I2C_Sensor' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Initialise I2C master' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='Initialise' />
						<command class_type='call' title='Start I2C' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='Send address (write)' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Flowcode_Write_Slave_Address' />
						</command>
						<command class_type='call' title='Send Command Code' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Pointer_Address_Conf_Reg' />
						</command>
						<command class_type='call' title='Send Databyte Low' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Configuration_Register_L' />
						</command>
						<command class_type='call' title='Send Databyte High' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Configuration_Register_H' />
						</command>
						<command class_type='call' title='Stop' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Write_Data' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='Pointer_Address' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Write I2C data' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='call' title='Start I2C' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='Send address' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Flowcode_Write_Slave_Address' />
						</command>
						<command class_type='call' title='Send pointer address' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='.Pointer_Address' />
						</command>
						<command class_type='call' title='Send high byte MSB' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Write_Calibration_Reg_H' />
						</command>
						<command class_type='call' title='Send low byte LSB' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Write_Calibration_Reg_L' />
						</command>
						<command class_type='call' title='Stop' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Init' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Set default values' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='// Special for Flowcode' />
							<exp exp='Flowcode_Write_Slave_Address = I2C_Slave_Address &lt;&lt; 1' />
							<exp exp='Flowcode_Read_Slave_Address = Flowcode_Write_Slave_Address + 1' />
						</command>
						<command class_type='calculation' title='Set version#' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='Version = 1' />
							<exp exp='' />
							<exp exp='' />
						</command>
						<command class_type='call' title='Start LCD' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Start' />
						<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='10' type='1' />
						<command class_type='call' title='Clear LCD' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Clear' />
						<command class_type='call' title='Show text' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
							<argument exp='&quot;Li-Charger&quot;' />
						</command>
						<command class_type='call' title='2nd line' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Cursor' >
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Show text' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
							<argument exp='&quot;V&quot;' />
						</command>
						<command class_type='call' title='Show version number' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintNumber' >
							<argument exp='Version' />
						</command>
						<command class_type='call' title='Enable VEML6075, send configuration word' cmdcolor='1975743' cmdcolor_sec='1975743' macro='Enable_I2C_Sensor' />
						<command class_type='comment' title='' comment='Calibration register address: 05h (R/W)
Calibration register (2 bytes):
Definitions: Current_LSB is the smallest current measured (Current units) 
             = (Maximum Expected Current * 2^-15)  in A/bit 
             (mostly in the range uA/bit or mA/bit)
Store in Calibration register: 0.04096/(Current_LSB * Rshunt)
e.g.
with Max current=1.5A Current_LSB is about 50 uA/bit
with Rshunt= 0.22R the calibration = 3723 = 0x0A13' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Berekening' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='Write_Calibration_Reg_H = 0x0A' />
							<exp exp='Write_Calibration_Reg_L = 0x13' />
						</command>
						<command class_type='call' title='Write Calibration factor' cmdcolor='1975743' cmdcolor_sec='1975743' macro='Write_Data' >
							<argument exp='0x05' />
						</command>
						<command class_type='calculation' title='Reset counter' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='Counter_Flickering = 0' />
						</command>
						<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='3' type='2' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Receive_Data' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='Pointer_Address' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Receive I2C word' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='call' title='Start I2C' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='Send address' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Flowcode_Write_Slave_Address' />
						</command>
						<command class_type='call' title='Send pointer address' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='.Pointer_Address' />
						</command>
						<command class_type='call' title='Restart I2C' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='Restart' />
						<command class_type='call' title='Send address' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Flowcode_Read_Slave_Address' />
						</command>
						<command class_type='call' title='Read Databyte Low (0= continue reading)' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='ReceiveByte' >
							<return exp='Read_Databyte_L' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Read Databyte High (1= last byte read)' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='ReceiveByte' >
							<return exp='Read_Databyte_H' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Stop' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='Bidirectional current sensor INA219 
ref: www.ti.com/product/INA219

Jan Lichtenbelt, NL
June, 2017
Version 1' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='Most important I2C variables:
I2C_Slave_Address = 0x40   Slave address (Port A0 and A1 of INA219 to GND)
Configuration_Register = 0x00   Configuration register address (Read/Write)
Configuration register (2 bytes): 0001 1001 1001 1111 = 199Fh
bit 15: 0   No reset
bit 14: X   not used
bit 13: 0   maximum bus voltage 16 Volt (at IN-)
bits 11, 12: 11  maximum voltage over the shunt ±320 mV
bits 7-10: 0011  12 bit Bus voltage resolution with 532 usec conversion time
bits 3-6: 0011   12 bits sunt voltage resulution with 532 usec conversion time
bits 0-2: 111  shunt and bus continous mode

Shunt voltage register address: 01h (R)
Shunt voltage (VIN+ - VIN-)in 10uV units 
in 2&apos;s complement format with:
320 mV = 32000 (dec)= 7C00h
0mV=  0
-0.01 mV= -1 (dec) = FFFFh
-320mV= -32000 (dec) = 8300h

Bus voltage register address: 02h (R)
Bus Voltage register (2 bytes)
    should be right shifted 3 bits (diviede by 8) 
    in 4 mV units

Power register adrress 03h (not used)

Calibration register address: 05h (R/W)
Calibration register (2 bytes):
Definitions: Current_LSB is the smallest current measured (Current units) 
             = (Maximum Expected Current * 2^-15)  in A/bit 
             (mostly in the range uA/bit or mA/bit)
Store in Calibration register: 0.04096/(Current_LSB * Rshunt)

Shunt current regrister address: 04h (R)
The shunt current register (2 bytes) in 1 mA unit
Negative values are stored in 2&apos;s complement format, see shunt voltage

' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='LCD output: Vbus and shunt current
LED output: 
Load current &gt;0
     Vbus &gt; 4.1 Volt green
     3 &lt; Vbus &lt; 4.1 Volt flickering green
Load current &lt;0
     Vbus &gt; 3.2 Volt flickering orange 
     3 &lt; Vbus &lt; 3.2 Volt orange
     2.7 &lt; Vbus &lt; 3 Volt flickering red
     Vbus &lt; 2.7 Volt red


Steps:
1. Enable I2C
2. Store Configuration word
3. Store calibration word
4. Read bus voltage and shunt current' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='I2C: 
Channel 1: SDA1 on port B1 and SCL1 on port B4
(Channel 2: SDA2 on port B2 and SCL2 in port B5. Not used)' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='Output ports:
LCD:
Rs port A2
E port A3
D4 port A4
D5 port A6
D6 port B0
D7 port B2

LEDs:
B5: LED green 
B6: LED orange
B3: LED red' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='native' title='Set internal osc. 16 MHz' ccode='OSCCON= 0x78; 

' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='call' title='Initialise' cmdcolor='1975743' cmdcolor_sec='1975743' macro='Init' />
						<command class_type='loop' title='Lus' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Read bus voltage pointer add 0x02' cmdcolor='1975743' cmdcolor_sec='1975743' macro='Receive_Data' >
									<argument exp='0x02' />
								</command>
								<command class_type='calculation' title='Save bus voltage' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='Bus_Voltage = Read_Databyte_L' />
									<exp exp='Bus_Voltage = Bus_Voltage + (Read_Databyte_H &lt;&lt; 8)' />
									<exp exp='Bus_Voltage = Bus_Voltage &gt;&gt; 3 // in  4 mV' />
									<exp exp='Bus_Voltage = Bus_Voltage &lt;&lt; 2 // in mV' />
								</command>
								<command class_type='call' title='Read shunt current pointer add. 0x04' cmdcolor='1975743' cmdcolor_sec='1975743' macro='Receive_Data' >
									<argument exp='0x04' />
								</command>
								<command class_type='calculation' title='Save shunt current' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='Shunt_Current = Read_Databyte_L' />
									<exp exp='Shunt_Current = Shunt_Current + (Read_Databyte_H &lt;&lt; 8)' />
								</command>
								<command class_type='calculation' title='Get negative sign' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='Current_Negative_Sign = (Shunt_Current &amp; 0x8000) = 0x8000 //test bit 15' />
									<exp exp='Shunt_Current = Shunt_Current &amp; 0x7FFF // get absolute value, ignore bit 15' />
								</command>
								<command class_type='decision' title='Current &lt;0' cmdcolor='3568629' cmdcolor_sec='3568629' exp='Current_Negative_Sign' swap='0' >
									<flowline >
										<command class_type='calculation' title='2&apos;s complement' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='Shunt_Current = 0x8000 - Shunt_Current' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='calculation' title='Calculate current in mA' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='Shunt_Current = Shunt_Current / 100 // mA units' />
								</command>
								<command class_type='call' title='Start LCD' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Start' />
								<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='3' type='1' />
								<command class_type='call' title='Show number' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintNumber' >
									<argument exp='Bus_Voltage' />
								</command>
								<command class_type='call' title='Show text' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
									<argument exp='&quot; Volt&quot;' />
								</command>
								<command class_type='call' title='2nd line' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Cursor' >
									<argument exp='0' />
									<argument exp='1' />
								</command>
								<command class_type='decision' title='Vbus &lt; 2.7 Volt' cmdcolor='3568629' cmdcolor_sec='3568629' exp='Bus_Voltage &lt; 2700' swap='0' >
									<flowline >
										<command class_type='call' title='Show text' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
											<argument exp='&quot;SHUT DOWN!!!&quot;' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='current &lt;0' cmdcolor='3568629' cmdcolor_sec='3568629' exp='Current_Negative_Sign' swap='0' >
											<flowline >
												<command class_type='call' title='Show sign' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
													<argument exp='&quot;-&quot;' />
												</command>
											</flowline>
											<flowline >
												<command class_type='call' title='Show sign' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
													<argument exp='&quot;+&quot;' />
												</command>
											</flowline>
										</command>
										<command class_type='call' title='Show number' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintNumber' >
											<argument exp='Shunt_Current' />
										</command>
										<command class_type='call' title='Show text' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
											<argument exp='&quot; mA&quot;' />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Current &lt;0?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='Shunt_Current &lt; 0' swap='0' >
									<flowline >
										<command class_type='decision' title='Vbus &gt; 3.2 Volt?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='Bus_Voltage &gt; 3200' swap='0' >
											<flowline >
												<command class_type='comment' title='' comment='Still in comfort range V&gt;3.2 Volt' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
												<command class_type='output' title='orange LED flickering' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048577' mask='64' exp='Counter_Flickering' />
												<command class_type='calculation' title='Change counter' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='Counter_Flickering = 1 - Counter_Flickering' />
												</command>
											</flowline>
											<flowline >
												<command class_type='decision' title='Vbus &gt; 3.0 Volt?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='Bus_Voltage &gt; 3000' swap='0' >
													<flowline >
														<command class_type='comment' title='' comment='First warning range 3-3.2 Volt' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
														<command class_type='output' title='orange LED on' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048577' mask='64' exp='1' />
													</flowline>
													<flowline >
														<command class_type='decision' title='Vbus &gt; 2.7 Volt?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='Bus_Voltage &gt; 2700' swap='0' >
															<flowline >
																<command class_type='comment' title='' comment='Serious warning range 2.7-3 Volt' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
																<command class_type='output' title='red LED flickering' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048577' mask='8' exp='Counter_Flickering' />
																<command class_type='calculation' title='Change counter' cmdcolor='7895044' cmdcolor_sec='7895044' >
																	<exp exp='Counter_Flickering = 1 - Counter_Flickering' />
																</command>
															</flowline>
															<flowline >
																<command class_type='comment' title='' comment='ALARM: STP DIRECTLY' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
																<command class_type='output' title='red LED on' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048577' mask='8' exp='1' />
															</flowline>
														</command>
													</flowline>
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Vbus &gt;4.1 Volt?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='0' swap='0' >
											<flowline >
												<command class_type='comment' title='' comment='Full of charge 4.1-4.2 VOLT' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
												<command class_type='output' title='green LED on' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048577' mask='32' exp='1' />
											</flowline>
											<flowline >
												<command class_type='comment' title='' comment='On the right way of loading &lt;4.1 Volt' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
												<command class_type='output' title='green LED flickering' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048577' mask='32' exp='Counter_Flickering' />
												<command class_type='calculation' title='Change counter' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='Counter_Flickering = 1 - Counter_Flickering' />
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
								<command class_type='delay' title='Vertraging' cmdcolor='7895044' cmdcolor_sec='7895044' exp='300' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='24219805-113d-4b12-b6bd-e1b0b0c33981' vmin='4' vmaj='1' codename='I2C_Master1' x='-10' y='110' z='0.755' xsz='60' ysz='26' zsz='1.51' 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='001' />
					<value target='BAUD_LIST' data='001' />
					<value target='SRC' data='000' />
					<value target='SMB' data='000' />
					<value target='StopDelay' data='1' />
					<value target='BAUD' data='50000' />
					<value target='SDA' data='$PORTB.1' />
					<value target='SCL' data='$PORTB.4' />
					<value target='label' data='I2C Master' />
					<value target='ScopeTraces' data='0' />
					<value target='ConsoleData' data='' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='d29dda88-17de-4008-991a-c881890d4c57' vmin='1' vmaj='1' codename='lcd_eb005' x='0' y='0' z='5.085' 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.4' />
					<value target='Pin_Data_1' data='$PORTA.6' />
					<value target='Pin_Data_2' data='$PORTB.0' />
					<value target='Pin_Data_3' data='$PORTB.2' />
					<value target='Pin_RS' data='$PORTA.2' />
					<value target='Pin_E' data='$PORTA.3' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='2105930' 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' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
	</panel3d>
	<layout >
		<view type='0' name='Init' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAOgMAANoCAAA' zoom='75' scrollx='0' scrolly='543' flags='0' />
		<view type='0' name='Write_Data' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAOgMAANoCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAOgMAANoCAAA' zoom='75' scrollx='0' scrolly='152' flags='0' />
		<view type='0' name='Enable_I2C_Sensor' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAOgMAANoCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Receive_Data' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAOgMAANoCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
