Page 65 - Making PIC Microcontroller Instruments and Controllers
P. 65
LCD DISPIAY
andbllnking
in the LCD display
ipiiiiiiiiiry{i{:l Disprayins "HELLOWORLD"
(Continue,tl
DEFINE I,CD RVIBIT 2
DEFINE NCD-BITS A
DEFINE I,CD I,INES 2
DEFINE I.CD COMMANDI'S 2 0 0 0 ; delay in rnicio seconds
DEFINE I,CD_DATAUS 50 delay in nicro seconds
Set Lhe port directions. we are setting (nust set) all of PORTD
a o d q t l o I P O R T I " s o ' - p ! i . F v 6 r ' h o ! o t D o o - L d s o . l r . \ e p
l i n e s . T h - l o ! l b b l - i i D o o D / d l o e s e t d s - p - - s : . ^ e L c
a 4 high bit path Lo feed the LCD.)
PAUSE 500 araow ror LLU srarEup
ERISD = %00000000 rlnes !o ouEpur
TRISE = %00000000 ser all PORTE lines !o output
o o - - o - D r q i a c o - L - o - e g s L o r
r
A.DCONI=%00000111 needed for the 16F877A - see above and
below this nakes all of poris A and E
disitaL.
the main loop of the program
I,CDOUT SFE, 1 clear screen, go !o position 1
PAUSE 250 pause 0.2s seconds
LCDOUIF \HELI,oZ
LCDOUT tFE, SCo ; go to second 1lne, frrst position
I,CDOUT \
