0 Introduction
LCD liquid crystal display devices are used as information display interfaces for intelligent instruments. They have the characteristics of low voltage, low power consumption, and clear display. Nowadays, they are widely used in low-power intelligent instruments. The JM240128A LCD used in this article is a graphic dot matrix LCD display, which consists of a controller T6963C, a row driver/column driver, and a 240×128 full dot matrix LCD display. It can display graphics and 15×8 (16×16 dot matrix) Chinese characters. The biggest feature of T6963C is its unique hardware initial value setting function. The parameters required for display driving, such as duty cycle coefficient, the number of bytes/rows transmitted by the drive, and the font selection of characters, are all set by the pin level. In this way, the initialization of T6963C is basically set when it is powered on, and the main focus of software operation can be fully used in the design of the display screen.
The 8-bit PIC series microcontrollers launched by Microchip Technology of the United States use a reduced instruction set (RISC), Harvard bus (Harvard) structure, and a two-stage pipeline instruction fetching method. They are practical, low-priced, have a small instruction set, low power consumption, high speed, small size, powerful functions, and are easy to learn. PIC16F774 belongs to a type of PIC mid-range series microcontrollers. It uses a 14-bit RISC instruction system. While maintaining a low price, it adds many functions such as A/D, internal EEPROM memory, comparison output, capture input, PWM output, I2C and SPI interfaces, asynchronous serial communication (USART) interface, analog voltage comparator, LCD driver, FLASH program memory, etc. It is a very powerful microcontroller. As long as its internal resources are fully utilized, a fully functional system can be formed with very few peripheral circuits.
1 Hardware circuit design of LCD module and PIC microcontroller
In this article, the connection between the PIC16F774 microcontroller and the JM240128A LCD module adopts an indirect control method, and its hardware circuit connection is shown in Figure 1.
Figure 1 Hardware circuit connection diagram of PIC16F774 microcontroller and JM240128A liquid crystal display module
In order to save the limited I/O port resources of the PIC microcontroller, the data transmission adopts serial transmission mode, and the serial/parallel conversion of the data is performed through the eight-bit serial input/parallel output shift register 74HC164 chip, and the data is transmitted to the LCD liquid crystal display module in parallel. In Figure 1, RA4 transmits data, RA2 provides clock pulses, and the C/D, /RD, and /WR control signals are directly controlled by PIC16F774 through RB3, RB2, and RB1. Since the integrated chip 74HC164 is a high-speed device, it meets the refresh rate requirements of the LCD. In this article, 74HC164 is only used for the liquid crystal display module, so the /CE signal can be grounded. The V0 pin in the JM240128A liquid crystal display module is the liquid crystal drive voltage. Since the module has its own negative voltage, the pin is suspended in Figure 1. If an external negative voltage is required, connect it to the VOUT pin.
The 8-bit edge-triggered shift register 74HC164 used for data serial/parallel conversion is a high-speed silicon gate CMOS device compatible with low-power Schottky TTL (LSTTL) devices. Data is serially input through one of the two input terminals (A or B). Either input terminal can be used as a high-level enable terminal to control the data input of the other input terminal. The two input terminals can also be connected together, or the unused input terminal can be connected to a high level, but it must not be left floating. Every time the clock (CP) changes from low to high, the data is shifted right by one bit and input to Q0. Q0 is the logical AND of the two data input terminals (A and B), which maintains a setup time length before the rising clock edge.
The LCD controller T6963C contains 67 pins. After being embedded in the LCD display module, it realizes the interface of row and column drive and display buffer. Therefore, we only need to connect a small number of pins to the microcontroller to realize complex Chinese, English and graphic display. There are two types of interface circuits between the LCD display module and the microcontroller: direct control and indirect control. This article adopts the latter control method.
The structural features and working principle of the T6963C controller are as follows:
T6963C is a dot matrix LCD graphic display controller. The character font is set by hardware. It can be displayed in graphics, text, and graphics and text synthesis, as well as feature display in text mode. It can also realize graphics copy operation, etc. It has an internal character generator CGROM with a total of 128 characters. T6963C can manage 64K display buffer and character generator CGRAM. It allows MPU to access the display buffer at any time and even perform bit operations. The initialization setting of T6963C is generally completed by pin setting, so its instruction system will focus on the setting of display function. T6963C instructions can have one or two parameters, or no parameters. The execution of each instruction is to first send in the parameters (if any) and then send in the instruction code. The interface between T6963C and row and column drivers and display buffer RAM has been realized on the LCD display module with built-in T6963C. At the same time, the structure of the LCD screen (single or double screen), data transmission mode, display window length, width, etc. have been set by hardware.
2 Software control of LCD module and PIC microcontroller
Software design flow chart
The data transmission and display between PIC microcontroller and LCD liquid crystal display module is realized by controlling the operation of T6963C. The software program flow is shown in Figure 2.
2.2 LCD driver subroutine
The system instruction set of the LCD display module is the instruction set of the T6963C controller. The instructions of T6963C can take 1 or 2 parameters, or no parameters. The function of the LCD driver subroutine is to read and write the LCD. [page]
The LCD display must be initialized before use. In addition to setting the program stack pointer, the initialization mainly sets the functions of the control chip T6963C in the LCD module, such as text/graphics first address and area settings, text/graphics switch, cursor shape setting and flashing switch, mode setting and screen clearing, etc.
2.4 Display of Chinese characters
The display of characters in the LCD display module can be realized in two ways: text display and graphic display. Here we focus on the method of displaying Chinese characters in graphic form.
The 240×128 dot matrix LCD display module can display 15×8 Chinese characters. For the display of each Chinese character, the address of the Chinese character in the character library should be calculated first, and then the font code of the Chinese character should be read out. When the display reaches the end of a line, it should be displayed in a new line.
When displaying Chinese characters, a 16×16 Chinese character font code occupies 32 bytes, and each line of display requires 2 bytes; when the second line is displayed, the display address should be added to the first byte address of the previous line by 30, and a total of 16 cycles are required to fully display a Chinese character.
When processing Chinese character display, if you want to realize the reverse display of Chinese characters (for example, to realize menu operation), the 32-byte font data of Chinese characters is XORed (XRL) with 0xFF, or inverted (CPL) before displaying.
In this system, it is also necessary to display numbers, letters and cursors, which are all displayed in a graphical 16×8 dot matrix. The display method of 16×8 dot matrix is similar to that of 16×16 dot matrix display, so I will not repeat it here.
Figure 2 Program Flowchart
3 Application of LCD Module in Medical Instruments
The interface between the LCD display module and the PIC microcontroller introduced in this article adopts the data serial transmission method, which not only saves I/O port resources, but also makes data transmission more stable and reliable, and operation control more flexible and convenient. This method has been successfully applied to the research and development of semi-automatic biochemical analyzer products. Practice has proved that the LCD screen has a clear display effect and no flicker, which meets the display requirements of the biochemical analyzer.
Figure 3 Schematic diagram of semi-automatic biochemical analyzer
The semi-automatic biochemical analyzer uses PIC16F774 as the main chip, and is composed of aspiration and washing circuit module, filter rotation module, multi-stage amplification circuit module, temperature control module, and peripheral input and output devices such as micro-printer, LCD liquid crystal display module and membrane keyboard. The principle is shown in Figure 3. The measurement results can not only be displayed in the form of characters on the LCD screen, which is beautiful and convenient, and easy to read data directly, but also can be printed out through the micro-printer for further analysis and research. The use of the membrane keyboard can realize functions such as page turning query and data entry. Due to the limited I/O port resources of the PIC16F774 microcontroller, the LCD liquid crystal display module and the micro-printer interface both exchange data with the PIC16F774 microcontroller in serial mode, which effectively solves the interface problem. The application of the LCD liquid crystal display module also provides a guarantee for the low power design of the entire system.
4 Conclusion
The author's innovation lies in the serial interface design between the microcontroller and the LCD display module, and the use of the high-speed eight-bit serial input/parallel output shift register 74HC164 for data serial/parallel conversion, which has fast execution speed and high refresh rate, meeting the display requirements of LCD in biochemical analyzers. Practice has proved that the use of graphic dot matrix JM240128A LCD module as the display terminal of intelligent instruments has standardized interfaces and beautiful interfaces. Since the electrical characteristics and hardware circuit interfaces of most LCD models are very similar, the method used in this article is generally applicable.
Previous article:A low-power mass storage system for single-chip microcomputer based on USB flash drive
Next article:Data Monitoring System Based on VC++
Recommended ReadingLatest update time:2024-11-16 19:56
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
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
- [NXP Rapid IoT Review] Hello GPIO
- How to draw a plum blossom pad in AD? The plum blossom pad network is independent and does not belong to any network
- #idlemarket# Transfer a brand new STM32L433 development board
- Leakage current and withstand voltage test of single-cell lithium battery powered products
- Getting Started with I2C on MSP MCUs
- TMS320VC5509A and aic23b chip have problems collecting noise signal frequency
- TFT LCD display to set the timer
- Carbon Film Resistors Risks
- ST MEMS Device Resource Library-Development Platform Application Guide
- I'm new to PCB, please give me some guidance, thank you