Appendix b: example of configuration values – Digilent 410-297P-KIT User Manual
Page 19
ChipKIT MX3 Board Reference Manual
Copyright Digilent, Inc. All rights reserved.
Other product and company names mentioned may be trademarks of their respective owners.
Page 19 of 25
Appendix B: Example of Configuration Values
The following example illustrates setting the configuration values in the PIC32 microcontroller on the ChipKIT MX3.
The microcontroller configuration should be done in a single source file in the project, and is typically done in the
‘main’ project source file. This example sets all configuration values to valid values for the ChipKIT MX3 board. It
sets the system clock for processor operation at 80Mhz, and the peripheral bus at 10Mhz. This example is for use
with MPLAB. Configuration variables are set by the boot loader in the MPIDE system.
/* ------------------------------------------------------------ */
/*
PIC32 Configuration Settings
*/
/* ------------------------------------------------------------ */
/* Oscillator Settings
*/
#pragma config FNOSC
= PRIPLL
// Oscillator selection
#pragma config POSCMOD
= XT
// Primary oscillator mode
#pragma config FPLLIDIV = DIV_2
// PLL input divider
#pragma config FPLLMUL
= MUL_20
// PLL multiplier
#pragma config FPLLODIV = DIV_1
// PLL output divider
#pragma config FPBDIV
= DIV_8
// Peripheral bus clock divider
#pragma config FSOSCEN
= OFF
// Secondary oscillator enable
/* Clock control settings
*/
#pragma config IESO = OFF
// Internal/external clock switchover
#pragma config FCKSM
= CSDCMD
// Clock switching (CSx)/Clock monitor (CMx)
#pragma config OSCIOFNC
= OFF
// Clock output on OSCO pin enable
/* Other Peripheral Device settings
*/
#pragma config FWDTEN
= OFF
// Watchdog timer enable
#pragma config WDTPS
= PS1024
// Watchdog timer post-scaler
/* Code Protection settings
*/
#pragma config CP
= OFF
// Code protection
#pragma config BWP = OFF
// Boot flash write protect
#pragma config PWP = OFF
// Program flash write protect
/* Debug settings
*/
//#pragma config ICESEL
= ICS_PGx2
// ICE pin selection