<root>
<document schema='101' license='1,30day_96531603,HEAQ8P' title='' description='' target='PIC.16F.16F1509' >
	<config data='!0,3fa4!10,1bff%0,4%3,0%5,1%6,0%7,1%9,3%b,1%10,3%19,1%1a,0%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 />
	<components >
		<settings autoimg='0' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='030353a3-e9a1-43c7-998f-9311afa712cf' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='panel' description='' category='Misc' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='0' iconpath='..\An idea.JPG' />
		<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='data_pointer' 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='value' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='data' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='96' />
					</def>
				</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='Initialize_registers' description='For educational use only.' >
						<command class_type='native' title='Initialize registers' textarea='36,0,390,57' ccode='osccon=0b01111000;

clc4sel0=0b00000100;
clc4sel1=0b00010100;
clc4gls0=0b00100000;
clc4gls1=0b10000000;
clc4gls2=0b00100000;
clc4gls3=0b10000000;
clc4pol=0x00;
clc4con=0b10000010;

clc1sel0=0b01110100;
clc1sel1=0x00;
clc1gls0=0b00001000;
clc1gls1=0b00001000;
clc1gls2=0b10000000;
clc1gls3=0b10000000;
clc1pol=0x00;
clc1con=0b10000011;

trisb.4=1;
clc3sel0=0x00;
clc3sel1=0x00;
clc3gls0=0b00000010;
clc3gls1=0b00000010;
clc3gls2=0b10000000;
clc3gls3=0b10000000;
clc3pol=0x00;
clc3con=0b10000010;

trisc.0=0;
clc2sel0=0b01000000;
clc2sel1=0b00000010;
clc2gls0=0b00001000;
clc2gls1=0b00001000;
clc2gls2=0b00100000;
clc2gls3=0b00100000;
clc2pol=0x00;
clc2con=0b11000000;

trisc.1=0;
nco1con=0b01000001;
nco1clk=0b01100001;
nco1accl=0x00;
nco1acch=0x00;
nco1accu=0x00;
nco1inch=0b11001100;
nco1incl=0b11001101;

trisb.7=0;
baudcon.BRG16=1;
baudcon.SCKP=1;
spbrgh=0x00;
spbrgl=0x04;
txsta.SYNC=1;
txsta.CSRC=1;
rcsta.CREN=1;

trisb.6=0;
trisc.7=0;
ssp1add=4;
ssp1con1= 0b00101010;' language='C' />
						<command class_type='loop' title='fill ram array with zero&apos;s' textarea='36,0,170,0' type='2' exp='97' >
							<flowline >
								<command class_type='calculation' title='Calculation' textarea='36,0,564,0' >
									<exp exp='data[data_pointer] = 0' />
									<exp exp='data_pointer = data_pointer + 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Change_data_values' description='For educational use only.' >
						<command class_type='comment' title='' comment='Some method of changing the ram array can be used here.' textarea='12,0,12,0' />
						<command class_type='calculation' title='Test value' >
							<exp exp='//unit 1' />
							<exp exp='data[1] = 0' />
							<exp exp='data[2] = 0' />
							<exp exp='data[3] = 21' />
							<exp exp='' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Send_data' description='For educational use only.' >
						<param name='UNITcount' type='u8' description='enter number of units (1-32)' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' textarea='36,0,506,48' >
							<exp exp='.UNITcount = .UNITcount - 1' />
						</command>
						<command class_type='native' title='send unit 1 data' textarea='36,0,467,55' ccode='FCV_DATA_POINTER = 1;
FCV_VALUE = FCV_DATA[FCV_DATA_POINTER];
rcsta.SPEN=1;
nco1accu=0x05;
nco1acch=0x00;
nco1accl=0x00;
nco1con.N1EN=1;
ssp1buf=FCV_VALUE;
FCV_DATA_POINTER ++;
FCV_VALUE = FCV_DATA[FCV_DATA_POINTER];
pir1.3 = 0;
while (pir1.3 == 0)
{
}
rcsta.SPEN=0;
nco1con.N1EN=0;
rcsta.SPEN=1;
nco1accu=0x05;
nco1acch=0x00;
nco1accl=0x00;
nco1con.N1EN=1;
ssp1buf=FCV_VALUE;
FCV_DATA_POINTER ++;
FCV_VALUE = FCV_DATA[FCV_DATA_POINTER];
pir1.3 = 0;
while (pir1.3 == 0)
{
}
rcsta.SPEN=0;
nco1con.N1EN=0;
rcsta.SPEN=1;
nco1accu=0x05;
nco1acch=0x00;
nco1accl=0x00;
nco1con.N1EN=1;
ssp1buf=FCV_VALUE;' language='C' />
						<command class_type='loop' title='Loop' textarea='36,0,309,0' type='2' exp='.UNITcount' >
							<flowline >
								<command class_type='native' title='send rest of units data' textarea='36,0,453,55' ccode='FCV_DATA_POINTER ++;
FCV_VALUE = FCV_DATA[FCV_DATA_POINTER];
pir1.3 = 0;
while (pir1.3 == 0)
{
}
rcsta.SPEN=0;
nco1con.N1EN=0;
rcsta.SPEN=1;
nco1accu=0x05;
nco1acch=0x00;
nco1accl=0x00;
nco1con.N1EN=1;
ssp1buf=FCV_VALUE;
FCV_DATA_POINTER ++;
FCV_VALUE = FCV_DATA[FCV_DATA_POINTER];
pir1.3 = 0;
while (pir1.3 == 0)
{
}
rcsta.SPEN=0;
nco1con.N1EN=0;
rcsta.SPEN=1;
nco1accu=0x05;
nco1acch=0x00;
nco1accl=0x00;
nco1con.N1EN=1;
ssp1buf=FCV_VALUE;
FCV_DATA_POINTER ++;
FCV_VALUE = FCV_DATA[FCV_DATA_POINTER];
pir1.3 = 0;
while (pir1.3 == 0)
{
}
rcsta.SPEN=0;
nco1con.N1EN=0;
rcsta.SPEN=1;
nco1accu=0x05;
nco1acch=0x00;
nco1accl=0x00;
nco1con.N1EN=1;
ssp1buf=FCV_VALUE;' language='C' />
							</flowline>
						</command>
						<command class_type='native' title='Wait for last transmission' textarea='36,0,36,54' ccode='pir1.3 = 0;
while (pir1.3 == 0)
{
}
rcsta.SPEN=0;
nco1con.N1EN=0;' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='For educational use only.' >
						<command class_type='comment' title='' comment='Install a jumper from pin 11 to pin 13.
Data output is on pin 16.
Pins Used : 9, 10, 11, 13, 15, 16

This program is inspired by AN1606.' textarea='12,0,12,0' />
						<command class_type='call' title='Call Macro Initalize registers' macro='Initialize_registers' />
						<command class_type='delay' title='adjustable startup stabalization delay' exp='1' type='1' />
						<command class_type='loop' title='Loop' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call macro Change_data_values' macro='Change_data_values' />
								<command class_type='call' title='Call Macro Send_data' textarea='36,0,242,0' macro='Send_data' >
									<argument exp='1' />
								</command>
								<command class_type='delay' title='adjustable refresh rate, fixed or by variable' textarea='36,0,169,0' exp='20' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
		</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---------------------wAAAAAUAAAAUQIAAAADAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Change_data_values' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAUQIAAAADAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialize_registers' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAUQIAAAADAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Send_data' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAUQIAAAADAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
