Thanks Darrel. I tried this:
asm
INT_LIST macro
INT_Handler RBC_INT, _Change, PBP, yes
endm
INT_CREATE
endasm
@ INT_ENABLE RBC_INT
Oscloop:
high portd.1
pauseus ontime
low portd.1
pauseus offtime
goto oscloop
Change:
portd.0=1
if portb.4=1 and ontime<1000 then ontime=ontime+1
if portb.5=1 and ontime>10 then ontime=ontime-1
if portb.6=1 and offtime<10000 then offtime=offtime+10
if portb.7=1 and offtime>1210 then offtime=offtime-10
@ INT_RETURN
The above works well. The thing is, with the original program, I was triggering the int with a rising edge on portb.0 then sending the necessary change bit over portc.0-3. The timing was generous, portb.0=1 for 100ms (not that this matters as it should have been a rising edge trigger anyway) then which ever ever portc was active was held high for 100ms as well. The timing was verified with a scope, as was entrance into the change routine by the ISR. Why did that not work?
Thanks again!




Bookmarks