LCD_IO 4

Using connection mode 4:

To use connection mode 4 the R/W, RS, Enable control lines and the highest 4 data lines (DB4 through DB7) must be connected to the microcontroller.

Relevant Constants:

Specific constants are used to control settings for the Liquid Crystal Display routines included with Great Cow BASIC. To set these constants the main program should specific constants to support the connection mode using #define. Constants required for connection mode 4.

Constants are required for 4-bit mode as follows.

Constant Name Controls Default Value

LCD_SPEED

FAST, MEDIUM or SLOW.

MEDIUM

LCD_IO

Must be 4

4

LCD_RS

Specifies the output pin that is connected to Register Select on the LCD.

Must be defined

LCD_RW

Specifies the output pin that is connected to Read/Write on the LCD. The R/W pin can be disabled*.

Must be defined (unless R/W is disabled)

LCD_Enable

Specifies the output pin that is connected to Read/Write on the LCD.

Must be defined

LCD_DB4

Output pin used to interface with bit 4 of the LCD data bus

Must be defined

LCD_DB5

Output pin used to interface with bit 5 of the LCD data bus

Must be defined

LCD_DB6

Output pin used to interface with bit 6 of the LCD data bus

Must be defined

LCD_DB7

Output pin used to interface with bit 7 of the LCD data bus

Must be defined

The R/W pin can be disabled by setting the LCD_NO_RW constant. If this is done, there is no need for the R/W to be connected to the chip, and no need for the LCD_RW constant to be set. Ensure that the R/W line on the LCD is connected to ground if not used.

For a code example download Four Wire LCD Example.

Also see for further code examples see Four Wire LCD Solutions.

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 8, LCD_IO 10 or LCD_IO 12