You are on page 1of 6

Liquid Crystal Displays (LCD)

LCD Module Pin Assignment Pin Symbol Level I/O number 1 Vss 2 Vcc 3 Vee 4 5 + 1 4 5 1" 11 12 13 14 ! #' , D2" D21 D22 D23 D24 D25 D2+ D21 "#1 "#1 1- 1--." "#1 "#1 "#1 "#1 "#1 "#1 "#1 "#1 $ $ $ $#3 $#3 $#3 $#3 $#3 $#3 $#3 $#3 un!tion Power supply (GND) Power supply (+5V) Contrast adjust " % $nstruct&on &nput 1 % Data &nput " % 'r&te to (CD )odule 1 % ead *ro) (CD )odule ,na/le s&0nal Data /us l&ne " ((!2) Data /us l&ne 1 Data /us l&ne 2 Data /us l&ne 3 Data /us l&ne 4 Data /us l&ne 5 Data /us l&ne + Data /us l&ne 1 (6!2)

LCD Driver "lo!# Diagram

e*erences 7 8ttp7##www98antron&:9co) !elect resources ta/ and tutorials entry 1

*+"it Initialisation

DISPLA$ C%A&AC'(& POSI'IO) A)D C%A&AC'(& ADD&(SS

'iming C,ara!teristi!s

&(AD 'IMI)-

.&I'( 'IMI)-

Inter/a!ing a 0123 !,ara!ter LCD to t,e In/ineon 014


Port !onne!tions to LCD module + (CD )odule to /e used &n 4-/&t )ode Port 4 2&t 1 2&t + 2&t 5 2&t 4 Port 1 2&t 1 2&t + 2&t 5 LCD pin D21 D2+ D25 D24 , - ,na/le #' ; ead#not'r&te ! ; e0&ster !elect

<C5 un!tions &equired lcd=&n&t&al&se - &n&t&al&se lcd *or 4-/&t )ode- 2-l&nes- etc lcd=wr&te=data - wr&te a /yte to /e d&splayed lcd=wr&te=control - wr&te a co))and to t8e lcd lcd=read=status - read t8e status o* t8e lcd lcd=read=data - read t8e data at t8e cursor pos&t&on - >>> do we need t8&s> lcd=putc8ar - ?pr&nt@ a c8aracter on t8e lcd at t8e current cursor pos&t&on9 lcd=clear - clear lcd d&splay lcd=/usy - returns 1 &* lcd /usy- " ot8erw&se lcd=0oto:y - )oAe lcd cursor to :-y pos&t&on lcd=wr&te=n&//le - wr&te a 4-/&t n&//le to t8e lcd )ay/e lcd=read=n&//le )&08t need to 8aAe so)e delays so )ay/e a delay *unct&on ; 8ow accurate s8ould t8e delays /e> Bny ot8ers> $t )&08t /e 0ood &* we could so)e8ow )aCe t8e standard <CD *unct&on pr&nt /e a/le to ?pr&nt@ d&rectly to t8e lcd9 $t would /e use*ul to )aCe t8ese *unct&ons &nto an lcd *unct&on l&/rary9 '8&c8 o* t8ese s8ould /e )ade aAa&la/le to a user> Eow can we preAent a user *ro) access&n0 *unct&ons t8at we donDt want t8e) to access> '8ere s8ould we start> 'e des&0n top down9 $)ple)ent and test /otto) up part&cularly w8en we are do&n0 so)et8&n0 *or t8e *&rst t&)e or t8at )ay/e d&**&cult9

LCD DRIVER (HD44780) instruction set


Code (2e!ution Des!ription 'ime &S &/. D"4 D"1 D"6 D"* D"7 D"3 D"0 D"8 Clear d&splay " " " " " " " " " 1 Clears d&splay and returns cursor to t8e 8o)e pos&t&on (address ")9 19+4)! eturns cursor to 8o)e pos&t&on (address ")9 Blso returns d&splay /e&n0 Cursor 8o)e " " " " " " " " 1 F 19+4)! s8&*ted to t8e or&0&nal pos&t&on9 DD B6 contents re)a&ns unc8an0ed9 !ets cursor )oAe d&rect&on ($#D)- spec&*&es to s8&*t t8e d&splay (!)9 ,ntry )ode set " " " " " " " 1 $#D ! 4"u! G8ese operat&ons are per*or)ed dur&n0 data read#wr&te9 D&splay 3n#3** !ets 3n#3** o* all d&splay (D)- cursor 3n#3** (C) and /l&nC o* cursor " " " " " " 1 D C 2 4"u! control pos&t&on c8aracter (2)9 !ets cursor-)oAe or d&splay-s8&*t (!#C)- s8&*t d&rect&on ( #()9 DD B6 Cursor#d&splay s8&*t " " " " " 1 !#C #( F F 4"u! contents re)a&ns unc8an0ed9 !ets &nter*ace data len0t8 (D()- nu)/er o* d&splay l&ne (N) and Hunct&on set " " " " 1 D( N H F F 4"u! c8aracter *ont(H)9 !ets t8e CG B6 address9 CG B6 data &s sent and rece&Aed a*ter t8&s !et CG B6 address " " " 1 CG B6 address 4"u! sett&n09 !ets t8e DD B6 address9 DD B6 data &s sent and rece&Aed a*ter t8&s !et DD B6 address " " 1 DD B6 address 4"u! sett&n09 eads 2usy-*la0 (2H) &nd&cat&n0 &nternal operat&on &s /e&n0 per*or)ed ead /usy-*la0 and " 1 2H CG B6 # DD B6 address and reads CG B6 or DD B6 address counter contents (depend&n0 "u! address counter on preA&ous &nstruct&on)9 'r&te to CG B6 or 1 " wr&te data 'r&tes data to CG B6 or DD B69 4"u! DD B6 ead *ro) CG B6 1 1 read data eads data *ro) CG B6 or DD B69 4"u! or DD B6 Instru!tion "it name $#D ! D C 2 !#C Settings " % Decre)ent cursor pos&t&on 1 % $ncre)ent cursor pos&t&on " % No d&splay s8&*t 1 % D&splay s8&*t " % D&splay o** 1 % D&splay on " % Cursor o** 1 % Cursor on " % Cursor /l&nC o** 1 % Cursor /l&nC on " % 6oAe cursor 1 % !8&*t d&splay "it name #( D( N H 2H Settings " % !8&*t le*t 1 % !8&*t r&08t " % 4-/&t &nter*ace 1 % 4-/&t &nter*ace " % 1#4 or 1#11 Duty (1 l&ne) 1 % 1#1+ Duty (2 l&nes) " % 5:1 dots 1 % 5:1" dots " % Can accept &nstruct&on 1 % $nternal operat&on &n pro0ress

You might also like