Files
xc8-picamp/include/config.h
2023-11-23 23:04:00 +01:00

39 lines
1.8 KiB
C

#ifndef CONFIG_H
#define CONFIG_H
// PIC hardware mapping
#include <xc.h>
// PIC16F887 Configuration Bit Settings
// #pragma config statements should precede project file includes.
#pragma config FOSC = INTRC_NOCLKOUT // Oscillator Selection bits (INTOSCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled and can be enabled by SWDTEN bit of the WDTCON register)
#pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = OFF // RE3/MCLR pin function select bit (RE3/MCLR pin function is digital input, MCLR internally tied to VDD)
#pragma config CP = OFF // Code Protection bit (Program memory code protection is disabled)
#pragma config CPD = OFF // Data Code Protection bit (Data memory code protection is disabled)
#pragma config BOREN = ON // Brown Out Reset Selection bits (BOR enabled)
#pragma config IESO = OFF // Internal External Switchover bit (Internal/External Switchover mode is disabled)
#pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enabled bit (Fail-Safe Clock Monitor is disabled)
#pragma config LVP = OFF // Low Voltage Programming Enable bit (RB3 pin has digital I/O, HV on MCLR must be used for programming)
#pragma config BOR4V = BOR40V // Brown-out Reset Selection bit (Brown-out Reset set to 4.0V)
#pragma config WRT = OFF // Flash Program Memory Self Write Enable bits (Write protection off)
// Used by the XC8 delay_ms(x) macro
#define _XTAL_FREQ 500000
#define REA PORTBbits.RB4
#define REB PORTBbits.RB5
#define NPN
#define ENABLED 1
#define DISABLED 0
#define LED_AMOUNT 4
#define POT_LIMIT 1023
#define DEADZONE 2
#endif