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.
| | Object | Size | Description | A1 | A2 | B1 | B2 | C1 |
 | oLCD | 6 Bytes | Controls a LCD Display. | x | x | x |
|
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) |
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. |
|
|
|
| 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 |
|
| IOGroup | Nibble | Description |
| 0 | 0 | The instance of the oLCD Object is inactive. |
| 0 | 1 | The instance of the oLCD Object is inactive. |
| 1 | 0 | The oLCD Object uses pins 8 - 11 for its data I/O. |
| 1 | 1 | The oLCD Object uses pins 12 - 15 for its data I/O. |
| 2 | 0 | The oLCD Object uses pins 16 - 19 for its data I/O. |
| 2 | 1 | The oLCD Object uses pins 20 - 23 for its data I/O. |
| 3 | 0 | The oLCD Object uses pins 24 - 27 for its data I/O. |
| 3 | 1 | 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 |
|
| Nibble | Constant | Description |
| 0 | cvLow | The oLCD Object uses the lower 4 bits of the specified IOGroup |
| 1 | cvHigh | 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. |
| Nibble | Constant | Description |
| 0 | cvLow | The I/O line specified by the IOLineRS property is set to logical low (0 Volts). |
| 1 | cvHigh | The 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 |
|
| Operate | Constant | Description |
| 0 | cvOff | New data is not sent to the display. |
| 1 | cvOn | New 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 |
|
|
|
Methods: |
|
| Methods | Description |
| 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. |
|
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 Syntax | C 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" |
|
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 |
 |
| Pin | Name | Description | I/O Line | I/O Group |
| 1 | 2 | 3 |
| L | H | L | H | L | H |
| P1 | Gnd | Power Ground | Gnd | | | | | | |
| P2 | Power | Power 5 Volts | 5 Volts | | | | | | |
| P3 | | | Gnd | | | | | | |
| P4 | RS | Register Select | 1 - 31 | | | | | | |
| P5 | | | Gnd | | | | | | |
| P6 | E | Enable/Strobe | 1 - 31 | | | | | | |
| P7 | D0 | Data 0 | Gnd | | | | | | |
| P8 | D1 | Data 1 | Gnd | | | | | | |
| P9 | D2 | Data 2 | Gnd | | | | | | |
| P10 | D3 | Data 3 | Gnd | | | | | | |
| P11 | D4 | Data 4 | | 8 | 12 | 16 | 20 | 24 | 28 |
| P12 | D5 | Data 5 | | 9 | 13 | 17 | 21 | 25 | 29 |
| P13 | D6 | Data 6 | | 10 | 14 | 18 | 22 | 26 | 30 |
| P14 | D7 | Data 7 | | 11 | 15 | 19 | 23 | 27 | 31 |
|
|
Related Items:
|
| | The following table lists objects with related functions
| | Object | Description | A1 | A2 | B1 | B2 | C1 |
 | oLCDSE | Controls a Scott Edwards Serial LCD Display. | x | x | x |
 | oVideoIC | Controls an Intuitive Circuits On-Screen Display Character Overlay board. | x | x | x |
 | o7Seg | Controls a 7-Segment Display. | x |
 | o7Seg2 | Controls a Dual 7-Segment Display. | x |
|
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.) |