LCD Overview

Introduction:

The LCD routines in this section allow Great Cow BASIC programs to control an alphanumeric Liquid Crystal Displays based on the HD44780 IC. This covers most 16 x 1, 16 x 2, 20 x 4 and 40 x 4 LCD displays.

These methods allow the displays to be connected to the microcontroller in many different ways:

Connection Mode Required Connections

0

No configuration is required directly by this method. The LCD routines must be provided with other subroutines which will handle the communication. This is useful for communicating with LCDs connected through RS232 or I2C.
This is an advanced method of driving an LCD.

1

Uses a combined data and clock line. This mode is used when the LCD is connected through a shift register 74HC595, as detailed at here.
This method of driving an LCD requires an additional integrated circuit and other passive components. This is not recommended for the beginner.

2

Uses separated Data and Clock lines. This mode is used when the LCD is connected through a 74LS174 shift register IC, as detailed at here
This method of driving an LCD requires additional integrated circuits and other passive components. This is not recommended for the beginner.

4

R/W, RS, Enable and the highest 4 data lines (DB4 through DB7) are connected to the microcontroller. The use of the R/W line is optional.
This a common method to connect a microcontroller to an LCD. This requires 7(6) data ports on the microcontroller.

8

R/W, RS, Enable and all 8 data lines. The data lines must all be connected to the same I/O port, in sequential order. For example, DB0 to PORTB.0, DB1 to PORTB.1 and so on, with`DB7` going to PORTB.7.
This is a common method to connect a microcontroller to a LCD. This requires 11(10) data ports on the microcontroller.

10

The LCD is controlled via I2C. A type 10 LCD 12C adapter. Set LCD_10 to 10 for the YwRobot LCD1602 IIC V1 or the Sainsmart LCD_PIC I2C adapter
This is a common method and requires two data ports on the microcontroller.

12

The LCD is controlled via I2C. A type 12 LCD 12C adapter. Set LCD_10 to `12`for the Ywmjkdz I2C adapter with a potentiometer (variable resistance) bent over top of chip.
This is a common method and requires two data ports on the microcontroller.





The support of the types of LCD displays is shown in the following table.

Connection Mode Supported LCD Types:
number of characters x number of lines

0,1,2,4,8,10 and 12

16 x 1, 16 x 2, 20 x 2, 20 x 4 type LCD displays,
also known as 1601, 1602, 2002, 2004 type LCD displays.

4

40 x 4 LCD displays,
also known as 4004 type LCD displays.





See the separate sections of the Help file for the specifics of each Connection Mode.

For more help, see LCD_IO 0, LCD_IO 1, LCD_IO 2, LCD_IO_2 74xx164, LCD_IO_2 74xx174, LCD_IO 4, LCD_IO 8, LCD_IO 10 or LCD_IO 12