Study Notes
for
redesigned
2012-08-30
versions:12_08_01
This is my study note on 12864. The 12864 LCD has comprehensive functions and is easy to use, and can meet the needs of general research and engineering applications.
Below I will talk about my experience in learning it in several aspects. I will try to introduce it as comprehensively as possible, and will mainly explain some special applications and some places that I think need special attention in more detail. For those more fixed and commonly used aspects, I will be brief.
Whether it is serial mode or parallel mode, the basic operations such as writing instructions, writing data, and reading operations on LCD are relatively fixed and basic. I think it is enough to understand and be able to port it on different processors. There is no need to write it out by yourself according to the manual timing diagram. Because someone has already written it and it works stably, we just need to learn to apply it on its basis. Now is the era of knowledge explosion, knowledge and information are expanding rapidly. We must learn to use existing results, and then carry out research on development and application on this basis. We don’t have to start from the bottom and do something that others have done very maturely again. This is not only inefficient, but also our energy is not allowed.
Okay, without further ado, I’ll start the introduction. Of course, I’ll also introduce the basic things.
The programs involved below are for msp430g2553. I have already adjusted them and can be used directly.
1. Introduction of 12864
1. The LCD module is a 128×64
2. The commonly used 12864 LCDs all use the ST7920 controller.
2) ST7920 can control the display of letters, numbers, Chinese fonts and custom pictures. It can be used to display graphics, demonstrate animations, draw curves, etc.
3) Character Display RAM
The character display RAM (DDRAM) of ST7920
It should be noted here that each row of ST7920 DDRAM can control 16 Chinese characters, and there are 4 rows in total. However, each row of LCD can only display 8 characters. In order to facilitate display observation, two rows of DDRAM are split into four rows during the LCD production process, and then displayed on the LCD, which means that only half of the DDRAM is used.
The coordinate addresses of the LCD display characters are as follows:
Chinese character display coordinates
Line1
Line2
Line3
Line4
It is not difficult to see from the above table that the first row and the third row are split from the same row in DDRAM, and similarly, the 2nd and
Knowing this, it is not difficult to understand that in the following program, when the line is changed, the address of the next line should be manually specified. For example, if the first line is displayed, I want to display the following data on the second line, so that it conforms to people's observation habits, then I have to manually switch the display address to the second line before changing the second line. Otherwise, after the first line is displayed, the address will automatically increase and will be displayed on the third line, which will be unnatural for us to observe. The program example will be involved below.
The built-in simplified Chinese font library is GB2312, which provides 8192 16*16 point Chinese fonts.
5), Half-width font ROM
Provides 126 16*8 point half-width letter and symbol fonts.
6) Graphics Display RAM
Provides 64*256-bit GDRAM
The RAM we commonly use is the one mentioned above. There are also some CGRAM
The DDRAM control described above displays Chinese characters. GDRAM controls the display of pictures. After power-on, DDRAM is turned on by default to control the LCD display. GDRAM is not turned on by default, and the data in it is random. If GDRAM is turned on at this time, the LCD will be controlled by both DDRAM and GDRAM. Since the data in GDRAM is random, garbled characters will be displayed. Therefore, the random data in GDRAM must be cleared before using it.
The function to clear GDRAM is as follows:
void
{
i
for(j
{
wr_lcd(comm,i++);
wr_lcd(comm,0x80);
}
i
{
}
}
The command functions for reading and writing data of the parallel mode LCD are as follows:
void
{
}
void
{
}
Since I am using msp430g2553, I have always used serial control mode.
//The following focuses on the serial timing
//SCLK: Serial synchronous clock line. Each operation of a data bit requires an SCLK transition edge, and here the rising edge is valid. That is to say, every time SCLK changes from low level to high level, the LCD controller
//The controller reads or outputs the data on the SID.
//SID: serial data, each operation consists of three bytes of data. The first byte sends a command control word to the controller, telling the controller what operation to do next. If it is a write instruction, send 11111000
//(0xf8), if it is write data, send 11111010(0xfa), if it is read status, send 11111100(0xfc), if it is read data, send 11111110(0xfe).
//The high 4 bits of the second byte are the high 4 bits of the sent instruction or data, and the low 4 bits of the second byte are filled with 0.
//The high 4 bits of the third byte are the low 4 bits of the sent instruction or data, and the low 4 bits of the third byte are filled with 0
//You can observe the timing to understand the details
The function of data transmission is as follows:
//12864 serial connection write data, write command function
void wr_lcd(uchar dat_comm,uchar content)//
{
}
[page]
void
{
}
5. The function to write an image to the full screen of the LCD is as follows:
void
{
i
for(j
{
wr_lcd(comm,i++);
wr_lcd(comm,0x80);
}
i
{
}
}
6. Below I will paste a function for testing the LCD function, which uses many functions of the LCD. You can observe the implementation phenomenon and the comments are also detailed. The code is as follows:
#include
#include
void
{
//
//When debugging, you can set a breakpoint here, execute the following instructions step by step, and observe the results
}
Previous article:12864 LCD In-depth Study Notes_2——Based on msp430g2553
Next article:Summary of electrical design work - MSP430G2553 study notes - 3
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Introduction to PID Control Algorithm and Strategy
- DSP28335 Peripheral Clock
- Please explain the role of the window comparator here
- EEWORLD University Hall----Live Replay: TI MSP430 low-power analog peripherals help home portable healthcare products
- [Sipeed LicheeRV 86 Panel Review] I Unboxing and Basic Function Test
- [Atria Development Board AT32F421 Review] 4. Run RTX
- [MM32 eMiniBoard Review] Initial Impressions of Receiving Data Download Environment Setup
- A brief discussion on several application solutions of GPRS
- 【Embedded Qt】Building the Qt runtime environment for embedded Linux
- Project Submission