I was trying to do a simple computed goto, where it was something like:
But when it adds 0x3 to the PCL, it goes bogus. Anyone know what the problem may be? I have screenshots attached which show a trace.
Update:
I found this somewhere, but it still doesn't seem to work. Instead of adding 0x3 it will add 0x6. The whole adding thing, even if I try to add 0x0, will make it flip out.
Rich (BB code):
movlw 0x3
call hex_to_7seg
...
hex_to_7seg:
addwf PCL
retlw xx
retlw xx
retlw xx
retlw xx
etc..
Update:
I found this somewhere, but it still doesn't seem to work. Instead of adding 0x3 it will add 0x6. The whole adding thing, even if I try to add 0x0, will make it flip out.
3) Look for instruction that modifies PCL like ADDWF PCL, W. Since 18 series address are WORD aligned, you need to add 2 lines before that instruction. CLRF STATUS, C and RLCF WREG, F.
Attachments
-
28.8 KB Views: 22
-
30 KB Views: 21
-
42 KB Views: 28
-
40.5 KB Views: 19
Last edited: