• AVR Freaks

Unlock sequence for PIC24

Author
vra
Junior Member
  • Total Posts : 94
  • Reward points : 0
  • Joined: 2014/07/14 18:35:19
  • Location: 0
  • Status: offline
2019/08/28 16:43:49 (permalink)
0

Unlock sequence for PIC24

Hi all, how are you?. I'm trying to configure my oscillator on a PIC24EP, for efects of simulation in Proteus the PIC24FJ has the same unlock sequence than the PIC24EP, so:
 
In the PIC24FJ and EP reference manual appears this code in assembler for doing the unlock sequence but how can I do this without applying explicit asm(...) in c?, or just by simply setting the OSCCON value like in the following thread
 
https://www.microchip.com/forums/m1108733.aspx
 
the compiler itself manage to do the unlock sequence without me to be explicitly involved?
 
Addition: I've found in the XC16 users manual the built-in functions the following functions:
 
__builtin_write_OSCCONH
__builtin_write_OSCCONL

 
which the manual says they can unlock the OSCCON register. -->is this the answer?
 
Thanks in advance for the help.
#1

1 Reply Related Threads

    vra
    Junior Member
    • Total Posts : 94
    • Reward points : 0
    • Joined: 2014/07/14 18:35:19
    • Location: 0
    • Status: offline
    Re: Unlock sequence for PIC24 2019/08/28 16:47:46 (permalink)
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5