Am working with interupts.
i write my code as it is given below.
when i apply the 5v on RB0/INT0 in proteous then no interupt come on RB6.
what is the reason?
is there any problem in code.
i write my code as it is given below.
Rich (BB code):
#include <P18f458.h>
//#include <delay.h>
#pragma config PWRT =OFF
#pragma config BOR =OFF
#pragma config DEBUG =OFF
#pragma config OSC =HS // 4MHz Crystal, (HS oscillator)
#pragma config WDT =OFF // watch dog timer off
#pragma config LVP =OFF // Low voltage program off
void chk_isr(void);
void chk_data(void);
#pragma interrupt chk_isr
void chk_isr(void)
{if(INTCONbits.INT0IF==0)
chk_data();
}
#pragma code my_HiPrio_int=0x08
void my_HiPrio_int(void)
{_asm
GOTO chk_isr
_endasm
}
#pragma code
void main()
{
TRISBbits.TRISB6=1;
TRISBbits.TRISB0=0;
INTCONbits.INT0IF=0;
INTCONbits.INT0IE=1;
INTCONbits.GIE=1;
}
void chk_data(void)
{TRISBbits.TRISB6=1;
INTCONbits.INT0IF=0;
}
what is the reason?
is there any problem in code.