Page 1 of 1

Convert configuration Pic33EP to 33MX

Posted: Mon Jan 08, 2018 12:16 pm
by Ferla
Hello guys
you could give me a hand in passing this code C (Pic33EP256MU806) ​​adapting it to the Pic33MX340F512H.
Configure the clock speed and always a disaster.
Do you know any road or tool that can help?

PLLFBD = 46; //frequenza uscita PLL // M=48
CLKDIVbits.PLLPOST = 0; // N1=2
CLKDIVbits.PLLPRE = 0; // N2=2
OSCTUN = 0; // Tune FRC oscillator, if FRC is used
RCONbits.SWDTEN = 0; // Disable Watch Dog Timer
__builtin_write_OSCCONH(0x03); // Initiate Clock Switch to HSPLL - Clock switching to incorporate PLL
__builtin_write_OSCCONL(0x01); // Start clock switching - Oscillator with PLL (NOSC=0b011)
while(OSCCONbits.COSC != 0b011);
while(OSCCONbits.LOCK != 1) // Wait for PLL to lock - Wait for Clock switch to occur
{ };

srand(TMR1);

Thank you, every help is well accepted.