<root>
<document schema='101' license='1,Roberto Castaldo,J2WZYR' title='Ricezione di un valore ad 8 bit con controllo CRC' description='Questo firmware serve a ricevere tramite linea seriale un carattere di 8 bit che indica il valore di
una grandezdelza che poi verrà usata.
In questo particolare progetto il chip è un PIC18F1220 

Il controllo del dato ricevuto viene fatto tramite lo xor del carattere di address (0-31)
 e quello del dato ed il risultato viene comparato con il dato di CRC ricevuto.
Verrùà trasmesso ACK o NAK a seconda se il CRC coincide o meno.

L&apos;indirizzo del dispositivo viene settatotramite la stessa linea seriale inviando tre caratteri &apos;A&apos; e di seguito l&apos;indirizzo.
Se ricezione andata a buon fine il dispositivo trasmetterà a sua volta l&apos;indirizzo che gli è stato
inviatoed un char di ACK' target='PIC.18F.18F1220' >
	<config data='!0,ff!8,f9!10,fc!18,f4!20,ff!28,ff!30,fe!38,ff!40,fd!48,ff!50,ff!58,ff!60,ff!68,ff%8,9%e,1%f,1%10,0%11,0%12,3%18,0%19,a%2f,1%30,0%32,1%37,1%40,1%41,0%4f,1%4e,1%50,1%51,1%5f,1%5e,1%5d,1%60,1%61,1%6e,1' clkspd='4000000' simspd='4' 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='Secondi_Timer_1' />
		<watch expr='On_Timer_1' />
		<watch expr='Fraz_Counter_1' />
		<watch expr='CRT' />
		<watch expr='Address' />
		<watch expr='Address' />
		<watch expr='Luce_Led' />
		<watch expr='Lux_ricevuto' />
		<watch expr='Pispol' />
	</debug>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='5f836e85-f4f0-43bb-89e0-25bd89e31db7' vstate='40' vmin='0' vmaj='0' srcleaf='' visiblename='' description='' category='Misc' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='0' iconpath='' />
		<component class_type='root' codename='panel' x='5' y='0' z='0' xsz='0.5' ysz='0.5' zsz='0.5' xang='50' yang='0' zang='0' xquat='0.422618' yquat='0' zquat='0' wquat='0.906308' visible='1' interactive='1' solid='1' layer='0' poslock='0' macronames='$(type)_$(module)__$(macro)' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='On_Timer_1' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Pointer_chars_to_receive' type='u8' description='Puntatore alla ricezione caratteri' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='CRC_Calcolato' type='u8' description='Valore di CRC che viene inviato dalMaster, carcolato e confrontato' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='NAK' type='s16' description='carattere di controllo &quot;Non Aggio Capito&quot;' isconst='1' isinit='1' usrinit='21' setinit='21' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Park_Lux_Ricevuto' type='u8' description='Parcheggio momentaneo del valore di luce ricevuto' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Address' type='u8' description='indirizzo del dispositivo' isconst='0' isinit='1' usrinit='25' setinit='25' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ACK' type='s16' description='carattere di controllo &quot;Aggio Capito&quot;' isconst='1' isinit='1' usrinit='6' setinit='06' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Led_Spenti' type='s16' description='I led sono totalmente spenti' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Addresses' type='s16' description='Valore dell&apos;ultimo indirizzo' isconst='1' isinit='1' usrinit='31' setinit='31' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Lux_ricevuto' type='u8' description='valore di luce ricevuta' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Attesa_CRC' type='s16' description='' isconst='1' isinit='1' usrinit='2' setinit='2' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Start_timeout' type='b1' description='flag che fa partire il timeout di ricezione' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Attesa_dato_Lux' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Pispol' type='b1' description='Serve per determinare il tempo della routine' isconst='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='CRT' type='u8' description='Valore del crt' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Fraz_Counter_2' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Fraz_Counter_1' type='u16' description='Ogni 15259  frazioni circa un secondo' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Char_ricevuto' type='u8' description='carattere ricevuto dalla seriale da 1 a 32 è indirizzo dispositivo' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Luce_Led' type='u8' description='Variabile che contiene valore di Duty Cicleda inviare ai led' isconst='0' isinit='1' usrinit='0' setinit='Led_Spenti' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Trasmetti_Nak' type='s16' description='' isconst='1' isinit='1' usrinit='4' setinit='4' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Trasmetti_Ack' type='s16' description='' isconst='1' isinit='1' usrinit='3' setinit='3' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Secondi_Timer_2' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='On_Timer_2' type='b1' description='Se attivo parte il counter2' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Secondi_Timer_1' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Counter_time_rec_chars' type='u8' description='Contatore per timeout ricezione caratteri' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Varialuce' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='Vede se il dato di luce ricevuto si è modificato' exp='Lux_ricevuto = Luce_Led' swap='0' >
							<flowline />
							<flowline >
								<command class_type='decision' title='Decisione' exp='Luce_Led &gt; Lux_ricevuto' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calcolo' >
											<exp exp='Luce_Led = Luce_Led - 1' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calcolo' >
											<exp exp='Luce_Led = Luce_Led + 1' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calcolo' >
							<exp exp='Pispol = !Pispol' />
						</command>
						<command class_type='output' title='Uscita' mode='1' port='1048576' mask='16' exp='Pispol' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Incrementa_pippo' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='Decisione' exp='On_Timer_1' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calcolo' >
									<exp exp='Fraz_Counter_1 = Fraz_Counter_1 + 1' />
								</command>
								<command class_type='decision' title='Decisione' exp='Fraz_Counter_1 &gt; 15' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calcolo' >
											<exp exp='Fraz_Counter_1 = 0' />
											<exp exp='Secondi_Timer_1 = Secondi_Timer_1 + 1' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decisione' exp='On_Timer_2' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calcolo' >
									<exp exp='Fraz_Counter_2 = Fraz_Counter_2 + 1' />
								</command>
								<command class_type='decision' title='Decisione' exp='Fraz_Counter_2 &gt; 15' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calcolo' >
											<exp exp='Fraz_Counter_2 = 0' />
											<exp exp='Secondi_Timer_2 = Secondi_Timer_2 + 1' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='native' title='Codice C setta clock interno a 8Mhz' ccode='/*
  Inserisci il codice C qui sotto
*/
osccon= 0x60;' language='C' />
						<command class_type='calculation' title='Calcolo' >
							<exp exp='Luce_Led = 32' />
						</command>
						<command class_type='call' title='Chiamata Macro Componente' component='PWM1' macro='Enable' />
						<command class_type='call' title='Chiamata Macro Componente' component='RS232' macro='Initialise' />
						<command class_type='call' title='Chiamata Macro Componente ricupera il suo indirizzo' component='eeprom1' macro='Read' >
							<return exp='Address' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Ricupera ultimo dato di luce a cui funzionava da acceso' component='eeprom1' macro='Read' >
							<return exp='Luce_Led' />
							<argument exp='1' />
						</command>
						<command class_type='calculation' title='Si accenderà stabile all&apos;ultimo valore di luce' >
							<exp exp='Lux_ricevuto = Luce_Led' />
						</command>
						<command class_type='comment' title='' comment='Togliere alla fine la trasmissione del proprio indirizzo. Solo per debug' textarea='12,0,12,0' />
						<command class_type='delay' title='Ritardo' exp='1' type='1' />
						<command class_type='output' title='Abilita chip 422 in trasmissione' mode='1' port='1048577' mask='4' exp='1' />
						<command class_type='call' title='Chiamata Macro Componente' component='RS232' macro='SendChar' >
							<argument exp='Address' />
						</command>
						<command class_type='delay' title='Ritardo' exp='1' type='1' />
						<command class_type='output' title='Toglie abilitazione alla trasmissione' mode='1' port='1048577' mask='4' exp='0' />
						<command class_type='output' title='Accende led' mode='1' port='1048577' mask='8' exp='1' />
						<command class_type='delay' title='Ritardo' exp='500' type='1' />
						<command class_type='output' title='Spegne led' mode='1' port='1048577' mask='8' exp='0' />
						<command class_type='interrupt' title='Int circa 1mS' enable='1' name='TMR0' call='Varialuce' >
							<settings timer='1' prescale='4' postscale='-1' rollover='-1' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='0' />
								<option value='1' />
								<option value='2' />
								<option value='-1' />
							</settings>
						</command>
						<command class_type='loop' title='Ciclo' type='0' exp='1' >
							<flowline >
								<command class_type='switch' title='attesa caratteri' textarea='36,25,36,25' exp='Pointer_chars_to_receive' >
									<case >
										<flowline >
											<command class_type='call' title='Chiamata Macro Componente' component='RS232' macro='ReceiveChar' >
												<return exp='Char_ricevuto' />
												<argument exp='255' />
											</command>
											<command class_type='decision' title='Decisione' exp='Char_ricevuto &lt; 255' swap='0' >
												<flowline >
													<command class_type='decision' title='Vede se carattere di settaggioindirizzo' exp='Char_ricevuto = &apos;A&apos;' swap='0' >
														<flowline >
															<command class_type='calculation' title='Punta a ricevere il prossimo &quot;A&quot;' >
																<exp exp='Pointer_chars_to_receive = 5' />
															</command>
															<command class_type='calculation' title='Fa partire timeout per ricevere caratteri' >
																<exp exp='Start_timeout = 1' />
															</command>
														</flowline>
														<flowline >
															<command class_type='decision' title='Primo carattere dato (lo è se maggiore di 31)  o indirizzo?' exp='Char_ricevuto &gt; Addresses' swap='0' >
																<flowline />
																<flowline >
																	<command class_type='decision' title='Primo carattere ricevuto è l&apos;indirizzo del dispositivo?' exp='Char_ricevuto = Address' swap='1' >
																		<flowline />
																		<flowline >
																			<command class_type='calculation' title='Punta a ricevere il carattere terzo' >
																				<exp exp='Pointer_chars_to_receive = Attesa_dato_Lux' />
																			</command>
																			<command class_type='calculation' title='Azzera il timer massimo per ricevere i Chars' >
																				<exp exp='Counter_time_rec_chars = 0' />
																			</command>
																			<command class_type='calculation' title='Fa partire timeout per ricevere caratteri' >
																				<exp exp='Start_timeout = 1' />
																			</command>
																		</flowline>
																	</command>
																</flowline>
															</command>
														</flowline>
													</command>
												</flowline>
												<flowline />
											</command>
										</flowline>
									</case>
									<case exp='Attesa_dato_Lux' >
										<flowline >
											<command class_type='call' title='Chiamata Macro Componente' component='RS232' macro='ReceiveChar' >
												<return exp='Char_ricevuto' />
												<argument exp='255' />
											</command>
											<command class_type='decision' title='Decisione' exp='Char_ricevuto &lt; 255' swap='0' >
												<flowline >
													<command class_type='decision' title='Se secondo carattere ricevuto = indirizzo ricomincio da capo' exp='Char_ricevuto &lt;= Addresses' swap='0' >
														<flowline >
															<command class_type='calculation' title='Stoppa l&apos;avanzamento del timer' >
																<exp exp='Start_timeout = 0' />
															</command>
															<command class_type='calculation' title='Azzera il timer massimo per ricevere i Chars' >
																<exp exp='Counter_time_rec_chars = 0' />
															</command>
															<command class_type='calculation' title='Indirizzo non mio, aspettiamo la nostra terna' >
																<exp exp='Pointer_chars_to_receive = 0' />
															</command>
														</flowline>
														<flowline >
															<command class_type='comment' title='' comment='Altrimenti si tratta del valore di luminosità da impostare' textarea='12,0,12,0' />
															<command class_type='calculation' title='Calcolo' >
																<exp exp='Park_Lux_Ricevuto = Char_ricevuto' />
															</command>
															<command class_type='calculation' title='Calcolo CRC' >
																<exp exp='CRC_Calcolato = Lux_ricevuto XOR Address' />
															</command>
															<command class_type='calculation' title='Punta a ricevere il carattere terzo' >
																<exp exp='Pointer_chars_to_receive = Attesa_CRC' />
															</command>
														</flowline>
													</command>
												</flowline>
												<flowline />
											</command>
										</flowline>
									</case>
									<case exp='Attesa_CRC' >
										<flowline >
											<command class_type='call' title='Chiamata Macro Componente' component='RS232' macro='ReceiveChar' >
												<return exp='Char_ricevuto' />
												<argument exp='255' />
											</command>
											<command class_type='decision' title='Decisione' exp='Char_ricevuto &lt; 255' swap='0' >
												<flowline >
													<command class_type='decision' title='Controllo CRC' exp='Char_ricevuto = CRC_Calcolato' swap='0' >
														<flowline >
															<command class_type='calculation' title='Calcolo' >
																<exp exp='Lux_ricevuto = Park_Lux_Ricevuto' />
															</command>
															<command class_type='call' title='Chiamata Macro Componente memorizza il valore di luce ricevuto' component='eeprom1' macro='Write' >
																<argument exp='1' />
																<argument exp='Lux_ricevuto' />
															</command>
															<command class_type='calculation' title='Punta a trasmettere ACK' >
																<exp exp='Pointer_chars_to_receive = Trasmetti_Ack' />
															</command>
														</flowline>
														<flowline >
															<command class_type='calculation' title='Stoppa l&apos;avanzamento del timer' disable='1' >
																<exp exp='Start_timeout = 0' />
															</command>
															<command class_type='calculation' title='Azzera il timer massimo per ricevere i Chars' disable='1' >
																<exp exp='Counter_time_rec_chars = 0' />
															</command>
															<command class_type='calculation' title='Azzera puntatore caratteri' disable='1' >
																<exp exp='Pointer_chars_to_receive = 0' />
															</command>
															<command class_type='calculation' title='Punta a trasmettere NAK' >
																<exp exp='Pointer_chars_to_receive = Trasmetti_Nak' />
															</command>
														</flowline>
													</command>
												</flowline>
												<flowline />
											</command>
										</flowline>
									</case>
									<case exp='Trasmetti_Ack' >
										<flowline >
											<command class_type='output' title='Abilita TX' mode='1' port='1048577' mask='4' exp='1' />
											<command class_type='delay' title='Ritardo' exp='200' type='0' />
											<command class_type='call' title='Chiamata Macro Componente' component='RS232' macro='SendChar' >
												<argument exp='ACK' />
											</command>
											<command class_type='calculation' title='Stoppa l&apos;avanzamento del timer' >
												<exp exp='Start_timeout = 0' />
											</command>
											<command class_type='calculation' title='Azzera il timer massimo per ricevere i Chars' >
												<exp exp='Counter_time_rec_chars = 0' />
											</command>
											<command class_type='calculation' title='Indirizzo non mio, aspettiamo la nostra terna' >
												<exp exp='Pointer_chars_to_receive = 0' />
											</command>
											<command class_type='delay' title='Ritardo' exp='200' type='0' />
											<command class_type='output' title='Toglie Abilitazione TX' mode='1' port='1048577' mask='4' exp='0' />
										</flowline>
									</case>
									<case exp='Trasmetti_Nak' >
										<flowline >
											<command class_type='output' title='Abilita TX' mode='1' port='1048577' mask='4' exp='1' />
											<command class_type='delay' title='Ritardo' exp='200' type='0' />
											<command class_type='call' title='Chiamata Macro Componente' component='RS232' macro='SendChar' >
												<argument exp='NAK' />
											</command>
											<command class_type='calculation' title='Stoppa l&apos;avanzamento del timer' >
												<exp exp='Start_timeout = 0' />
											</command>
											<command class_type='calculation' title='Azzera il timer massimo per ricevere i Chars' >
												<exp exp='Counter_time_rec_chars = 0' />
											</command>
											<command class_type='calculation' title='Indirizzo non mio, aspettiamo la nostra terna' >
												<exp exp='Pointer_chars_to_receive = 0' />
											</command>
											<command class_type='delay' title='Ritardo' exp='200' type='0' />
											<command class_type='output' title='Toglie Abilitazione TX' mode='1' port='1048577' mask='4' exp='0' />
										</flowline>
									</case>
									<case exp='5' >
										<flowline >
											<command class_type='call' title='Chiamata Macro Componente' component='RS232' macro='ReceiveChar' >
												<return exp='Char_ricevuto' />
												<argument exp='255' />
											</command>
											<command class_type='decision' title='Decisione' exp='Char_ricevuto &lt; 255' swap='0' >
												<flowline >
													<command class_type='decision' title='Decisione' exp='Char_ricevuto = &apos;A&apos;' swap='1' >
														<flowline >
															<command class_type='calculation' title='Stoppa l&apos;avanzamento del timer' >
																<exp exp='Start_timeout = 0' />
															</command>
															<command class_type='calculation' title='Azzera il timer massimo per ricevere i Chars' >
																<exp exp='Counter_time_rec_chars = 0' />
															</command>
															<command class_type='calculation' title='Indirizzo non mio, aspettiamo la nostra terna' >
																<exp exp='Pointer_chars_to_receive = 0' />
															</command>
														</flowline>
														<flowline >
															<command class_type='calculation' title='Punta a ricevere il carattere terzo' >
																<exp exp='Pointer_chars_to_receive = 6' />
															</command>
														</flowline>
													</command>
												</flowline>
												<flowline />
											</command>
										</flowline>
									</case>
									<case exp='6' >
										<flowline >
											<command class_type='call' title='Chiamata Macro Componente' component='RS232' macro='ReceiveChar' >
												<return exp='Char_ricevuto' />
												<argument exp='255' />
											</command>
											<command class_type='decision' title='Decisione' exp='Char_ricevuto &lt; 255' swap='0' >
												<flowline >
													<command class_type='decision' title='Decisione' exp='Char_ricevuto = &apos;A&apos;' swap='1' >
														<flowline >
															<command class_type='calculation' title='Stoppa l&apos;avanzamento del timer' >
																<exp exp='Start_timeout = 0' />
															</command>
															<command class_type='calculation' title='Azzera il timer massimo per ricevere i Chars' >
																<exp exp='Counter_time_rec_chars = 0' />
															</command>
															<command class_type='calculation' title='Indirizzo non mio, aspettiamo la nostra terna' >
																<exp exp='Pointer_chars_to_receive = 0' />
															</command>
														</flowline>
														<flowline >
															<command class_type='calculation' title='Punta a ricevere il carattere terzo' >
																<exp exp='Pointer_chars_to_receive = 7' />
															</command>
														</flowline>
													</command>
												</flowline>
												<flowline />
											</command>
										</flowline>
									</case>
									<case exp='7' >
										<flowline >
											<command class_type='call' title='Chiamata Macro Componente' component='RS232' macro='ReceiveChar' >
												<return exp='Char_ricevuto' />
												<argument exp='255' />
											</command>
											<command class_type='decision' title='Decisione' exp='Char_ricevuto &lt; 255' swap='0' >
												<flowline >
													<command class_type='decision' title='Decisione' exp='Char_ricevuto &gt; 31' swap='0' >
														<flowline >
															<command class_type='calculation' title='Stoppa l&apos;avanzamento del timer' >
																<exp exp='Start_timeout = 0' />
															</command>
															<command class_type='calculation' title='Azzera il timer massimo per ricevere i Chars' >
																<exp exp='Counter_time_rec_chars = 0' />
															</command>
															<command class_type='calculation' title='Indirizzo non mio, aspettiamo la nostra terna' >
																<exp exp='Pointer_chars_to_receive = 0' />
															</command>
														</flowline>
														<flowline >
															<command class_type='calculation' title='Questo dato è quello di indirizzo' >
																<exp exp='Address = Char_ricevuto' />
															</command>
															<command class_type='calculation' title='Indirizzo non mio, aspettiamo la nostra terna' >
																<exp exp='Pointer_chars_to_receive = 8' />
															</command>
														</flowline>
													</command>
												</flowline>
												<flowline />
											</command>
										</flowline>
									</case>
									<case exp='8' >
										<flowline >
											<command class_type='delay' title='Ritardo' exp='5' type='1' />
											<command class_type='output' title='Abilita TX' mode='1' port='1048577' mask='4' exp='1' />
											<command class_type='delay' title='Ritardo' exp='1' type='1' />
											<command class_type='call' title='Chiamata Macro Componente' component='RS232' macro='SendChar' >
												<argument exp='Char_ricevuto' />
											</command>
											<command class_type='call' title='Chiamata Macro Componente' component='RS232' macro='SendChar' >
												<argument exp='ACK' />
											</command>
											<command class_type='calculation' title='Stoppa l&apos;avanzamento del timer' >
												<exp exp='Start_timeout = 0' />
											</command>
											<command class_type='calculation' title='Azzera il timer massimo per ricevere i Chars' >
												<exp exp='Counter_time_rec_chars = 0' />
											</command>
											<command class_type='calculation' title='Indirizzo non mio, aspettiamo la nostra terna' >
												<exp exp='Pointer_chars_to_receive = 0' />
											</command>
											<command class_type='call' title='Chiamata Macro Componente memorizza indirizzo assegnato' component='eeprom1' macro='Write' >
												<argument exp='0' />
												<argument exp='Address' />
											</command>
											<command class_type='delay' title='Ritardo' exp='6' type='1' />
											<command class_type='output' title='Toglie Abilitazione TX' mode='1' port='1048577' mask='4' exp='0' />
										</flowline>
									</case>
								</command>
								<command class_type='call' title='Chiamata Macro Componente' component='PWM1' macro='SetDutyCycle' >
									<argument exp='Luce_Led' />
								</command>
								<command class_type='calculation' title='Calcolo' disable='1' >
									<exp exp='CRT = address XOR 50' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='pippo' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='6' vmaj='1' codename='PWM1' x='-112' y='264' z='4.00066' xsz='4.53333' ysz='4.53333' zsz='4.53333' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='001' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTB.3' />
					<value target='RemapPin' data='' />
					<value target='timer' data='002' />
					<value target='period' data='255' />
					<value target='prescale' data='004' />
					<value target='period_calc' data='4096.000000' />
					<value target='frequency_calc' data='0.244141' />
					<value target='pwm_prescale' data='16' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='dfb4d07a-3d70-45d5-83ef-07e3c95d86ab' vmin='4' vmaj='1' codename='Tabella' x='-128' y='-288' z='0' xsz='152' ysz='144' zsz='25' 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='intfixed' data='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05,
0x05, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x09, 0x09, 0x0A, 0x0A, 0x0B, 0x0B,
0x0C, 0x0C, 0x0D, 0x0D, 0x0E, 0x0F, 0x0F, 0x10, 0x11, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1F, 0x20, 0x21, 0x23, 0x24, 0x26, 0x27, 0x29, 0x2B, 0x2C,
0x2E, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3A, 0x3C, 0x3E, 0x40, 0x43, 0x45, 0x47, 0x4A, 0x4C, 0x4F,
0x51, 0x54, 0x57, 0x59, 0x5C, 0x5F, 0x62, 0x64, 0x67, 0x6A, 0x6D, 0x70, 0x73, 0x76, 0x79, 0x7C,
0x7F, 0x82, 0x85, 0x88, 0x8B, 0x8E, 0x91, 0x94, 0x97, 0x9A, 0x9C, 0x9F, 0xA2, 0xA5, 0xA7, 0xAA,
0xAD, 0xAF, 0xB2, 0xB4, 0xB7, 0xB9, 0xBB, 0xBE, 0xC0, 0xC2, 0xC4, 0xC6, 0xC8, 0xCA, 0xCC, 0xCE,
0xD0, 0xD2, 0xD3, 0xD5, 0xD7, 0xD8, 0xDA, 0xDB, 0xDD, 0xDE, 0xDF, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5,
0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xED, 0xEE, 0xEF, 0xEF, 0xF0, 0xF1, 0xF1, 0xF2,
0xF2, 0xF3, 0xF3, 0xF4, 0xF4, 0xF5, 0xF5, 0xF6, 0xF6, 0xF6, 0xF7, 0xF7, 0xF7, 0xF8, 0xF8, 0xF8,
0xF9, 0xF9, 0xF9, 0xF9, 0xFA, 0xFA, 0xFA, 0xFA, 0xFA, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFC,
0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD,
0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFF, 0xFF' />
					<value target='floatfixed' data='' />
					<value target='fixedexp' data='0' />
					<value target='EmbedIntoC' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='8462ac99-ca8f-429b-953a-36dbe58ada72' vmin='4' vmaj='1' codename='pot_trim_finger2' x='-440' y='-8' z='19.2495' xsz='125.011' ysz='125.011' zsz='128.33' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='angle_start' data='225.000000' />
					<value target='angle_sweep' data='270.000000' />
					<value target='color' data='16777215' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='4' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='003' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c73616d1-7ad0-45d9-aada-69ccfa4c5efc' vmin='3' vmaj='1' codename='RS232' x='-120' y='-24' z='0.755' xsz='192' ysz='88.0001' 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='$PORTB.1' />
					<value target='RX' data='$PORTB.4' />
					<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='1' />
					<value target='ConsoleData' data='1' />
					<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 class_type='ref' guid='d92e8259-f3a8-4176-a8c4-fe7ca42b2c3f' vmin='1' vmaj='1' codename='led_5mm1' x='24' y='120' z='-1.90735e-007' xsz='7.33945' ysz='6.77966' 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='$PORTB.5' />
					<value target='polarity' data='001' />
					<value target='on_color' data='10551200' />
					<value target='length' data='4.000000' />
					<value target='show_label' data='002' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='d92e8259-f3a8-4176-a8c4-fe7ca42b2c3f' vmin='1' vmaj='1' codename='led_5mm2' x='-200' y='-144' z='-1.90735e-007' xsz='7.33945' ysz='6.77966' 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='$PORTB.2' />
					<value target='polarity' data='001' />
					<value target='on_color' data='16729600' />
					<value target='length' data='4.000000' />
					<value target='show_label' data='002' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='dcbf571f-a6fa-402d-bdd4-be00cca4070f' vmin='1' vmaj='1' codename='eeprom1' x='200' y='-16' z='1.24088' xsz='232' ysz='160' zsz='20' 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='EESize' data='256 byte' />
					<value target='EEbitdepth' data='8 bit' />
					<value target='InitialValues' data='' />
					<value target='InitValsParsed' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='5c1da48f-ce54-4622-bdd9-fc812e373696' vmin='0' vmaj='1' codename='sw_push_rnd_pnl1' x='-448' y='-240' z='-6.175' xsz='3.82979' ysz='3.82979' 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='$PORTB.6' />
					<value target='polarity' data='000' />
					<value target='debounce' data='10' />
					<value target='operation' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='5c1da48f-ce54-4622-bdd9-fc812e373696' vmin='0' vmaj='1' codename='sw_push_rnd_pnl2' x='-440' y='280' z='-6.175' xsz='4.25532' ysz='4.68085' 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='$PORTB.7' />
					<value target='polarity' data='000' />
					<value target='debounce' data='10' />
					<value target='operation' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7fdaec78-394e-4ec9-a578-4f1a12a12076' vmin='1' vmaj='1' codename='led_5mm_clip1' x='-104' y='-144' z='-3.85' xsz='8.20513' ysz='9.23077' 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='$PORTB.3' />
					<value target='polarity' data='001' />
					<value target='on_color' data='16711680' />
					<value target='show_label' data='002' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7fdaec78-394e-4ec9-a578-4f1a12a12076' vmin='1' vmaj='1' codename='led_5mm_clip2' x='24' y='56' z='-3.85' xsz='7.17949' ysz='7.17949' 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='$PORTA.4' />
					<value target='polarity' data='001' />
					<value target='on_color' data='8453975' />
					<value target='show_label' data='002' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7fdaec78-394e-4ec9-a578-4f1a12a12076' vmin='1' vmaj='1' codename='led_5mm_clip3' x='24' y='-16' z='-3.85' xsz='7.17949' ysz='7.17949' 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='$PORTA.3' />
					<value target='polarity' data='001' />
					<value target='on_color' data='8453975' />
					<value target='show_label' data='002' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7fdaec78-394e-4ec9-a578-4f1a12a12076' vmin='1' vmaj='1' codename='led_5mm_clip4' x='24' y='-88' z='-3.85' xsz='7.17949' ysz='7.17949' 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='$PORTA.2' />
					<value target='polarity' data='001' />
					<value target='on_color' data='8453975' />
					<value target='show_label' data='002' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7fdaec78-394e-4ec9-a578-4f1a12a12076' vmin='1' vmaj='1' codename='led_5mm_clip5' x='24' y='-160' z='-3.85' xsz='7.17949' ysz='7.17949' 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='$PORTA.1' />
					<value target='polarity' data='001' />
					<value target='on_color' data='8453975' />
					<value target='show_label' data='002' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7fdaec78-394e-4ec9-a578-4f1a12a12076' vmin='1' vmaj='1' codename='led_5mm_clip6' x='24' y='-232' z='-3.85' xsz='7.17949' ysz='7.17949' 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='$PORTA.0' />
					<value target='polarity' data='001' />
					<value target='on_color' data='8453975' />
					<value target='show_label' data='002' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7fdaec78-394e-4ec9-a578-4f1a12a12076' vmin='1' vmaj='1' codename='led_5mm_clip8' x='24' y='-376' z='-3.85' xsz='7.17949' ysz='7.17949' 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='$PORTA.7' />
					<value target='polarity' data='001' />
					<value target='on_color' data='8453975' />
					<value target='show_label' data='002' />
					<value target='label_property' data='pin' />
					<value target='label_color' data='16777215' />
					<value target='label_scale' data='1.000000' />
					<value target='label_auto_scale' data='0' />
					<value target='label_position' data='003' />
				</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='-81' ye='-33' ze='861.786' xt='-81' yt='-33' 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='4' />
		<table rgb='7884836' img='' style='0' size='36' />
		<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---------------------wAAAAAUAAAAcAMAAJEDAAA' zoom='50' scrollx='0' scrolly='580' flags='0' />
		<view type='0' name='Varialuce' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAcAMAAJEDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
