1 Introduction
In the design of intelligent instruments, it is usually necessary to display the measurement and control information. Due to the power consumption, volume and other conditions of the instrument, general CRT displays are often not suitable. Although semiconductor digital tubes can display numbers and a few letters, they cannot flexibly display various texts, graphics, tables, etc., and have great limitations. LCD displays are widely used in the display of various intelligent instruments due to their advantages such as powerful functions, low power consumption, clear display and light structure. PIC microcontroller is a high-performance microcontroller launched by MICROCHIP of the United States. Compared with the traditional MCS51 series microcontroller, it has many built-in functional modules, good anti-interference, fast speed and low power consumption, and is widely used in the field of industrial control [1]. This article will take SED1520 and PIC16F874 as examples to introduce the practical method of LCD display and PIC microcontroller interface.
2 Structure, instructions of SED1520 and its interface circuit with PIC microcontroller
The structural block diagram of SED1520 is shown in Figure 1. It mainly consists of a timing counter, row and column address storage and decoding circuit, display RAM, MPU interface circuit, and LCD interface circuit. Its interface with the outside is mainly divided into three parts: one part is power supply, reset signal and clock; one part is LCD interface, and the other part is interface with MPU (microprocessor). The interface with LCD is generally provided by the manufacturer of LCD module. For the user of LCD module, only the part with MPU interface needs to be mastered. In addition, SED1520 also needs to provide a 2KHZ clock signal [2].
The instruction list of SED1520 is shown in Table 1. Its display memory has 4 pages (corresponding to page addresses 0~3), each page has 80 bytes (corresponding to column addresses 0~79), and the 8-bit data in each byte corresponds to the 8-dot row in the same column on the display screen. The column address pointer manages these 80 byte units. The column address pointer is a 7-bit plus 1 counter. It and the page address register uniquely specify a unit of the display memory. The RAM in SED1520 has 32 lines, divided into 4 pages, 8 lines per page. If characters are displayed in 8*8 dot matrix, 10 characters can be written in one line per page, and 4 lines in total. Chinese characters are generally 16*16 dot matrix, so 5 characters can be displayed in each line, and 2 lines in total. If multiple SED1520s are put together, LCD modules with different display capacities can be formed.
The interface circuit between SED1520 and PIC16F874 is shown in Figure 2. The pins are described as follows:
A0: instruction/data selection. A high level indicates that data is transmitted, and a low level indicates that instructions are transmitted.
Chip select signal, low level is valid, and high level means that the MPU does not access SED1520.
Read enable, low level indicates that the MPU reads data or instructions from SED1520, and high level is invalid.
Write enable, low level indicates that the MPU writes data or instructions to SED1520, and high level is invalid.
CL: clock input terminal. Provided by RC1 of PIC16F874, it allows it to work in PWM2 output mode.
D0~D7: data input and output pins.
Reset signal input terminal, low level is valid.
VDD: logic power positive.
VSS: logic power ground. [page]
The interpretation and execution of the instructions of SED1520 do not rely on the external clock, but are synchronized by the internal clock, so its instruction execution speed is very fast, and it is generally not necessary to detect whether SED1520 is busy. Since the I/O port of PIC16F874 is output or input, the corresponding register must be set [3], as shown in Figure 2, the RD port of PIC16F874 must be set as an output port when writing data to SED1520, and it must be set as an input port when reading data. In order to simplify the program and increase the speed, we can write data directly to it without reading the status of SED1520. In this way, the RD pin of SED1520 is directly connected to a high level, and the RC3 pin of PIC16F874 can also be saved for other uses.
3 Specific programming examples
In specific practical applications, we often need to display Chinese characters. The general Chinese character model is shown in Figure 4. The 8 bits inside the byte are arranged horizontally, while for SED1520, the 8 bits of the byte are arranged vertically, that is, each character is displayed across 8 lines. It is necessary to display Chinese characters according to Figure 5.
Then the bytes of the font need to be calculated bit by bit as follows: bit7 of the 8 bytes of byte group 1 of the standard font is combined to become byte 1 of the SED1520 Chinese font, bit6 is combined to become byte 2 of the SED1520 Chinese font, and so on, the 32 bytes of the SED1520 Chinese font can be calculated. When displaying, first determine the position of byte 1 (page address and column address), then display bytes 1 to byte 16 continuously, then add 1 to the page address, and the column address is the column address of byte 1. After setting, send bytes 17 to byte 32 to complete the display of a Chinese character. We will take 12232 as an example to introduce the use of the LCD module. 12232 has two built-in SED1520s. Different SED1520s are accessed through chip selection. It can display 4 lines (corresponding to page addresses 0~3), and each line can display 122 characters. The first 61 characters correspond to the left SED1520, and the last 61 characters correspond to the right SED1520. Column addresses 0~60 correspond to the positions of these 61 characters, and column addresses 61~79 are not used. The program flow chart for initializing SED1520 is shown in Figure 3. Clearing the screen is to set all the data in the display RAM to 0. After initialization, to display characters at a specific position, you need to set the corresponding page address (row) and column address, and then write data to SED1520. The following is the display part initialization program flow chart.
4 Conclusion
SED1520 is a high performance-price ratio LCD driver chip. It can be used in various instruments with single-chip microcomputer interface, which has the characteristics of hardware saving, low power consumption, and simple software program. The interface design has been successfully applied to the display of electric vehicle power management, proving that the design is stable and reliable.
The author's innovation point: Before writing data to the LCD controller, the single-chip microcomputer generally reads whether it is busy to avoid data writing failure, and the I/O port of the PIC single-chip microcomputer must constantly change the setting of the port during the function conversion between reading and writing, so the program is very cumbersome and may also cause system instability. After actual design and application, the author omitted the read status detection of the LCD controller and made appropriate delays according to the read and write timing described in the SED1520 data sheet. This streamlined the program and saved the I/O port, which is relatively valuable in the single-chip microcomputer system design, and the system has been stable.
Previous article:Automobile Electric Power Steering System Using PIC Microcontroller
Next article:High-precision data acquisition device based on PIC16F87X series microcontroller
- Popular Resources
- Popular amplifiers
- singlechip-implementation-of-levelcrossing-adc-for-ecg-sampling-2332-0796-1000219
- Linux lcd_display_font tutorial
- Research on control algorithm and program design of intelligent tracking car_Technical report of the first \"Freescale\" Cup National College Student Intelligent Car Invitational Competition
- USB Complete The Developer\'s Guide 5ed (USB Development Complete 5th Edition)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- The award-winning live broadcast will start at 10:00 this morning: "Dadatong helps you unlock the new generation of ADAS technology"
- Free Pinouts eBook (The Pinouts Book) V0.3
- [ESK32-360 Review] 4. Run the virtual serial port routine
- 【TI recommended course】#Lecture on basic knowledge of electronic circuits#
- Low-pass filter waveform distortion problem
- Questions about PCB antenna
- 【AT-START-F425 Evaluation】01 Development Environment Construction
- [RVB2601 Creative Application Development] RVB2601 Hardware Part--1
- #Servo What is a servo?
- Allegro differential pair equal length setting