<root>
<document schema='101' license='1,Jan Lichtenbelt,W0QPYU' title='' description='' target='PIC.16F.16LF1847' >
	<config data='!0,ba4!10,1cff%0,4%3,0%5,1%6,0%7,1%8,1%9,1%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='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 />
	<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='Conf_UV_IT_400ms' type='u8' description='Integration time' isconst='0' isinit='1' usrinit='48' setinit='0x30' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='UV_B' type='u16' 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='Conf_SD' type='u8' description='Shut down' isconst='0' isinit='1' usrinit='1' setinit='0x01' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Conf_Reg' type='u8' description='Register' isconst='0' isinit='1' usrinit='0' setinit='0x00' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Conf_L' 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='Conf_H' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0x00' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Read_Slave_Address' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Write_Slave_Address' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Conf_UV_IT_800ms' type='u8' description='Integration time' isconst='0' isinit='1' usrinit='64' setinit='0x40' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='UVB_Data_Reg' type='u8' description='Register define' isconst='0' isinit='1' usrinit='9' setinit='0x09' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Conf_UV_IT_50ms' type='u8' description='Integration time' isconst='0' isinit='1' usrinit='0' setinit='0x00' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Slave_Address' type='u8' description='Slave address' isconst='0' isinit='1' usrinit='16' setinit='0x10' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Conf_UV_IT_100ms' type='u8' description='Integration time' isconst='0' isinit='1' usrinit='1' setinit='0x01' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Conf_UV_AF_Auto' type='u8' description='Active force mode (normal disabled)' isconst='0' isinit='1' usrinit='0' setinit='0x00' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Conf_UV_Trig_No' type='u8' description='No active force mode trigger' isconst='0' isinit='1' usrinit='0' setinit='0x00' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Conf_UV_IT_200ms' type='u8' description='Integration time' isconst='0' isinit='1' usrinit='32' setinit='0x20' />
				</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='Conf_Default' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Shut_Down' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='16777215' cmdcolor_sec='16777215' >
							<exp exp='Conf_L = Conf_Default | Conf_SD' />
						</command>
						<command class_type='comment' title='' comment='VEML6075_write_word(VEML6075_ADDR, VEML6075_CONF_REG, VEML6075_conf);' 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 (write)' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Write_Slave_Address' />
						</command>
						<command class_type='call' title='Send Command Code' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Conf_Reg' />
						</command>
						<command class_type='call' title='Send Databyte Low' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Conf_L' />
						</command>
						<command class_type='call' title='Send Databyte High' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Conf_H' />
						</command>
						<command class_type='call' title='Stop' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Enable' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='16777215' cmdcolor_sec='16777215' >
							<exp exp='Conf_L = Conf_Default' />
						</command>
						<command class_type='comment' title='' comment='VEML6075_write_word(VEML6075_ADDR, VEML6075_CONF_REG, VEML6075_conf)' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<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='Write_Slave_Address' />
						</command>
						<command class_type='call' title='Send Command Code' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Conf_Reg' />
						</command>
						<command class_type='call' title='Send Databyte Low' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Conf_L' />
						</command>
						<command class_type='call' title='Send Databyte High' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='Conf_H' />
						</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='16777215' cmdcolor_sec='16777215' >
							<exp exp='// Special for Flowcode' />
							<exp exp='Write_Slave_Address = Slave_Address &lt;&lt; 1' />
							<exp exp='Read_Slave_Address = Write_Slave_Address + 1' />
							<exp exp='' />
							<exp exp='// default includes Active Force mode (disabled), Trigger (off) and Integration time' />
							<exp exp='Conf_Default = Conf_UV_AF_Auto | Conf_UV_Trig_No | Conf_UV_IT_100ms' />
						</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='16734207' cmdcolor_sec='16734207' 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;UVB version 3&quot;' />
						</command>
						<command class_type='delay' title='Delay' cmdcolor='16734207' cmdcolor_sec='16734207' exp='1' type='2' />
						<command class_type='call' title='Enable VEML6075' cmdcolor='1975743' cmdcolor_sec='1975743' macro='Enable' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Receive_Data' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='Ext_Address' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Receive UVB data' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='VEML6075_read_word(VEML6075_ADDR, VEML6075_UVB_DATA_REG, &amp;uvb_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='Write_Slave_Address' />
						</command>
						<command class_type='call' title='Send Command Code address' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='UVB_Data_Reg' />
						</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='Read_Slave_Address' />
						</command>
						<command class_type='call' title='Read Databyte Low' 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 (last)' cmdcolor='1975743' cmdcolor_sec='1975743' component='I2C_Master1' macro='TransmitByte' >
							<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='Vishay UVA and UVB Light Sensor with I²C Interface VEML6075

Datasheet:
http://www.vishay.com/docs/84304/veml6075.pdf
application note with C-code program:
http://www.vishay.com/docs/84339/designingveml6075.pdf

The C-code program has been used to measure only the UVB values.

Jan Lichtenbelt, NL
January 16, 2017' 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)' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='LCD special connetions:
Rs port A2
E port A3
D4 port B0
D5 port A4!!!
D6 port B2
D7 port B3' 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='Receive UV-B data' cmdcolor='1975743' cmdcolor_sec='1975743' macro='Receive_Data' />
								<command class_type='calculation' title='Calculate UV-B' cmdcolor='16777215' cmdcolor_sec='16777215' >
									<exp exp='UV_B = Read_Databyte_H &lt;&lt; 8' />
									<exp exp='UV_B = UV_B + Read_Databyte_L' />
								</command>
								<command class_type='call' title='Clear LCD' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Clear' />
								<command class_type='call' title='Show number' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintNumber' >
									<argument exp='UV_B' />
								</command>
								<command class_type='delay' title='Delay' cmdcolor='16734207' cmdcolor_sec='16734207' 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='$PORTB.0' />
					<value target='Pin_Data_1' data='$PORTA.4' />
					<value target='Pin_Data_2' data='$PORTB.2' />
					<value target='Pin_Data_3' data='$PORTB.3' />
					<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='Enable' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA8AMAAFsCAAA' zoom='75' scrollx='0' scrolly='96' flags='0' />
		<view type='0' name='Receive_Data' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA8AMAAFsCAAA' zoom='75' scrollx='0' scrolly='185' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA8AMAAFsCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Init' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA8AMAAFsCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Shut_Down' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA8AMAAFsCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
