Hot!MCC clock setup ?

Author
Jan Audio
Starting Member
  • Total Posts : 33
  • Reward points : 0
  • Joined: 2018/09/24 08:12:24
  • Location: 0
  • Status: offline
2018/10/31 07:26:45 (permalink)
0

MCC clock setup ?

Hi, i generated some code with MCC for PIC32MX170F256B.
I dont understand that with SYSKEY, and the rest,
i deleted all this code.
 

void SYSTEM_RegUnlock(void)
{
    SYSKEY = 0x12345678;
    SYSKEY = 0xAA996655;
    SYSKEY = 0x556699AA;
}

void SYSTEM_RegLock(void)
{
    SYSKEY = 0x00000000;
}

void OSCILLATOR_Initialize(void)
{
    SYSTEM_RegUnlock();
    // CF no clock failure; COSC FRCPLL; PLLODIV DIV_2; PBDIVRDY disabled; SLOCK out of lock; FRCDIV FRC/2; SLPEN Idle on WAIT instruction; NOSC FRCPLL; PLLMULT MUL_24; SOSCEN disabled; PBDIV DIV_1; CLKLOCK unlocked; OSWEN Switch is Complete; SOSCRDY disabled;
    OSCCON = 0x9071100;
    SYSTEM_RegLock();
    // TUN Center Frequency;
    OSCTUN = 0x0;
    // DIVSWEN disabled; RSLP disabled; ACTIVE Active; ROSEL SYSCLK; OE Not Driven out on REFCLKO pin; SIDL disabled; RODIV 0; ON disabled;
    REFOCON = 0x100;
    // ROTRIM 0;
    REFOTRIM = 0x0;
}

 
If i delete it, it does the same since the configuration is already in those bytes also.
Why does MCC generate this double ?, the configuration bytes also works.
If i delete this code do i miss something ?, maybe only finetuning ?
 
thanks
post edited by Jan Audio - 2018/10/31 07:32:07
#1

0 Replies Related Threads

    Jump to:
    © 2019 APG vNext Commercial Version 4.5