How to modify a project from 72 to 80MHz
2/22/08 1 of 1 Microchip Technology Inc.
To migrate an existing project from 72 to 80MHz operation, you would need to 1) modify oscillator
settings and 2) modify logic that is frequency dependent – for example, recalculate timer and
baud rate values. This brief note describes oscillator changes only. Refer to PIC32 product
datasheet to learn how to recalculate timer and baud rate values.
Exact oscillator setting change will depend on following factors:
1) How is the project currently achieving 72MHz, is it using Internal FRC, HS, EC, or XT
oscillator mode
2) Is project using MPLAB Configuration Bits window to program oscillator settings?
3) Is project using embedded configuration settings as defined by compiler?
For the sake of simplicity, we will assume the project is using 8MHz crystal.
Case 1: Project is using 8MHz crystal and MPLAB Configuration bits
Window
Select Configure-> Configuration bits… menu to open Configuration Bits window. Modify the
Configuration bits settings as below:
1. Make sure that “Configuration Bits set in code” checkbox is unchecked.
2. Select PLL Input Divider field and set the value to “2x Divider”.
3. Select PLL Multiplier field and set the value to “20x Multiplier”.
4. Select System PLL Output Clock Divider field and set the value to “PLL Divide by 1”
Case 2: Project is using 8MHz crystal and embedded configuration bits
settings as defined by the compiler
Following steps outline changes required when using MPLAB C32 Compiler. If you are not using
C32 compiler, refer to your compiler-specific documents for proper syntax.
Locate and modify FPLLDIV, FPLLMUL, and FPLLODIV pragma values as below:
#pragma FPLLIDIV = DIV_2, FPLLMUL = MUL_20, FPLLODIV = DIV_1