arnab913
Junior Member level 3
- Joined
- Jul 27, 2012
- Messages
- 30
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Location
- Chittagong, Bangladesh
- Activity points
- 1,515
Hi,
facing problem to do an external interrupt on 18f4550 uc. Got a lot pain...Trying various way,but nothing happens...
Please help...
facing problem to do an external interrupt on 18f4550 uc. Got a lot pain...Trying various way,but nothing happens...
Code:
void Interrupt()
{
// This is external INT0 interrupt (for sync start)
// - once we get falling edge on RB0 we are disabling INT0 interrupt
if (INT0IF_bit && INT0IE_bit) {
INT0IF_bit = 0;
INT0IE_bit = 0;
PORTC = 0xFF;
//Delay_1sec;
}
}
void main()
{
TRISB=0xFF;
PORTB=0;
TRISC=0;
PORTC=0;
INTCON=0b10010000;
INTEDG0_bit = 0; // Interrupt on falling edge on RB0
while(1)
{
if (PORTB.f0==1)
{
INT0IF_bit=1;
INT0IE_bit=1;
}
}
}