pic 16f73
portb.0
is it possible to switch between rising and falling edges interupt. both within the same loop
loop:
if risingedge then mysub
if falling edge then mysub
goto loop
if i try
OPTION_REG.6 = 1 ' rising edge
INTCON.4 = 1 'enable int <--not sure if necessry
INTCON.1 = 0 ' reset the interruptflag
loop:
'OPTION_REG.6 = 1 'rising edge
'INTCON.1 = 0 ' reset the interruptflag
IF INTCON.1 = 1 THEN
INTCON.1 = 0 ' reset the interruptflag
gosub fire
endif
'OPTION_REG.6 = 0 ' falling edge
'INTCON.1 = 0 ' reset the interruptflag
IF INTCON.1 = 1 THEN
INTCON.1 = 0 ' reset the interruptflag
gosub fire
endif
goto loop
it wont work
Bookmarks