Code: Select all
const osci=0x30; //calibration value.
void InitTimer1(){
T1CON = 0x01;
TMR1IF_bit = 0;
TMR1H = 0xFF;
TMR1L = 0xF9;
TMR1IE_bit = 1;
INTCON = 0xC0;
}
void Interrupt(){
if (TMR1IF_bit){
TMR1IF_bit = 0;
TMR1H = 0xFF;
TMR1L = 0xF9;
//Enter your code here
gpio.B4=~gpio.B4;
}
}
void main()
{
InitTimer1();
trisio=0; //all pins as output
ANSEL=0b0000; // ALL ANALOG PINS configured as digital I/O.
OSCCAL=osci; //Load internal oscillator calibration value
while(1)
{
}
}
}