One thing that can cause garbage characters like that is when a 4-bit interface gets out of sync, and it gets the low nibble from the last byte with the high nibble of the next byte.
Sometimes you can toggle the E line once to get it back in sync, but to detect when to do that you need to have the R/W line connected to the PIC so you can see the busy flag. If it's not busy for 1.6mS after giving it a clear screen command ($FE,1) then it's probably out of sync.
With an 8-bit interface that error can't happen.
You can also re-initialize the LCD by clearing PBP's FLAGS system variable.
On the next LCDOUT statement it will start from scratch as if power was turned on.
Code:
FLAGS = 0
LCDOUT $FE,1
In some cases, an LCD cannot be reset from software. It takes a power down sequence.
If the LCD is powered from a PIC pin, you can cycle power to the LCD, then clear the FLAGS variable.
Bookmarks