Maybe someone with more dsPIC experiance can help, i'm new to poking around at this level.
I have a dsPIC33EV with an external 8MHz XTAL I wish to run this at 80Mhz. I'm using FC to set most of my registers, via build options.
Then the first line on my FC is C Code.
Code: Select all
CLKDIVbits.PLLPRE = 0; // N1 (0=Divide by 2)
PLLFBDbits.PLLDIV = 40; //M Multiply F Xtal
CLKDIVbits.PLLPOST = 0; //N2 (0= Divide by 2)
A) is it OK to change the PLL setting at this point? i.e. within flowcode main.
I test this by outputting a 10mS pulse and measuring with a scope.
B) Can I change an the PIC's FCD to allow me to select 80MHz in project options? Since I only get 40, 48, 64 options and so my FC delays are out.
Using a FC clock speed of 40, I get what looks like a sensible halved value. so I must be close.
C)
However I can't get my UART to output a stable 115200 serial stream.
Do other users find they have to tune the oscillator to get a PLL clock close to 80MHz ? or are the base settings generally OK.
I would like to stay at 80MHz (unless there is a good reason not too), since I'll be using CAN and it should be easier to calculate my TQ settings if the FOsc is simply 4x faster than the std settings.
Thanks, J.