2
\$\begingroup\$

I am using PIC32MX795F512L with the internal RC oscillator. By changing the settings of the config, I can get to 60 MHz max. But I can't get to 80 MHz. When I change the config for 80 MHz, PIC32 just won't run. Here is my config settings for 80 MHz clock speed.

    #pragma config FNOSC =  001            // 001       // FRCPLL       // Internal Fast RC oscillator (8 MHz) w/ PLL
    //#pragma config JTAGEN = OFF         // Disable JTAG
    #pragma config FSOSCEN = OFF        // Disable Secondary Oscillator
    #pragma config OSCIOFNC = OFF       // Enable CLKO Output on the OSCO Pin
    #pragma config FCKSM = CSECMD       // Enable Clock Switching & Fail-Safe Clock Monitor (FSCM) 
    #pragma config FWDTEN = OFF         // Watchdog Timer Disabled

    //#pragma config ICESEL = ICS_PGx1    // ICE/ICD Comm Channel Select
    #pragma config FPLLIDIV = DIV_2     // Divide FRC before PLL (now 4 MHz)
    #pragma config FPLLMUL =  MUL_20     // PLL Multiply (now 80 MHz)
    #pragma config FPLLODIV = DIV_1     // Divide After PLL (now 40 MHz)
                                        // see figure 8.1 in datasheet for more info
    #pragma config FPBDIV = DIV_1       // PBCLK = SYCLK

The same config above runs on the Explorer 16 Board. But It doesn't run in my custom designed PCB.

\$\endgroup\$
  • \$\begingroup\$ What kind of debugging have you done? Does the exact same code work if you just change the speed? Do you have access to an oscilloscope so you can enable the CLKO output and look at the resulting speed? \$\endgroup\$ – pipe Jul 26 '16 at 21:32
  • \$\begingroup\$ The Exact same code works on my custom PCB when I change FPLLMUL = MUL_15. Which would make output Clock of 60 Mhz. I can see that In Oscilloscope. But It just stops working when I cange it back to FPLLMUL = MUL_20. \$\endgroup\$ – Uday Savaria Jul 26 '16 at 21:48
  • \$\begingroup\$ Could be your layout. What does your PCB look like? Where & what value decoupling caps do you have? \$\endgroup\$ – brhans Jul 26 '16 at 22:01
  • \$\begingroup\$ I have decoupling capacitors on the PCB with 0.1 uF value. I Have kept it On the PCB As close as possible to the PIC32. couple of them might be more then 6mm. is that a big issue? \$\endgroup\$ – Uday Savaria Jul 26 '16 at 22:26
  • \$\begingroup\$ @TheRobotPeople No, that sounds fine. The general layout should not be that critical when you use the internal oscillator - you just have to make sure that VDD is stable and well decoupled. \$\endgroup\$ – pipe Jul 26 '16 at 22:31
-2
\$\begingroup\$

If you want speeds as high as 80MHz, you will need to use an external oscillator.

The FRC (Fast RC oscillator) maximun frequency is 8MHz, you can divide it by 2/4/.../256, but you can't increase it.

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ Good catch. This is "obvious" from figure 8-1 in the datasheet, page 141. The FRC bypasses the PLL and goes straight to the postscaler. \$\endgroup\$ – pipe Jul 26 '16 at 21:46
  • \$\begingroup\$ With a 48MHZ xtal and the PLL, internal clock rate can be as fast as 192MHZ. \$\endgroup\$ – Sparky256 Jul 26 '16 at 21:47
  • 2
    \$\begingroup\$ But if you change the config to use FRC with PLL. It can do that too. The following link explains it well. umassamherstm5.org/tech-tutorials/pic32-tutorials/… \$\endgroup\$ – Uday Savaria Jul 26 '16 at 21:49
  • \$\begingroup\$ @TheRobotPeople That's right. I missed the FRCPLL in one of the arrows. \$\endgroup\$ – pipe Jul 26 '16 at 22:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.