<root>
<document schema='101' license='1,siliconchip,X4H0GQ' title='' description='' target='PIC.16F.16F1937' >
	<config data='!0,fe2!10,1eff%0,2%3,0%5,1%6,1%7,1%8,1%9,3%b,1%c,0%d,0%10,3%14,3%18,0%19,1%1a,1%1c,1%1d,0' clkspd='19660800' simspd='1' usewdt='0' constif='0' />
	<plugins >
		<dll_dbg_icd enabled='0' >
			<data name='debug' value='1' />
			<data name='userpins' value='0' />
			<data name='speed' value='0' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='1' />
			<data name='clkbit' value='6' />
			<data name='dataport' value='1' />
			<data name='databit' value='7' />
			<data name='ghostype' value='0' />
			<data name='monitor' value='1' />
			<data name='ictloop' value='0' />
			<data name='ictrate' value='20000' />
			<data name='ictmask' value='0' />
			<data name='anlpres' value='19' />
			<data name='digmask1' value='-1' />
			<data name='digmask2' value='-1' />
		</dll_dbg_icd>
		<dll_upgrader enabled='1' />
		<dll_webhelp enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='PWMFrequency' />
		<watch expr='SetFrequencyPWM.Duty10Bit' />
		<watch expr='SetFrequencyPWM.PeriodOverflow' />
		<watch expr='SetFrequencyPWM.Prescaler' />
		<watch expr='ClockFrequencyHz' />
		<watch expr='key' />
		<watch expr='display_result' />
		<watch expr='number' />
		<watch expr='count' />
	</debug>
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='1' />
			<data name='ClockPin' value='6' />
			<data name='DataPort' value='1' />
			<data name='DataPin' value='7' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='9' />
			<data name='CalculatedCommsDelay' value='9' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='db63e63e-5eef-4b6d-9815-c3518a5fb797' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' iconpath='' />
		<component class_type='root' codename='panel' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='count' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='key' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='PWMFrequency' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='display_result' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='4' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='number' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ClockFrequencyHz' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='result' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Cursor' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
							<argument exp='&quot;PWM Fcy=&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
							<argument exp='display_result' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='count = 4' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='number = 0' />
									<exp exp='key = 0' />
									<exp exp='count = 0' />
									<exp exp='PWMFrequency = 0' />
								</command>
								<command class_type='loop' title='Loop' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' type='1' exp='key &lt;&gt; 11' >
									<flowline >
										<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='keypad_eb014' macro='GetNumber' >
											<return exp='key' />
										</command>
									</flowline>
								</command>
								<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Clear' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Cursor' >
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
									<argument exp='&quot;PWM Fcy=&quot;' />
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
									<argument exp='&quot;Hz  &quot;' />
								</command>
								<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='50' type='1' />
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SetFrequencyPWM' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='PeriodOverflow' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='Prescaler' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='Duty10Bit' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.Prescaler = 1' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='.PeriodOverflow &gt; 255' start='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.PeriodOverflow = (- .Prescaler + (ClockFrequencyHz / (number &lt;&lt; 2))) / .Prescaler' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.PeriodOverflow &gt; 255' swap='0' >
									<flowline >
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='.Prescaler = .Prescaler &lt;&lt; 2' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.Duty10Bit = .PeriodOverflow &lt;&lt; 1' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PWM1' macro='ChangePeriod' >
							<argument exp='.PeriodOverflow' />
							<argument exp='.Prescaler' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PWM1' macro='SetDutyCycle10Bit' >
							<argument exp='.Duty10Bit' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='result' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Start' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Cursor' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
							<argument exp='&quot;PWM Fcy=&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
							<argument exp='&quot;Hz  &quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='PWM1' macro='Enable' />
						<command class_type='calculation' title='This Must Match Clock Speed' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='ClockFrequencyHz = 19660800' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='keypad_eb014' macro='GetNumber' >
									<return exp='key' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='key &lt; 255' swap='0' >
									<flowline >
										<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='3568629' cmdcolor_sec='3568629' exp='key' >
											<case >
												<flowline >
													<command class_type='calculation' title='' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
														<exp exp='number = (number * 10) + key' />
														<exp exp='count = count + 1' />
													</command>
													<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
														<exp exp='Display_Result = ToString$ (number)' />
													</command>
													<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Cursor' >
														<argument exp='0' />
														<argument exp='0' />
													</command>
													<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
														<argument exp='&quot;PWM Fcy=&quot;' />
													</command>
													<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
														<argument exp='display_result' />
													</command>
													<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
														<argument exp='&quot;Hz  &quot;' />
													</command>
												</flowline>
											</case>
											<case exp='10' >
												<flowline >
													<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='SetFrequencyPWM' />
												</flowline>
											</case>
											<case exp='11' >
												<flowline >
													<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Clear' />
													<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
														<exp exp='number = 0' />
														<exp exp='key = 0' />
														<exp exp='count = 0' />
														<exp exp='PWMFrequency = 0' />
														<exp exp='' />
													</command>
													<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='SetFrequencyPWM' />
													<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='Cursor' >
														<argument exp='0' />
														<argument exp='0' />
													</command>
													<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
														<argument exp='&quot;PWM Fcy=&quot;' />
													</command>
													<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='lcd_eb005' macro='PrintString' >
														<argument exp='&quot;Hz  &quot;' />
													</command>
												</flowline>
											</case>
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='200' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='8' vmaj='1' codename='PWM1' x='25.8828' y='99.2175' z='2.636' xsz='1.48148' ysz='1.48148' zsz='1.48148' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='001' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTC.2' />
					<value target='RemapPin' data='000' />
					<value target='timer' data='2' />
					<value target='period' data='86' />
					<value target='prescale' data='6' />
					<value target='period_calc' data='1132.812500' />
					<value target='frequency_calc' data='0.882759' />
					<value target='pwm_prescale' data='64' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='f8c9b53d-0bf2-469f-8f0a-34caa93749ba' vmin='1' vmaj='1' codename='lcd_16x2' x='-30' y='40' z='3.575' 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 />
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='b07090da-50a4-41ed-97d8-99016c092a14' vmin='0' vmaj='1' codename='keypad_eb014' x='-40' y='100' z='4.73' 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='port' data='000' />
					<value target='pin_col1' data='$PORTA.0' />
					<value target='pin_col2' data='$PORTA.1' />
					<value target='pin_col3' data='$PORTA.2' />
					<value target='pin_row1' data='$PORTA.4' />
					<value target='pin_row2' data='$PORTA.5' />
					<value target='pin_row3' data='$PORTA.6' />
					<value target='pin_row4' data='$PORTA.7' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='d29dda88-17de-4008-991a-c881890d4c57' vmin='1' vmaj='1' codename='lcd_eb005' x='0' y='11.85' z='21.575' xsz='1.75' ysz='1.65289' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='Pin_Data_0' data='$PORTB.0' />
					<value target='Pin_Data_1' data='$PORTB.1' />
					<value target='Pin_Data_2' data='$PORTB.2' />
					<value target='Pin_Data_3' data='$PORTB.3' />
					<value target='Pin_RS' data='$PORTB.4' />
					<value target='Pin_E' data='$PORTB.5' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='16760992' img='' style='0' />
		<camera xe='-5.09889' ye='34.8612' ze='191.895' xt='-5.09889' yt='34.8612' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='25' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALwUAAFECAAA' zoom='75' scrollx='0' scrolly='690' flags='0' />
		<view type='0' name='result' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALwUAAFECAAA' zoom='75' scrollx='0' scrolly='293' flags='0' />
		<view type='0' name='SetFrequencyPWM' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAALwUAAFECAAA' zoom='75' scrollx='0' scrolly='310' flags='0' />
	</layout>
</document>
</root>
