Hardware Reference
In-Depth Information
When the displayed data is shifted repeatedly, each line moves only horizontally. The sec-
ond line of the display does not shift into the first row. The contents of the address counter will
not change if the only action performed is a display shift.
F UNCTION S ET
This instruction allows the user to set the interface data length, select the num-
ber of display lines, and select the character fonts. There are three bit variables in this
instruction:
DL: Data is sent or received in 8-bit length (DB7 to DB0) when DL is set to 1 and in
4-bit length (DB7 to DB4) when DL is 0. When the pin count is at a premium for the
application, the 4-bit data length should be chosen even though it is cumbersome to
perform the programming.
N: This bit sets the number of display lines. When set to 0, one-line display is
selected. When set to 1, two-line display is selected.
F: When set to 0, the 5 3 8 font is selected. When set to 1, the 5 3 10 font is selected.
S ET CGRAM A DDRESS
This instruction contains the CGRAM address to be set into the address counter.
S ET DDRAM A DDRESS
This instruction allows the user to set the address of the DDRAM in the address counter.
This instruction is used whenever the user wants to set the cursor to a certain position on the
LCD screen.
R EAD B USY F LAG AND A DDRESS
This instruction reads the busy flag (BF) and the address counter. The BF flag indicates
whether the LCD controller is still executing the previously received instruction.
7.8.6 Interfacing the HD44780U to the HCS12 Microcontroller
The data transfer between the HD44780U and the MCU can be done in 4 or 8 bits at
a time. When in 4-bit mode, data are carried on the upper four data pins (DB7,DB4). The
upper 4 bits are sent over DB7,DB4 first and followed immediately by the lower 4 bits.
For those HCS12 members that do not support external memory, the designer must
use I/O ports to interface with the LCD module. For those HCS12 members that support
external memory, the designer has the choice of using I/O ports to interface with the LCD
module or treating the LCD as a memory device. This chapter will treat the LCD only as an
I/O device.
The LCD circuit connection for the Dragon12-Plus (4-bit data bus) is illustrated in
Figure 7.28. The R/W signal to the LCD kit in the Dragon12 demo board is grounded; this pre-
vents the user from polling the BF flag to determine whether the LCD internal operation has
been completed.
Certain timing parameters must be satisfied in order to access the LCD successfully. The
read and write timing diagrams are shown in Figures 7.29 and 7.30, respectively. The values
of timing parameters depend on the frequency of the operation. HD44780U-based LCDs can
operate at either 1 MHz (cycle time of E signal) or 2 MHz. The values of timing parameters at
these two frequencies are shown in Tables 7.10 and 7.11, respectively.
 
Search WWH ::




Custom Search