Using connection mode 1:
This approach uses a single connectivity line that supports a combined data and clock signal between the microcontroller and the LCD display. This approach is used when the LCD is connected through a shift register 74HC595, as detailed at here. This connection method is also called a 1-wire connection.
This solution approach recognises the original work provided in the Elektor Magazine.
Relevant Constants:
Specific constants are used to control settings for the Liquid Crystal Display routines included with GCBASIC. To set these constants the main program should specific constants to support the connection mode using #define.
When using connection mode 1, only two constants must be set - all others are optional or can be ignored.
How to connect and control the LCD background led: see LCDBacklight.
| Constant Name | Controls | Default Value |
|---|---|---|
|
|
The I/O mode. |
|
|
|
The clock/data pin used in 1-bit mode. |
Mandated |
LCD.h supports in 1-wire mode the control of pin 4 of the 74HC595 for the background led.
Example:
#chip mega8, 8
' Connection mode 1: a single combined clock/data line drives a 74HC595
' shift register, which in turn drives the LCD. LCDBacklight controls
' pin 4 of the 74HC595 in this mode.
#define LCD_IO 1
#define LCD_CD PORTD.1
#define LCD_NO_RW
LCDBacklight On
CLS
Print "GCBASIC"
Locate 1,0
Print " Hello World." ' <<< the print instruction this page documentsKey line: Print " Hello World." — writes to the second LCD line after Locate 1,0; both Print calls are shifted out over the single LCD_CD line to the 74HC595, one bit at a time, with no other wiring involved.
See further code examples at 0, 1 and 2 Wire LCD Solutions.
See the separate sections of the Help file for the specifics of each Connection Mode.
See Also:
- LCD_IO 0 — single subroutine, software-driven mode
- LCD_IO 2 — 2-wire shift register, deprecated
- LCD_IO 2_74xx164 — 2-wire via 74HC164/74LS164, the preferred 2-wire method
- LCD_IO 2_74xx174 — 2-wire via 74LS174, deprecated
- LCD_IO 3 — 3-wire shift register with an added Enable line
- LCD_IO 4 — 4-bit parallel connection
- LCD_IO 8 — 8-bit parallel connection
- LCD_IO 10 — I2C via a PCF8574/PCF8574A I/O expander
- LCD_IO 12 — I2C via a Ywmjkdz-layout adapter
- LCD_IO 14 — SPI expander
- LCD_IO 16 — PIC16LF72 SPI expander
- LCD_IO 107 — K107 serial adapter

