i try to interrupt the 240ac power line by using the pin rb0/int(zero crossing detector) of pic16f877a.the code as shown below(search from internet):
void interrupt()
{
PORTA = PORTA - 1; //decrement the value on PORTA
INTCON.INTF = 0; //enable new RB0/INT interrupts
OPTION_REG=0;
}
void main()
{
OPTION_REG.INTEDG=1;
TRISA = 0x00; //set all PORTA pins as outputs
PORTA = 0xff; //make all PORTA pins high
INTCON.INTE = 1; //enable RB0/INT interrupts
INTCON.GIE = 1; //enable all un-masked interrupts
}
are those coding will work.can someone help me briefly translate it into basic pro language cause i use microcode studio basic pro to compile.
Bookmarks