LCD1602 Liquid Crystal

Publisher:Lihua521Latest update time:2022-04-27 Source: eefocusKeywords:LCD1602 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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
Pinout

Timing
Timing

Steps

Initialize
write command (RS=L) Set display coordinates
and write data (RS=H)

Command to
clear the screen:
Clear screen

Instruction code: 0x01

Enter mode settings:
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 data

Common instructions: 0x06

Display switch control:
Display switch control

D: 0, display function off; 1, display function onC
: 0, no cursor; 1, cursorB
: 0, cursor flashing; 1, cursor not flashing

Common instructions: 0x0c

Function settings:
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 character

Common instructions: 0x38

DDRAM
DDRAM

When writing the display address, the highest bit D7 is required to be constant at high level 1.
Actual address: addr + 80H

Common instructions: 0x80 (set starting point)

Application Circuit
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}


Keywords:LCD1602 Reference address:LCD1602 Liquid Crystal

Previous article:EEPROM IIC
Next article:Serial port structure of 51 single chip microcomputer

Recommended ReadingLatest update time:2024-11-16 14:52

Download LCD1602.h and LCD1602.c files (51 MCU LCD driver)
Contents of LCD1602.c file (this is a complete 1602 LCD screen driver file with protues simulation file using 51 single-chip microcomputer): Complete program source code and simulation file download: http://www.51hei.com/f/TLC1543c51.rar  /*----File Description---- - File Name: LCD1602.h - Functions: - Description
[Microcontroller]
Program for LCD1602 to display adjustable clock
//Hope it helps beginners// #include #define uchar unsigned char #define uint unsigned int sbit lcden=P2^7; sbit lcdrs=P2^6; sbit W=P2^5; sbit k1=P3^0; sbit k2=P3^1; sbit k3=P3^2; uchar num,count,k1num; char miao,fen,shi; uchar code table =" 2015-01-5 SAT" ; uchar code table1 =" 00:00:00"; void delay(u
[Microcontroller]
C8051F LCD1602 Program
摘要: /********************************************************************************************************** File : LCD1602.c* Hardware Environment: DVK501 F320 EX* Build Environment : Silicon LABs 3. ... /******************************************************************************************************** * * F
[Microcontroller]
Based on 51 single chip microcomputer + LCD1602 display
LCD1602 Introduction LCD1602 related pins LCD1602 write command, write data related operation diagram According to the above timing diagram and timing parameter diagram, we can write the write command code and write data code Write command code Write Command void write_com(char command) { RS = 0;  RW = 0;
[Microcontroller]
Based on 51 single chip microcomputer + LCD1602 display
AT89S52 and LCD1602 (asm/c51)
  LCD1602 DDRAM address mapping table: The first line address is 80H The second line address is C0H Interface between MCU and LCD1602 ;///////////////////////////////////////////////////////// Project name: AT89S52 and LCD1602 interface Experimental function: Display WWW.LZY.EDU.CN on the first
[Microcontroller]
AT89S52 and LCD1602 (asm/c51)
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号