MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip
MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip
MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
16-Bit C <strong>Compiler</strong> User’s Guide<br />
__builtin_write_RTCWEN<br />
Description: Used to write to the RTCC Timer by implementing the unlock sequence<br />
by writing the correct unlock values to NVMKEY <strong>and</strong> then setting the<br />
RTCWREN bit of RCFGCAL SFR.<br />
Prototype: void __builtin_write_RTCWEN(void);<br />
Argument: None.<br />
Return Value: None.<br />
Assembler Operator<br />
/ Machine<br />
Instruction:<br />
Error Messages None.<br />
mov #0x55, Wn<br />
mov Wn, _NVMKEY<br />
mov #0xAA, Wn<br />
mov Wn, _NVMKEY<br />
bset _NVMVON, #15<br />
nop<br />
nop<br />
__builtin_write_OSCCONL<br />
Description: Unlocks <strong>and</strong> writes its argument to OSCCONL.<br />
Prototype: void __builtin_write_OSCCONL(unsigned char value);<br />
Argument: value character to be written<br />
Return Value: None.<br />
Assembler Opera- mov #0x46, w0<br />
tor / Machine mov #0x57, w1<br />
Instruction*: mov __OSCCON, w2<br />
mov.b w0, [w2]<br />
mov.b w1, [w2]<br />
mov.b value, [w2]<br />
Error Messages None.<br />
* The exact sequnce may be different.<br />
__builtin_write_OSCCONH<br />
Description: Unlocks <strong>and</strong> writes its argument to OSCCONH.<br />
Prototype: void __builtin_write_OSCCONH(unsigned char value);<br />
Argument: value character to be written<br />
Return Value: None.<br />
Assembler Opera- mov #0x78, w0<br />
tor / Machine mov #0x9A, w1<br />
Instruction*: mov __OSCCON+1, w2<br />
mov.b w0, [w2]<br />
mov.b w1, [w2]<br />
mov.b value, [w2]<br />
Error Messages None.<br />
* The exact sequnce may be different.<br />
DS51284G-page 162 © 2008 <strong>Microchip</strong> Technology Inc.