ÿþO b s Bu g a w y [w i e t l a c z a L C D z u k Ba d e m s t e r o w a n i a
H D 4 4 7 8 0 U
f l a p o 2 1 3 - e l e k t r o d a ( m i c h w o l o @ o p . p l )
1 . O p i s s y g n a Bó w s t e r u j c y c h
Øð E E n a b l e p r z y p r z e j [c i u z 1 n a 0 u m o |l i w i a p r z e p i s a n i e z a -
w a r t o [c i z w e j [ d a n y c h d o r e j e s t r ó w .
Øð R S p r z e Bc z a n i e r e j e s t r ó w p o m i d z y r e j e s t r e m d a n y c h a r e -
j e s t r e m i n s t r u k c j i 0 r e j e s t r i n s t r u k c j i , 1 r e j e s t r d a n y c h .
Øð R / W u m o |l i w i a z a p i a n i e d a n y c h d o w y [w i e t l a c z a b d z
s p r a w d z e n i a f l a g , 0 z a p i s d o w y [w i e t l a c z a , 1 o d c z y t f l a g z
w y [w i e t l a c z a .
Øð D B 7 . . . D B 0 w e j [c i a d a n y c h / f l a g i . W t r y b i e 8 b i t o w y m w y k o -
r z y s t w a n e s w e j [c i a o d D B 7 d o D B 0 , n a t o m i a s t w t r y b i e 4 b i t o -
w y m w y k o r z y s t y w a n a j e s t w y Bc z n i e s t a r s z a p o Bó w k a o d D B 7 d o
D B 4 .
Øð V s c w e j [c i e n a p i c i a k o n t r a s t u ( n a p i c i e z e l e |n e o d n a p i c i a
z a s i l a n i a w y [w i e t l a c z a ) .
Øð V c c n a p i c i e z a s i l a n i a z a l e |n i e o d m o d e l u 3 , 3 V l u b 5 V .
Øð G n d m a s a n a p i c i a z a s i l a n i a .
2 . S y m b o l e u |y w a n e p r z y k o n f i g u r a c j i p r o c e s o r a H D 4 4 7 8 0 U
Øð D L s z e r o k o [ m a g i s t r a l i d a n y c h , g d y D L = 0 s z e r o k o [ 4
b i t o w a , D L = 1 s z e r o k o [ 8 b i t o w a .
Øð N l i c z b a w i e r s z y , g d y N = 0 j e d e n w i e r s z , 1 d w a w i e r -
s z e .
Øð F w y b ó r w i e l k o [c i f o n t a , g d y F = 0 5 x 8 , F = 1 5 x 1 0 .
Øð D z a Bc z e n i e / w y Bc z e n i e w y [w i e t l a c z a , g d y D = 0 w y -
[w i e t l a c z w y g a s z o n y , D = 1 a k t y w n y .
Øð C k u r s o r w i d o c z n y / n i e w i d o c z n y , g d y C = 0 n i e w i d o c z n y ,
C = 1 w i d o c z n y .
Øð B m i g a n i e k u r s o r a a k t y w n e / n i e a k t y w n e , g d y B = 0 b r a k
m i g a n i a , B = 1 m i g a n i e w Bc z o n e .
Øð I / D i n k r e m e n t a c j a / d e k r e m e n t a c j a , g d y I / D = 1 i n k r e m e n -
t a c j a , I / D = 0 d e k r e m e n t a c j a .
Øð S p r z e s u n i c i e , S = 1 p r z e s u n i c i e a k t y w n e , S = 0 b r a k
p r z e s u n i c i a .
3 . A l g o r y t m k o n f i g u r a c j i
S t a r t -
I n i t i a l i z a t i o n
S t a r t - u p p o w e r
s u p p l y , a d d d e l a y
5 V o p t i o n 1 5 m s ,
3 , 3 V o p t i o n 4 0 m s
W a i t t o p o w e r s u p p l y
r e a c h 4 , 5 V o r 2 , 7 V
S e t o n p i n s R S =
0 , R / W = 0 , D B 7 =
0 , D B 6 = 0 , D B 5 =
1 , D B 4 = 1
I n s e r t d e l a y 4 , 1 m s
B o o t - u p p r o c e d u r e o f
S e t o n p i n s R S =
H D 4 4 7 8 0 p r o c e s s o r
0 , R / W = 0 , D B 7 =
0 , D B 6 = 0 , D B 5 =
1 , D B 4 = 1
S w i t c h i n g t o 4 b i t
I n s e r t d e l a y 1 0 0 u s
d a t a l e n g t h i n t e r f a c e
S e t o n p i n s R S =
0 , R / W = 0 , D B 7 =
W a i t u n t i l f l a g e B F w i l l b e 1
0 , D B 6 = 0 , D B 5 =
i n d i c a t e r e a d y t o g e t n e w
1 , D B 4 = 1
c o m m a n d
S e t o n p i n s R S =
0 , R / W = 0 , D B 7 =
0 , D B 6 = 0 , D B 5 =
1 , D B 4 = 0
T h i s t w o b l o c k a f t e r i f c o n d i t i o n s e t u p
R / W = 1
4 b i t i n t e r f a c e l e n g t h a n d
I f D L = 0 s e t 4 b i t i n t e r f a c e l e n g t h , D L = 1 s e t 8 b i t
i f N = 0 ( 1 r o w ) o r N = 1 ( 2 r o w ) ,
F = 0 ( 5 x 8 ) o r F = 1 ( 5 x 1 0 )
I f ( D B 7 = = 1 )
N o
Y e s
S e t o n p i n s R S = S e t o n p i n s R S =
0 , R / W = 0 , D B 7 = 0 , R / W = 0 , D B 7 =
0 , D B 6 = 0 , D B 5 = N , D B 6 = F , D B 5 =
W a i t u n t i l f l a g e B F w i l l b e 1
1 , D B 4 = D L 1 , D B 4 = 0
i n d i c a t e r e a d y t o g e t n e w
c o m m a n d
R / W = 1
T h i s t w o b l o c k a f t e r i f c o n d i t i o n s e t u p
s o m e d i s p l a y i n f o r m a t i o n
I f D = 0 d i s p l a y i n f o i s t u r n o f f , D = 1 d i s p l a y i s a n a c t i v e
I f ( D B 7 = = 1 )
i f C = 0 c u r s o r i s t u r n o f f o r C = 1 c u r s o r i s a n a c t i v e ,
N o
B = 0 s t a t i c c u r s o r o r B = 1 b l i n k i n g c u r s o r
Y e s
S e t o n p i n s R S = S e t o n p i n s R S =
0 , R / W = 0 , D B 7 = 0 , R / W = 0 , D B 7 =
0 , D B 6 = 0 , D B 5 = 1 , D B 6 = D , D B 5
0 , D B 4 = 0 = C , D B 4 = B
R / W = 1
I f ( D B 7 = = 1 )
N o
Y e s
S e t o n p i n s R S = S e t o n p i n s R S =
R e s t o f i n i t i a l i z a t i o n i s i n
0 , R / W = 0 , D B 7 = 0 , R / W = 0 , D B 7 =
o n h d 4 4 7 8 0 u _ a l g 0 2
0 , D B 6 = 0 , D B 5 = 1 , D B 6 = D , D B 5
d o c u m e n t
0 , D B 4 = 0 = C , D B 4 = B
P i e r w s z a c z [ a l g o r y t m u h d d 4 4 7 8 0 u _ a l g 0 1
C o n t i n o u s f r o m W a i t t o l a s t i n t e r n a l
o p e r a t i o n i s f i n i s h e d
d o c u m e n t
h d 4 4 7 8 0 u _ a l g 0 1
S e t o p t i o n s m o v e c u r s o r o r s h i f t d i s p l a y
R / W = 1
S / C = 0 c u r s o r m o v e , S / C = 1 d i s p l a y s h i f t
a n d R / L = 0 s h i f t t o l e f t ,
R / L = 1 s h i f t t o r i g h t , x - l e s s w o r t h s t a t e
I f ( D B 7 = = 1 )
N o
Y e s
S e t o n p i n s R S = S e t o n p i n s R S =
0 , R / W = 0 , D B 7 = 0 , R / W = 0 , D B 7 =
0 , D B 6 = 0 , D B 5 = S / C , D B 6 = R / L ,
0 , D B 4 = 1 D B 5 = x , D B 4 = x
R / W = 1
W a i t t o l a s t i n t e r n a l
o p e r a t i o n i s f i n i s h e d
S e t o p t i o n s c u r s o r m o v e d i r e c t i o n
a n d s p e c i f i e s d i s p l a y s h i f t
I / D = 0 d e c r e m e n t , S / C = 1 i n c r e m e n t
I f ( D B 7 = = 1 )
a n d S = 1 a d d d i s p l a y s h i f t
N o
Y e s
S e t o n p i n s R S = S e t o n p i n s R S =
0 , R / W = 0 , D B 7 = 0 , R / W = 0 , D B 7 =
0 , D B 6 = 0 , D B 5 = 0 , D B 6 = 1 , D B 5 =
0 , D B 4 = 0 I / D , D B 4 = S
R / W = 1
W a i t t o l a s t i n t e r n a l
o p e r a t i o n i s f i n i s h e d
C l e a r a l l e n t i r e d i s p l a y a n d s e t s D D R A M
a d d r e s s t o 0 i n a d d r e s s c o u n t e r
I f ( D B 7 = = 1 )
N o
Y e s
S e t o n p i n s R S = S e t o n p i n s R S =
0 , R / W = 0 , D B 7 = 0 , R / W = 0 , D B 7 =
0 , D B 6 = 0 , D B 5 = 0 , D B 6 = 0 , D B 5 =
0 , D B 4 = 0 0 , D B 4 = 1
3 n o t d e s c r i b e d
o p t i o n s p l e a s e
r e f e r t o H D 4 4 7 8 0 u
m a n u a l
E n d o f i n i t i a l i z a t i o n
p r o c e d u r e o f
H D 4 4 7 8 0 u
D r u g a c z [ a l g o r y t m u h d d 4 4 7 8 0 u _ a l g 0 1
4 . A l g o r y t m z m i a n y p o z y c j i n a w y [w i e t l a c z u .
S t a r t R o w C h a n g e
I n s t r u c t i o n t o s a v e 0 x 8 0
1 i n d i c a t e s o p e r a t i o n c h a n g e D D R A M a c t u a l
S e t o n p i n s R S =
p o s i t i o n , y - p o s i t i o n i f 0 r o w 1 p o s i t i o n 1
0 , R / W = 0 , D B 7 =
c h o o s e r o w 1 a n d i f 1 c h o o s e r o w 2 , x - i s
1 , D B 6 = y , D B 5 =
p o s i t i o n o n o n e r o w
x , D B 4 = x
S e t o n p i n s R S =
0 , R / W = 0 , D B 7 =
x , D B 6 = x , D B 5 =
x , D B 4 = x
W a i t f o r i n t e r n a l
o p e r a t i o n f i n i s h
R / W = 1
I n s t r u c t i o n t o s a v e 0 x C 0
r o w 2 p o s i t i o n 1
I f ( D B 7 = = 1 )
N o
Y e s
E x i t R o w C h a n g e
5 . A l g o r y t m z a p i s u z n a k u n a w y [w i e t l a c z u .
S t a r t C h a r a c t e r
S a v e
I f Y o u w a n t t o s a v e a c h a r a c t e r t o d i s p l a y Y o u s h o u l d
S a v e C h a r a c t e r f o r
c h a n g e R S t o 1 a n d R / W t o 0 a n d x i s a l l p o s i t i o n i n
i n s t a n c e A i s i n A S C I I
S e t o n p i n s R S =
A S C I I c o d e t a b l e f o r i n s t a n c e c h a r a c t e r A 0 x 6 5
0 x 6 5
1 , R / W = 0 , D B 7 =
x , D B 6 = x , D B 5 =
x , D B 4 = x
A
S e t o n p i n s R S =
0 , R / W = 0 , D B 7 =
x , D B 6 = x , D B 5 =
x , D B 4 = x
R / W = 1
I f ( D B 7 = = 1 )
N o
Y e s
E n d o f S a v e
C h a r a c t e r
6 . A l g o r y t m z a p i s u z n a k u s p e c j a l n e g o d o p a m i c i z n a k o w e j C G R A M
S a v e N e w C h a r a c t e r
i n C G R A M
S e t o n p i n s R S =
0 , R / W = 0 , D B 7 =
1 i n d i c a t e t h a t c h o o s e s a v e i n s t r u c t i o n w r i t e t o
0 , D B 6 = 1 , D B 5 =
C G R A M , a l l x i s a d d r e s s t o s p e c y f i c l i n e , i f y o u w a n t
x , D B 4 = x
s a v e 8 p o i n t h i g h t c h a r a c t e r Y o u s h o u l d i n x p l a c e
i n s e r t I v a r i a b l e ( i n c r e m e n t )
S e t o n p i n s R S =
0 , R / W = 0 , D B 7 =
x , D B 6 = x , D B 5 =
x , D B 4 = x
R / W = 1
W a i t t o t h e t h e l a s t i n t e r n a l o p e r a t i o n i s
f i n i s h
C h a r a c t e r 5 x 8 p i x e l s
I f ( D B 7 = = 1 )
C h a r a c t e r p o l i s h A
N o
Y e s
0 x 0 8
0 0 0 0 1 0 0 0
0 x 0 A
0 0 0 0 1 0 1 0
S e t o n p i n s R S =
1 , R / W = 0 , D B 7 =
0 x C 0
0 0 0 0 1 1 0 0
x , D B 6 = x , D B 5 =
S a v e p a t t e r n o f n e w o n e l i n e c h a r a c t e r i n
x , D B 4 = x
C G R A M
0 x 8 0
0 0 0 0 1 0 0 0
S e t o n p i n s R S =
0 x 1 8
0 0 0 1 1 0 0 0
0 , R / W = 0 , D B 7 =
x , D B 6 = x , D B 5 =
x , D B 4 = x
0 x 0 8
0 0 0 0 1 0 0 0
0 x 0 F
R / W = 1
0 0 0 0 1 1 1 1
W a i t t o t h e t h e l a s t i n t e r n a l o p e r a t i o n i s
f i n i s h
0 x 0 0
0 0 0 0 0 0 0 0
I f ( D B 7 = = 1 )
N o
Y e s
Y e s
S a v e t h e 5 x 8 c h a r a c t e r s a v e i n C G R A M
I f ( i = = 8 )
N o
i + +
E n d o f S a v e N e w
C h a r a c t e r i n
C G R A M
7 . A l g o r y t m i n i c j a l i z a c j i w y [w i e t l a c z a n a p i s a n y w j z y k u A N S I C
8 . A l g o r y t m i n i c j a l i z a c j i w y [w i e t l a c z a n a p i s a n y w j z y k u V H D L
Wyszukiwarka
Podobne podstrony:
programowanie sterowników wyświetlaczy LCD 2Wyświetlacz LCDInstrukcja obsługi wyświetlacza alfanumerycznego RS232Kurs AVR GCC Wyświetlacz LCD od Nokii310Termometr cyfrowy z wyświetlaczem LCDLaboratorium 3 wyświetlacz LCDAlfanumeryczne wyświetlacze LCD, cz 1Alfanumeryczne wyświetlacze LCD Cześć 2Nowe wyswietlacze LCDAlfanumeryczne wyświetlacze LCD, cz4więcej podobnych podstron