• AVR Freaks

Hot!can not congfig 60Mhz Oscillator

Author
vietnguyen
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2019/05/01 20:01:27
  • Location: 0
  • Status: offline
2019/05/31 23:58:49 (permalink)
5 (1)

can not congfig 60Mhz Oscillator

hello everyone, 
i have a problem when config for the oscillator of DSPIC33EP512MC504.
The first time, I use similar dspic (DSPIC33EP512MU810) and config it runs at 60Mhz, it works correctly. My crystal is 8MHz 
 
FOSCSEL(FNOSC_PRIPLL & IESO_OFF);
_FOSC(FCKSM_CSECMD & POSCMD_XT & OSCIOFNC_OFF & IOL1WAY_OFF);
main
{
PLLFBD=58; /* M=70 */ //PLL Feedback Divisor Register 
CLKDIVbits.PLLPOST = 0; /* N1=2 */ 
CLKDIVbits.PLLPRE = 0; /* N2=2 */
OSCTUN=0; 
__builtin_write_OSCCONH(0x03); /* Initiate Clock Switch to Primary Oscillator with PLL (NOSC=0b011)*/
__builtin_write_OSCCONL(0x01);
while (OSCCONbits.COSC != 0b011); /* Wait for Clock switch to occur */
while(OSCCONbits.LOCK !=1);
}
 
But when I move to [<font]DSPIC33EP512MC504, it not work. it just works when I change PLLFBD=58, it means My MCU run at 40MHz
can anyone have the same my problem, please help me
#1

0 Replies Related Threads

    Jump to:
    © 2019 APG vNext Commercial Version 4.5