Somehow, the RESUME got moved inside the IF statement.
The only way it will resume is if PORTB.6 changes.
Otherwise it falls off into never never land.
<br>
Somehow, the RESUME got moved inside the IF statement.
The only way it will resume is if PORTB.6 changes.
Otherwise it falls off into never never land.
<br>
DT
Ok Darrel i´ve found the error.
I changed the program like this and it´s working perfect.
DISABLE
myint:
RBCpins = PORTB
INTCON.0 = 0
if rbcpins.7 <> Lastpins.7 then
dpo1 = 0
for lp = 0 to 20
pause 1
next lp
dpo2 = 0
for lp = 0 to 40
pause 1
next lp
dpo1 = 1
dpo2 = dpo1
endif
if rbcpins.6 <> lastpins.6 then
dpo2 = 0
for lp = 0 to 20
pause 1
next lp
dpo1 = 0
for lp = 0 to 40
pause 1
next lp
dpo2 = 1
dpo1 = dpo2
endif
RESUME
ENABLE
Maybe the error comes from the subroutine. I include the subroutine directly and it works fine.
Thanks a lot Darrel
PS: How you insert a code in a window like you posted it before ?
Using [code][/code] tags puts it in a window.
At the bottom of the page, there's a box that says "Posting Rules". Inside that there's a link to vB code. Check it out. You can do all kinds of formatting.
hth,
DT
Darrel and ON INTERRUPT in the same thread ???
![]()
![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Well, I figure you can't appreciate "Instant Interrupts" until you've had to deal with ON INTERRUPT a few times.
Got to get them started.
<br>
DT
I wish Melabs would be willing to replace ON INTERRUPT with DT-INT... man you have to talk to them
Another compiler use something around that... you know which one![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
is it possible to use a momentary switch (operating on 5v) as a digital input? so I can use interrupts.
Bookmarks