Professional Documents
Culture Documents
LCD Lecture
LCD Lecture
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)
*+"it Initialisation
'iming C,ara!teristi!s
&(AD 'IMI)-
.&I'( 'IMI)-
<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