<root>
<document schema='101' license='1,Jim Gailer,ACEU6J' title='MSF Anthorn Radio Synchronised Clock' description='This is a clock that takes its time-setting information from MSF time from the 60kHz Anthorn transmitter.
The software controls time acquisition and periodic recalibration. The objective is to provide tim
 accurate to +/-0.1 seconds.

The clock uses a DS3231 real time clock (RTC) chip to minimise power and provide an accurate second
pulse.  It uses a Symtric RFT60 RF time receiver.

There are three 7-segment LCD display units:
4 digit for hours and minutes
2 digit for seconds
3.5 digit for other data such as DUT1, temperature and date.
The LCD displays are driven by PCF8577C I2C segment drivers.

There is an array of LEDs that, when enabled, display a complete
minute of Anthorn MSF data A-bits, plus parity, organised into BCD date and day of week.
In addition the current second of the A-bit and B-bit time code data is displayed, updated
as the decoding process progresses.
The LEDs are driven by PCA9555DB I2C latched drivers. The LEDs can be switched off
to conserve power.

There is a miniature piezo-electric &apos;loudspeaker&apos; that is used to accompany the time data
collection process and to provide second ticks and minute beeps. The sound can be switched
off to conserve sanity.

' target='PIC.18F.18F45K22' >
	<config data='!0,e800!10,fcf9!20,fd00!30,bf!40,ffff!50,ffff!60,ffff%8,8%c,0%d,1%e,1%f,1%10,1%11,0%13,3%18,0%1a,f%28,1%29,0%2a,1%2b,1%2c,1%2d,1%2f,1%30,1%32,1%36,0%37,1%40,1%41,1%42,1%43,1%4e,1%4f,1%50,1%51,1%52,1%53,1%5d,1%5e,1%5f,1%60,1%61,1%62,1%63,1%6e,1' clkspd='4000000' simspd='9' 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='e18353c6-fec3-45f1-ae9f-25fe9a17e0fb' 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' macronames='$(type)_$(module)__$(macro)' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='LOW' type='s16' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AM' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='PM' type='s16' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='dSecs' type='s16' description='0-1 second in 300pps increments' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTCDate' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='10' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MSFAmPm' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADDR_24_12' type='s16' description='' isconst='1' isinit='1' usrinit='3' setinit='3' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='UKCivilTimeAuto' type='b1' description='Whether Auto (TRUE) or always GMT (FALSE)' isconst='0' isinit='1' usrinit='1' setinit='TRUE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MSFDayOfMonth' type='u8' description='Day of month number derived from MSF signal' isconst='0' isinit='1' usrinit='32' setinit='32' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='GMT' type='s16' description='Value of UKCivilTimeFlag for GMT' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MSFBValue' type='b1' description='Array of B-Bit by second. NB GPS seconds 1-60! Also space for leap second.' isconst='0' isinit='0' usrinit='0' setinit='' >
						<array size='62' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RX_OFF' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOUND_A_B' type='s16' description='' isconst='1' isinit='1' usrinit='5' setinit='5' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FALSE' type='s16' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='clock24' type='b1' description='24 or 12 hour clock?' isconst='0' isinit='1' usrinit='1' setinit='TRUE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='soundOn' type='b1' description='Whether time ticks should be provided' isconst='0' isinit='1' usrinit='1' setinit='TRUE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DUT1' type='s16' description='UTC error in milliseconds, consolidated from seconds 1 to 16 samples' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='BST' type='s16' description='Value of UKCivilTimeFlag for BST' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTCSecs' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MAX_ALIGNMENT_ERROR' type='s16' description='Maximum allowable error between MSF and RTC' isconst='1' isinit='1' usrinit='5' setinit='5' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MSFYear' type='u8' description='2-digit year number derived from MSF signal' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADDR_LEDS_ON' type='s16' description='' isconst='1' isinit='1' usrinit='2' setinit='2' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOUND_TEST' type='s16' description='' isconst='1' isinit='1' usrinit='2' setinit='2' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MSFDateTimeError' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='FALSE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOUND_MINUTE' type='s16' description='' isconst='1' isinit='1' usrinit='6' setinit='6' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MSFDayOfWeek' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ledsOn' type='b1' description='Whether LEDs are displayed' isconst='0' isinit='1' usrinit='1' setinit='TRUE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADDR_LED_DISPLAY' type='s16' description='LED driver I2C address' isconst='1' isinit='1' usrinit='66' setinit='0b01000010' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='sampleClockCounter' type='s16' description='Provides a settable time delay for secondSync' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='syncOK' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='FALSE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADDR_PORT_A' type='s16' description='Address of port A of the LED I2C controller' isconst='1' isinit='1' usrinit='2' setinit='0x02' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MSFMinute' type='u8' description='Minute number derived from MSF signal' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTCSecondOk' type='b1' description='Result of testing seconds against MSF' isconst='0' isinit='1' usrinit='0' setinit='FALSE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='x' type='u8' description='' isconst='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='BLANK' type='s16' description='Value for a blank digit' isconst='1' isinit='1' usrinit='10' setinit='10' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='daysInMonth' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='13' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DUT1Sign' type='u8' description='0 = zero,1 = negative, 2 = positive,' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='temperature' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RX_ON' type='s16' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='segValue' type='u8' description='Array holding 7-segment versions of decimals' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='14' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ERROR' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MSFPulseFlag' type='b1' description='True when next MSF seconds pulse is due' isconst='0' isinit='1' usrinit='0' setinit='FALSE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='NO_ERROR' type='s16' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='sampleClockEnable' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='FALSE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='pHAMOK' type='b1' description='Hour and minute parity' isconst='0' isinit='1' usrinit='0' setinit='FALSE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTCSecondInterruptFlag' type='b1' description='Set by INT1 on -ve edge of clock chip waveform' isconst='0' isinit='1' usrinit='0' setinit='FALSE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='sampleClockFlag' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='FALSE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='aSecs' type='u8' description='Auxilliary seconds counter for calibration' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='sampleDelayCounter' type='s16' description='Countdown from the RTC second to the next MSF pulse' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MSFAValue' type='b1' description='Array of A-Bit by second. NB GPS seconds 1-60! Also space for leap second.' isconst='0' isinit='0' usrinit='0' setinit='' >
						<array size='62' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='UKCivilTimeFlag' type='b1' description='Is 1 for BST, 0 for GMT' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SAMPLE_RATE' type='s16' description='Interrupt rate, derived from RTC, Hz' isconst='1' isinit='1' usrinit='300' setinit='300' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='pYOK' type='b1' description='year parity' isconst='0' isinit='1' usrinit='0' setinit='FALSE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='pDOWOK' type='b1' description='Day of week parity' isconst='0' isinit='1' usrinit='0' setinit='FALSE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOUND_B' type='s16' description='' isconst='1' isinit='1' usrinit='4' setinit='4' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='CAL_STATUS_MSFDATA_DECODED' type='s16' description='' isconst='1' isinit='1' usrinit='5' setinit='5' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTCTime' type='T8' description='Time string read from RTC' isconst='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
						<array size='8' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADDR_CIVIL_TIME' type='s16' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOUND_A' type='s16' description='' isconst='1' isinit='1' usrinit='3' setinit='3' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RX_WARMUP_TIME' type='s16' description='Max seconds from receiver PON to firstvalid received pulse' isconst='1' isinit='1' usrinit='2' setinit='2' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ADDR_SOUND_ON' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MSFMonth' type='u8' description='Month number derived from MSF signal' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='pMOK' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='FALSE' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOUND_SECOND' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MSFHour' type='u8' description='Hour from decodeMSF() [ parity-checked]' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='TRUE' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='collectMSFDateTimeCode' description='Collect MSF A-bit and B-bit data for a full minute
Normally follows straight on from alignRTCMinuteToMSF() so it starts on second 0' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='SAMPLE_DELAY' type='s16' description='Milliseaconds' isconst='1' isinit='1' usrinit='150' setinit='150' />
						<local name='SAMPLE_LENGTH' type='s16' description='These are SAMPLE_RATE pps pulses' isconst='1' isinit='1' usrinit='34' setinit='34' />
						<local name='minuteIdentifier' type='u8' description='Holds the last 8 seconds of A-bit code to detect minute identifier' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='aCodeOnesCount' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='MSFPulseSample' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='bCodeOnesCount' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='DISPLAY_ADDRESS' type='s16' description='' isconst='1' isinit='1' usrinit='116' setinit='0x74' />
						<local name='VECTOR_SS' type='s16' description='Offset of the seconds digits' isconst='1' isinit='1' usrinit='8' setinit='0x08' />
						<local name='sUnits' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='sTens' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='BLANK' type='s16' description='' isconst='1' isinit='1' usrinit='10' setinit='10' />
						<local name='VECTOR_HH' type='s16' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
						<command class_type='calculation' title='Initialise RTC interrupt' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='RTCSecondInterruptFlag = FALSE' />
							<exp exp='sampleClockEnable = TRUE' />
							<exp exp='.minuteIdentifier = 0' />
						</command>
						<command class_type='loop' title='Loop until second 59' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='RTCSecs = 59' start='0' >
							<flowline >
								<command class_type='calculation' title='Reset RTC interrupt ' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='RTCSecondInterruptFlag = FALSE' />
									<exp exp='' />
								</command>
								<command class_type='loop' title='Wait for next RTC second' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='RTCSecondInterruptFlag = TRUE' start='0' >
									<flowline />
								</command>
								<command class_type='delay' title='Wait for A-pulse' cmdcolor='7895044' cmdcolor_sec='7895044' exp='.SAMPLE_DELAY' type='1' />
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='sampleClockCounter = 0' />
									<exp exp='sampleClockFlag = FALSE' />
									<exp exp='.aCodeOnesCount = 0' />
								</command>
								<command class_type='loop' title='Loop for duration of A-bit (~100ms)' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='sampleClockCounter = .SAMPLE_LENGTH' start='0' >
									<flowline >
										<command class_type='loop' title='Wait for next sample clock' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='sampleClockFlag = TRUE' start='0' >
											<flowline />
										</command>
										<command class_type='input' title='Input' cmdcolor='3610239' cmdcolor_sec='3610239' mode='1' port='1048577' mask='1' exp='.MSFPulseSample' />
										<command class_type='calculation' title='Reset sample clock pulse and sample MSF Rx' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='sampleClockFlag = FALSE' />
											<exp exp='.aCodeOnesCount = .aCodeOnesCount + .MSFPulseSample' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='sampleClockCounter = 0' />
									<exp exp='sampleClockFlag = FALSE' />
									<exp exp='.bCodeOnesCount = 0' />
								</command>
								<command class_type='loop' title='Loop for duration of B-bit (~100ms)' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='sampleClockCounter = .SAMPLE_LENGTH' start='0' >
									<flowline >
										<command class_type='loop' title='Wait for next sample clock' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='sampleClockFlag = TRUE' start='0' >
											<flowline />
										</command>
										<command class_type='input' title='Input' cmdcolor='3610239' cmdcolor_sec='3610239' mode='1' port='1048577' mask='1' exp='.MSFPulseSample' />
										<command class_type='calculation' title='Reset sample clock pulse and sample MSF Rx' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='sampleClockFlag = FALSE' />
											<exp exp='.bCodeOnesCount = .bCodeOnesCount + .MSFPulseSample' />
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='ReadTimeINT' >
									<return exp='RTCSecs' />
									<argument exp='0' />
								</command>
								<command class_type='decision' title='Was A-bit high for that second?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.aCodeOnesCount &gt; (.SAMPLE_LENGTH / 2)' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='MSFAValue[RTCSecs] = 1' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='MSFAValue[RTCSecs] = 0' />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Was B-bit high for that second?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.bCodeOnesCount &gt; (.SAMPLE_LENGTH / 2)' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='MSFBValue[RTCSecs] = 1' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='MSFBValue[RTCSecs] = 0' />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(MSFAValue[RTCSecs] = 1) AND (MSFBValue[RTCSecs] = 0)' swap='0' >
									<flowline >
										<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='makeSounds' >
											<argument exp='SOUND_A' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(MSFAValue[RTCSecs] = 0) AND (MSFBValue[RTCSecs] = 0)' swap='0' >
									<flowline >
										<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='makeSounds' >
											<argument exp='SOUND_SECOND' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(MSFAValue[RTCSecs] = 0) AND (MSFBValue[RTCSecs] = 1)' swap='0' >
									<flowline >
										<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='makeSounds' >
											<argument exp='SOUND_B' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(MSFAValue[RTCSecs] = 1) AND (MSFBValue[RTCSecs] = 1)' swap='0' >
									<flowline >
										<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='makeSounds' >
											<argument exp='SOUND_A_B' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='comment' title='' comment='Seconds' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='RTCSecs &gt; 9' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.sUnits = segValue[RTCSecs MOD 10]' />
											<exp exp='.sTens = segValue[(RTCSecs - (RTCSecs MOD 10)) / 10]' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.sUnits = segValue[RTCSecs]' />
											<exp exp='.sTens = segValue[0]' />
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Start' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.DISPLAY_ADDRESS' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.VECTOR_HH' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[MSFAValue[RTCSecs]]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.BLANK]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.BLANK]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[MSFBValue[RTCSecs]]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.sTens' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.sUnits' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Stop' />
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='paintLED' />
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='sampleClockEnable = FALSE' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='makeSounds' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='soundType' type='u8' description='What type of noise to make' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='decision' title='Is sound switched on?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='soundOn = TRUE' swap='0' >
							<flowline >
								<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.soundType' >
									<case >
										<flowline />
									</case>
									<case exp='SOUND_A' >
										<flowline >
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PiezoSounder1' macro='BuzzerBeep' >
												<argument exp='100' />
												<argument exp='0' />
												<argument exp='1' />
												<argument exp='220' />
											</command>
										</flowline>
									</case>
									<case exp='SOUND_B' >
										<flowline >
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PiezoSounder1' macro='BuzzerBeep' >
												<argument exp='100' />
												<argument exp='0' />
												<argument exp='1' />
												<argument exp='440' />
											</command>
										</flowline>
									</case>
									<case exp='SOUND_A_B' >
										<flowline >
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PiezoSounder1' macro='BuzzerBeep' >
												<argument exp='100' />
												<argument exp='0' />
												<argument exp='1' />
												<argument exp='220' />
											</command>
											<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='100' type='1' />
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PiezoSounder1' macro='BuzzerBeep' >
												<argument exp='100' />
												<argument exp='0' />
												<argument exp='1' />
												<argument exp='440' />
											</command>
										</flowline>
									</case>
									<case exp='SOUND_TEST' >
										<flowline >
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PiezoSounder1' macro='BuzzerBeep' >
												<argument exp='100' />
												<argument exp='0' />
												<argument exp='1' />
												<argument exp='220' />
											</command>
											<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='100' type='1' />
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PiezoSounder1' macro='BuzzerBeep' >
												<argument exp='100' />
												<argument exp='0' />
												<argument exp='1' />
												<argument exp='440' />
											</command>
											<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='100' type='1' />
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PiezoSounder1' macro='BuzzerBeep' >
												<argument exp='100' />
												<argument exp='0' />
												<argument exp='1' />
												<argument exp='440' />
											</command>
											<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='100' type='1' />
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PiezoSounder1' macro='BuzzerBeep' >
												<argument exp='10' />
												<argument exp='0' />
												<argument exp='1' />
												<argument exp='880' />
											</command>
											<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='100' type='1' />
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PiezoSounder1' macro='BuzzerBeep' >
												<argument exp='100' />
												<argument exp='0' />
												<argument exp='1' />
												<argument exp='1660' />
											</command>
										</flowline>
									</case>
									<case exp='SOUND_MINUTE' >
										<flowline >
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PiezoSounder1' macro='BuzzerBeep' >
												<argument exp='100' />
												<argument exp='0' />
												<argument exp='1' />
												<argument exp='1660' />
											</command>
										</flowline>
									</case>
									<case exp='SOUND_SECOND' >
										<flowline >
											<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PiezoSounder1' macro='BuzzerBeep' >
												<argument exp='10' />
												<argument exp='0' />
												<argument exp='1' />
												<argument exp='880' />
											</command>
										</flowline>
									</case>
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='runSoftwareClock' description='A software clock to avoid taking the RTC out of standby
more often than necessary.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='RTCSecs = RTCSecs + 1' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='RTCSecs &gt;= 60' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='RTCSecs = 0' />
									<exp exp='MSFMinute = MSFMinute + 1' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFMinute &gt;= 60' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='MSFMinute = 0' />
											<exp exp='MSFHour = MSFHour + 1' />
										</command>
										<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFHour &gt;= 24' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='MSFHour = 0' />
												</command>
												<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='ReadTimeINT' >
													<return exp='MSFMinute' />
													<argument exp='1' />
												</command>
												<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='ReadTimeINT' >
													<return exp='MSFHour' />
													<argument exp='2' />
												</command>
												<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='ReadDateINT' >
													<return exp='MSFDayOfMonth' />
													<argument exp='0' />
												</command>
												<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='ReadDateINT' >
													<return exp='MSFMonth' />
													<argument exp='1' />
												</command>
												<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='ReadDateINT' >
													<return exp='MSFYear' />
													<argument exp='2' />
												</command>
												<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='ReadTimeINT' >
													<return exp='RTCSecs' />
													<argument exp='0' />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='displayTest' description='Illuminates all LCD segments for a brief period at clock switch-on.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='dataWord' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='hTens' type='u8' description='Tens of hours' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='hUnits' type='u8' description='Units of hours' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='mTens' type='u8' description='Tens of minutes' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='mUnits' type='u8' description='Units of minutes' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='sTens' type='u8' description='Tens of seconds' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='sUnits' type='u8' description='Units of seconds' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='uTC1Hundreds' type='u8' description='Hundreds of milliseconds' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='uTC1Sign' type='u8' description='PLUS, MINUS or NONE' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='POSITIVE' type='s16' description='' isconst='1' isinit='1' usrinit='13' setinit='13' />
						<local name='NEGATIVE' type='s16' description='' isconst='1' isinit='1' usrinit='12' setinit='12' />
						<local name='BLANK' type='s16' description='' isconst='1' isinit='1' usrinit='10' setinit='10' />
						<local name='uTC1Tens' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='uTC1Units' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='DISPLAY_ADDRESS' type='s16' description='Address of LCD display' isconst='1' isinit='1' usrinit='116' setinit='0x74' />
						<local name='VECTOR_HH' type='s16' description='Offset of first hour character' isconst='1' isinit='1' usrinit='0' setinit='0x00' />
						<local name='VECTOR_H' type='s16' description='Vector of second hour digit' isconst='1' isinit='1' usrinit='2' setinit='0x02' />
						<local name='VECTOR_MM' type='s16' description='Vector of first minute vector' isconst='1' isinit='1' usrinit='4' setinit='0x04' />
						<local name='VECTOR_M' type='s16' description='Vector of second minute digit' isconst='1' isinit='1' usrinit='6' setinit='0x06' />
						<local name='VECTOR_SS' type='s16' description='Vector for first seconds digit' isconst='1' isinit='1' usrinit='8' setinit='0x08' />
						<local name='VECTOR_S' type='s16' description='Vector of second seconds digit' isconst='1' isinit='1' usrinit='9' setinit='0x09' />
						<local name='addr' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='x' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='VECTOR_UUU' type='s16' description='' isconst='1' isinit='1' usrinit='10' setinit='10' />
						<local name='y' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.y = 0' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='.y = 2' start='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.x = 11 - .y' />
									<exp exp='' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Start' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.DISPLAY_ADDRESS' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.VECTOR_HH' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.x]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.x]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Stop' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Start' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.DISPLAY_ADDRESS' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.VECTOR_MM' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.x]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.x]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Stop' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Start' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.DISPLAY_ADDRESS' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.VECTOR_SS' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.x]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.x]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Stop' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Start' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.DISPLAY_ADDRESS' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.VECTOR_UUU' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.x]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.x]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.x]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Stop' />
								<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='1' type='2' />
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.y = .y + 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='decodeMSFDateTimeCode' description='Using 60 seconds of MSF date/time data, this decodes it from BCD into
into date and time. Parity checking is done where possible.
The macro is run during the 59th second of data collection to provide
RTC time update for the following minute.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='BST_SECOND' type='s16' description='Second when B-bit indicates BST or GMT' isconst='1' isinit='1' usrinit='58' setinit='58' />
						<local name='count' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='exit' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='FALSE' />
						<local name='bitCountYear' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='bitCountMonthAndDate' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='bitCountDayOfWeek' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='bitCountHoursMinutes' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='DUT1pos' type='s16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='DUT1neg' type='s16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='comment' title='' comment='Having collected a minute&apos;s worth of MSF data in getMSFData(),
This macro decodes it (during the 59th second) to provide time/date
information from MSF and to check the parity.' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Innocent until proved guilty...' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='MSFDateTimeError = NO_ERROR' />
						</command>
						<command class_type='decision' title='Detect state of GMT/BST flag' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFBValue[.BST_SECOND] = BST' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='UKCivilTimeFlag = BST' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='UKCivilTimeFlag = GMT' />
								</command>
							</flowline>
						</command>
						<command class_type='comment' title='' comment='Decode the DUT1 value' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='decision' title='Both second 1 and second 9 DUT data is zero?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(MSFBValue[1] = LOW) &amp;&amp; (MSFBValue[9] = LOW)' swap='0' >
							<flowline >
								<command class_type='calculation' title='Make DUT1 error zero' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='DUT1 = 0' />
									<exp exp='DUT1Sign = 0' />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Is second 1 B-bit FALSE?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFBValue[1] = FALSE' swap='0' >
									<flowline >
										<command class_type='calculation' title='Make DUT1 error zero' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.DUT1pos = 0' />
											<exp exp='DUT1Sign = 0' />
										</command>
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='There&apos;s a positive DUT1' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
										<command class_type='calculation' title='reset loop counter' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.count = 1' />
										</command>
										<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='(.count &lt; 9) &amp;&amp; (.exit = FALSE)' start='0' >
											<flowline >
												<command class_type='decision' title='This second&apos;s sample is logic low' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFBValue[.count] = LOW' swap='0' >
													<flowline >
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='.exit = TRUE' />
														</command>
													</flowline>
													<flowline >
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='.count = .count + 1' />
														</command>
													</flowline>
												</command>
											</flowline>
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.DUT1pos = (.count - 1)' />
											<exp exp='DUT1Sign = 2' />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Is second 9 B-bit FALSE?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFBValue[9] = FALSE' swap='0' >
									<flowline >
										<command class_type='calculation' title='Make DUT1 error zero' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.DUT1neg = 0' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='reset loop counter' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.count = 9' />
										</command>
										<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='(.count &lt; 17) &amp;&amp; (.exit = FALSE)' start='0' >
											<flowline >
												<command class_type='decision' title='This second&apos;s sample is logic low?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFBValue[.count] = LOW' swap='0' >
													<flowline >
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='.exit = TRUE' />
														</command>
													</flowline>
													<flowline >
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='.count = .count + 1' />
														</command>
													</flowline>
												</command>
											</flowline>
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.DUT1neg = (.count - 9)' />
											<exp exp='DUT1Sign = 1' />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='One of the DUT readings should be zero' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(.DUT1pos != 0) &amp;&amp; (.DUT1neg != 0)' swap='0' >
									<flowline >
										<command class_type='calculation' title='Indicate error' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='DUT1 = 9' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Select the non-zero DUT reading' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.DUT1pos != 0' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='DUT1 = .DUT1pos' />
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='DUT1 = .DUT1neg' />
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='comment' title='' comment='Check MSF year parity' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='MSFDateTimeError = NO_ERROR' />
							<exp exp='.count = 17' />
							<exp exp='.bitCountYear = 0' />
						</command>
						<command class_type='loop' title='Loop through year A- bits' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='.count = 25' start='0' >
							<flowline >
								<command class_type='calculation' title='Add value of individual A-bit' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.bitCountYear = .bitCountYear + MSFAValue[.count]' />
									<exp exp='.count = .count + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Add the year parity value B-bit' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.bitCountYear = .bitCountYear + MSFBValue[54]' />
						</command>
						<command class_type='decision' title='Is parityValue an even number' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(.bitCountYear MOD 2) = 0' swap='0' >
							<flowline >
								<command class_type='comment' title='' comment='Parity even - error in value(s)' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='calculation' title='Indicate at least one set of data failed parity' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFDateTimeError = ERROR' />
								</command>
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='Parity is odd (i.e., OK)' textarea='65,-3,65,-3' cmdcolor='1975743' cmdcolor_sec='1975743' />
							</flowline>
						</command>
						<command class_type='comment' title='' comment='Decode the MSF year from BCD values' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Calculate year' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='MSFYear = 0' />
							<exp exp='MSFYear = MSFYear + (MSFAValue[24])' />
							<exp exp='MSFYear = MSFYear + (MSFAValue[23] * 2)' />
							<exp exp='MSFYear = MSFYear + (MSFAValue[22] * 4)' />
							<exp exp='MSFYear = MSFYear + (MSFAValue[21] * 8)' />
							<exp exp='MSFYear = MSFYear + (MSFAValue[20] * 10)' />
							<exp exp='MSFYear = MSFYear + (MSFAValue[19] * 20)' />
							<exp exp='MSFYear = MSFYear + (MSFAValue[18] * 40)' />
							<exp exp='MSFYear = MSFYear + (MSFAValue[17] * 80)' />
						</command>
						<command class_type='comment' title='' comment='Check MSF month and date parity' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.count = 25' />
							<exp exp='.bitCountMonthAndDate = 0' />
						</command>
						<command class_type='loop' title='Loop through month/date data bits' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='.count = 36' start='0' >
							<flowline >
								<command class_type='calculation' title='Add value of current bit to parityValue' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.bitCountMonthAndDate = .bitCountMonthAndDate + MSFAValue[.count]' />
									<exp exp='.count = .count + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Add the month/date parity value B-bit' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.bitCountMonthAndDate = .bitCountMonthAndDate + MSFBValue[55]' />
						</command>
						<command class_type='decision' title='Is parityValue an even number' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(.bitCountMonthAndDate MOD 2) = 0' swap='0' >
							<flowline >
								<command class_type='comment' title='' comment='Parity even - error in values' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='calculation' title='Indicate at least one set of data failed parity' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFDateTimeError = ERROR' />
								</command>
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='Parity is odd (i.e., OK)' textarea='65,-3,65,-3' cmdcolor='1975743' cmdcolor_sec='1975743' />
							</flowline>
						</command>
						<command class_type='comment' title='' comment='Calculate month and date from BCD values' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Calculate month and day' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='MSFMonth = 0' />
							<exp exp='MSFMonth = MSFMonth + MSFAValue[29]' />
							<exp exp='MSFMonth = MSFMonth + (MSFAValue[28] * 2)' />
							<exp exp='MSFMonth = MSFMonth + (MSFAValue[27] * 4)' />
							<exp exp='MSFMonth = MSFMonth + (MSFAValue[26] * 8)' />
							<exp exp='MSFMonth = MSFMonth + (MSFAValue[25] * 10)' />
							<exp exp='MSFDayOfMonth = 0' />
							<exp exp='MSFDayOfMonth = MSFDayOfMonth + MSFAValue[35]' />
							<exp exp='MSFDayOfMonth = MSFDayOfMonth + (MSFAValue[34] * 2)' />
							<exp exp='MSFDayOfMonth = MSFDayOfMonth + (MSFAValue[33] * 4)' />
							<exp exp='MSFDayOfMonth = MSFDayOfMonth + (MSFAValue[32] * 8)' />
							<exp exp='MSFDayOfMonth = MSFDayOfMonth + (MSFAValue[31] * 10)' />
							<exp exp='MSFDayOfMonth = MSFDayOfMonth + (MSFAValue[30] * 20)' />
						</command>
						<command class_type='decision' title='Check month and date are sensible' cmdcolor='3568629' cmdcolor_sec='3568629' exp='((MSFMonth &gt; 12) OR (MSFDayOfMonth &gt; 31))' swap='0' >
							<flowline >
								<command class_type='calculation' title='Multiple-bit parity error' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFDateTimeError = ERROR' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='comment' title='' comment='Check MSF day of week parity' textarea='12,0,12,0' disable='1' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.count = 36' />
							<exp exp='.bitCountDayOfWeek = 0' />
						</command>
						<command class_type='loop' title='Loop through day of week data A-bits' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='.count = 39' start='0' >
							<flowline >
								<command class_type='calculation' title='Add each A-bit to parityValue' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.bitCountDayOfWeek = .bitCountDayOfWeek + MSFAValue[.count]' />
									<exp exp='.count = .count + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Add the day of week parity parity bit value' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.bitCountDayOfWeek = .bitCountDayOfWeek + MSFBValue[56]' />
						</command>
						<command class_type='decision' title='Is the parityValue an even number' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(.bitCountDayOfWeek MOD 2) = 0' swap='0' >
							<flowline >
								<command class_type='comment' title='' comment='Parity even - error in values' textarea='12,0,12,0' disable='1' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='calculation' title='Indicate at least one set of data failed parity' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFDateTimeError = ERROR' />
								</command>
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='Parity is odd (i.e., OK)' textarea='65,-3,65,-3' cmdcolor='1975743' cmdcolor_sec='1975743' />
							</flowline>
						</command>
						<command class_type='comment' title='' comment='Calculate day of week from BCD values' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Calculate day of week' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='MSFDayOfWeek = 0' />
							<exp exp='MSFDayOfWeek = MSFDayOfWeek + MSFAValue[38]' />
							<exp exp='MSFDayOfWeek = MSFDayOfWeek + (MSFAValue[37] * 2)' />
							<exp exp='MSFDayOfWeek = MSFDayOfWeek + (MSFAValue[36] * 4)' />
						</command>
						<command class_type='decision' title='Check day of week is sensible' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(MSFDayOfWeek &gt; 6)' swap='0' >
							<flowline >
								<command class_type='calculation' title='Multiple-bit parity error' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFDateTimeError = ERROR' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='comment' title='' comment='Check MSF hour and minute parity' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.count = 39' />
							<exp exp='.bitCountHoursMinutes = 0' />
						</command>
						<command class_type='loop' title='Loop round the hour and minute A-bits' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='.count = 52' start='0' >
							<flowline >
								<command class_type='calculation' title='Count the number of ones' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.bitCountHoursMinutes = .bitCountHoursMinutes + MSFAValue[.count]' />
									<exp exp='.count = .count + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Add the parity value' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.bitCountHoursMinutes = .bitCountHoursMinutes + MSFBValue[57]' />
						</command>
						<command class_type='decision' title='Is the parityValue an even number' cmdcolor='3568629' cmdcolor_sec='3568629' exp='(.bitCountHoursMinutes MOD 2) = 0' swap='0' >
							<flowline >
								<command class_type='comment' title='' comment='Parity even - error in values' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='calculation' title='Indicate at least one set of data failed parity' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFDateTimeError = ERROR' />
								</command>
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='Parity is odd, (i.e., OK)' textarea='65,-3,65,-3' cmdcolor='1975743' cmdcolor_sec='1975743' />
							</flowline>
						</command>
						<command class_type='comment' title='' comment='Calculate hour and minute from BCD values' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Calculate hour and minute' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='MSFHour = 0' />
							<exp exp='MSFHour = MSFHour + (MSFAValue[44])' />
							<exp exp='MSFHour = MSFHour + (MSFAValue[43] * 2)' />
							<exp exp='MSFHour = MSFHour + (MSFAValue[42] * 4)' />
							<exp exp='MSFHour = MSFHour + (MSFAValue[41] * 8)' />
							<exp exp='MSFHour = MSFHour + (MSFAValue[40] * 10)' />
							<exp exp='MSFHour = MSFHour + (MSFAValue[39] * 20)' />
							<exp exp='MSFMinute = 0' />
							<exp exp='MSFMinute = MSFMinute + MSFAValue[51]' />
							<exp exp='MSFMinute = MSFMinute + (MSFAValue[50] * 2)' />
							<exp exp='MSFMinute = MSFMinute + (MSFAValue[49] * 4)' />
							<exp exp='MSFMinute = MSFMinute + (MSFAValue[48] * 8)' />
							<exp exp='MSFMinute = MSFMinute + (MSFAValue[47] * 10)' />
							<exp exp='MSFMinute = MSFMinute + (MSFAValue[46] * 20)' />
							<exp exp='MSFMinute = MSFMinute + (MSFAValue[45] * 40)' />
						</command>
						<command class_type='decision' title='Check hour and minute are sensible' cmdcolor='3568629' cmdcolor_sec='3568629' exp='((MSFHour &gt; 23) OR (MSFMinute &gt; 59))' swap='0' >
							<flowline >
								<command class_type='calculation' title='Multiple-bit parity error' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFDateTimeError = ERROR' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='AM or PM?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFHour &gt; 12' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAmPm = PM' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAmPm = AM' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Were any parity errors found?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFDateTimeError = NO_ERROR' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='RTCSecondInterruptFlag = FALSE' />
								</command>
								<command class_type='call' title='Set RTC Date' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='WriteDate' >
									<argument exp='MSFDayOfMonth' />
									<argument exp='MSFMonth' />
									<argument exp='MSFYear' />
									<argument exp='20' />
								</command>
								<command class_type='comment' title='' comment='Set part of update before the wait to minimise
additional error in the RTC second edge.
Most of the delay is I2C time due to running
the PIC clock at 4MHz.' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='loop' title='Wait for next RTC second' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='RTCSecondInterruptFlag = TRUE' start='0' >
									<flowline />
								</command>
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='RTCSecs = 0' />
								</command>
								<command class_type='call' title='Set RTC time' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='WriteTime' >
									<argument exp='RTCSecs' />
									<argument exp='MSFMinute' />
									<argument exp='MSFHour' />
									<argument exp='MSFAmPm' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='paintLED' description='When the LEDs are enabled, this displays the date and other MSF data
on a once per second basis.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='IO0' type='u8' description='' isconst='0' isinit='1' usrinit='255' setinit='0xFF' />
						<local name='IO1' type='u8' description='' isconst='0' isinit='1' usrinit='255' setinit='0xFF' />
						<local name='IO3' type='u8' description='' isconst='0' isinit='1' usrinit='255' setinit='0xFF' />
						<local name='IO2' type='u8' description='' isconst='0' isinit='1' usrinit='255' setinit='0xFF' />
						<command class_type='comment' title='' comment='Toggle appropriate LEDs 
N.B., inverted logic - LED is on for logic 0' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='Set up registers for I2C driver chips U5 and U7' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='U5 Bank 0' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.IO0 = 0' />
							<exp exp='.IO0 = .IO0 + !MSFAValue[25]' />
							<exp exp='.IO0 = .IO0 &lt;&lt; 1' />
							<exp exp='.IO0 = .IO0 + !MSFAValue[26]' />
							<exp exp='.IO0 = .IO0 &lt;&lt; 1' />
							<exp exp='.IO0 = .IO0 + !MSFAValue[27]' />
							<exp exp='.IO0 = .IO0 &lt;&lt; 1' />
							<exp exp='.IO0 = .IO0 + !MSFAValue[28]' />
							<exp exp='.IO0 = .IO0 &lt;&lt; 1' />
							<exp exp='.IO0 = .IO0 + !MSFAValue[29]' />
							<exp exp='.IO0 = .IO0 &lt;&lt; 1' />
							<exp exp='.IO0 = .IO0 + !MSFAValue[36]' />
							<exp exp='.IO0 = .IO0 &lt;&lt; 1' />
							<exp exp='.IO0 = .IO0 + !MSFAValue[37]' />
							<exp exp='.IO0 = .IO0 &lt;&lt; 1' />
							<exp exp='.IO0 = .IO0 + !MSFAValue[38]' />
							<exp exp='' />
						</command>
						<command class_type='calculation' title='U5 Bank 1' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.IO1 = 0' />
							<exp exp='.IO1 = .IO1 + !MSFAValue[30]' />
							<exp exp='.IO1 = .IO1 &lt;&lt; 1' />
							<exp exp='.IO1 = .IO1 + !MSFAValue[31]' />
							<exp exp='.IO1 = .IO1 &lt;&lt; 1' />
							<exp exp='.IO1 = .IO1 + !MSFAValue[32]' />
							<exp exp='.IO1 = .IO1 &lt;&lt; 1' />
							<exp exp='.IO1 = .IO1 + !MSFAValue[33]' />
							<exp exp='.IO1 = .IO1 &lt;&lt; 1' />
							<exp exp='.IO1 = .IO1 + !MSFAValue[34]' />
							<exp exp='.IO1 = .IO1 &lt;&lt; 1' />
							<exp exp='.IO1 = .IO1 + !MSFAValue[35]' />
							<exp exp='.IO1 = .IO1 &lt;&lt; 1' />
							<exp exp='.IO1 = .IO1 + !MSFAValue[RTCSecs]' />
							<exp exp='.IO1 = .IO1 &lt;&lt; 1' />
							<exp exp='.IO1 = .IO1 + !MSFBValue[RTCSecs]' />
							<exp exp='' />
						</command>
						<command class_type='calculation' title='U7 Bank 0' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.IO2 = 0' />
							<exp exp='.IO2 = .IO2 + !pYOK' />
							<exp exp='.IO2 = .IO2 &lt;&lt; 1' />
							<exp exp='.IO2 = .IO2 + !pMOK' />
							<exp exp='.IO2 = .IO2 &lt;&lt; 1' />
							<exp exp='.IO2 = .IO2 + !pDOWOK' />
							<exp exp='.IO2 = .IO2 &lt;&lt; 1' />
							<exp exp='.IO2 = .IO2 + !pHAMOK' />
							<exp exp='.IO2 = .IO2 &lt;&lt; 1' />
							<exp exp='.IO2 = .IO2 + !MSFBValue[58]' />
							<exp exp='.IO2 = .IO2 &lt;&lt; 1' />
							<exp exp='.IO2 = .IO2 + !MSFBValue[53]' />
							<exp exp='.IO2 = .IO2 &lt;&lt; 1' />
							<exp exp='.IO2 = .IO2 + 1' />
							<exp exp='.IO2 = .IO2 &lt;&lt; 1' />
							<exp exp='.IO2 = .IO2 + !MSFAValue[RTCSecs]' />
							<exp exp='' />
						</command>
						<command class_type='calculation' title='U7 Bank 1' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.IO3 = 0' />
							<exp exp='.IO3 = .IO3 + !MSFAValue[24]' />
							<exp exp='.IO3 = .IO3 &lt;&lt; 1' />
							<exp exp='.IO3 = .IO3 + !MSFAValue[23]' />
							<exp exp='.IO3 = .IO3 &lt;&lt; 1' />
							<exp exp='.IO3 = .IO3 + !MSFAValue[22]' />
							<exp exp='.IO3 = .IO3 &lt;&lt; 1' />
							<exp exp='.IO3 = .IO3 + !MSFAValue[21]' />
							<exp exp='.IO3 = .IO3 &lt;&lt; 1' />
							<exp exp='.IO3 = .IO3 + !MSFAValue[20]' />
							<exp exp='.IO3 = .IO3 &lt;&lt; 1' />
							<exp exp='.IO3 = .IO3 + !MSFAValue[19]' />
							<exp exp='.IO3 = .IO3 &lt;&lt; 1' />
							<exp exp='.IO3 = .IO3 + !MSFAValue[18]' />
							<exp exp='.IO3 = .IO3 &lt;&lt; 1' />
							<exp exp='.IO3 = .IO3 + !MSFAValue[17]' />
							<exp exp='' />
							<exp exp='' />
						</command>
						<command class_type='comment' title='' comment='Send data to LED latches' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='call' title='Start LED driver I2C' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='Start' />
						<command class_type='call' title='Send LED display driver address (U5)' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='0b01000000' />
						</command>
						<command class_type='call' title='Send port A address' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='0x02' />
						</command>
						<command class_type='call' title='Output to bank 0 - all LEDs off' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='.IO0' />
						</command>
						<command class_type='call' title='Output to bank 1 - all LEDs off' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='.IO1' />
						</command>
						<command class_type='call' title='Send a re-start' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='Restart' />
						<command class_type='call' title='Send LED display driver address (U7)' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='0b01000010' />
						</command>
						<command class_type='call' title='Send address of next word' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='0x02' />
						</command>
						<command class_type='call' title='Output to bank 0 - all LEDs off' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='.IO2' />
						</command>
						<command class_type='call' title='Output to bank 1 - all LEDs off' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='.IO3' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='decodeTimerInterrupt' description='Provides a 300pps interrupt to clock the MSF date code collection process' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='is the time gating switched on?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='sampleClockEnable = TRUE' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='sampleClockFlag = TRUE' />
									<exp exp='sampleClockCounter = sampleClockCounter + 1' />
									<exp exp='sampleDelayCounter = sampleDelayCounter - 1' />
								</command>
								<command class_type='comment' title='' comment='sampleDelayCounter provides a time delay from the
RTC second pulse edge, equal to the measured RTC error.
sampleDelayCounter is set in RTSSecondInterrupt()
and decremented here.' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='comment' title='' comment='Maintain an independent seconds tick for calibration purposes' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='decision' title='Second end?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='dSecs = SAMPLE_RATE - 1' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='dSecs = 0' />
											<exp exp='aSecs = aSecs + 1' />
										</command>
										<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='aSecs &gt; 59' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='aSecs = 0' />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='dSecs = dSecs + 1' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ledTest' description='Briefly switches the date LEDs on as part of self-test.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='LED_DRIVER_ADDRESS' type='s16' description='' isconst='1' isinit='1' usrinit='32' setinit='0x20' />
						<local name='x' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='y' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='comment' title='' comment='Set up registers for I2C driver chips
U5 and U7 to zero (all LEDs on)' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.y = 0xFF' />
						</command>
						<command class_type='call' title='Call Component Macro' disable='1' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='SendByteTransaction' >
							<argument exp='0b01000000' />
							<argument exp='0' />
							<argument exp='2' />
							<argument exp='.y' />
						</command>
						<command class_type='call' title='Start LED driver I2C' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='Start' />
						<command class_type='call' title='Send LED display driver address (U5)' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='0b01000000' />
						</command>
						<command class_type='call' title='Command write to port 0 register' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='0x02' />
						</command>
						<command class_type='call' title='Output to bank 0 - all LEDs on' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='.y' />
						</command>
						<command class_type='call' title='Output to bank 1 - all LEDs on' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='.y' />
						</command>
						<command class_type='call' title='Send a re-start' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='Restart' />
						<command class_type='call' title='Send LED display driver address (U7)' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='0b01000010' />
						</command>
						<command class_type='call' title='Command write to port 0 register' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='0x02' />
						</command>
						<command class_type='call' title='Output to bank 0 - all LEDs on' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='.y' />
						</command>
						<command class_type='call' title='Output to bank 1 - all LEDs on' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
							<argument exp='.y' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='Stop' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.x = 0' swap='0' >
							<flowline >
								<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048577' mask='16' exp='1' />
								<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='1' type='1' />
								<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048577' mask='16' exp='0' />
							</flowline>
							<flowline >
								<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048577' mask='32' exp='1' />
								<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='1' type='1' />
								<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048577' mask='32' exp='0' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='RTCInterrupt' description='Sets a flag at each negative-going clock edge of the DS3231 chip' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='$PORTB.6 = 0' swap='0' >
							<flowline >
								<command class_type='comment' title='' comment='sampleDelayCounter provides a time delay from the
RTC second pulse edge, equal to the measured RTC error.
sampleDelayCounter is set here and decremented in
decodeTimerInterrupt().' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='calculation' title='Set the RTC second flag' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='RTCSecondInterruptFlag = TRUE' />
									<exp exp='' />
								</command>
								<command class_type='calculation' title='Set the delay counter to correspond to 1 second' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='sampleDelayCounter = SAMPLE_RATE' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='paintLCDDisplay' description='Send date, time and other data to the seven segment LCD drivers.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='dataWord' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='hTens' type='u8' description='Tens of hours' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='hUnits' type='u8' description='Units of hours' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='mTens' type='u8' description='Tens of minutes' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='mUnits' type='u8' description='Units of minutes' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='sTens' type='u8' description='Tens of seconds' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='sUnits' type='u8' description='Units of seconds' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='DUT1Hundreds' type='u8' description='Hundreds of milliseconds' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='DUT1Sign' type='u8' description='PLUS, MINUS or NONE' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='POSITIVE' type='s16' description='' isconst='1' isinit='1' usrinit='12' setinit='12' />
						<local name='NEGATIVE' type='s16' description='' isconst='1' isinit='1' usrinit='8' setinit='8' />
						<local name='BLANK' type='s16' description='' isconst='1' isinit='1' usrinit='10' setinit='10' />
						<local name='DUT1Tens' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='DUT1Units' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='DISPLAY_ADDRESS' type='s16' description='Address of LCD display' isconst='1' isinit='1' usrinit='116' setinit='0x74' />
						<local name='VECTOR_HH' type='s16' description='Offset of first hour character' isconst='1' isinit='1' usrinit='0' setinit='0x00' />
						<local name='VECTOR_H' type='s16' description='Vector of second hour digit' isconst='1' isinit='1' usrinit='2' setinit='0x02' />
						<local name='VECTOR_MM' type='s16' description='Vector of first minute vector' isconst='1' isinit='1' usrinit='4' setinit='0x04' />
						<local name='VECTOR_M' type='s16' description='Vector of second minute digit' isconst='1' isinit='1' usrinit='6' setinit='0x06' />
						<local name='VECTOR_SS' type='s16' description='Vector for first seconds digit' isconst='1' isinit='1' usrinit='8' setinit='0x08' />
						<local name='VECTOR_S' type='s16' description='Vector of second seconds digit' isconst='1' isinit='1' usrinit='9' setinit='0x09' />
						<local name='addr' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='COLON' type='s16' description='' isconst='1' isinit='1' usrinit='128' setinit='0x80' />
						<local name='sign' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='comment' title='' comment='Date and time to LCD' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='Split the time information into individual digits' textarea='12,0,12,0' disable='1' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='Hours' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFHour &gt; 9' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.hUnits = segValue[MSFHour MOD 10]' />
									<exp exp='.hTens = segValue[(MSFHour - (MSFHour MOD 10)) / 10]' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.hUnits = segValue[MSFHour]' />
									<exp exp='.hTens = segValue[0]' />
								</command>
							</flowline>
						</command>
						<command class_type='comment' title='' comment='Minutes' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFMinute &gt; 9' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.mUnits = segValue[MSFMinute MOD 10]' />
									<exp exp='.mTens = segValue[(MSFMinute - (MSFMinute MOD 10)) / 10]' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.mUnits = segValue[MSFMinute]' />
									<exp exp='.mTens = segValue[0]' />
								</command>
							</flowline>
						</command>
						<command class_type='comment' title='' comment='Seconds' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='RTCSecs &gt; 9' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.sUnits = segValue[RTCSecs MOD 10]' />
									<exp exp='.sTens = segValue[(RTCSecs - (RTCSecs MOD 10)) / 10]' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.sUnits = segValue[RTCSecs]' />
									<exp exp='.sTens = segValue[0]' />
								</command>
							</flowline>
						</command>
						<command class_type='comment' title='' comment='DUT1' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='decision' title='Positive DUT1?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='DUT1Sign = 2' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.DUT1Hundreds = segValue[DUT1]' />
									<exp exp='.DUT1Tens = segValue[0]' />
									<exp exp='.DUT1Units = segValue[0]' />
									<exp exp='.sign = 13' />
									<exp exp='.DUT1Sign = segValue[.POSITIVE]' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Negative DUT1?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='DUT1Sign = 1' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.DUT1Hundreds = segValue[DUT1]' />
									<exp exp='.DUT1Tens = segValue[0]' />
									<exp exp='.DUT1Units = segValue[0]' />
									<exp exp='.sign = 12' />
									<exp exp='.DUT1Sign = segValue[.NEGATIVE]' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='zero DUT1?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='DUT1 = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.DUT1Hundreds = segValue[0]' />
									<exp exp='.DUT1Tens = segValue[.BLANK]' />
									<exp exp='.DUT1Units = segValue[.BLANK]' />
									<exp exp='.sign = 0' />
									<exp exp='.DUT1Sign = segValue[.BLANK]' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='comment' title='' comment='Print the time to the LCD displays' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Start' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.DISPLAY_ADDRESS' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.VECTOR_HH' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.hTens' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='(.hUnits|.COLON)' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.mTens' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.mUnits' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.sTens' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.sUnits' />
						</command>
						<command class_type='comment' title='' comment='Next two I2C values clear the remaining two non-existant digits.
(two digit display)' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='segValue[BLANK]' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='segValue[BLANK]' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.sign' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.DUT1Hundreds' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.DUT1Tens' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.DUT1Units' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='dailyCalibrate' description='Re-locks onto MSF second and restores second zero of the RTC.
Requires only that RTC is within 5 seconds at the start of the macro.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='startingMinute' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='calibrationTime' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='calibrationType' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='FULL_CALIBRATION' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
						<local name='hourSafe' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='dayOfMonthSafe' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='dayOfWeekSafe' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='MSFYearSafe' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='tempCalibrationTime' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='monthSafe' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='SECONDS_SYNC' type='s16' description='' isconst='1' isinit='1' usrinit='2' setinit='2' />
						<command class_type='comment' title='' comment='Only check date/time once per hour, to reduce time out of sleep
Allow time for MSF Rx to settle before minute identifier' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='decision' title='Start at 44 secs into each new hour' cmdcolor='3568629' cmdcolor_sec='3568629' exp='((MSFMinute = 0) &amp;&amp; (RTCSecs = 44))' swap='0' >
							<flowline >
								<command class_type='calculation' title='Default daily calibration' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.calibrationType = .SECONDS_SYNC' />
									<exp exp='.calibrationTime = 2' />
								</command>
								<command class_type='decision' title='Is it a leap year?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='((MSFYear MOD 4) = 0) || (MSFYear = 00)' swap='0' >
									<flowline >
										<command class_type='calculation' title='Correct the lookup table' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='daysInMonth[2] = 29' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='comment' title='' comment='Leap seconds are actually inserted at the end of
minute 59 of hour 23 of the last day in the month.
Which month? Usually December but not for certain.
That means that in the first minute of the next day,
the time will be indicated 1 second out until
calibration is done at the end of the first minute.
Ideally the clock would sync seconds at the end of the
last minute, with time displayed continuously,
allowing second 60 to be displayed and followed by
a full calibration at the end of minute 0 of the new month.
Work in progress.' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='decision' title='1st day of month? This is when we see leap-seconds &amp; UT1 change' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFDayOfMonth = 1' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.calibrationType = .FULL_CALIBRATION' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='decision' title='Is it last Sunday in March, when daylight saving starts?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='((MSFMonth = 3) &amp;&amp; (MSFDayOfMonth &gt; 24) &amp;&amp; (MSFDayOfWeek = 0))' swap='0' >
									<flowline >
										<command class_type='calculation' title='1am for start of BST' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.calibrationTime = 1' />
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.calibrationType = .FULL_CALIBRATION' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='decision' title='' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFHour = .calibrationTime' swap='0' >
									<flowline >
										<command class_type='native' title='Switch to 4MHz clock' ccode='/*
  Enter C code below this comment
*/
OSCCON = 0b01010010;' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
										<command class_type='output' title='Switch on MSF Rx' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048576' mask='4' exp='RX_ON' />
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='RTCSecondInterruptFlag = FALSE' />
										</command>
										<command class_type='decision' title='Select calibration type' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.calibrationType = .SECONDS_SYNC' swap='0' >
											<flowline >
												<command class_type='comment' title='' comment='Calibrate seconds only' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
												<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048577' mask='8' exp='1' />
												<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='ReadTimeINT' >
													<return exp='RTCSecs' />
													<argument exp='0' />
												</command>
												<command class_type='call' title='Store current minute' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='ReadTimeINT' >
													<return exp='.startingMinute' />
													<argument exp='1' />
												</command>
												<command class_type='call' title='Check that edge of RTC secs are aligned with MSF &amp; fix if needed' cmdcolor='1975743' cmdcolor_sec='1975743' macro='alignRTCSecondsToMSF' />
												<command class_type='call' title='Sample MSF A-bit data and find the minute marker' cmdcolor='1975743' cmdcolor_sec='1975743' macro='alignRTCMinuteToMSF' />
												<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='.startingMinute = .startingMinute + 1' />
												</command>
												<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='WriteTimeMinutes' >
													<argument exp='.startingMinute' />
												</command>
												<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='MSFMinute = .startingMinute' />
												</command>
												<command class_type='decision' title='Allow for double-incrementing of minutes on return to clock' cmdcolor='3568629' cmdcolor_sec='3568629' exp='MSFMinute = 0' swap='0' >
													<flowline >
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='MSFMinute = 59' />
														</command>
													</flowline>
													<flowline >
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='MSFMinute = MSFMinute - 1' />
														</command>
													</flowline>
												</command>
												<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='ReadTimeINT' >
													<return exp='RTCSecs' />
													<argument exp='0' />
												</command>
												<command class_type='decision' title='Allow for double-incrementing of seconds on return to clock' cmdcolor='3568629' cmdcolor_sec='3568629' exp='RTCSecs = 0' swap='0' >
													<flowline >
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='RTCSecs = 59' />
														</command>
													</flowline>
													<flowline >
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='RTCSecs = RTCSecs - 1' />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline >
												<command class_type='comment' title='' comment='Full calibration' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
												<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048577' mask='4' exp='1' />
												<command class_type='call' title='Full calibration' cmdcolor='1975743' cmdcolor_sec='1975743' macro='GetMSFDateTime' />
											</flowline>
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='output' title='Switch on MSF Rx' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048576' mask='4' exp='RX_OFF' />
					</flowline>
				</macro>
				<macro >
					<flowline name='synthesizeLED' description='Creates LED pattern from stored date/time values.
It is the reverse of the decoding process, really for
the novelty of the display.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='temp' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='comment' title='' comment='Update day of week' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.temp = MSFDayOfWeek' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 4' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[36] = 1' />
									<exp exp='.temp = .temp - 4' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[36] = 0' />
									<exp exp='' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 2' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[37] = 1' />
									<exp exp='.temp = .temp - 2' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[37] = 0' />
									<exp exp='' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='MSFAValue[38] = .temp' />
							<exp exp='' />
						</command>
						<command class_type='comment' title='' comment='Update day of month' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.temp = MSFDayOfMonth' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 20' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[30] = 1' />
									<exp exp='.temp = .temp - 20' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[30] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 10' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[31] = 1' />
									<exp exp='.temp = .temp - 10' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[31] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 8' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[32] = 1' />
									<exp exp='.temp = .temp - 8' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[32] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 4' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[33] = 1' />
									<exp exp='.temp = .temp - 4' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[33] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 2' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[34] = 1' />
									<exp exp='.temp = .temp - 2' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[34] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='MSFAValue[35] = .temp' />
						</command>
						<command class_type='comment' title='' comment='Update month' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.temp = MSFMonth' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 10' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[25] = 1' />
									<exp exp='.temp = .temp - 10' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[25] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 8' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[26] = 1' />
									<exp exp='.temp = .temp - 8' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[26] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 4' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[27] = 1' />
									<exp exp='.temp = .temp - 4' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[27] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 2' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[28] = 1' />
									<exp exp='.temp = .temp - 2' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[28] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='MSFAValue[29] = .temp' />
						</command>
						<command class_type='comment' title='' comment='Update year' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.temp = MSFYear' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 80' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[17] = 1' />
									<exp exp='.temp = .temp - 80' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[17] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 40' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[18] = 1' />
									<exp exp='.temp = .temp - 40' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[18] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 20' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[19] = 1' />
									<exp exp='.temp = .temp - 20' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[19] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 10' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[20] = 1' />
									<exp exp='.temp = .temp - 10' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[20] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 8' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[21] = 1' />
									<exp exp='.temp = .temp - 8' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[21] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 4' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[22] = 1' />
									<exp exp='.temp = .temp - 4' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[22] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp &gt;= 2' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[23] = 1' />
									<exp exp='.temp = .temp - 2' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFAValue[23] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='MSFAValue[24] = .temp' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='GetMSFDateTime' description='This macro collects date/time data and setts the clock.
It is normally run at switch-on, once per month or as required to get BST changes, leap seconds and changes to DUT1 information.
Whenever possible, dailyCalibrate is used instead to reduce power.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='BLANK' type='s16' description='index for a blank display digit' isconst='1' isinit='1' usrinit='10' setinit='10' />
						<local name='DISPLAY_ADDRESS' type='s16' description='' isconst='1' isinit='1' usrinit='116' setinit='0x74' />
						<local name='VECTOR_HH' type='s16' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
						<command class_type='comment' title='' comment='RTC initialisation is a 3-step process:
1) set the RTC second edge to coincide with the
second pulse from the MSF Rx. It can now be used
to collect MSF time A- and B-pulse data.
2) synchronise the RTC seconds with the MSF minute
marker. This allows the MSF time data to be decoded.
3) collect and decode the A-bit and B-bit data to provide
year through to minute time and DUT1 data.' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='RTC needs to be co-incident with MSF before date/time code can be collected' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='call' title='Check that edge of RTC secs are aligned with MSF &amp; fix if needed' cmdcolor='1975743' cmdcolor_sec='1975743' macro='alignRTCSecondsToMSF' />
						<command class_type='call' title='Sample MSF A-bit data and find the minute marker' cmdcolor='1975743' cmdcolor_sec='1975743' macro='alignRTCMinuteToMSF' />
						<command class_type='comment' title='' comment='Now collect a minute&apos;s worth of A-bit and B-bit data.' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Start' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.DISPLAY_ADDRESS' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='.VECTOR_HH' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='segValue[.BLANK]' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='segValue[.BLANK]' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
							<argument exp='segValue[.BLANK]' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Stop' />
						<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='MSFDateTimeError = NO_ERROR' start='0' >
							<flowline >
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='collectMSFDateTimeCode' />
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='decodeMSFDateTimeCode' />
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='RTCSecondInterruptFlag = FALSE' />
						</command>
						<command class_type='loop' title='Loop until second zero' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='RTCSecondInterruptFlag' start='0' >
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='checkMenu' description='Once per second this is called to monitor the state of the menu buttons.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='native' title='Switch to digital input for PORTB B4-B7' ccode='/*
  Enter C code below this comment
*/
WPUB=0b11110000;
ANSELB=0;
LATB = 0b11111111;
RBPU = 0; // Weak pull-ups on' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='decision' title='Is the GMT/Auto button pressed (Needs extra button on Rx board)' disable='1' cmdcolor='3568629' cmdcolor_sec='3568629' exp='$PORTA.0 = FALSE' swap='0' >
							<flowline >
								<command class_type='comment' title='' comment='Toggle between auto and always GMT' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='decision' title='Are we using Auto mode or GMT only mode' cmdcolor='3568629' cmdcolor_sec='3568629' exp='UKCivilTimeAuto = TRUE' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='UKCivilTimeAuto = FALSE' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='UKCivilTimeAuto = TRUE' />
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='eeprom1' macro='Write' >
									<argument exp='ADDR_CIVIL_TIME' />
									<argument exp='UKCivilTimeAuto' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Is the Update button pressed?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='$PORTB.7 = FALSE' swap='0' >
							<flowline >
								<command class_type='output' title='Switch on MSF Rx' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048576' mask='4' exp='RX_ON' />
								<command class_type='delay' title='Time for receiver to settle' cmdcolor='7895044' cmdcolor_sec='7895044' exp='RX_WARMUP_TIME' type='2' />
								<command class_type='call' title='Fully calibrate clock time against MSF Anthorn' cmdcolor='1975743' cmdcolor_sec='1975743' macro='GetMSFDateTime' />
								<command class_type='output' title='Switch MSF Rx off' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048576' mask='4' exp='RX_OFF' />
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Is the sound on/off button pressed?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='$PORTB.5 = FALSE' swap='0' >
							<flowline >
								<command class_type='decision' title='Is the sound on?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='soundOn = TRUE' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='soundOn = FALSE' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='soundOn = TRUE' />
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='eeprom1' macro='Write' >
									<argument exp='ADDR_SOUND_ON' />
									<argument exp='soundOn' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Is the LEDs on/off button pressed?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='$PORTB.4 = FALSE' swap='0' >
							<flowline >
								<command class_type='decision' title='Ares the LEDs on?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='ledsOn = TRUE' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='ledsOn = FALSE' />
										</command>
										<command class_type='comment' title='' comment='Switch all LEDs off' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
										<command class_type='call' title='Start LED driver I2C' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='Start' />
										<command class_type='call' title='Send LED display driver address (U5)' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
											<argument exp='0b01000000' />
										</command>
										<command class_type='call' title='Send port A address' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
											<argument exp='0x02' />
										</command>
										<command class_type='call' title='Output to bank 0 - all LEDs off' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
											<argument exp='0xFF' />
										</command>
										<command class_type='call' title='Output to bank 1 - all LEDs off' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
											<argument exp='0xFF' />
										</command>
										<command class_type='call' title='Send a re-start' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='Restart' />
										<command class_type='call' title='Send LED display driver address (U7)' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
											<argument exp='0b01000010' />
										</command>
										<command class_type='call' title='Send address of next word' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
											<argument exp='0x02' />
										</command>
										<command class_type='call' title='Output to bank 0 - all LEDs off' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
											<argument exp='0xFF' />
										</command>
										<command class_type='call' title='Output to bank 1 - all LEDs off' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='TransmitByte' >
											<argument exp='0xFF' />
										</command>
										<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='Stop' />
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='ledsOn = TRUE' />
										</command>
										<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='paintLED' />
									</flowline>
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='eeprom1' macro='Write' >
									<argument exp='ADDR_LEDS_ON' />
									<argument exp='ledsOn' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='native' title='Switch to analogue mode for power savings for PORTB B4-B7' ccode='/*
  Enter C code below this comment
*/
ANSELB=0b11111111;' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
					</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='Port usage:
PortA not used (monitor LCD)
B0 = MSF Rx input (+ve edge = second)
B4 = RTC input (-ve edge = second)
Other port B used for programming &amp; test flags.
C2 = MSF Rx on (0v = ON)
C3 = SCL1
C4 = SDA1

' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='delay' title='Let PIC settle' cmdcolor='7895044' cmdcolor_sec='7895044' exp='100' type='1' />
						<command class_type='native' title='Initialise power management' ccode='/*
  Enter C code below this comment
*/
// Set internal clock, 4MHz
OSCCON = 0b01010010;
/* 
// Switch off unused peripherals to conserve power
PMD0 = 0B1111101; //Disable UART 1&amp;2 and all timers but 2. Bit 1 is equivalent to TMR2MD
PMD1 = 0B00111111; // Disable MSSPs and CCPs. N.B. zeroing the two MSBs stops I2C 1&amp;2 working! Bits 1 and 2 are equivalent to CCP1MD and CCP2MD
PMD2 = 0b11111111; // Disable CTMU, CMPxMDs and ADC

CTMUEN = 0; // Switch CTMU off
FVREN = 0; // Switch off voltage reference
// PORT A...
TRISA = 0b11111111;
LATA = 0b11111111;
PORTA = 0b11111111; 
ANSELA = 0;
C1ON = 0; C2ON = 0; // Switch comparators off
C1OE = 0; C2OE = 0; // Disable comparator outputs
SRLEN = 0; // Switch latch off
DACEN = 0; // Switch off DAC
HLVDEN = 0; // Switch off high/low volts detect
SRLEN = 0; //  Disable SR latch

// PORT B...
TRISB = 0b11111111;
LATB = 0b11111111;
*/
WPUB = 0b11110000; // weak pull-ups on PORTB.4, 5 and 7
RBPU = 0; // Switch on pull-ups (active low)
ANSELB = 0;
/*
PORTB = 0b11111111;

// PORT C...
TRISC = 0b11111111;
LATC = 0b11111111;
ANSELC = 0;
PORTC = 0b11111111;
RCSTA1 = 0; // # Disable serial port receive
TXSTA1 = 0; // # Disable serial port transmit
// PORT D...
//TRISD = 0b11111111;
//LATD = 0b11111111;
//ANSELD = 0b11111111;
CCP1CON = 0; //# Disable CCP1
CCP2CON = 0; //# Disable CCP2
CCP3CON = 0; //# Disable CCP3
CCP4CON = 0; //# Disable CCP4
CCP5CON = 0; //# Disable CCP5
//PORTD = 0;
// PORT E...
TRISE = 0b11111111;
LATE = 0b11111111;
ANSELE = 0b11111111;
*/
   
' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='calculation' title='Set number of days for each month' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='daysInMonth[1] = 31' />
							<exp exp='daysInMonth[2] = 28' />
							<exp exp='daysInMonth[3] = 31' />
							<exp exp='daysInMonth[4] = 30' />
							<exp exp='daysInMonth[5] = 31' />
							<exp exp='daysInMonth[6] = 30' />
							<exp exp='daysInMonth[7] = 31' />
							<exp exp='daysInMonth[8] = 31' />
							<exp exp='daysInMonth[9] = 30' />
							<exp exp='daysInMonth[10] = 31' />
							<exp exp='daysInMonth[11] = 30' />
							<exp exp='daysInMonth[12] = 31' />
						</command>
						<command class_type='calculation' title='Set up LCD display seven segment values.' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='segValue[0] = 0x3F' />
							<exp exp='segValue[1] = 0x06' />
							<exp exp='segValue[2] = 0x5B' />
							<exp exp='segValue[3] = 0x4F' />
							<exp exp='segValue[4] = 0x66' />
							<exp exp='segValue[5] = 0x6D' />
							<exp exp='segValue[6] = 0x7D' />
							<exp exp='segValue[7] = 0x07' />
							<exp exp='segValue[8] = 0x7F' />
							<exp exp='segValue[9] = 0x67' />
							<exp exp='segValue[10] = 0x00' />
							<exp exp='segValue[11] = 0xFF' />
							<exp exp='segValue[12] = 0x08' />
							<exp exp='segValue[13] = 0x0C' />
						</command>
						<command class_type='comment' title='' comment='0-9 = numbers
10 = Blank
11 = all segments except +/-
12 = bottom segment, or negative
13 = bottom and bottom right segment, or positive' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LED_I2C' macro='Initialise' />
						<command class_type='comment' title='' comment='The next command appears only to set up the I2C port.
This also enables I2C1 to work OK (for the LCD displays).' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='500' type='1' />
						<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='ledTest' />
								<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='100' type='1' />
							</flowline>
						</command>
						<command class_type='call' title='Set up RTC' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='Initialise' />
						<command class_type='delay' title='Wait for RTC and display to start' cmdcolor='7895044' cmdcolor_sec='7895044' exp='1' type='2' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='displayTest' />
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='soundOn = TRUE' swap='0' >
							<flowline >
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='makeSounds' >
									<argument exp='SOUND_TEST' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='soundOn = TRUE' />
								</command>
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='makeSounds' >
									<argument exp='SOUND_TEST' />
								</command>
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='soundOn = FALSE' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Get stored civil time mode' cmdcolor='1975743' cmdcolor_sec='1975743' component='eeprom1' macro='Read' >
							<return exp='UKCivilTimeAuto' />
							<argument exp='ADDR_CIVIL_TIME' />
						</command>
						<command class_type='call' title='Get stored sound mode' cmdcolor='1975743' cmdcolor_sec='1975743' component='eeprom1' macro='Read' >
							<return exp='soundOn' />
							<argument exp='ADDR_SOUND_ON' />
						</command>
						<command class_type='call' title='Get stored LEDs on/off' disable='1' cmdcolor='1975743' cmdcolor_sec='1975743' component='eeprom1' macro='Read' >
							<return exp='ledsOn' />
							<argument exp='ADDR_LEDS_ON' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='ledsOn = TRUE' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='eeprom1' macro='Read' >
							<return exp='clock24' />
							<argument exp='ADDR_24_12' />
						</command>
						<command class_type='interrupt' title='Interrupt' cmdcolor='3610239' cmdcolor_sec='3610239' enable='1' name='IOC0' call='RTCInterrupt' >
							<settings timer='0' prescale='-1' postscale='-1' rollover='-1' bitcount='-1' trigger='3' maskhi='-0------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='-0------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
							</settings>
						</command>
						<command class_type='interrupt' title='Start interrupt on positive edges of MSF pulse' cmdcolor='3610239' cmdcolor_sec='3610239' enable='1' name='INT0' call='MSFInterrupt' >
							<settings timer='0' prescale='-1' postscale='-1' rollover='-1' bitcount='-1' trigger='1' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='0' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
							</settings>
						</command>
						<command class_type='interrupt' title='Start 300pps interrupt to clock the secondSync timing' cmdcolor='3610239' cmdcolor_sec='3610239' enable='1' name='TMR2' call='decodeTimerInterrupt' >
							<settings timer='1' prescale='4' postscale='4' rollover='208' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='1' />
								<option value='3' />
								<option value='208' />
								<option value='-1' />
							</settings>
						</command>
						<command class_type='output' title='Switch on MSF Rx' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048576' mask='4' exp='RX_ON' />
						<command class_type='delay' title='Time for receiver to settle' cmdcolor='7895044' cmdcolor_sec='7895044' exp='RX_WARMUP_TIME' type='2' />
						<command class_type='call' title='Fully calibrate clock time against MSF Anthorn' cmdcolor='1975743' cmdcolor_sec='1975743' macro='GetMSFDateTime' />
						<command class_type='output' title='Switch MSF Rx on' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048576' mask='4' exp='RX_OFF' />
						<command class_type='loop' title='Main loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='1' >
							<flowline >
								<command class_type='decision' title='Each second' cmdcolor='3568629' cmdcolor_sec='3568629' exp='RTCSecondInterruptFlag = TRUE' swap='0' >
									<flowline >
										<command class_type='native' title='Switch to 1MHz clock' disable='1' ccode='/*
  Enter C code below this comment
*/
OSCCON = 0b01010010;' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='RTCSecondInterruptFlag = FALSE' />
										</command>
										<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='checkMenu' />
										<command class_type='call' title='Increment clock time by one sec (Real Time Clock not affected)' cmdcolor='1975743' cmdcolor_sec='1975743' macro='runSoftwareClock' />
										<command class_type='comment' title='' comment='Note that the following macros, paintClock, runClock and dailyCalibrate
Need to be in that order or else the seconds will display
or/and update wrongly.' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
										<command class_type='call' title='Paint time and other data to LCD' cmdcolor='1975743' cmdcolor_sec='1975743' macro='paintLCDDisplay' />
										<command class_type='output' title='Output' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048576' mask='2' exp='1' />
										<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='RTCSecs = 0' swap='0' >
											<flowline >
												<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='makeSounds' >
													<argument exp='SOUND_MINUTE' />
												</command>
											</flowline>
											<flowline >
												<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='makeSounds' >
													<argument exp='SOUND_SECOND' />
												</command>
											</flowline>
										</command>
										<command class_type='call' title='Carry out calibration if time is right' cmdcolor='1975743' cmdcolor_sec='1975743' macro='dailyCalibrate' />
									</flowline>
									<flowline >
										<command class_type='native' title='Go to sleep' disable='1' ccode='/*
  Enter C code below this comment
*/
SLEEP();' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
									</flowline>
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='MSFInterrupt' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Indicate second transition according to MSF radio signal' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='MSFPulseFlag = TRUE' />
							<exp exp='' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='alignRTCSecondsToMSF' description='Resets the RTC seconds to coincide with MSF time.
Checks for alignment and repeats as necessary (because
the received pulse may be corrupted by noise or because
the MSF B-pulse was started on in error).' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='loop' title='Loop until an acceptable time alignment is achieved' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='RTCSecondOk = FALSE' start='0' >
							<flowline >
								<command class_type='calculation' title='Clear MSF interrupt flag' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFPulseFlag = FALSE' />
								</command>
								<command class_type='loop' title='Wait for next second' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='MSFPulseFlag = TRUE' start='0' >
									<flowline />
								</command>
								<command class_type='call' title='Sync the RTC seconds negative-going edge with MSF ' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='WriteTimeSeconds' >
									<argument exp='0' />
								</command>
								<command class_type='comment' title='' comment='Measure alignment error from MSFPulseFlag
to next RTC interrupt' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='calculation' title='Zero the timer' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='MSFPulseFlag = FALSE' />
									<exp exp='sampleDelayCounter = 0' />
								</command>
								<command class_type='calculation' title='Initialise the RTC interrupt flag' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='RTCSecondInterruptFlag = FALSE' />
								</command>
								<command class_type='loop' title='Wait for RTC interrupt' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='RTCSecondInterruptFlag = FALSE' start='0' >
									<flowline />
								</command>
								<command class_type='comment' title='' comment='sampleDelayCounter now contains the error' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='decision' title='Excess error?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='((sampleDelayCounter &gt; MAX_ALIGNMENT_ERROR) &amp;&amp; (sampleDelayCounter &lt; (SAMPLE_RATE - MAX_ALIGNMENT_ERROR)))' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='Error too great, try again' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
									</flowline>
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='RTCSecondOk = TRUE' />
										</command>
										<command class_type='comment' title='' comment='RTC should now be set within +/- 16ms, but
the Rx has a fixed time delay of 26ms.
Next step is to shift the RTC in the direction
to correct this.' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
										<command class_type='calculation' title='Clear RTC interrupt flag' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='RTCSecondInterruptFlag = FALSE' />
										</command>
										<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='RTCSecondInterruptFlag = TRUE' start='0' >
											<flowline />
										</command>
										<command class_type='comment' title='' comment='This delay also partially corrects the I2C delays
both here and at the end of decodeMSFDateTimeCode().' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
										<command class_type='delay' title='Delay to the next second pulse minus 52ms' cmdcolor='7895044' cmdcolor_sec='7895044' exp='947' type='1' />
										<command class_type='call' title='Sync the RTC second edge with MSF ' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='WriteTimeSeconds' >
											<argument exp='0' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='alignRTCMinuteToMSF' description='This macro normally follows alignRTCSecondsToMSF(), which locks
on to (any) second.
It finds the 01111110 A-bit sequence: the following second is zero.
On entry the second edge is identified. On exit second zero is found
ready for data collection.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='SAMPLE_DELAY' type='s16' description='Milliseconds from UTC second to A-bit pulse start' isconst='1' isinit='1' usrinit='150' setinit='150' />
						<local name='SAMPLE_LENGTH' type='s16' description='These are SAMPLE_RATE pps pulses' isconst='1' isinit='1' usrinit='33' setinit='33' />
						<local name='minuteIdentifierWord' type='u8' description='Holds the last 8 seconds of A-bit code to detect minute identifier' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='aCodeOnesCount' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='MSFPulseSample' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='a' type='b1' description='Signals that a zero has been seen' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='b' type='u8' description='how many A-bits seen since a zero' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='DISPLAY_ADDRESS' type='s16' description='' isconst='1' isinit='1' usrinit='116' setinit='0x74' />
						<local name='VECTOR_HH' type='s16' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
						<local name='c' type='b1' description='Indicates whether the final zero of the minute identifier has been received' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='calculation' title='Initialise RTC interrupt' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='RTCSecondInterruptFlag = FALSE' />
							<exp exp='sampleClockEnable = TRUE' />
							<exp exp='.minuteIdentifierWord = 0' />
							<exp exp='.a = 0' />
							<exp exp='.b = 0' />
							<exp exp='.c = 0' />
						</command>
						<command class_type='loop' title='Loop until minute identifier is found' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='.minuteIdentifierWord = 0b01111110' start='0' >
							<flowline >
								<command class_type='calculation' title='Reset RTC interrupt ' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='RTCSecondInterruptFlag = FALSE' />
									<exp exp='' />
								</command>
								<command class_type='loop' title='Wait for next RTC second' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='RTCSecondInterruptFlag = TRUE' start='0' >
									<flowline />
								</command>
								<command class_type='delay' title='Wait for A-pulse' cmdcolor='7895044' cmdcolor_sec='7895044' exp='.SAMPLE_DELAY' type='1' />
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='sampleClockCounter = 0' />
									<exp exp='sampleClockFlag = FALSE' />
									<exp exp='.aCodeOnesCount = 0' />
								</command>
								<command class_type='loop' title='Loop for duration of A-bit (~100ms)' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='sampleClockCounter = .SAMPLE_LENGTH' start='0' >
									<flowline >
										<command class_type='loop' title='Wait for next sample clock' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='sampleClockFlag = TRUE' start='0' >
											<flowline />
										</command>
										<command class_type='input' title='Input' cmdcolor='3610239' cmdcolor_sec='3610239' mode='1' port='1048577' mask='1' exp='.MSFPulseSample' />
										<command class_type='calculation' title='Reset sample clock pulse and sample MSF Rx' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='sampleClockFlag = FALSE' />
											<exp exp='.aCodeOnesCount = .aCodeOnesCount + .MSFPulseSample' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Shift minute identifier one place' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.minuteIdentifierWord = .minuteIdentifierWord &lt;&lt; 1' />
								</command>
								<command class_type='decision' title='Was A-bit high for that second?' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.aCodeOnesCount &gt; (.SAMPLE_LENGTH / 2)' swap='0' >
									<flowline >
										<command class_type='calculation' title='Make LSB one' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.minuteIdentifierWord = .minuteIdentifierWord + 1' />
										</command>
										<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.a = 1' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='.b = .b + 1' />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='LSB stays at zero' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.a = 1' />
										</command>
										<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.b = 6' swap='0' >
											<flowline >
												<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='.c = 1' />
												</command>
											</flowline>
											<flowline >
												<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.b &gt; 0' swap='0' >
													<flowline >
														<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='.b = 0' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
								<command class_type='comment' title='' comment='Display current identifier status.
Display as 
First digit = 1 if a leading zero has been found, zero if not
Second digit will then increment until a zero is found
Second digit will be zeroed if subsequently a zero is
received before the required six (01111110).
Third digit indicates that the final zero has been received.' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Start' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.DISPLAY_ADDRESS' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='.VECTOR_HH' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.a]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.b]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[.c]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='TransmitByte' >
									<argument exp='segValue[BLANK]' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='LCD_I2C' macro='Stop' />
							</flowline>
						</command>
						<command class_type='calculation' title='Reset RTC interrupt ' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='RTCSecondInterruptFlag = FALSE' />
							<exp exp='' />
						</command>
						<command class_type='loop' title='Wait for next RTC second' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='RTCSecondInterruptFlag = TRUE' start='0' >
							<flowline />
						</command>
						<command class_type='call' title='Correct RTC seconds' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='WriteTimeSeconds' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='ReadTimeINT' >
							<return exp='RTCSecs' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='RTC' macro='ReadTimeINT' >
							<return exp='MSFMinute' />
							<argument exp='1' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='sampleClockEnable = FALSE' />
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='a032b252-4991-4fbc-bdde-18646f741455' vmin='68' vmaj='1' codename='RTC' x='-50.0001' y='-48' z='0.755' xsz='0.999998' ysz='1.15385' 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='SQW' data='002' />
					<value target='En32kHz' data='0' />
					<value target='DayReturn' data='001' />
					<value target='AlarmInt' data='0' />
					<value target='DOF' data='000' />
					<value target='TimeFrmt' data='000' />
					<value target='BST' data='0' />
					<value target='Alarm1Rate' data='006' />
					<value target='Alarm2Rate' data='005' />
					<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.3' />
					<value target='label' data='DS3132' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='24219805-113d-4b12-b6bd-e1b0b0c33981' vmin='4' vmaj='1' codename='LCD_I2C' x='50.0001' y='-48' z='0.755' xsz='59.9999' ysz='30' 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='0' />
					<value target='BAUD' data='50000' />
					<value target='SDA' data='$PORTC.4' />
					<value target='SCL' data='$PORTC.3' />
					<value target='label' data='I2C Master' />
					<value target='ScopeTraces' data='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='dcbf571f-a6fa-402d-bdd4-be00cca4070f' vmin='1' vmaj='1' codename='eeprom1' x='-40' y='60' z='10' xsz='20' ysz='20' 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='0,1,0,0' />
					<value target='InitValsParsed' data='0,1,0,0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='24219805-113d-4b12-b6bd-e1b0b0c33981' vmin='4' vmaj='1' codename='LED_I2C' x='50' y='-90' 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='002' />
					<value target='BAUD_LIST' data='001' />
					<value target='SRC' data='000' />
					<value target='SMB' data='000' />
					<value target='StopDelay' data='0' />
					<value target='BAUD' data='50000' />
					<value target='SDA' data='$PORTD.1' />
					<value target='SCL' data='$PORTD.0' />
					<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='70ec3aee-f273-4b0e-8ee6-e2b3a8b693af' vmin='0' vmaj='1' codename='PiezoSounder1' x='180' y='180' z='39.37' 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='$PORTA.3' />
					<value target='Color' data='16729600' />
				</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='26.4501' ye='5.66607' ze='850' xt='26.4501' yt='5.66607' 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='-3.36354' ye='20.555' ze='336.875' xt='-3.36354' yt='20.555' 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='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='1536' flags='0' />
		<view type='0' name='ledTest' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='281' flags='0' />
		<view type='0' name='paintLED' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='1139' flags='0' />
		<view type='0' name='decodeTimerInterrupt' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='synthesizeLED' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='RTCInterrupt' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='alignRTCMinuteToMSF' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='alignRTCSecondsToMSF' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='MSFInterrupt' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='dailyCalibrate' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='makeSounds' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='runSoftwareClock' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='GetMSFDateTime' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='decodeMSFDateTimeCode' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='6251' flags='0' />
		<view type='0' name='paintLCDDisplay' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='displayTest' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='385' flags='0' />
		<view type='0' name='checkMenu' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='collectMSFDateTimeCode' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAnggAANIDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
