-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added MikroE PIC32MX Clicker configuration
- Loading branch information
1 parent
c5dde5a
commit a53229b
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* MikroE boards */ | ||
|
||
#define prodPIC32MXClicker 0x0001 | ||
|
||
#if defined(_BOARD_MIKROE_PIC32MX_CLICKER_) | ||
#define _CONFIG_VALID_ | ||
|
||
#if defined(PUT_CONFIG_BITS_HERE) | ||
|
||
// DEVCFG3 | ||
// USERID = No Setting | ||
#pragma config FSRSSEL = PRIORITY_7 // SRS Select (SRS Priority 7) | ||
#pragma config FCANIO = ON // CAN I/O Pin Select (Default CAN I/O) | ||
#pragma config FUSBIDIO = ON // USB USID Selection (Controlled by the USB Module) | ||
#pragma config FVBUSONIO = ON // USB VBUS ON Selection (Controlled by USB Module) | ||
|
||
// DEVCFG2 | ||
#pragma config FPLLIDIV = DIV_2 // PLL Input Divider (2x Divider) | ||
#pragma config FPLLMUL = MUL_20 // PLL Multiplier (20x Multiplier) | ||
#pragma config UPLLIDIV = DIV_2 // USB PLL Input Divider (2x Divider) | ||
#pragma config UPLLEN = ON // USB PLL Enable (Enabled) | ||
#pragma config FPLLODIV = DIV_1 // System PLL Output Clock Divider (PLL Divide by 1) | ||
|
||
// DEVCFG1 | ||
#pragma config FNOSC = PRIPLL // Oscillator Selection Bits (Primary Osc w/PLL (XT+,HS+,EC+PLL)) | ||
#pragma config FSOSCEN = ON // Secondary Oscillator Enable (Enabled) | ||
#pragma config IESO = OFF // Internal/External Switch Over (Disabled) | ||
#pragma config POSCMOD = HS // Primary Oscillator Configuration (HS osc mode) | ||
#pragma config OSCIOFNC = OFF // CLKO Output Signal Active on the OSCO Pin (Disabled) | ||
#pragma config FPBDIV = DIV_1 // Peripheral Clock Divisor (Pb_Clk is Sys_Clk/1) | ||
#pragma config FCKSM = CSECME // Clock Switching and Monitor Selection (Clock Switch Enable, FSCM Enabled) | ||
#pragma config WDTPS = PS1024 // Watchdog Timer Postscaler (1:1024) | ||
#pragma config FWDTEN = OFF // Watchdog Timer Enable (WDT Disabled (SWDTEN Bit Controls)) | ||
|
||
// DEVCFG0 | ||
#pragma config DEBUG = OFF // Background Debugger Enable (Debugger is disabled) | ||
#pragma config ICESEL = ICS_PGx2 // ICE/ICD Comm Channel Select (ICE EMUC2/EMUD2 pins shared with PGC2/PGD2) | ||
#pragma config PWP = OFF // Program Flash Write Protect (Disable) | ||
#pragma config BWP = OFF // Boot Flash Write Protect bit (Protection Disabled) | ||
#pragma config CP = OFF // Code Protect (Protection Disabled) | ||
|
||
#endif | ||
|
||
#define CAPABILITIES (blCapBootLED | blCapDownloadLED | blCapUSBInterface | blCapProgramButton | blCapVirtualProgramButton | CAPCOMMON) | ||
|
||
// BTN / LED sense | ||
#define LedOn High | ||
#define BntOn Low | ||
|
||
// Boot LED | ||
#define BLedLat D | ||
#define BLedBit 1 | ||
|
||
// Data LED | ||
#define DLedLat D | ||
#define DLedBit 4 | ||
|
||
// Virtual program button | ||
#define VPBntLat B | ||
#define VPBntBit 4 | ||
|
||
// Program button | ||
#define PBntPort B | ||
#define PBntBit 4 | ||
|
||
#define _CPU_NAME_ "32MX534F064H" | ||
#define VEND vendMikroE | ||
#define PROD prodPIC32MXClicker | ||
#define F_CPU 80000000UL | ||
#define F_PBUS F_CPU | ||
|
||
#define FLASH_BYTES 0x10000 // 64K | ||
#define FLASH_PAGE_SIZE 4096 | ||
#define LoadFlashWaitStates() (CHECON = 2) // 0 for 0-30Mhz, 1 for 31-60Mhz, 2 for 61-80Mhz | ||
#endif |