#include // BEGIN CONFIG #pragma config FOSC = HS // Oscillator Selection bits (HS oscillator) #pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT enabled) #pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT disabled) #pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled) #pragma config LVP = OFF // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3 is digital I/O, HV on MCLR must be used for programming) #pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off) #pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control) #pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off) // END CONFIG // Use internal crystal at 8MHz #define _XTAL_FREQ 20000000 //#define DEBUG 1 // Define baud rate of 9600 #define Baud_rate 9600 // Define if VFD if used #define VFD 1 // Define ADC Option #define ADC 1 // HD44780 #define RS RD2 // Register Select on RD2 #define EN RD3 // Enable on RD3 #define D4 RD4 // Data 4 on RD4 #define D5 RD5 // Data 5 on RD5 #define D6 RD6 // Data 6 on RD6 #define D7 RD7 // Data 7 on RD7 //Define Buttons #define DECR RB5 #define INCR RB4 #define SETB RB2 //Define Buzz #define BEEP RD1