-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.h
42 lines (33 loc) · 1.08 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
/*
* File: config.h
* Author: Syed Tahmid Mahbub
* Modifed by: Bruce Land
* Created on October 10, 2014
* Mod: 24Sept2015
*/
#ifndef CONFIG_H
#define CONFIG_H
#define _SUPPRESS_PLIB_WARNING 1
#include <plib.h>
// serial stuff
#include <stdio.h>
//=============================================================
// 40 MHz
#pragma config FNOSC = FRCPLL, POSCMOD = OFF
#pragma config FPLLIDIV = DIV_2, FPLLMUL = MUL_20 //40 MHz
#pragma config FPBDIV = DIV_1, FPLLODIV = DIV_2 // PB 40 MHz
#pragma config FWDTEN = OFF, FSOSCEN = OFF, JTAGEN = OFF
//==============================================================
// Protothreads configure
// IF use_vref_debug IS defined, pin 25 is Vref output
//#define use_vref_debug
// IF use_uart_serial IS defined, pin 21 and pin 22 are used by the uart
//#define use_uart_serial
#define BAUDRATE 9600 // must match PC terminal emulator setting
/////////////////////////////////
// set up clock parameters
// system cpu clock
#define sys_clock 40000000
// sys_clock/FPBDIV
#define pb_clock sys_clock // divide by one in this case
#endif /* CONFIG_H */