According to the Hitachi HD44780 Datasheet, RS should be set (high) before sending data commands and cleared (low) before sending instruction commands.
Since PBP has only a single instruction for parallel LCDs (LCDOUT), the compiler has to have a way to tell the difference between instruction commands and data commands.
My interpretation is that the $FE is a flag (i.e., instruction prefix) to tell the software that the next byte will be an instruction and therefore the software should clear the RS line before sending the next byte, otherswise the software should keep RS high when sending the next byte. ($FE is not sent to the LCD).
LCDOUT $FE,2 ; sends b0000010 to the LCD with RS low.
LCDOUT 2 ; sends b00000010 to the LCD with RS high.
If I had to guess as to why $FE, it probably comes from the serial "backpack" people that first made serial interfaces to parallel lcds. See any of the datasheets for serial LCDs at www.seetron.com for an example of this (they use $FE as an instruction prefix).
Further, $FE also is not defined by the HD44780 datasheet - a good choice for a flag.
(Lastly, make sure your LCD is based around HD44780 driver or compatible or else you might find other surprises.)
Paul Borgmeier
Salt Lake City, Utah
USA




Bookmarks