Mikrocontroller und Digitale Elektronik
›
Thread
LCD zeigt einzelne Zeichen nicht an
B
Bernd
Gast
11.03.2009 15:22
#1189408
Hallo,
Ich habe vor mit einem 8051 Microcontroller (AT89C5130A-M) ein LCD
Display anzusteuern. Das Display wird vom externen Bus des µController
mit 8(10) Bit angesteuert. Die Initialisierung des Displays klappt
wunderbar. Aber manche Buchstaben (z.B. N oder T) werden nicht
angezeigt. Ich danke euch schon einmal im Voraus für eure guten Tipps.
Gruß Bernd
Hier der Assembler Code:
1 org 0 h
2 AA equ 01000001 b
3 YY equ 01011001 b
4 NN equ 01101110 b
5 II equ 01101001 b
6 CC equ 01000011 b
7 KK equ 01001011 b
8 orl 08 Eh , # 00000010 b ; movx befehle f ü r externen ram umschalten
9 lcall warte50ms
10
11 mov a , # 00111000 b ; Function Set
12 movx @ R0 , a
13 lcall warte50ms
14
15 mov a , # 00001110 b ; Display ON / OFF
16 movx @ R0 , a
17 lcall warte50ms
18
19 mov a , # 00000110 b ; Increment
20 movx @ R0 , a
21 lcall warte50ms
22
23 mov a , # 00000001 b ; Clear Display
24 movx @ R0 , a
25 lcall warte50ms
26
27 mov a , # 00000010 b ; Return Home
28 movx @ R0 , a
29 lcall warte50ms
30
31 setb P3 . 6
32 setb P3 . 7
33
34 prog :
35
36 speichern :
37 mov R0 , # YY
38 mov a , R0
39 movx @ R0 , a
40 lcall warte50ms
41
42 mov R0 , # AA
43 mov a , R0
44 movx @ R0 , a
45 lcall warte50ms
46
47
48
49 mov R0 , # II
50 mov a , R0
51 movx @ R1 , a
52 lcall warte50ms
53
54 mov R0 , # CC
55 mov a , R0
56 movx @ R0 , a
57 lcall warte50ms
58
59 mov R0 , # KK
60 mov a , R0
61 movx @ R0 , a
62 lcall warte50ms
63
64
65 schl :
66 sjmp schl
67
68 warte50ms :
69 push PSW
70 push 0
71 push 1
72 mov 1 , # 189
73 ws0_labelB1 :
74 mov 0 , # 75
75 ws0_labelB0 :
76 nop
77 nop
78 nop
79 nop
80 nop
81 djnz 0 , ws0_labelB0
82 djnz 1 , ws0_labelB1
83 nop
84 pop 1
85 pop 0
86 pop PSW
87 ret
88
89
90 end
B
Bernd
Gast
11.03.2009 17:32
#1189644
Hi,
Ich habe mein Problem durch rumprobieren gelöst aber ich weiß nicht wiso
es jetzt funktioniert. Hier der neue Code:
1 org 0 h
2 AA equ 01000001 b
3 YY equ 01011001 b
4 NN equ 01101110 b
5 II equ 01101001 b
6 CC equ 01000011 b
7 KK equ 01001011 b
8 orl 08 Eh , # 00000010 b ; movx befehle f ü r externen ram umschalten
9 lcall warte50ms
10
11 mov a , # 00111000 b ; Function Set
12 movx @ R0 , a
13 lcall warte50ms
14
15 mov a , # 00001110 b ; Display ON / OFF
16 movx @ R0 , a
17 lcall warte50ms
18
19 mov a , # 00000110 b ; Increment
20 movx @ R0 , a
21 lcall warte50ms
22
23 mov a , # 00000001 b ; Clear Display
24 movx @ R0 , a
25 lcall warte50ms
26
27 mov a , # 00000010 b ; Return Home
28 movx @ R0 , a
29 lcall warte50ms
30
31
32 prog :
33
34 speichern :
35 mov R0 , # YY
36
37 mov a , # YY
38 movx @ R0 , a
39 lcall warte50ms
40
41 ; mov R0 , # AA
42 mov a , # AA
43 movx @ R0 , a
44 lcall warte50ms
45
46 ; mov R0 , # NN
47 mov a , # NN
48 movx @ R0 , a
49 lcall warte50ms
50
51 ; mov R0 , # NN
52 mov a , # NN
53 movx @ R0 , a
54 lcall warte50ms
55
56 ; mov R0 , # II
57 mov a , # II
58 movx @ R0 , a
59 lcall warte50ms
60
61 ; mov R0 , # CC
62 mov a , # CC
63 movx @ R0 , a
64 lcall warte50ms
65
66 ; mov R0 , # KK
67 mov a , # KK
68 movx @ R0 , a
69 lcall warte50ms
70
71
72 schl :
73 sjmp schl
74
75 warte50ms :
76 push PSW
77 push 0
78 push 1
79 mov 1 , # 189
80 ws0_labelB1 :
81 mov 0 , # 75
82 ws0_labelB0 :
83 nop
84 nop
85 nop
86 nop
87 nop
88 djnz 0 , ws0_labelB0
89 djnz 1 , ws0_labelB1
90 nop
91 pop 1
92 pop 0
93 pop PSW
94 ret
95
96
97 end
Gruß Bernd
Antwort schreiben
Bitte melde dich an, um einen Beitrag zu schreiben.
Noch kein Account?
Die Registrierung ist kostenlos und dauert nur eine Minute.
Jetzt registrieren