what's wrong with this interrupt
the prog. below is a simple interrupt enables RB7 to RB4 ports to work as external interrupt, i used one of them to view numbers countes from 0 to 5 and display it on serial LCD and return to a main prog. to view a message, but the problem when i enter intterupt i can not get out from it, i did the same prgo to RB0 and gave me good result, but with RB7-RB4 is not
trisa=%00000
trisb=%11111111
option_reg=%10000000
intcon = %10001000
I var byte
on interrupt goto int
main:
serout porta.0,2,[254,1]
pause 10
serout porta.0,2,["Hello"]
pause 100
goto main
disable interrupt
int:
for i=0 to 5
serout porta.0,2,[254,1]
pause 10
serout porta.0,2,[#i]
pause 1000
next i
INTCON.0=0
resume
enable interrupt
end
Other method ?????????????????????
Quote:
Originally Posted by micro
i solved the problem with another method as below
if portb<>0 then intcon=%10001000
Just a longer way to read PORTB ... no other method here !!!
Elegant solution would have been to display the port where the interrupt came from, in the "serout"
Alain