Appendix b: example of configuration values – Digilent MX3cK User Manual
Page 17

Cerebot MX3cK Reference Manual
www.digilentinc.com
page 17 of 23
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
Appendix B: Example of Configuration Values
The following example illustrates setting the configuration values in the PIC32 microcontroller on the
Cerebot MX3cK. 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 Cerebot MX3cK 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 chipKIT 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