-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h
48 lines (35 loc) · 2.77 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// PIC24F16KL401 Configuration Bit Settings
// 'C' source line config statements
// FBS
#pragma config BWRP = OFF // Boot Segment Write Protect (Disabled)
#pragma config BSS = OFF // Boot segment Protect (No boot flash segment)
// FGS
#pragma config GWRP = OFF // General Segment Flash Write Protect (General segment may be written)
#pragma config GSS0 = OFF // General Segment Code Protect (No Protection)
// FOSCSEL
#pragma config FNOSC = PRIPLL // Oscillator Select (Primary Oscillator with PLL (XT+PLL, HS+PLL, EC+PLL))
#pragma config SOSCSRC = DIG // SOSC Source Type (Digital Mode for use with external clock on SCLKI)
#pragma config LPRCSEL = LP // LPRC Power and Accuracy (Low Power/Low Accuracy)
#pragma config IESO = OFF // Internal External Switch Over bit (Internal External Switchover mode disabled (Two-speed Start-up disabled))
// FOSC
#pragma config POSCMD = XT // Primary Oscillator Mode (XT oscillator mode selected)
#pragma config OSCIOFNC = ON // CLKO Pin I/O Function (Port I/O enabled (CLKO disabled))
#pragma config POSCFREQ = MS // Primary Oscillator Frequency Range (Primary Oscillator/External Clock frequency between 100kHz to 8MHz)
#pragma config SOSCSEL = SOSCHP // SOSC Power Selection Configuration bits (Secondary Oscillator configured for high-power operation)
#pragma config FCKSM = CSDCMD // Clock Switching and Monitor Selection (Clock Switching and Fail-safe Clock Monitor Disabled)
// FWDT
#pragma config WDTPS = PS32768 // Watchdog Timer Postscale Select bits (1:32768)
#pragma config FWPSA = PR32 // WDT Prescaler bit (WDT prescaler ratio of 1:32)
#pragma config FWDTEN = OFF // Watchdog Timer Enable bits (WDT disabled in hardware; SWDTEN bit disabled)
#pragma config WINDIS = OFF // Windowed Watchdog Timer Disable bit (Standard WDT selected (windowed WDT disabled))
// FPOR
#pragma config BOREN = BOR0 // Brown-out Reset Enable bits (Brown-out Reset disabled in hardware; SBOREN bit disabled)
#pragma config PWRTEN = ON // Power-up Timer Enable (PWRT enabled)
#pragma config I2C1SEL = PRI // Alternate I2C1 Pin Mapping bit (Default SCL1/SDA1 Pins for I2C1)
#pragma config BORV = V18 // Brown-out Reset Voltage bits (Brown-out Reset at 1.8V)
#pragma config MCLRE = ON // MCLR Pin Enable bit (RA5 input disabled; MCLR enabled)
// FICD
#pragma config ICS = PGx1 // ICD Pin Placement Select (EMUC/EMUD share PGC1/PGD1)
// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.
#include <xc.h>