Connecting the LCD02 to the BS2 using Serial Mode 

Introduction
This example shows how to connect the LCD02 module to the Basic Stamp BS2. The LCD02 is used in serial mode. Serial mode is selected by placing the link on the 2 pin header on the LCD02 module. This is the factory default setting. The BS2 internal 5v regulator is not suitable for the LCD02. I therefore recommend you use a separate 5v regulator. The LED backlight on the LCD02 requires around 270mA.

Circuit Schematic for connecting the BS2 Stamp to the LCD02 Display Module


Software for BS2, BS2e, BS2sx and BS2p

Although the photo shows the BS2, this code has also been checked on the BS2e and with the correct BAUD setting, the BS2sx and BS2p
It can be downloaded here

'{$STAMP BS2}

'***********************************************************
'**                                                       **
'**          Routines for the Basic Stamp BS2             **
'**        Controlling LCD02 Serial LCD Display           **
'**                                                       **
'**          Copyright 2004 - Devantech Ltd               **
'**    Commercial use of this software is prohibited      **
'**    Private and educational use only is permitted      **
'**                                                       **
'**       Written by Gerald Coe - April 2004              **
'**                                                       **
'***********************************************************

Key1    VAR  Byte
Key2    VAR  Byte

Tx      CON  9       ' To Rx on LCD
Rx      CON  8       ' To Tx on LCD
CLRSCRN CON 12       ' Clear Screen
CUROFF  CON  4       ' Hide Cursor
SETCUR  CON  2       ' set cursor position
GETKEYS CON 16       ' Serial mode, Get Keys Command
BAUD    CON 84       ' BS2 & BS2e - 9600 - see parallax documentation
'BAUD CON 240        ' BS2sx & BS2p - 9600 - see parallax documentation

Main:
PAUSE 500            ' Wait for the display to go through its power up routine
  SEROUT Tx, BAUD, [CLRSCRN, CUROFF, " LCD02 - BS2 Serial Demonstration "]

MainLoop:
  SEROUT Tx, BAUD, [GETKEYS]
  SERIN Rx, BAUD, [Key1, Key2]
  SEROUT Tx, BAUD, [SETCUR, 61,"Keypad ", BIN4 key2, BIN8 key1]
  GOTO MainLoop      ' Loop forever
 

You can find LCD02 Documentation Here