It is a dot matrix LCD module specially used to display letters, numbers and symbols.
It is composed of several 5x7 or 5x10 dot matrix character positions.
Pinout
Timing
Steps
Initialize
write command (RS=L) Set display coordinates
and write data (RS=H)
Command to
clear the screen:
Instruction code: 0x01
Enter mode settings:
I/D: 0, the cursor moves left after writing new data; 1, the cursor
moves right after writing new data S: 0, the display screen does not move after writing new data; 1, the display screen moves right by 1 character after writing new dataCommon instructions: 0x06
Display switch control:
D: 0, display function off; 1, display function onC
: 0, no cursor; 1, cursorB
: 0, cursor flashing; 1, cursor not flashingCommon instructions: 0x0c
Function settings:
D: 0, data bus is 4 bits; 1, data bus is 8 bits
N: 0, display 1 line; 1, display 2 lines
F: 0, 5×7 dot matrix/each character; 1, 5×10 dot matrix/each characterCommon instructions: 0x38
DDRAM
When writing the display address, the highest bit D7 is required to be constant at high level 1.
Actual address: addr + 80HCommon instructions: 0x80 (set starting point)
Application Circuit
Example
sbit LCD1602_E = P2^7; sbit LCD1602_RW = P2^5; sbit LCD1602_RS = P2 ^ 6; void LcdWriteCom(uchar com) //write command { LCD1602_E = 0; // Enable LCD1602_RS = 0; //Select to send command LCD1602_RW = 0; //Select write LCD1602_DATAPINS = com; //Insert command Lcd1602_Delay1ms(1); //Wait for data to stabilize LCD1602_E = 1; //Write timing Lcd1602_Delay1ms(5); //hold time LCD1602_E = 0; }void LcdWriteData(uchar dat) //Write data { LCD1602_E = 0; //Enable clear LCD1602_RS = 1; //Select input data LCD1602_RW = 0; LCD1602_DATAPINS = dat; //Write data Lcd1602_Delay1ms(1); LCD1602_E = 1; Lcd1602_Delay1ms(5); LCD1602_E = 0; }void LcdInit() { LcdWriteCom(0x38); //Open the display LcdWriteCom(0x0c); //Turn on the display without displaying the cursor LcdWriteCom(0x06); //Write a pointer plus 1 LcdWriteCom(0x01); //Clear screen LcdWriteCom(0x80); //Set the data pointer starting point}
Previous article:EEPROM IIC
Next article:Serial port structure of 51 single chip microcomputer
Recommended ReadingLatest update time:2024-11-16 14:52
- Popular Resources
- Popular amplifiers
- Single-chip microcomputer C language programming and simulation
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- stm32+lcd1602 example
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
- Is there a 24-bit AD chip with a gain of 256?
- How to choose the packaging form of resistors and capacitors? Are there any principles?
- EEWORLD University Hall----Microelectronics Technology (Harbin Institute of Technology)
- About the voltage spike problem of MOS in motor driver
- Embedded processors face side-channel attacks
- Insurance issues
- Typical application diagram from the DS125DF1610 product data sheet
- How to spend your one-hour commute every day
- Permanent magnetic material measuring device
- IBIS model parameter modification