【MPLAB X IDE】05: Configuration bits

Publisher:温暖拥抱Latest update time:2020-04-25 Source: eefocusKeywords:MPLAB  IDE  Configuration  bits Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

environment

MPLAB X IDE Version: v5.10


Compiler: xc16-gcc v1.20


Solution

1. Open the menu Production Set Configuration Bits, and the configuration bit interface pops up. Modify the parameters according to the project requirements.

2. Click on "Output Production Source Code" and paste the following code into the main program.


// PIC24EP64GP204 Configuration Bit Settings

 

// 'C' source line config statements

 

// FICD

#pragma config ICS = PGD1               // ICD Communication Channel Select bits (Communicate on PGEC1 and PGED1)

#pragma config JTAGEN = OFF             // JTAG Enable bit (JTAG is disabled)

 

// FPOR

#pragma config ALTI2C1 = OFF            // Alternate I2C1 pins (I2C1 mapped to SDA1/SCL1 pins)

#pragma config ALTI2C2 = OFF            // Alternate I2C2 pins (I2C2 mapped to SDA2/SCL2 pins)

#pragma config WDTWIN = WIN75           // Watchdog Window Select bits (WDT Window is 75% of WDT period)

 

// FWDT

#pragma config WDTPOST = PS4096         // Watchdog Timer Postscaler bits (1:4,096)

#pragma config WDTPRE = PR128           // Watchdog Timer Prescaler bit (1:128)

#pragma config PLLKEN = ON              // PLL Lock Enable bit (Clock switch to PLL source will wait until the PLL lock signal is valid.)

#pragma config WINDIS = OFF             // Watchdog Timer Window Enable bit (Watchdog Timer in Non-Window mode)

#pragma config FWDTEN = OFF             // Watchdog Timer Enable bit (Watchdog timer enabled/disabled by user software)

 

// DARK

#pragma config POSCMD = HS              // Primary Oscillator Mode Select bits (HS Crystal Oscillator Mode)

#pragma config OSCIOFNC = OFF           // OSC2 Pin Function bit (OSC2 is clock output)

#pragma config IOL1WAY = ON             // Peripheral pin select configuration (Allow only one reconfiguration)

#pragma config FCKSM = CSDCMD           // Clock Switching Mode bits (Both Clock switching and Fail-safe Clock Monitor are disabled)

 

// FOSCSEL

#pragma config FNOSC = PRIPLL           // Oscillator Source Selection (Primary Oscillator with PLL module (XT + PLL, HS + PLL, EC + PLL))

#pragma config IESO = ON                // Two-speed Oscillator Start-up Enable bit (Start up device with FRC, then switch to user-selected oscillator source)

 

// FGS

#pragma config GWRP = OFF               // General Segment Write-Protect bit (General Segment may be written)

#pragma config GCP = OFF                // General Segment Code-Protect bit (General Segment Code protect is Disabled)

 

// #pragma config statements should precede project file includes.

// Use project enums instead of #define for ON and OFF.

 

#include

Keywords:MPLAB  IDE  Configuration  bits Reference address:【MPLAB X IDE】05: Configuration bits

Previous article:microchip dsPIC33 IC3D simulation, "target device is not ready for debugging" issue
Next article:PIC16F877 timing voltage acquisition LCD1602 display Proteus simulation diagram

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号