Hi folks, I'm trying to read the chip registers, I build the project, then load it, then I press run, I get a message that the target program has changed from last build...? or I get this message: Unable to enter debug mode.
I'm trying to run this table program:
Code:
LIST p=16F88
include "P16F88.inc"
__config _CONFIG1, _WDT_OFF & _INTRC_IO & _MCLR_ON & _LVP_OFF
ERRORLEVEL 0, -302
TB0 equ 0x20
org 0x20
dt, h'0',h'1',h'2',h'3',h'4',
dt, h'5',h'6',h'7',h'8'
return
org 0X00
movlw 0x06
addwf PCL
call TB0
hang goto hang
end
I'm trying to get the table to return the 6th value using this program. Really, all I'm trying to do is understand how the table program works. Watching the three registers, I see a 6 in W, but nothing in PCL, and nothing in VALUE being returned.
Code:
LIST p=16F88
include "P16F88.inc"
__config _CONFIG1, _WDT_OFF & _INTRC_IO & _MCLR_ON & _LVP_OFF
ERRORLEVEL 0, -302
TB0 equ 0x20
value equ 0x30
org 0x00
goto main
org 0x20
dt, h'0',h'1',h'2',h'3',h'4',
dt, h'5',h'6',h'7',h'8'
return
main
movlw 0x06
call TB0
addwf PCL,f
movwf value
hang goto hang
end
I've modified your code so it works. I also changed the data in the table to make it more obvious that it does work:
Code:
LIST p=16F88
include "P16F88.inc"
__config _CONFIG1, _WDT_OFF & _INTRC_IO & _MCLR_ON & _LVP_OFF
ERRORLEVEL 0, -302
value equ 0x30
org 0x00
goto main
org 0x20
TB0 addwf PCL,f
dt h'40',h'41',h'42',h'43',h'44'
dt h'45',h'46',h'47',h'48'
main
movlw 0x6
call TB0
movwf value
hang
goto hang
end
Thanks Kchriste, I wasn't too far from being there, but it could have been as far as the moon since I didn't know if it was program, programmer or hardware, or me. As usual, it was me being very green and making all the mistakes.
Yes Boomslang, I did get the AD to work with Bill's help, and thanks a lot guys, you have been most helpful. Now with the table working, I'll be able to patch the whole program together... I hope. I suppose I could have kept working on it a little longer and get it to work eventually, but I have a lazy bone somewhere...
Hey, it's my first program, and the first time I program a PIC I suppose it's a little ambitious a project, but I have to say it does make quite an introduction since it incorportates nearly all the features of the 16F88, AD, tables, eprom r/w. Now I have to make all the tables to work together, and then it's the eprom. After that, I'll patch it all together and hopefully it'll do what I want it to do.
But I have to say it's not the first time I program, I have written some Fortran and some very basic Basic. And I have a good idea about what the movement of data entails. I downloaded Swordfish, I think it is a lot easier to program with Swordfish than with assembly, once the language is mastered. But I like assembly, it's very simple, and I can do what I want with it.