
Originally Posted by
BigWumpus
DW is not working for PIC16F.... it places a WORD packed in 2 BYTEs with a RETLW added
I think you've got it backwards.
This is DW data compiled for a 16F877. It places each 14-bit word value in successive program word locations, which can then be read with READCODE.
Code:
0286 00490 DataTable
0286 1234 2178 0001 00491 DW 1234h, 2178h, 0001h, 0781H
0781
This is the same data used in a LOOKUP2 statement.
Code:
00516 LU2RET?C 01234h
0301 3434 M retlw low (01234h)
0302 3412 M retlw high (01234h)
0303 3400 M retlw 0
00517 LU2RET?C 02178h
0304 3478 M retlw low (02178h)
0305 3421 M retlw high (02178h)
0306 3400 M retlw 0
00518 LU2RET?C 001h
0307 3401 M retlw low (001h)
0308 3400 M retlw high (001h)
0309 3400 M retlw 0
00519 LU2RET?C 00781h
030A 3481 M retlw low (00781h)
030B 3407 M retlw high (00781h)
030C 3400 M retlw 0
It's the LOOKUP2 that puts the retlw's in there.
As for the examples above. I have run the code. It works.
You didn't include the ReadWord subroutine with your code so I can't tell how yours is tryng to read the NTC table.
<br>
Bookmarks