/* 
 * File:   configbits.h
 * Author: Mike
 *
 * 2016 board with 8 MHz resonator
 */

#ifndef CONFIGBITS_H
#define	CONFIGBITS_H

/*
 using external osc
 peripheral clock = at 10 MHz (80 MHz/8)
 */

#pragma config FNOSC = PRIPLL // Oscillator selection
#pragma config POSCMOD = HS // Primary oscillator mode
#pragma config FPLLIDIV = DIV_2 // PLL input divider (8 -> 4)
#pragma config FPLLMUL = MUL_20 // PLL multiplier  ( 4x20 = 80)
#pragma config FPLLODIV = DIV_1 // PLL output divider
#pragma config FPBDIV = DIV_8 // Peripheral bus clock divider 80/ = 80 mhz
#pragma config FSOSCEN = OFF // Secondary oscillator enable
/* Clock control settings
*/
#pragma config IESO = ON // Internal/external clock switchover
#pragma config FCKSM = CSECME // Clock switching (CSx)/Clock monitor (CMx)
#pragma config OSCIOFNC = OFF // Clock output on OSCO pin enable
/* USB Settings
*/
//#pragma config UPLLEN = OFF // USB PLL enable
//#pragma config UPLLIDIV = DIV_2 // USB PLL input divider
//#pragma config FVBUSONIO = OFF // VBUS pin control
//#pragma config FUSBIDIO = OFF // USBID pin control
/* Other Peripheral Device settings
*/
#pragma config FWDTEN = OFF // Watchdog timer enable
#pragma config WDTPS = PS4096 // Watchdog timer post-scaler
#pragma config FSRSSEL = PRIORITY_7 // SRS interrupt priority
#pragma config DEBUG = ON


#pragma config	ICESEL	= ICS_PGx1	// ICE pin selection
#endif	/* CONFIGBITS_H */

