<root>
<document schema='101' license='1,PAULWILLIAMS9199,FX812Y' title='' description='' target='PIC.16F.16F887' >
	<config data='!0,2bc2!10,3eff%0,2%3,0%4,0%5,0%6,1%7,1%8,3%a,0%b,1%c,0%d,1%19,3%18,0' clkspd='4000000' simspd='3' 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 />
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='67bbfaca-1696-4c13-b91b-50a6733e4626' 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='COUNT' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='STR' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='5' />
					</def>
				</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='RetVal' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='PORTC' type='u8' description='Data_&amp;_Clock_INPUT' isconst='0' isinit='1' usrinit='24' setinit='0x18' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='I2C_TRANSMIT' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='DeviceAddress' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='InternalAddress' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Data' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='ALL DONE' textarea='12,0,12,0' />
						<command class_type='call' title='Start I²C Transaction' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='Device Address + Write bit' component='I2C_Master1' macro='TransmitByte' >
							<return exp='RetVal' />
							<argument exp='.DeviceAddress' />
						</command>
						<command class_type='call' title='' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='.InternalAddress &gt;&gt; 8' />
						</command>
						<command class_type='call' title='Device Address + Write bit' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='.InternalAddress' />
						</command>
						<command class_type='call' title='Send Data' component='I2C_Master1' macro='TransmitByte' >
							<return exp='RetVal' />
							<argument exp='.Data' />
						</command>
						<command class_type='call' title='Stop I²C Transaction' component='I2C_Master1' macro='Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='I2C_RECIEVE' description='' >
						<return name='Return' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='DeviceAddress' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='InternalAddress' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Component Macro' component='' macro='' />
						<command class_type='call' title='Start I²C Transaction' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='Device Address + Write bit' component='I2C_Master1' macro='TransmitByte' >
							<return exp='RetVal' />
							<argument exp='.DeviceAddress' />
						</command>
						<command class_type='call' title='Device Address + Write bit' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='.InternalAddress &gt;&gt; 8' />
						</command>
						<command class_type='call' title='Device Address + Write bit' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='.InternalAddress' />
						</command>
						<command class_type='call' title='Restart I2C' component='I2C_Master1' macro='Restart' />
						<command class_type='call' title='Device Address + Read bit' component='I2C_Master1' macro='TransmitByte' >
							<return exp='RetVal' />
							<argument exp='.DeviceAddress | 0x3F' />
						</command>
						<command class_type='call' title='Receive Data' component='I2C_Master1' macro='ReceiveByte' >
							<return exp='.Return' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Stop I²C Transaction' 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='A basic Master to slave read or write sequence for I2C follows the following order:

I2C Tutorial : I2C basic command sequence.
1. Send the START bit (S).
2. Send the slave address (ADDR).
3. Send the Read(R)-1 / Write(W)-0 bit.
4. Wait for/Send an acknowledge bit (A).
5. Send/Receive the data byte (8 bits) (DATA).
6. Expect/Send acknowledge bit (A).
7. Send the STOP bit (P).

The sequence 5 and 6 can be repeated so that 
a multibyte block can be read or written.' textarea='12,0,12,0' />
						<command class_type='input' title='Input' mode='0' port='1048578' mask='0' exp='PORTC' />
						<command class_type='call' title='Initialise the I²C' component='I2C_Master1' macro='Initialise' />
						<command class_type='call' title='Call Component Macro' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='Initialise the LCD' component='lcd_I2C1' macro='Start' />
						<command class_type='comment' title='' comment='Main Basic overview of a I²C Write transaction

1) Start transaction
2) Send device address with read bit = 1/write bit = 0
3) Send internal EEPROM address MSB
4) Send internal EEPROM address LSB
5) Send n data bytes to be written
6) Stop transaction' textarea='46,130,46,130' />
						<command class_type='output' title='Output' mode='1' port='1048579' mask='2' exp='1' />
						<command class_type='loop' title='Loop' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call Macro' macro='I2C_TRANSMIT' >
									<argument exp='0x3F' />
									<argument exp='0x0000' />
									<argument exp='&apos;H&apos;' />
								</command>
								<command class_type='output' title='Output' mode='1' port='1048579' mask='4' exp='1' />
								<command class_type='call' title='Call Component Macro' component='lcd_I2C1' macro='Cursor' >
									<argument exp='2' />
									<argument exp='0' />
								</command>
								<command class_type='output' title='Output' mode='1' port='1048579' mask='8' exp='1' />
								<command class_type='call' title='Call Component Macro' component='lcd_I2C1' macro='PrintString' >
									<argument exp='&quot;I2C LCD TEST&quot;' />
								</command>
								<command class_type='output' title='Output' mode='1' port='1048579' mask='16' exp='1' />
								<command class_type='call' title='Call Component Macro' component='I2C_Master1' macro='Stop' />
								<command class_type='output' title='Output' mode='1' port='1048579' mask='32' exp='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='24219805-113d-4b12-b6bd-e1b0b0c33981' vmin='4' vmaj='1' codename='I2C_Master1' x='-80' y='32' 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='000' />
					<value target='SRC' data='000' />
					<value target='SMB' data='000' />
					<value target='StopDelay' data='1' />
					<value target='BAUD' data='50000' />
					<value target='SDA' data='$PORTC.4' />
					<value target='SCL' data='$PORTC.3' />
					<value target='label' data='I2C Master' />
					<value target='ScopeTraces' data='1' />
					<value target='ConsoleData' data='1' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='bcd6a955-12c6-4ed4-a22f-f16eb62e0762' vmin='1' vmaj='1' codename='lcd_I2C1' x='-56' y='56' 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 />
				<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='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAMwMAAHkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='I2C_RECIEVE' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAMwMAAHkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='I2C_TRANSMIT' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAMwMAAHkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
