LCD117 Custom Screen


The LCD117 serial LCD driver chip ($5US) from Peter Anderson has the ability to store a custom screen. This screen can be used as the LCD startup screen or can be displayed by a command.

However, the chip's memory is designed for a display with 4 lines of 20 characters each. The display I use with the LCD117 has 2 lines of 24 characters each. After a brief email exchange with Peter, I came up with the following way to store a custom screen for the 2x24 display. See this page for details on using a PICAXE to control a 9600 baud LCD driver.

setfreq m8	'to get 9600 baud for LCD serial input
sertxd("?G420")	'define display as 4x20
pause 500		'wait for chip to configure
'ruler     12345678901234567890	'only works in fixed format text
sertxd("?C0xxxxxxxxxxxxxxxxxxxx")	'20 characters of line 0
pause 200		'wait for chip to write data
sertxd("?C1xxxxxxxxxxxxxxxxxxxx")	'20 characters of line 1
pause 200
sertxd("?C2xxxx")	'last 4 characters of line 0
pause 200
sertxd("?C3xxxx")	'last 4 characters of line 1
pause 200
sertxd("?G224")	'define display as 2x24
pause 500		'wait for chip to configure
setfreq m4		'normal speed for other operations

Because of the 4x20 design of the LCD117 driver, the cursor location commands don't understand lines with more than 20 characters (even when the configuration is set to match the display). Cursor commands with an X value greater than 19 are interpreted as "no change". To get to the last 4 characters of a line, you must write the characters in a block, starting in the 20th character position (cursor command ?x19).
setfreq m8
'put an "x" in the last *addressable* position of line 1 (positions are 0-19)
' then the rest of the text is displayed in the last 4 columns
sertxd("?y1?x19x1234")
setfreq m4
 

Note that smaller displays (less than 20 characters/line) should not be affected by the above anomalies.


Home Page | Projects Page

Copyright © 2006 John E. Carter
Last update .