Hardware Reference
In-Depth Information
of DDRAM or CGRAM is determined by the instruction. After writing into (reading from)
DDRAM or CGRAM, the content of the AC register is automatically incremented (decre-
mented) by 1. The contents of the AC register is output to the DB6..DB0 pins when the RS signal
is low and the R/W signal is high.
7.8.5 Instruction Description
The functions of LCD instructions are discussed in this section.
C LEAR D ISPLAY
This instruction writes the space code 0x20 into all DDRAM locations. It then sets 0 into
the address counter and returns the display to its original status if it was shifted. In other words,
the display disappears and the cursor or blinking goes to the upper left corner of the display. It
also sets the I/D bit to 1 (increment mode) in entry mode.
R ETURN H OME
This instruction sets DDRAM address 0 into the address counter and returns to its original
status if it was shifted. The DDRAM contents are not changed. The cursor or blinking goes to
the upper left corner of the display.
E NTRY M ODE S ET
The I/D bit of this instruction controls the incrementing (I/D 5 1) or decrementing
(I/D 5 0) of the DDRAM address. The cursor or blinking will be moved to the right or left
depending on whether this bit is set to 1 or 0. The same applies to writing and reading of
CGRAM.
The S bit of this instruction controls the shifting of the LCD display. The display shifts if
S 5 1. Otherwise, the display does not shift. If S is 1, it will seem as if the cursor does not move
but the display does. The display does not shift when reading from DDRAM. Also, writing into
or reading from CGRAM does not shift the display.
D ISPLAY O N /O FF C ONTROL
This instruction has three bit parameters: D , C , and B . When the D bit is set to 1, the dis-
play is turned on; otherwise it is turned off. The cursor is turned on when the C bit is set to 1.
The character indicated by the cursor will blink when the B bit is set to 1.
C URSOR OR D ISPLAY S HIFT
This instruction shifts the cursor position to the right or left without writing or reading
display data. The shifting is controlled by 2 bits, as shown in Table 7.9. This function is used to
correct or search the display. When the cursor gets to the end of a line, it will be moved to the
beginning of the next line.
S/C
R/L
Operation
0
0
Shifts the cursor position to the left. (AC is decremented by 1)
0
1
Shifts the cursor position to the right. (AC is incremented by 1)
1
0
Shifts the entire display to the left. The cursor follows the display shift.
1
1
Shifts the entire display to the right. The cursor follows the display shift.
Table 7.9 LCD shift function
 
Search WWH ::




Custom Search