ENABLE causes PBP to continue inserting interrupt test code. If you jump out
of the ISR routine with GOSUB TXT2PDU, and this sub routine has interrupt
test code in it, then it's going to jump directly back to your ISR sub-routine.
Example. In your ISR interrupt routine you have ENABLE at the end which is
causing PBP to insert interrupt test code in your lower sub-routine TXT2PDU.
Once you land on the first GOSUB TXT2PDU statement, you land right on
code inside your TXT2PDU routine that's re-directing you right back to the
beginning of ISR.
' == last part of ISR routine ==
INTCON.1 = 0 ' Clear interrupt flag
Resume ' Return to main program "with RETFIE"
' Enable '<=== CONTINUES PLACING INTERRUPT TEST CODE AFTER HERE
Remove the ENABLE from the last line of routine ISR (like shown above), and
drop it at the bottom of your TXT2PDU sub-routine like this;
TXT2PDU:
for x=1 to 7
tmp(x) = string1(x) << (8-x)
next x
ch(0)=string1(0)
pdu(0)=tmp(1) + ch(0)
for x=1 to 6
ch(x)=string1(x) >> x
pdu(x)=tmp(x+1) + ch(x)
next x
for x=0 to 6
hserout [hex2 pdu(x)]
next x
RETURN ' return from each GOSUB
Enable ' Re-enable auto inserrtion of interrupt checking code beyond here
Bookmarks