CHAPTER 3: PERIPHERAL CIRCUITS (LCD Driver)
II-31
• Displaying 7-segment
The LCD display routine using the assignment of Figure
3.5.3 can be programmed as follows.
Label
Mnemonic/operand
Comment
ORG
000H
RETD
3FH
;
0 is displayed
RETD
06H
;
1 is displayed
RETD
5BH
;
2 is displayed
RETD
4FH
;
3 is displayed
RETD
66H
;
4 is displayed
RETD
6DH
;
5 is displayed
RETD
7DH
;
6 is displayed
RETD
27H
;
7 is displayed
RETD
7FH
;
8 is displayed
RETD
6FH
;
9 is displayed
SEVENS:
LD
B,0
;
Set the address of jump
LD
X,090H
;
Set address of display memory
JPBA
When the above routine is called (by the CALL or CALZ
instruction) with any number from "0" to "9" set in the A
register for the assignment of Figure 3.5.4, seven segments
are displayed according to the contents of the A register.
The RETD instruction can be used to write data to the
display memory only if it is addressed using the X register.
(Addressing using the Y register is invalid.)
Note that the stack pointer must be set to a proper value
before the CALL (CALZ) instruction is executed.
Fig. 3.5.4
Data set in A register and
displayed patterns
Examples of
LCD driver control
program
0
1
Display
A resister
2
3
Display
A resister
4
5
Display
A resister
6
7
Display
A resister
8
9
Display
A resister
Содержание E0C6001
Страница 4: ...Hardware E0C6001 I Technical Hardware ...
Страница 79: ...Software E0C6001 II Technical Software ...