oLCD Object

Back to top of page Description:
 

A Hardware Object that outputs characters to any LCD module which uses the 44780 chip set.

 The following table lists the size and availability of the oLCD Object.
 ObjectSizeDescriptionA1A2B1B2C1
oLCD6 BytesControls a LCD Display.xxx
Back to top of page Operation:
 When the oLCD Object's Value property is set to the ASCII value of a character, that character is sent out the I/O Lines specified by the IOGroup, IOLineE, and IOLineRS properties in such a way that an LCD module using a 44780 chip set will display the character.

Setting the VString property to a string of characters will sequentially send each character in the string to the LCD module.

Invoking the Locate method will cause the LCD's cursor to be positioned on the LCD's screen at the specified X-Y coordinates.  Invoking the Clear method will cause the LCD module to clear its screen of any characters.

The DIO property is an instance of the oDIO8F object which is created when the oLCD object is.  The oLCD object configures the oDIO8F object in such a way that it will provide the proper I/O control of the 44780 LCD Chip.  Changing attributes of the oDIO8F may change the way the LCD behaves to something different than the way described in this document.  (see oDIO8F object for more detail on how the oDIO8F Object sends data to the LCD)

Back to top of page Properties:

The following table lists the properties of the oLCD Object:

Property

Description

Value
A value who's binary data is sent to the Display.
Object Class: oByte Value Range: 0 - 255
Data Type: Numeric Default Value: 0

Used to send the value of any ASCII or control character to the LCD.

VString
A string version of the Value property.
Object Class: oProperty
Data Type: Numeric
IOGroup
A value that specifies which pack of 8 or 4 I/O lines is connected to the LCD's Data lines.
Object Class: oIOGroup Value Range: 0 - 3
Data Type: Numeric Default Value: 0
IOGroupNibbleDescription
00

The instance of the oLCD Object is inactive.

01

The instance of the oLCD Object is inactive.

10

The oLCD Object uses pins 8 - 11 for its data I/O.

11

The oLCD Object uses pins 12 - 15 for its data I/O.

20

The oLCD Object uses pins 16 - 19 for its data I/O.

21

The oLCD Object uses pins 20 - 23 for its data I/O.

30

The oLCD Object uses pins 24 - 27 for its data I/O.

31

The oLCD Object uses pins 28 - 31 for its data I/O.

Some I/O Lines have special purposes.  Be sure to see oIOGroup for details.
Nibble
A value that selects which half of the I/O Group to use when in 4-bit mode.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
NibbleConstantDescription
0cvLow

The oLCD Object uses the lower 4 bits of the specified IOGroup

1cvHigh

The oLCD Object uses the upper 4 bits of the specified IOGroup

IOLineE
A value that specifies which I/O Line is connected to the LCD's Data Strobe Line.
Object Class: oIOLine Value Range: 0 - 31
Data Type: Numeric Default Value: 0
Some I/O Lines have special purposes.  Be sure to see oIOLine help file for details.
IOLineRS
A value that specifies which I/O Line is connected to the Register Select Line.
Object Class: oIOLine Value Range: 0 - 31
Data Type: Numeric Default Value: 0
Some I/O Lines have special purposes.  Be sure to see oIOLine help file for details.
RS
A value that selects which register set of the LCD Display to write data to.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
Controls the output state of the I/O Line specified by the IOLineRS property.
NibbleConstantDescription
0cvLowThe I/O line specified by the IOLineRS property is set to logical low (0 Volts).
1cvHighThe I/O line specified by the IOLineRS property is set to logical high (5 Volts).
Operate
A value that selects if new data is sent to the display or not.
Object Class: oOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
OperateConstantDescription
0cvOffNew data is not sent to the display.
1cvOnNew data is sent to the display.
DIO
The I/O function object used to control the LCD.
Object Class: oDIO8F Value Range: 0 - 255
Data Type: Numeric Default Value: 0
When the oLCD object is created, it configures its oDIO8F Object to do two 4-bit transfers when new data is written with the following assignment:

Attributes of the LCD's operation can be adjusted by directly manipulating the oDIO8F object, but note that doing so may change the way the LCD behaves to something different than the way described in this document.

Address
Returns a pointer to the address of the oCounter Object instance.
Object Class: oAddress Value Range: 0 - 127
Data Type:Pointer (Read Only) Default Value: Address of Object

Back to top of page Methods:
MethodsDescription
Clear

Clears the LCD screen.

Locate

Sets the cursor to the specified location.
The Locate command uses two arguments; Row & Column, both of which are 0 based. 
Example: X.Locate(0,1) ' will locate cursor at 1st row, 2nd column.
Example: X.Locate(1,9) ' will locate cursor at 2nd row, 10th column.

Back to top of page Examples:
 In the following example, the oLCD Object is used to display the phrase "Hello World" on a LCD module that uses the 44780 chip set.
Visual Basic SyntaxC and Java Syntax
' Uses the oLCD Object to print
' "Hello There" on an LCD.

Dim LCD As New oLCD

Sub Main() 
  LCD.IOLineRS = 26
  LCD.IOLineE = 27
  LCD.IOGroup = 3
  LCD.Nibble = 1
  LCD.Operate = 1
  LCD.Init
  LCD.Clear
  LCD.Locate(1,2)
  LCD.VString = "Hello World"
End Sub
// Uses the oLCD Object to print
// "Hello There" on an LCD.

oLCD LCD = New oLCD;

Void Main(Void){
  LCD.IOLineRS = 26;
  LCD.IOLineE = 27;
  LCD.IOGroup = 3;
  LCD.Nibble = 1;
  LCD.Operate = 1;
  LCD.Init;
  LCD.Clear;
  LCD.Locate(1,2);
  LCD.VString = "Hello World";
}
Basic Syntax
' Uses the oLCD Object to print
' "Hello There" on an LCD.

LCD As oLCD(3,1,27,26,cvOn)

LCD.Init		
LCD.Clear		
LCD.Locate(1,2) ' Locate cursor at 2nd row, 3rd column.
LCD.VString = "Hello World"
Back to top of page Connections:
The oLCD uses 6 I/O lines.  The 6 I/O lines are divided into one group of 4 consecutive data lines and two independent control lines.  The 4 consecutive data lines can be in IOGroup 1, 2, or 3 on either the upper or lower 4 bits.  The two independent control lines can be on any unused I/O line.
LCD Module Connections Where:
IOLineRS = 26
IOLineE = 27
IOGroup = 3
Nibble = 1

PinNameDescriptionI/O LineI/O Group
123
LHLHLH
P1GndPower GroundGnd      
P2PowerPower 5 Volts5 Volts      
P3  Gnd      
P4RSRegister Select1 - 31      
P5  Gnd      
P6EEnable/Strobe1 - 31      
P7D0Data 0Gnd      
P8D1Data 1Gnd      
P9D2Data 2Gnd      
P10D3Data 3Gnd      
P11D4Data 4 81216202428
P12D5Data 5 91317212529
P13D6Data 6 101418222630
P14D7Data 7 111519232731

Back to top of page Related Items:

 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oLCDSEControls a Scott Edwards Serial LCD Display.xxx
oVideoICControls an Intuitive Circuits On-Screen Display Character Overlay board.xxx
o7SegControls a 7-Segment Display.x
o7Seg2Controls a Dual 7-Segment Display.x
Back to top of page Version History and Bug List:
 Firmware Ver B1: Introduced.

Bugs:
Compiler Ver 5: Programs with numerous objects cause the data written to the LCD to be scrambled.  (Fixed in compiler Ver 6.00.)


ooPIC Compiler Ver 6.0 (c) Copyright 1997 - 2007 Savage Innovations, LLC.