You are on page 1of 13

Parallel Input/Output Ports Interfacing

Chapter 5

Objectives
Upon completion of this chapter, you will be able to:
Describe I/O ports interfacing to LEDs, Switches, 7-Segment Display, LCD and keyboard interfacing Apply the I/O system interfacing

I/O Ports

Example: PortB and TRISB Register

VCC

VCC

10K

10K

RB0
SPST Pushbutton Switch

RB0

SPST Toggle Switch

VCC

VCC

10K

10K

RB0 RB7
SPDT Pushbutton Switch SPDT Toggle Switch VCC

RB0 RB7
VCC

10K 10K

DPDT Pushbutton Switch DPDT Toggle Swtich

LCD Interfacing
Based on the HD44780 model There are in total of 14 pins

LCD Pin Descriptions


Function Ground Power supply Contrast Pin Number 1 2 3 4 5 Name Vss Vdd Vee RS R/W Logic State 0 0 0 1 1 Description 0V +5V 0 - Vdd D0 D7 are interpreted as commands D0 D7 are interpreted as data Write data (from controller to LCD) Read data (from LCD to controller) Access to LCD disabled Normal operating Data/commands are transferred to LCD Bit 0 LSB Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 MSB

Control of operating

6 7 8 9 Data / commands 10 11 12 13 14

E D0 D1 D2 D3 D4 D5 D6 D7

1 From 1 to 0 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1

LCD Screen
LCD screen consists of two lines with 16 characters each Every character consists of 5x8 or 5x11 dot matrix

LCD Connections

Model with backlights

Model without backlights

LCD Memory
LCD display contains three memory blocks:
DDRAM - Display Data RAM CGRAM - Character Generator RAM CGROM - Character Generator ROM

LCD Memory (contd)


CGROM memory contains default character map

LCD Operation
There are two ways to send characters to LCD:
Delay method Monitoring busy flag

Examples: Pp. 483, 484 & 486 (textbook)

End of Chapter 5

You might also like