You are on page 1of 13

4

MICROCONTROLLERBOARD {AlphanumericLCDandKeypad}
MohamadFauziZakaria http://fkee.uthm.edu.my/mfauzi

Contents
2

HardwareSetupforHitachiHD44780LCDcontroller. TimingDiagram Ti i Di CommandSet DDRAMAddress CharacterPattern h LCDProgramming g g FunctionLibraryforXLCD

Schematic
3

mfauzi

3 January, 2011

TimingDiagram Timing Diagram


4

CommandSet{1} Command Set {1}


5

CommandSet{2} Command Set {2}


6

CommandSet{3} Command Set {3}


7

DDRAMADDRESS DDRAM ADDRESS


8

CharacterPattern{1} Character Pattern {1}


9

CharacterPattern{2} Character Pattern {2}


10

CharacterPattern{3} Character Pattern {3}


11

LCD LCD Programming


12

LCDSubroutine LCD Subroutine Driver


13

LCDSubroutine LCD Subroutine Setup


14

Application MainFunction Application Main Function


15

FunctionLibraryforXLCD Function Library for XLCD


16

Macrosfor SelectingLCDPinAssignments
17

18

Macros for Selecting Selecting4or8bitMode

XLCDDelayFunctions XLCD Delay Functions


19

TheXLCDlibrariesalsorequirethatthefollowingfunctionsbe definedbytheusertoprovidetheappropriatedelays: defined by the user to provide the appropriate delays:

ExampleofUse xlcd.h {1} Example of Use xlcd h{1}


20

ExampleofUse xlcd.h {2} Example of Use xlcd h{2}


21

ExampleofUse xlcd.h {3} Example of Use xlcd h{3}


22

Keypad
23

A keypad is simply an array of push buttons connected in rows and columns columns. Two processes of keypad programming:
1.

2.

key k press d t ti detection 1. Interrupt method 2. Scanning method key identification. y

mfauzi

3 January, 2011

Interrupt Method Key Press Detection


24

0 1 1 1 1 0 1 1

If RB3 RB0 = 1110 for the row and RB7 - RB4 = 1011 d for the column. Then, the key number 2 was pressed.

mfauzi

3 January, 2011

25

Flow Chart for Program 12 4


mfauzi

Scanning Method for Key Press Detection


3 January, 2011

You might also like