Overview What kind of LCD Interfacing the LCD Displaying Text and Numbers Common Issues.

13

Transcript of Overview What kind of LCD Interfacing the LCD Displaying Text and Numbers Common Issues.

Overview•What kind of LCD

•Interfacing the LCD

•Displaying Text and Numbers

•Common Issues

HD44780 Character Display Driver

Takes in a parallel data stream and converts it to a character.

What kind of LCD???•Nokia and Motorola cell phones

•Fax machines and Printers

•Character or Graphic

•Hitachi HD44780

8 Bit Data Connection

2 Control Pins

8 Data Pins

4 Power Supply Pins

Interfacing the LCD

PIN

S

GN

D

1

Vcc

2C

on

tra

st

3

RS

4R

/W

5

E

6

D0

7D

1

8

D2

9D

3

10

D4

1

1D

5

12

D6

1

3D

7

14

ASCII characters(10 pins on chip)

Pow

er S

uppl

y

Con

trol

Pin

s

Dat

a P

ins

RS 0 for control codes1 for display characters

E 0 while sending cursor positioning code 1 while delivering

character

Control Lines• RS = Register Select

• E = Clock Input

• R/W = Ground (power supply line)

PIN

S

GN

D

1

Vcc

2C

on

tra

st

3

RS

4R

/W

5

E

6

D0

7D

1

8

D2

9D

3

10

D4

1

1D

5

12

D6

1

3D

7

14

ASCII characters(10 pins on chip)

Pow

er S

uppl

y

Con

trol

Pin

s

Dat

a P

ins

ExampleSend the letter V to the display and place it in the top center of a 2x8 character display.

PIN

S

GN

D

1

Vcc

2C

on

tra

st

3

RS

4R

/W

5

E

6

D0

7D

1

8

D2

9D

3

10

D4

1

1D

5

12

D6

1

3D

7

14

V

Cursor Position Codes

#$80 #$81 #$82 #$83 #$84 #$85 #$86 #$87 #$88

#$C0 #$C1 #$C2 #$C3 #$C4 #$C5 #$C6 #$C7 #$C8

Step 1 Drive RS pin low

Step 2 Send position code #$83

Step 3 Drive RS pin high

Step 4 Drive E pin high

Step 5 Load ASCII “V” in to the port

ASCII “V” = #$56 = 01010110

Step 6 Drive E pin lowTells display to accept byte

ExampleSend the letter V to the display and place it in the top center of a 2x8 character display.

PIN

S

GN

D

1

Vcc

2C

on

tra

st

3

RS

4R

/W

5

E

6

D0

7D

1

8

D2

9D

3

10

D4

1

1D

5

12

D6

1

3D

7

14

V

Con

trol

Pin

s

Dat

a P

ins

4 Bit Data Connection

2 Control Pins

4 Data Pins

4 Power Supply Pins

Interfacing the LCD

PIN

S

GN

D

1

Vcc

2C

on

tra

st

3

RS

4R

/W

5

E

6

D0

7D

1

8

D2

9D

3

10

D4

1

1D

5

12

D6

1

3D

7

14

ASCII characters(6 pins on chip)

Pow

er S

uppl

y

Con

trol

Pin

s

Dat

a P

ins

Step 1 Drive RS pin low

Step 2 Send position code #$83

Step 3 Drive RS pin high

Step 4 Drive E pin high

Step 5 Load high nibble in to the port

ASCII “V” = #$5 = 0101

Step 6 Drive E pin lowTells display to accept byte

Step 7 Drive E pin high

Step 7 Load low nibble in to the port

ASCII “V” = #$6 = 0110

Step 6 Drive E pin lowTells display to accept byte

ExampleP

INS

GN

D

1

Vcc

2C

on

tra

st

3

RS

4R

/W

5

E

6

D0

7D

1

8

D2

9D

3

10

D4

1

1D

5

12

D6

1

3D

7

14

V

Con

trol

Pin

s

Dat

a P

ins

Shift Registers• Save I/O pins on micro processor

• Requires more effort to stream out data

How do you display numbers???• What is the ASCII code for Decimal 75?

How do you display numbers???• What is the ASCII code for Decimal 75?

The Decimal value must be broken down in to single digits that represent the 100’s, 10’s and 1’s.

How do you display numbers???• What is the ASCII code for Decimal 75?

The Decimal value must be broken down in to single digits that represent the 100’s, 10’s and 1’s.

Binary Coded Decimal conversion