Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

T0CON = 0x08; //Timer0 prescaler 1:1, timer off INTCON.TMR0IE = 1; //Timer0 interrupt enabled INTCON.

GIE = 1; //Global interrupt enabled TMR0H = 0xF8; //Preload value for 1ms TMR0L = 0x2F; T0CON.TMR0ON = 1; //Turn timer0 on

void interruptHigh (void) __interrupt 1 {

TMR0H = 0xF8; //Preload value for 1ms TMR0L = 0x2F; // Do whatever you have to after 1ms INTCON.TMR0IF = 0; //Clear interrupt flag
if(INTCONbits.TMR0IF) { // Timer0 overflow interrupt INTCONbits.TMR0IF = 0; // ACK } }

You might also like