SoCKit User Manual
84
www.terasic.com
December 1, 2015
6
6
.
.
4
4
S
S
P
P
I
I
I
I
n
n
t
t
e
e
r
r
f
f
a
a
c
c
e
e
d
d
G
G
r
r
a
a
p
p
h
h
i
i
c
c
L
L
C
C
D
D
This demonstration shows how to control the Graphic LCD by using the HPS SPIM (SPI Master)
controller and HPS GPIO controllers.
Function Block Diagram
Figure 6-11
s
hows the function block diagram of this demonstration. The LTC is connected to the
SPIM1
,
GPIO1
,
and
GPIO2
controllers in HPS on this SoCKit board.
The built-in virtual
memory-mapped device driver in the system is used to access the registers in the HPS SPIM and GPIO controllers.
The SPI interface is used to transfer Data or Command from HPS to LCD. Because the LCD is write-only, only
three SPI signals
LCM_SPIM_CLK
,
LCM_SPIM_SS
, and
LCM_SPIM_MOSI
are required. The
LCM_D_C
signal is used to indicate the signal transferred on the SPI bus is Data or Command. When
LCM_D_C
signal is
pulled high, it means the signal on SPI bus is Data. When
LCM_D_C
signal is pulled low, it means the signal on
SPI bus is Command. The
LCD_RST_n
is the reset control signal of LCD. This signal is low active. The
LCM_BK
signal is used to turn on/off the black light of the LCD. When this signal is pulled high, LCD backlight
is turned on.
Figure 6-11 Block Diagram of the Graphic LCD Demonstration
LCD Control
Developer needs to initialize the LCD before sending any display data. The initialization includes:
Common output mode select (Code: 0xC0~0xCF)
Power sontrol set (Code: 0x28~0x2F)
Display start line set (Code: 0x40~0x7F)
Page address set (Code: 0xB0~0xB8)
Column address set (Code: 0x00 to 0x18)