> Hi,
>
> I'm building a project with the 16F877 chip interfaced to a Hitachi type
> LCD. I have plenty of LCD screens to display (much more than 256
> chars) and so I want to implement them all at the top of the program
> memory.
>
> However when I do that I run in to table read errors, and my program
> crashes. I've read the Microchip app notes on implementing a safe table
> read in high memory, and used the method they say, but it still crashes!
> I just can't figure it out.
>
> The text table is at ORG 1800h and just has 4 RETLW instructions, to
> print out the letters A, B, C, D as a test. At the start of the
> troublesome routine I print a ">" to indicate I'm in the display_message
> routine, and a "<" at the end to show I'm finished. The program prints the
> ">" on the LCD and then crashes.
>
> Here's extracts of my code. Can anyone spot the bug?
>
> TABLE_ADDR EQU 0x1800
>
> ;-----------------------------------------------------------------------;
> ; display_welcome ;
> ;-----------------------------------------------------------------------;
>
> display_message
> movlw 0
> movf offset < What are you moving OFFSET to?, or is this
> a test of the register? Or did you mean MOVWF?
>
> movlw ">"
> call send_ascii
>
> movlw LOW TABLE
> addwf offset
> movlw HIGH TABLE
> btfsc status,c
> addlw 1
> movwf PCLATH
> movf offset,w
>
> call TABLE
> call send_ascii
>
> movlw "<"
> call send_ascii
>
> return
>
> ;-----------------------------------------------------------------------;
> ; Messages ;
> ;-----------------------------------------------------------------------;
>
> ORG TABLE_ADDR
>
> TABLE
> movwf PCL ; called with displacement in W
> retlw "A"
> retlw "B"
> retlw "C"
> retlw "D"
>
> Any help appreciated!
>
> Paul
>
> --
>
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
> use
EraseMElistservspam_OUT
TakeThisOuTmitvma.mit.edu?body=SET%20PICList%20DIGEST