Seek a FPGA control LCD12864 program, the program is written in VHDL, and the LCD is a serial transmission of data, urgent!!!
Author:Liu Xiaoqin Time:2021-07-22 09:40 Browse(616)
Does LCD have documentation?
Does LCD have documentation? Write a module corresponding to the specification.
in the digital circuit.

Seek a FPGA control LCD12864 program, the program is written in VHDL, and the LCD is a serial transmission of data, urgent!!!

all data are saved as 0 and 1, and different results can be obtained by performing different data operations on the LCD controller.
for the display operation in English.
because there are few types of English letters, only 8 bits (one byte) are needed.
for Chinese.
however, more than 6000 are commonly used, So our DOS predecessors thought of a way, that is, to group the high 128 rarely used values in the ASCII table into two groups to represent Chinese characters, that is, the internal code of Chinese characters.
while the remaining low 128 bits are reserved for English characters.
that is, the internal code of English.
.
.
then.
after getting the internal code of Chinese characters, it is only a group of numbers, so how can it be displayed on the screen? This involves the font of a character. Although the font is also a group of numbers, its meaning has fundamentally changed with the meaning of numbers. It records the shape of English or Chinese characters with the information of numbers, For example, the recording mode of "a" in English is shown in Figure 1.
.
the "a" pattern in Figure 1.
.
while the recording mode of "you" in Chinese is shown in Figure 2.
.
the "you" pattern in Figure 2.
.
introduction of 12864 dot matrix LCD.
.
12864 is a kind of graphic dot matrix LCD.
it mainly consists of row driver / column driver and 128 bit matrix LCD × It is composed of 64 dot matrix LCD.
it can complete graphics display.
it can also display 8 × 4 (16 × 16 dot matrix).
.
.
pin number




























































































































































8.
db1.
H / L.
data line.
.
9.
DB2.
H / L.
data line.
.
10.
db3.
H / L.
db3















































































<
.
17.
ret.
signal H / L.
reset signal.
low level reset.
.
18.
Vout.
- 10V.
LCD driving negative voltage.
.
19.
LED +.
-.
LED backlight power supply.
.
20.
LED -.
-.
LED backlight power supply.
.
.
Table 1: 12864LCD pin description.
.
.
before using 12864LCD, the following functional devices must be understood before programming.
12864LCD The device and related functions are as follows:
.
1. Instruction register (IR).
.
IR is used to register instruction code.
corresponding to data register data.
2When D / I=0,
under the action of falling edge of e signal, instruction code is written into IR.
.
.
2. Data register (DR).
.
DR is used to register data.
corresponding to instruction register register register register instruction.
when D / I=1,
under the action of falling edge, graphic display data is written into Dr, The data transmission between DR and DDRAM is automatically executed in the module.
.
.
3. Busy flag: BF.
.
the BF flag provides internal working conditions.
BF=1 indicates that the module is operating internally.
at this time, the module does not accept external instructions and data.
when BF=0, the module is ready, It can accept external instructions and data at any time.
.
.
by using the status read instruction.
the BF can be read to the DB7 bus to check the working state of the module.
.
.
4. Display control trigger DFF.
.
this trigger is used to control the opening and closing of the module screen display.
DFF=1 is display off.
the contents of DDRAM are displayed on the screen, DFF=0 is display off.
.
.
the state of DDF is controlled by the instruction display on / off and RST signals.
.
.
5. XY address counter.
.
the XY address counter is a 9-bit counter.
the state of DDF is controlled by the instruction display on / off and RST signalsThe upper three bits are the X address counter.
the lower six bits are the Y address counter, the XY address counter is actually the address pointer of DDRAM, and the X address counter is the page pointer of DDRAM, The Y address counter is the Y address pointer of DDRAM.
.
.
the X address counter has no counting function.
it can only be set with instructions.
.
.
.
the Y address counter has cyclic counting function.
after each display data is written, the Y address is automatically increased by 1, The Y address pointer ranges from 0 to 63.
.
.
6. Display data RAM (DDRAM).
.
DDRAM stores graphic display data.
data of 1 indicates display selection.
data of 0 indicates display non selection.
the relationship between DDRAM and address and display position is shown in DDRAM address table.
.
.
7. Z address counter.
.
Z address counter is a 6-bit counter.
this counter is used for counting When a line is scanned, the address counter will automatically add 1 to point to the next line of scanning data. After RST is reset, the Z address counter will be 0.
.
.
the Z address counter can be preset with the command display start line.
therefore.
the start line of the display screen is controlled by this command, That is, from which line the data of DDRAM will be displayed in the first line of the screen.
there are 64 lines of DDRAM in this module.
the screen can scroll through 64 lines in a cycle.
.
in this module, the data of DDRAM will be displayed in the first line of the screen
12864 LCD's instruction system and time sequence.
.
the instruction system of this kind of LCD module (i.e. KS0108B and its compatible control driver) is relatively simple.
there are only seven kinds in total.
the instruction table is shown in Table 2:
.
instruction name.
control signal.
control code.
.
R / W.
rs.
DB7.
DB6.
db5.
DB4.
db3.
db1.
db1.
db1















































































<
.
column address setting.
0.
0.
0.
1.
X
X.
X.
X.
X.
X.
.
read status.
1.
0.
busy.
0















write data.

write data.

write data.













Table 2: 12864LCD instruction list.







































<
.
when db0 When=1.
LCD displays the contents of ram; When db0=0, turn off the display.
.
.
2. Display start line (row) setting command.
.
R / WRS.
DB7 DB6 db5 DB4 db3db2db1 db0.
.
00.
11 display start line (0-63).
.
this command sets the line number of the display RAM corresponding to the top line of the LCD screen.
changing the display start line regularly can make the LCD realize the effect of scrolling.
.
.
3 Page setting instructions.
.
R / WRS.
DB7 DB6 db5 DB4 db3db2db1 db0.
.
00.
10111 page number (0-7).
0
display RAM has 64 lines.
there are 8 pages, 8 lines in each page.
.
.
4. Column address setting instruction.
.
R / WRS.
DB7 DB6 db5 DB4 db3 DB2 db1 db0.
.
00.
01 display column address (0-63).
.
set page address and column address.
uniquely determine a unit in display RAM, so that MPU can.
.
use read The write instruction reads the contents of the unit or writes a byte of data to the unit.
.
.
5 Read status command.
.
R / WRS.
DB7 DB6 db5 DB4 db3db2db1 db0.
.
10.
busy0on / offrest0000.
.
this command is used to query the status of LCD internal controller.
the meaning of each parameter is as follows:
.
busy: 1 - internal working 0 - normal state.
.
on / off: 1 - display off 0 - display on.
.
reset: 1 - reset state 0 - normal state.


in the busy and reset states,
except for the read state command, other commands have no effect on the LCD module.
.
.
before operating the LCD module, you need to query the busy state.
to determine whether you can operate the LCD module.
.
.
6. Write data command.
4
R / WRS.
DB7 DB6 db5 DB4 db3db2db1 db0.
.
01.
write data.
.
read data instruction.
R / WRS.
DB7 DB6 db5 DB4 db3db2db1 db0.
.
11.
read display data.
.
.
the column address is automatically increased by one after each read and write operation.
it must be noted that before the read operation, there must be a blank read operation, The data in the unit to be read will be read out after Rereading
Related topics