<root>
<document schema='101' license='10,C04B9607-34AA-AE8C-B369-A7F373D01935,YKHPEN' title='' description='' target='AVR.ATMEGA.Arduino Mega 2560 R3' >
	<config data='' clkspd='16000000' simspd='1' usewdt='0' constif='0' />
	<plugins >
		<dll_dbg_icd enabled='0' >
			<data name='debug' value='1' />
			<data name='userpins' value='0' />
			<data name='speed' value='0' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='1' />
			<data name='clkbit' value='6' />
			<data name='dataport' value='1' />
			<data name='databit' value='7' />
			<data name='ghostype' value='0' />
			<data name='monitor' value='1' />
			<data name='ictloop' value='0' />
			<data name='ictrate' value='20000' />
			<data name='ictmask' value='0' />
			<data name='anlpres' value='255' />
			<data name='digmask1' value='-1' />
			<data name='digmask2' value='-1' />
		</dll_dbg_icd>
		<dll_models enabled='1' />
		<dll_upgrader enabled='1' />
		<dll_webhelp enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='ddrb' />
		<watch expr='tccr1a' />
		<watch expr='tccr1b' />
		<watch expr='PWM1.CS1' />
		<watch expr='PWM1.RC' />
		<watch expr='PWM1.div' />
		<watch expr='PWM1.Frequence' />
		<watch expr='PWM1.Rapport_cyclique' />
	</debug>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='78322b45-7d4e-41c0-a46c-f0e5fc62abaa' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='0' iconpath='' />
		<component class_type='root' codename='panel' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='f' type='u32' description='' isconst='0' isinit='1' usrinit='1' setinit='1' />
				</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='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='PWM1' description='' >
						<param name='Frequence' type='u32' description='en HZ' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Rapport_cyclique' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='CS1' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='RC' type='u32' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<local name='div' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='decision' title='Décision' exp='.Rapport_cyclique &gt; 100' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calcul' >
									<exp exp='.Rapport_cyclique = 100' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Décision' exp='.Frequence &gt; 4000000' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calcul' >
									<exp exp='.Frequence = 4000000' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Décision' exp='.Frequence &lt; 200' swap='0' >
							<flowline >
								<command class_type='decision' title='Décision' exp='.Frequence &lt; 20' swap='0' >
									<flowline >
										<command class_type='decision' title='Décision' exp='.Frequence &lt; 2' swap='0' >
											<flowline >
												<command class_type='calculation' title='presaler=256' >
													<exp exp='.CS1 = 4' />
													<exp exp='.div = 31250 / .Frequence' />
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='presaler=64' >
													<exp exp='.CS1 = 3' />
													<exp exp='.div = 125000 / .Frequence' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='presaler=8' >
											<exp exp='.CS1 = 2' />
											<exp exp='.div = 1000000 / .Frequence' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='prescaler =1' >
									<exp exp='.CS1 = 1' />
									<exp exp='.div = 8000000 / .Frequence' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Décision' exp='.RC &lt; 1' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calcul' >
									<exp exp='.RC = 1' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calcul' ccode='// Calcul
// Calcul:
//  .RC = (.Rapport_cyclique * .div) / 100
FCL_RC = (FCL_RAPPORT_CYCLIQUE * FCL_DIV) / 100;
' >
							<exp exp='.RC = (.Rapport_cyclique * .div) / 100' />
						</command>
						<command class_type='native' title='Code C' ccode='DDRB |= 1&lt;&lt;6;
TCCR1A = (0&lt;&lt;6)|(2&lt;&lt;4)|(0&lt;&lt;2)|(8&amp;3);
TCCR1B = ((8&gt;&gt;2)&lt;&lt;3)|FCL_CS1;
ICR1 = FCL_DIV;
OCR1B = FCL_RC;' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<command class_type='call' title='4MHz à 1Hz' macro='PWM1' >
							<argument exp='1000' />
							<argument exp='50' />
						</command>
						<command class_type='loop' title='Boucle' type='0' exp='1' >
							<flowline />
						</command>
					</flowline>
				</macro>
			</macros>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='0' brightness='0' perspective='0' >
		<background rgb='9737364' img='' style='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='1' lighting='0' brightness='256' perspective='0' >
		<background rgb='16777215' img='' style='0' />
		<table rgb='16777215' img='' style='0' size='26' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAqQQAAGsEAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='PWM1' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAqQQAAGsEAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
