| 193 |
Kevin |
1 |
/* ------------------------------------------------------------ */
|
|
|
2 |
/* PIC32 Configuration Settings */
|
|
|
3 |
/* ------------------------------------------------------------ */
|
|
|
4 |
/* Oscillator Settings */
|
|
|
5 |
#pragma config FNOSC = PRIPLL // Oscillator Selection Bits
|
|
|
6 |
#pragma config POSCMOD = EC // Primary Oscillator Configuration
|
|
|
7 |
#pragma config FPLLIDIV = DIV_2 // PLL Input Divider
|
|
|
8 |
#pragma config FPLLMUL = MUL_20 // PLL Multiplier
|
|
|
9 |
#pragma config FPLLODIV = DIV_1 // PLL Output Divider
|
|
|
10 |
#pragma config FPBDIV = DIV_8 // Peripheral Clock Divisor (timers/UART/SPI/I2C)
|
|
|
11 |
#pragma config FSOSCEN = OFF // Secondary Oscillator Enable
|
|
|
12 |
/* Clock Control Settings */
|
|
|
13 |
#pragma config IESO = OFF // Internal/External Clock Switch Over
|
|
|
14 |
#pragma config FCKSM = CSDCMD // Clock Switching and Monitor Selection
|
|
|
15 |
#pragma config OSCIOFNC = OFF // CLKO Output Signal Active on the OSCO Pin
|
|
|
16 |
/* USB Settings */
|
|
|
17 |
#pragma config UPLLEN = ON // USB PLL Enable
|
|
|
18 |
#pragma config UPLLIDIV = DIV_2 // USB PLL Input Divider
|
|
|
19 |
#pragma config FVBUSONIO = OFF // USB VBUS ON Selection
|
|
|
20 |
#pragma config FUSBIDIO = OFF // USB USID Selection
|
|
|
21 |
/* Other Peripheral Device Settings */
|
|
|
22 |
#pragma config FWDTEN = OFF // Watchdog Timer Enable
|
|
|
23 |
#pragma config WDTPS = PS1024 // Watchdog Timer Postscaler
|
|
|
24 |
#pragma config FSRSSEL = PRIORITY_7 // SRS Interrupt Priority
|
|
|
25 |
#pragma config FCANIO = OFF // CAN I/O Pin Select (default/alternate)
|
|
|
26 |
#pragma config FETHIO = ON // Ethernet I/O Pin Select (default/alternate)
|
|
|
27 |
#pragma config FMIIEN = OFF // Ethernet MII/RMII select (OFF=RMII)
|
|
|
28 |
/* Code Protection Settings */
|
|
|
29 |
#pragma config CP = OFF // Code Protect
|
|
|
30 |
#pragma config BWP = OFF // Boot Flash Write Protect
|
|
|
31 |
#pragma config PWP = OFF // Program Flash Write Protect
|
|
|
32 |
/* Debug Settings */
|
|
|
33 |
#pragma config ICESEL = ICS_PGx1 // ICE/ICD Comm Channel Select (on-board debugger)
|
|
|
34 |
/* ------------------------------------------------------------ */
|
|
|
35 |
|
|
|
36 |
#include <xc.h>
|
|
|
37 |
#include <plib.h>
|
|
|
38 |
#include "defines.h"
|
|
|
39 |
|
|
|
40 |
int main() {
|
|
|
41 |
/* Configure the target for maximum performance at 80 MHz. */
|
|
|
42 |
SYSTEMConfigPerformance(80000000UL);
|
|
|
43 |
|
|
|
44 |
INTConfigureSystem(INT_SYSTEM_CONFIG_MULT_VECTOR);
|
|
|
45 |
|
|
|
46 |
LED1_TRIS = 0;
|
|
|
47 |
LED2_TRIS = 0;
|
|
|
48 |
LED3_TRIS = 0;
|
|
|
49 |
LED4_TRIS = 0;
|
|
|
50 |
LED1_PORT = 1;
|
|
|
51 |
LED2_PORT = 1;
|
|
|
52 |
LED3_PORT = 1;
|
|
|
53 |
LED4_PORT = 1;
|
|
|
54 |
|
|
|
55 |
while(1) {}
|
|
|
56 |
}
|
|
|
57 |
|