<root>
<document schema='101' license='1,celebrium,86ER3C' title='' description='' target='PIC16.33E.33EP128MC206' >
	<config data='!0,ffef!10,ffff!20,ffba!30,ff3c!40,fffa!50,fffd%0,3%4,0%5,1%14,1%15,1%16,3%20,a%24,1%25,1%26,0%27,1%30,0%32,1%35,1%36,0%40,2%46,1%47,1%50,1%51,0' clkspd='70000000' 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_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='0a96ed50-ca84-4e15-9804-04ac957ec758' 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='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='TMR' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='output' title='ADXL Power' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='135266306' mask='8' exp='1' />
						<command class_type='output' title='UHF RFID Power ' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='135266310' mask='2' exp='1' />
						<command class_type='output' title='RF Power' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048582' mask='64' exp='1' />
						<command class_type='output' title='RF Power Reset' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='135266305' mask='32' exp='0' />
						<command class_type='output' title='Çıktı' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048582' mask='128' exp='1' />
						<command class_type='output' title='Çıktı' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='135266310' mask='1' exp='1' />
						<command class_type='delay' title='Gecikme' cmdcolor='7895044' cmdcolor_sec='7895044' exp='500' type='1' />
						<command class_type='output' title='Çıktı' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048582' mask='128' exp='0' />
						<command class_type='output' title='Çıktı' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='135266310' mask='1' exp='0' />
						<command class_type='delay' title='Gecikme' cmdcolor='7895044' cmdcolor_sec='7895044' exp='500' type='1' />
						<command class_type='comment' title='' comment='Açıklama' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='output' title='ADXL Power' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='135266306' mask='8' exp='0' />
						<command class_type='output' title='UHF RFID Power ' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='135266310' mask='2' exp='0' />
						<command class_type='output' title='RF Power' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048582' mask='64' exp='0' />
						<command class_type='delay' title='Gecikme' cmdcolor='7895044' cmdcolor_sec='7895044' exp='500' type='1' />
						<command class_type='comment' title='' comment='Sleep mode is the lowest current-consumption state. The characteristics of Sleep mode include
the following:' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='native' title='C kod' ccode='/*
  Enter C code below this comment
*/
' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='comment' title='' comment='RCON: Reset Control Register(1)

bit 15 TRAPR: Trap Reset Flag bit
1 = A Trap Conflict Reset has occurred
0 = A Trap Conflict Reset has not occurred
bit 14 IOPUWR: Illegal Opcode or Uninitialized W Access Reset Flag bit
1 = An illegal opcode detection, an illegal address mode or an uninitialized W register used as an
Address Pointer caused a Reset
0 = An illegal opcode or uninitialized W register Reset has not occurred
bit 13 SBOREN: Software BOR Enable/Disable bit(4)
1 = BOR is turned on in software
0 = BOR is turned off in software
bit 12 Unimplemented: Read as ‘0’
bit 11 VREGSF: Flash Voltage Regulator Stand-by During Sleep bit
1 = Flash voltage regulator is active during Sleep
0 = Flash voltage regulator goes into Stand-by mode during Sleep
bit 10 Unimplemented: Read as ‘0’
bit 9 CM: Configuration Mismatch Flag bit(2)
1 = A configuration mismatch Reset has occurred
0 = A configuration mismatch Reset has not occurred
bit 8 VREGS: Voltage Regulator Stand-by During Sleep bit
1 = Voltage regulator is active during Sleep
0 = Voltage regulator goes into Stand-by mode during Sleep
bit 7 EXTR: External Reset Pin bit
1 = A Master Clear (pin) Reset has occurred
0 = A Master Clear (pin) Reset has not occurred
bit 6 SWR: Software Reset (Instruction) Flag bit
1 = A RESET instruction has been executed
0 = A RESET instruction has not been executed
bit 5 SWDTEN: Software Enable/Disable of WDT bit(3)
1 = WDT is enabled
0 = WDT is disabled
Note 1: All of the Reset status bits can be set or cleared in software. Setting one of these bits in software does not
cause a device Reset.
2: The configuration mismatch Reset flag is not available on all devices. (Refer to the specific device data
sheet.)
3: If the FWDTEN Configuration bit is ‘1’ (unprogrammed), the WDT is always enabled, regardless of the
SWDTEN bit setting.
4: The SBOREN bit is ignored if the BOREN Configuration bit = 0 (FPOR&lt;3&gt;).
© 2010 Microchip Technology Inc. DS70602B-page 8-5
Section 8. Reset
Reset
8
bit 4 WDTO: Watchdog Time-out Flag bit
1 = WDT time-out has occurred
0 = WDT time-out has not occurred
bit 3 SLEEP: Wake-up from Sleep Flag bit
1 = Device has been in Sleep mode
0 = Device has not been in Sleep mode
bit 2 IDLE: Wake-up from Idle Flag bit
1 = Device was in Idle mode
0 = Device was not in Idle mode
bit 1 BOR: Brown-out Reset Flag bit
1 = A Brown-out Reset or Power-on Reset has occurred
0 = A Brown-out Reset has not occurred
bit 0 POR: Power-on Reset Flag bit
1 = A Power-on Reset has occurred
0 = A Power-on Reset has not occurred
Register 8-1: RCON: Reset Control Register(1) (Continued)
Note 1: All of the Reset status bits can be set or cleared in software. Setting one of these bits in software does not
cause a device Reset.
2: The configuration mismatch Reset flag is not available on all devices. (Refer to the specific device data
sheet.)
3: If the FWDTEN Configuration bit is ‘1’ (unprogrammed), the WDT is always enabled, regardless of the
SWDTEN bit setting.
4: The SBOREN bit is ignored if the BOREN Configuration bit = 0 (FPOR&lt;3&gt;).' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='native' title='STEP 1' ccode='// The Primary Oscillator (POSC) and internal FRC oscillator are disabled
set_bit (FOSC,1);
set_bit (FOSC,0);
/*
bit 1-0 POSCMD&lt;1:0&gt;: Primary Oscillator Mode Selection bits

11 = Primary oscillator disabled
10 = HS Crystal Oscillator mode (10 MHz to 60 MHz)
01 = XT Crystal Oscillator mode (3.5 MHz to 10 MHz)
00 = EC (External Clock) mode (0 MHz to 60 MHz)
*/' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='native' title='STEP  2' ccode='/*The Secondary Oscillator (SOSC) continues to run if the Secondary Oscillator Enable bit
(LPOSCEN) in the Oscillator Control register (OSCCON&lt;1&gt;) is set. For details, refer to
Section 7. “Oscillator” (DS70580) in the “dsPIC33E/PIC24E Family Reference Manual”.
*/
set_bit  (OSCCON,1);
' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='native' title='STEP 3' ccode='/*
The WDT, clock source and LPRC oscillator continue to run if the Watchdog Timer is
enabled. The WDT, if enabled, is automatically cleared prior to entering Sleep mode. For
details, see 9.3 “Watchdog Timer”.

WATHCDOG TIMER POSTCALER  : 1:1024 is it ok
WATHCDOG TIMER PRESCALER  : 1:128 is it ok
WATCHDOG TIMER ENABLE     : ENABLE  is it ok
 
*/
' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='native' title='STEP  4' ccode='/*If the Voltage Regulator Standby Enable bit (VREGS) is cleared in the Reset Control
register (RCON&lt;8&gt;), the internal voltage regulator enters the Stand-by state. The voltage
regulator consumes a reduced amount of current in the Stand-by state.
*/
clear_bit(RCON,8);
//bit 8 VREGS: Voltage Regulator Stand-by During Sleep bit
//1 = Voltage regulator is active during Sleep
//0 = Voltage regulator goes into Stand-by mode during Sleep' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='native' title='STEP  5' ccode='/*
If the Flash Memory Voltage Regulator Stand-by Enable bit (VREGSF) in the Reset Control
register (RCON&lt;11&gt;) is cleared, the voltage regulator that powers the Flash memory
enters the Stand-by state. The Flash voltage regulator consumes a reduced amount of
current in the Stand-by state.
*/
clear_bit(RCON,11);  

//bit 11 VREGSF: Flash Voltage Regulator Stand-by During Sleep bit
//1 = Flash voltage regulator is active during Sleep
//0 = Flash voltage regulator goes into Stand-by mode during Sleep' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='native' title='STEP 6' ccode='/*
 The peripherals operating with the system clock are disabled
*/

/*
it is not working
*/' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='native' title='STEP 7' ccode='/*
The Fail-Safe Clock Monitor (FSCM) does not operate during Sleep mode, because the
system clock is disabled
*/

/*
ok
*/' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='native' title='STEP 8' ccode='/*
• Enable the voltage regulator to enter Stand-by state in Sleep mode
When the device exits Sleep mode, it restarts with the current clock source as indicated by the Cur
Clock Source Selection bits (COSC&lt;2:0&gt;) in the Oscillator Control register (OSCCON&lt;14:12&gt;)
*/

set_bit(RCON,3);

//bit 3 SLEEP: Wake-up from Sleep Flag bit 
//1 = Device has been in Sleep mode
//0 = Device has not been in Sleep mode

' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='native' title='STEP 9' ccode='/*
To minimize current consumption in Sleep mode, do the following:
• Ensure that I/O pins do not drive resistive loads
• Ensure that I/O pins configured as inputs are not floating
• Disable the SOSC
• Disable the WDT
• Enable the voltage regulator to enter Stand-by state in Sleep mode
When the device exits Sleep mode, it restarts with the current clock source as indicated by the Cur
Clock Source Selection bits (COSC&lt;2:0&gt;) in the Oscillator Control register (OSCCON&lt;14:12&gt;)
*/
set_bit(OSCCON,14);
clear_bit(OSCCON,13);
set_bit(OSCCON,12);

/*bit 14-12 COSC&lt;2:0&gt;: Current Oscillator Selection bits (read-only)
111 = Fast RC Oscillator with Divide-by-N (FRCDIVN)
110 = Fast RC Oscillator with Divide-by-16 (FRCDIV16)
101 = Low-Power RC Oscillator (LPRC)
100 = Secondary Oscillator (SOSC)
011 = Primary Oscillator with PLL (XTPLL, HSPLL, ECPLL)
010 = Primary Oscillator (XT, HS, EC)
001 = Fast RC Oscillator with PLL (FRCPLL)
000 = Fast RC Oscillator (FRC)*/' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
						<command class_type='comment' title='' comment='FOSC: Oscillator Configuration Register

bit 15-8 Reserved: Reserved bits must be programmed as ‘1’


bit 7-6 FCKSM&lt;1:0&gt;: Clock Switching Mode bits
1x = Clock switching is disabled, Fail-Safe Clock Monitor is disabled
01 = Clock switching is enabled, Fail-Safe Clock Monitor is disabled
00 = Clock switching is enabled, Fail-Safe Clock Monitor is enabled


bit 5 IOL1WAY: Peripheral Pin Select Configuration bit(1)
1 = Allow only one reconfiguration
0 = Allow multiple reconfigurations


bit 4-3 Reserved: Reserved bits must be programmed as ‘1’


bit 2 OSCIOFNC: OSC2 Pin Function bit (except in XT and HS modes)
1 = OSC2 is the clock output and the instruction cycle (FCY) clock is output on the OSC2 pin
0 = OSC2 is a general purpose digital I/O pin


bit 1-0 POSCMD&lt;1:0&gt;: Primary Oscillator Mode Selection bits
11 = Primary oscillator disabled
10 = HS Crystal Oscillator mode (10 MHz to 60 MHz)
01 = XT Crystal Oscillator mode (3.5 MHz to 10 MHz)
00 = EC (External Clock) mode (0 MHz to 60 MHz)
Note 1: The IOL1WAY bit is not available on all dsPIC33E/PIC24E devices. For more information, refer to the
“Special Features” chapter in the specific device data sheet.' textarea='72,-6,72,-6' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='OSCCON: Oscillator Control Register


bit 15 Unimplemented: Read as ‘0’


bit 14-12 COSC&lt;2:0&gt;: Current Oscillator Selection bits (read-only)
111 = Fast RC Oscillator with Divide-by-N (FRCDIVN)
110 = Fast RC Oscillator with Divide-by-16 (FRCDIV16)
101 = Low-Power RC Oscillator (LPRC)
100 = Secondary Oscillator (SOSC)
011 = Primary Oscillator with PLL (XTPLL, HSPLL, ECPLL)
010 = Primary Oscillator (XT, HS, EC)
001 = Fast RC Oscillator with PLL (FRCPLL)
000 = Fast RC Oscillator (FRC)


bit 11 Unimplemented: Read as ‘0’
bit 10-8 NOSC&lt;2:0&gt;: New Oscillator Selection bits
111 = Fast RC Oscillator with Divide by N (FRCDIVN)
110 = Fast RC Oscillator with Divide by 16 (FRCDIV16)
101 = Low-Power RC Oscillator (LPRC)
100 = Secondary Oscillator (SOSC)
011 = Primary Oscillator with PLL (XTPLL, HSPLL, ECPLL)
010 = Primary Oscillator (XT, HS, EC)
001 = Fast RC Oscillator with PLL (FRCPLL)
000 = Fast RC Oscillator (FRC)


bit 7 CLKLOCK: Clock Lock Enable bit
If clock switching is enabled and FSCM is disabled (FCKSM&lt;1:0&gt; (FOSC&lt;7:6&gt;) = 01):
1 = Clock switching is disabled, system clock source is locked
0 = Clock switching is enabled, system clock source may be modified by clock switching


bit 6 IOLOCK: Peripheral Pin Select (PPS) Lock bit(1)
1 = Peripheral Pin Select is locked. Writes to Peripheral Pin Select registers are not allowed.
0 = Peripheral Pin Select is not locked. Writes to Peripheral Pin Select registers are allowed.


bit 5 LOCK: PLL Lock Status bit (read-only)
1 = Indicates that PLL is in lock or PLL start-up timer is satisfied
0 = Indicates that PLL is out of lock, start-up timer is in progress or PLL is disabled


bit 4 Unimplemented: Read as ‘0’
Note 1: The IOLOCK bit is not available on all dsPIC33E/PIC24E devices. For more information, refer to
“Oscillator” chapter in the specific device data sheet.
2: This bit is only reset on a POR.
Note: Writes to this register require an unlock sequence. For more information and examples see 7.13 “Clock
Switching”.dsPIC33E/PIC24E Family Reference Manual
DS70580C-page 7-10 © 2009-2012 Microchip Technology Inc.


bit 3 CF: Clock Fail Detect bit (read or cleared by application)
1 = FSCM has detected clock failure
0 = FSCM has not detected clock failure


bit 2 Unimplemented: Read as ‘0’


bit 1 LPOSCEN: Secondary Oscillator (SOSC) Enable bit
1 = Enable secondary oscillator
0 = Disable secondary oscillator


bit 0 OSWEN: Oscillator Switch Enable bit
1 = Request oscillator switch to selection specified by the NOSC&lt;2:0&gt; bits
0 = Oscillator switch is complete
Register 7-3: OSCCON: Oscillator Control Register (Continued)
Note 1: The IOLOCK bit is not available on all dsPIC33E/PIC24E devices. For more information, refer to
“Oscillator” chapter in the specific device data sheet.
2: This bit is only reset on a POR.

Note: Writes to this register require an unlock sequence. For more information and examples see 7.13 “Clock
Switching”.' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='loop' title='Döngü' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='1' >
							<flowline />
						</command>
					</flowline>
				</macro>
			</macros>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='2105930' 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='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---------------------wUAAAAYAAAAgAUAAHcCAAA' zoom='70' scrollx='0' scrolly='1650' flags='0' />
	</layout>
</document>
</root>
