Hi All,
I'm working on a program for the PIC12F1840. As part of my ISR, I am adjusting a target value that is then later compared with the A/D. I've narrowed it down to my target adjustment subroutine using traps (execution goes in, but it never comes out!). I'd appreciate any help you can offer. Stepping through the code manually in MPLAB X works fine.
AD_switch ;Change target value ; TODO: FIX THIS! CALLS GO IN, BUT THEY NEVER COME OUT!!!
movf jump,w
call output_table
movwf target ;load value from output table into target for A/D
incf jump,f
return
output_table ; TODO: NEVER LEAVES HERE ALIVE?
addwf PCL,f
outputs dt 0xDB,0x1F,0x3F,0x5E,0x7D,0x9C,0xBC,0xDB,0xFA ;retlw with value ; GETTING STUCK HERE?
clrf jump ;reset counter if gone past last value
clrw ; also need to do this as we are using w for PCL jump
goto output_table ;and try again
Thanks