Oct 14, 2011 #1 S sanaprog Newbie level 6 Joined Aug 5, 2011 Messages 13 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,395 int run=0; void interrupt(void){ INTCON.INTF = 0; portd=~portd; } void main() { TRISB = 0x01; PORTB=0; TRISd = 0x00; portd=0x3f; INTCON.GIE = 1; INTCON.INTE = 1; intcon.intf=0; INTCON.PEIE = 0; OPTION_REG.INTEDG = 1; do { }while(1); } can anyone tell me what is the wrong with this code...interrupt occurs but it returns to 0 if interrupt not given within few seconds....
int run=0; void interrupt(void){ INTCON.INTF = 0; portd=~portd; } void main() { TRISB = 0x01; PORTB=0; TRISd = 0x00; portd=0x3f; INTCON.GIE = 1; INTCON.INTE = 1; intcon.intf=0; INTCON.PEIE = 0; OPTION_REG.INTEDG = 1; do { }while(1); } can anyone tell me what is the wrong with this code...interrupt occurs but it returns to 0 if interrupt not given within few seconds....
Oct 14, 2011 #2 bigdogguru Administrator Joined Mar 12, 2010 Messages 9,821 Helped 2,350 Reputation 4,694 Reaction score 2,272 Trophy points 1,413 Location Southwest, USA Activity points 62,383 Re: prolem External interrupt RB0/INT in pic16f877 What compiler are you using? And did you disable the watchdog timer in your configuration bit settings? BigDog
Re: prolem External interrupt RB0/INT in pic16f877 What compiler are you using? And did you disable the watchdog timer in your configuration bit settings? BigDog
Oct 17, 2011 #3 S sanaprog Newbie level 6 Joined Aug 5, 2011 Messages 13 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,395 Re: prolem External interrupt RB0/INT in pic16f877 THANKS for the reply...i am using mikro-c8....n how 2 set wdt off in mikro C...??in mPLAB i know its just ...#pragma config WDT = OFF... bt in mikro c:sad:
Re: prolem External interrupt RB0/INT in pic16f877 THANKS for the reply...i am using mikro-c8....n how 2 set wdt off in mikro C...??in mPLAB i know its just ...#pragma config WDT = OFF... bt in mikro c:sad:
Oct 17, 2011 #4 bigdogguru Administrator Joined Mar 12, 2010 Messages 9,821 Helped 2,350 Reputation 4,694 Reaction score 2,272 Trophy points 1,413 Location Southwest, USA Activity points 62,383 Re: prolem External interrupt RB0/INT in pic16f877 To set the Configuration Bits in MikroC, Goto Menu: "Project" -> "Edit Project ..." BigDog
Re: prolem External interrupt RB0/INT in pic16f877 To set the Configuration Bits in MikroC, Goto Menu: "Project" -> "Edit Project ..." BigDog