Trying to get my interrupt RB0 pin to accept a rising edge interrupt, but no matter what it keeps expecting a falling edge...anyone know what i am doing wrong?
The code works if I ground RB0 (it triggers the interrupt), but I want the interrupt to trigger when 5v is applied (rising edge).
--------------
@ DEVICE INTRC_OSC, LVP_OFF, WDT_OFF, MCLR_OFF
DEFINE OSC 8
OSCCON = %01110000 ' INTRC = 8MHz
OPTION_REG.6=1 'Trigger on rising edge
INTCON = %10010000 'Enable INTE
INTCON.1 = 0 'Clear RB0/INT External Interrupt Flag bit
On Interrupt Goto UpdateCounter
PORTB=0
Pause 500 ' Wait for startup
LOW PORTB.3
loop:
HIGH PORTB.4
Pause 2000 ' Wait 5 second
LOW PORTB.4
Pause 2000 ' Wait 5 second
Goto loop ' Do it forever
Disable
UpdateCounter:
LOW PORTB.4
HIGH PORTB.3
pause 2000
LOW PORTB.3
INTCON.1=0 're-enable interrupts
resume
ENABLE
GOTO loop
END
Bookmarks