#include <htc.h>
#include "main.h"
void
main(void)
{
Init(); //Initalize the chip
while (1){
GPIO4 = 1; //To make bit 4 of GPIO high/low
GPIO5 = 1; //To make bit 5 of GPIO high/low
}
}
void Init(void)
{
#asm
call 0x3FF //Load Factory Calibration Value Into OSCCAL
bsf _STATUS,5 //BANK1
movwf _OSCCAL
#endasm
ANSEL = 0b00000000; // configure A/D inputs as digital I/O
TRISIO = 0b11001111; //GPIO 3,4 outputs, GPIO 0,1,2,5,6,7 inputs
OPTION = 0b11010000; // Timer0 internal clock, 1:2 prescale
CMCON = 0b00000111; // configure all comparator inputs as digital I/O
}