<root>
<document schema='101' license='1,407charles,AUQQUZ' title='' description='' target='AVR.ATMEGA.Arduino Uno R3 SMD' >
	<config data='' 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='rxd' />
		<watch expr='data' />
		<watch expr='rxd' />
		<watch expr='tmp' />
		<watch expr='affichage.CHR_aff' />
		<watch expr='affichage.CHR_tmp' />
		<watch expr='affichage.tmp' />
		<watch expr='affichage.CHR_aff' />
		<watch expr='affichage.tmp' />
		<watch expr='affichage.tmp' />
	</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='Misc' 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='mois' type='T8' description='' isconst='1' isinit='1' usrinit='&quot;JanFebMarAprMayJunJulAugSepOctNovDec&quot;' setinit='&quot;JanFebMarAprMayJunJulAugSepOctNovDec&quot;' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='data' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='8' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='tmp' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='adresse' type='s16' description='' isconst='1' isinit='1' usrinit='104' setinit='0x68' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rxd' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='jour' type='T8' description='' isconst='1' isinit='1' usrinit='&quot;SunMonTueWenThuFriSat&quot;' setinit='&quot;SunMonTueWenThuFriSat&quot;' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='lecture_heure' description='' >
						<command class_type='call' title='' textarea='36,0,511,300' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='Appel de la Routine Composant' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='(adresse &lt;&lt;1)' />
						</command>
						<command class_type='call' title='Appel de la Routine Composant' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='0' />
						</command>
						<command class_type='comment' title='' comment='adresse de départ' textarea='12,0,12,0' />
						<command class_type='call' title='Appel de la Routine Composant' component='I2C_Master1' macro='Restart' />
						<command class_type='call' title='Appel de la Routine Composant' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='adresse &lt;&lt; 1 | 0x01' />
						</command>
						<command class_type='loop' title='Boucle' type='2' forvar='tmp' exp='6' >
							<flowline >
								<command class_type='call' title='lecture registres' component='I2C_Master1' macro='ReceiveByte' >
									<return exp='data[tmp]' />
									<argument exp='0' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='cloture trame i2C' component='I2C_Master1' macro='ReceiveByte' >
							<return exp='data[6]' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Appel de la Routine Composant' component='I2C_Master1' macro='Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialisation' description='' >
						<command class_type='call' title='Appel de la Routine Composant' textarea='36,0,511,300' component='I2C_Master1' macro='Initialise' />
						<command class_type='call' title='Appel de la Routine Composant' component='RS2321' macro='Initialise' />
						<command class_type='comment' title='' comment='activation horloge' textarea='12,0,12,0' />
						<command class_type='call' title='' textarea='36,0,511,300' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='adresse = 68' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='(adresse &lt;&lt;1)' />
						</command>
						<command class_type='comment' title='' comment='adresse de départ' textarea='12,0,12,0' />
						<command class_type='call' title='Control' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='0x07' />
						</command>
						<command class_type='call' title='Mot de controle out 32768Hz' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='0b00010000' />
						</command>
						<command class_type='call' title='Appel de la Routine Composant' component='I2C_Master1' macro='Stop' />
						<command class_type='call' title='Appel d&apos;une Macro' macro='Mise_a_heure' />
						<command class_type='comment' title='' comment='gLCD' textarea='12,0,12,0' />
						<command class_type='call' title='Appel de la Routine Composant' component='lcd_4x20' macro='Start' />
						<command class_type='call' title='Appel de la Routine Composant' component='lcd_4x20' macro='PrintString' >
							<argument exp='&quot;RTC DS1307&quot;' />
						</command>
						<command class_type='delay' title='Delay' exp='1' type='2' />
						<command class_type='call' title='Call Component Macro' component='lcd_4x20' macro='Clear' />
					</flowline>
				</macro>
				<macro >
					<flowline name='affichage' description='' >
						<local name='tmp' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='CHR_tmp' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='3' />
						</local>
						<local name='CHR_aff' type='T8' description='' isconst='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
							<array size='16' />
						</local>
						<local name='jour' type='T8' description='' isconst='1' isinit='1' usrinit='&quot;DimLunMarMerJeuVenSam&quot;' setinit='&quot;DimLunMarMerJeuVenSam&quot;' />
						<command class_type='comment' title='' comment='heure' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='lcd_4x20' macro='Cursor' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Appel de la Routine Composant' component='lcd_4x20' macro='PrintString' >
							<argument exp='&quot;Time&quot;' />
						</command>
						<command class_type='calculation' title='Heure' >
							<exp exp='.tmp = data[2] AND 0xf0 //heure x10' />
							<exp exp='.tmp = .tmp &gt;&gt; 4' />
							<exp exp='.CHR_tmp = ToString$ (.tmp)' />
							<exp exp='.CHR_aff = .CHR_aff + .CHR_tmp' />
							<exp exp='.tmp = data[2] AND 0x0F //heure x1' />
							<exp exp='.CHR_tmp = ToString$ (.tmp)' />
							<exp exp='.CHR_aff = .CHR_aff + .CHR_tmp + &quot;:&quot;' />
						</command>
						<command class_type='calculation' title='min' >
							<exp exp='.tmp = data[1] AND 0xf0 //heure x10' />
							<exp exp='.tmp = .tmp &gt;&gt; 4' />
							<exp exp='.CHR_tmp = ToString$ (.tmp)' />
							<exp exp='.CHR_aff = .CHR_aff + .CHR_tmp' />
							<exp exp='.tmp = data[1] AND 0x0F //heure x1' />
							<exp exp='.CHR_tmp = ToString$ (.tmp)' />
							<exp exp='.CHR_aff = .CHR_aff + .CHR_tmp + &quot;:&quot;' />
						</command>
						<command class_type='calculation' title='sec' >
							<exp exp='.tmp = data[0] AND 0xf0 //heure x10' />
							<exp exp='.tmp = .tmp &gt;&gt; 4' />
							<exp exp='.CHR_tmp = ToString$ (.tmp)' />
							<exp exp='.CHR_aff = .CHR_aff + .CHR_tmp' />
							<exp exp='.tmp = data[0] AND 0x0F //heure x1' />
							<exp exp='.CHR_tmp = ToString$ (.tmp)' />
							<exp exp='.CHR_aff = .CHR_aff + .CHR_tmp + &quot;    &quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='lcd_4x20' macro='Cursor' >
							<argument exp='5' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Appel de la Routine Composant' component='lcd_4x20' macro='PrintString' >
							<argument exp='.CHR_aff' />
						</command>
						<command class_type='comment' title='' comment='Date' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='lcd_4x20' macro='Cursor' >
							<argument exp='0' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Appel de la Routine Composant' component='lcd_4x20' macro='PrintString' >
							<argument exp='&quot;Date:&quot;' />
						</command>
						<command class_type='calculation' title='jour semaine' >
							<exp exp='.tmp = data[3] AND 0x07 //jour semaine' />
							<exp exp='.CHR_aff = Mid$ (jour, (.tmp * 3),3)' />
							<exp exp='.CHR_aff = .CHR_aff + &quot; &quot;' />
						</command>
						<command class_type='calculation' title='date' >
							<exp exp='.tmp = data[4] AND 0x30 //jour x10' />
							<exp exp='.tmp = .tmp &gt;&gt; 4' />
							<exp exp='.CHR_tmp = ToString$ (.tmp)' />
							<exp exp='.CHR_aff = .CHR_aff + .CHR_tmp' />
							<exp exp='.tmp = data[4] AND 0x0F //jour x1' />
							<exp exp='.CHR_tmp = ToString$ (.tmp)' />
							<exp exp='.CHR_aff = .CHR_aff + .CHR_tmp + &quot; &quot;' />
						</command>
						<command class_type='calculation' title='mois' >
							<exp exp='.tmp = data[5] AND 0x0F //mois' />
							<exp exp='.tmp = .tmp + 10 * ((data[5] AND 0x10) &gt;&gt; 4)' />
							<exp exp='.tmp = .tmp - 1' />
							<exp exp='.CHR_tmp = Mid$ (mois, (.tmp * 3),3)' />
							<exp exp='.CHR_aff = .CHR_aff + .CHR_tmp + &quot; &quot;' />
						</command>
						<command class_type='calculation' title='annee' >
							<exp exp='.tmp = data[6] AND 0xf0 //annee x10' />
							<exp exp='.tmp = .tmp &gt;&gt; 4' />
							<exp exp='.CHR_tmp = ToString$ (.tmp)' />
							<exp exp='.CHR_aff = .CHR_aff + &quot;20&quot; + .CHR_tmp' />
							<exp exp='.tmp = data[6] AND 0x0F //annee x1' />
							<exp exp='.CHR_tmp = ToString$ (.tmp)' />
							<exp exp='.CHR_aff = .CHR_aff + .CHR_tmp + &quot; &quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='lcd_4x20' macro='Cursor' >
							<argument exp='5' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Appel de la Routine Composant' component='lcd_4x20' macro='PrintString' >
							<argument exp='.CHR_aff' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Mise_a_heure' description='' >
						<command class_type='comment' title='' comment='Lecture registre 0 bit 7' textarea='12,0,12,0' />
						<command class_type='call' title='' textarea='36,0,511,300' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='Appel de la Routine Composant' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='(adresse &lt;&lt;1)' />
						</command>
						<command class_type='call' title='Registre 0' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='Appel de la Routine Composant' component='I2C_Master1' macro='Restart' />
						<command class_type='call' title='Appel de la Routine Composant' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='adresse &lt;&lt; 1 | 0x01' />
						</command>
						<command class_type='call' title='Appel de la Routine Composant' component='I2C_Master1' macro='ReceiveByte' >
							<return exp='tmp' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='' textarea='36,0,511,300' component='I2C_Master1' macro='Stop' />
						<command class_type='calculation' title='bit 7 registre 0' >
							<exp exp='tmp = tmp AND 0x80' />
						</command>
						<command class_type='decision' title='Décision' exp='tmp = 0x80' swap='0' >
							<flowline >
								<command class_type='comment' title='' comment='Mise à l&apos;heure
' textarea='12,0,12,0' />
								<command class_type='calculation' title='simulation sans DS1307' >
									<exp exp='data[2] = 0x01 //heure' />
									<exp exp='data[1] = 0x46 //minute' />
									<exp exp='data[0] = 0x00 //seconde' />
									<exp exp='' />
									<exp exp='data[3] = 0x07 //jour' />
									<exp exp='data[4] = 0x16 //date' />
									<exp exp='data[5] = 0x08 //mois' />
									<exp exp='data[6] = 0x15 //année' />
								</command>
								<command class_type='call' title='' textarea='36,0,511,300' component='I2C_Master1' macro='Start' />
								<command class_type='call' title='Appel de la Routine Composant' component='I2C_Master1' macro='TransmitByte' >
									<argument exp='(adresse &lt;&lt;1)' />
								</command>
								<command class_type='comment' title='' comment='adresse de départ' textarea='12,0,12,0' />
								<command class_type='call' title='registre départ 0' component='I2C_Master1' macro='TransmitByte' >
									<argument exp='0' />
								</command>
								<command class_type='loop' title='Boucle' type='2' forvar='tmp' exp='7' >
									<flowline >
										<command class_type='call' title='lecture registres' component='I2C_Master1' macro='TransmitByte' >
											<argument exp='data[tmp]' />
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Appel de la Routine Composant' component='I2C_Master1' macro='Stop' />
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='interruption' description='' />
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<command class_type='call' title='Appel d&apos;une Macro' textarea='36,0,511,300' macro='Initialisation' />
						<command class_type='loop' title='Boucle' textarea='36,0,511,300' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Lecture DS1307' macro='lecture_heure' />
								<command class_type='delay' title='Delay' exp='1' type='1' />
								<command class_type='call' title='Affichage gLCD' macro='affichage' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='a2b40602-5421-4e2f-ba82-96db1be51d69' vmin='1' vmaj='1' codename='lcd_4x20' x='20' y='69.85' z='3.575' xsz='2.5' ysz='3.52617' 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='$PORTD.2' />
					<value target='Pin_Data_1' data='$PORTD.3' />
					<value target='Pin_Data_2' data='$PORTD.4' />
					<value target='Pin_Data_3' data='$PORTD.5' />
					<value target='Pin_RS' data='$PORTD.6' />
					<value target='Pin_E' data='$PORTD.7' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='24219805-113d-4b12-b6bd-e1b0b0c33981' vmin='2' vmaj='1' codename='I2C_Master1' x='16' y='-24' 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='BAUD' data='50000' />
					<value target='SDA' data='$PORTC.4' />
					<value target='SCL' data='$PORTC.5' />
					<value target='label' data='I2C Master' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c73616d1-7ad0-45d9-aada-69ccfa4c5efc' vmin='3' vmaj='1' codename='RS2321' x='16' y='-64' 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='004' />
					<value target='BAUD' data='9600' />
					<value target='DBITS' data='008' />
					<value target='RETURN' data='000' />
					<value target='ToutVal' data='255' />
					<value target='FLOWEN' data='000' />
					<value target='ECHO' data='000' />
					<value target='TX' data='$PORTD.1' />
					<value target='RX' data='$PORTD.0' />
					<value target='CTS' data='$PORTB.1' />
					<value target='RTS' data='$PORTB.2' />
					<value target='TXRemap' data='' />
					<value target='RXRemap' data='' />
					<value target='label' data='RS232' />
					<value target='ScopeTraces' data='0' />
					<value target='ConsoleData' data='0' />
					<value target='ConsoleColumns' data='64' />
					<value target='DataSource' data='001' />
					<value target='com_port' data='003' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='0' 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='1' lighting='1' brightness='0' perspective='0' >
		<background rgb='16777215' img='' style='0' />
		<table rgb='16777215' img='' style='0' size='26' />
		<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='affichage' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAARgMAAFkCAAA' zoom='75' scrollx='0' scrolly='45' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAARgMAAFkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialisation' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAARgMAAFkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='lecture_heure' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAARgMAAFkCAAA' zoom='75' scrollx='0' scrolly='194' flags='0' />
		<view type='0' name='Mise_a_heure' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAARgMAAFkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
