problem External interrupt RB0/INT in pic16f877

Status
Not open for further replies.

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....
 

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

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

To set the Configuration Bits in MikroC,

Goto Menu:

"Project" -> "Edit Project ..."



BigDog
 
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…