PIC Microcontroller has following types of Interrupt-
- Timer Interrupt
- Serial Interrupt
- External Interrupt
- Port B Interrupt
The following steps are same in this type of Interrupt–
- Assign Interrupt to that location where it has Highest Priority(0×08) and when interrupt occurs Program Counter should jump to that location(0×08)
#pragma code in=0×08
in()
{
_asm
GOTO chk
_endasm
}
#pragma code - Check which type of Interrupt Occurred and Jump to that Interrupt Subroutine
#pragma interrupt chk
void chk()
{
if(INTCONbits.TMR0IF==1)
T0();
if(PIR1bits.TMR1IF==1)
T1();
}
- You can download Interrupt files from here…. ENJOY……
No comments:
Post a Comment