9600 Baud LCD interface

The usual PICAXE interface to a serial LCD display is at 2400 baud, using any available output pin. It's possible to use the more common 9600 baud interfaces from a PICAXE 18A (and probably other chips that support setfreq). Using setfreq m8 provides 9600 baud output from the sertxd command. It should be obvious that this only works if you are not using serial out for another purpose and if changing the clock frequency does not affect other functions being used (pause, etc).

My design uses the LCD117 chip ($5US) from Peter Anderson and the original K107 PC board ($4US) from Brian Riley, with a 2x24 backlit LCD ($4US) from All Electronics.

The LCD117 page has the full command set for the driver. You can set the display format (2x24, 4x20, etc), define a custom startup message of up to 4 lines of 20 characters, etc.

The code for talking the controller at 9600 baud is simple:

For a single command:

setfreq m8		'to get 9600 baud for LCD serial input
sertxd("?f")		'clear LCD screen
setfreq m4		'normal speed for other operations

For multiple commands:
setfreq m8
'Set cursor to line 0, position 10, display value in variable Counter,
'add a ":", display value in register b0, tab to the next position -
'writing a value to a specific screen location each time it's updated
setfreq m4

If you need to keep the PICAXE clock frequency constant, the newest version of the K107 board has an option to use the LCD108 chip from Peter Anderson to provide a 2400 baud interface.

Home Page | Projects Page

Copyright © 2006 John E. Carter
Last update .