Digi BL1800 user manual R/W pin and DB0-DB3 on

Models: BL1800

1 94
Download 94 pages 15.6 Kb
Page 49
Image 49

Before running the LCD_DEMO.C sample program, you will need an LCD based on the HD44780 (or an equivalent) controller.

LCD_DEMO.C—demonstrates a 4-bit interface to an LCD based on the HD44780 (or an equivalent) controller.

Connect the LCD to Parallel Port A.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PA0—LCD DB4

 

Jackrabbit

 

Optional Brightness

 

 

 

+5 V

VCC LCD

 

 

Prototyping Board

 

 

 

 

 

Control

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VEE

 

PA1—LCD DB5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VEE

 

 

 

 

 

 

 

 

 

 

 

10 kW

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PA2—LCD DB6

 

J3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PA3—LCD DB7

 

 

 

 

 

 

 

 

-5 V

 

 

 

 

 

 

 

 

 

 

 

 

PA0

 

 

 

 

 

 

 

DB4

 

PA6—LCD RS Register Select

 

3

4

PA1

 

 

 

 

 

 

 

DB5

 

 

 

 

PA2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DB6

 

 

 

 

PA3

 

 

 

 

 

 

 

 

(0 = command, 1 = data)

 

5

6

 

 

 

 

 

 

 

DB7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PA6

 

 

 

 

 

 

 

 

 

PA7—LCD E:normally low, latches

 

 

 

 

 

 

 

 

 

 

RS

 

 

 

10

PA7

 

 

 

 

 

 

 

 

 

9

 

 

 

 

 

 

 

E

 

on high to low transition

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DB0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DB1

 

The R/W pin and DB0–DB3 on

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DB2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DB3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R/W

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

the LCD are grounded. DB0–DB3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

are not used with a 4-bit interface.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This sample program only involves writing, and that is why we ground the R/W pin. VEE is used to control brightness—the simplest thing to do is ground it. If you need to control the brightness, you can connect a potentiometer between ground and -5 V, with the arm going to the VEE pin. Check the specs on the LCD before doing this as some LCDs may require a different connection. VCC is +5 V and VSS is ground.

User’s Manual

45

Page 49
Image 49
Digi BL1800 user manual R/W pin and DB0-DB3 on