1602 LCD related c51 programming

Publisher:Lihua1314520Latest update time:2012-08-18 Source: 51hei Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1. Writing data and instructions needs to be done on the rising edge of LCDEN level. To achieve this, you should: ensure that LCDEN=0 when the program executes other instructions;
LCDEN level must be pulled low immediately after completing the execution of read and write data and instructions;
Ensure that LCDEN=0 before executing the write data instruction sub-function. For example:

…
 LCDEN=0;
…
void write_dat(char a)
{
 char e=1;
 while(e)e=read();
 RS=1;
 RW=0;
 P0=a;
 LCDEN=1;
 for(e=127;e>0;e--);
 LCDEN=0;
}

It is not possible to only pull the LCDEN level down before pulling the LCDEN level up in the write data instruction sub-function without delay.
For example this is wrong:

void write_cmd(char a)
{
 char e=1;
 while(e)e=read();
 LCDEN=0;
 RS=0;
 RW=0;
 P0=a;
 LCDEN=1;
 for(e=127;e>0;e--);
}

2. If the screen scrolling mode is used, the video memory address set before writing data is the position where the cursor stops. For example

Enter "QQ 814921012"

Address setting: write_cmd(0x82);

The screen will finally display: 12_

 
3. When the program starts to initialize the screen, the clear screen command should be executed. The clear screen command should also be added in due course during the program.

4. The scrolling is to connect the first and last addresses to form a ring. After executing the scrolling command, the screen will scroll immediately, and it will scroll once each time it is executed.
 The two lines scroll together and cannot be separated.
Reference address:1602 LCD related c51 programming

Previous article:C51 MCU Programming Specifications
Next article:TLC549 analog-to-digital conversion C51 program

Recommended ReadingLatest update time:2024-11-16 16:19

Based on ds18b20 temperature band upper limit program--LCD1602 liquid crystal display
This is displayed using 1602. The program is a modification of the previous experiments. When the temperature is =40 degrees, the fan rotates. This is a microcontroller system experiment for participating in an electronic competition. The program is in assembly language (ASM) with detailed comments, which is worth refe
[Microcontroller]
LCD1602 four-bit bus attempt successful
   According to the instructions of LCD1602, it can be set as a four-bit bus. The original eight-bit parallel port input wiring can be reduced by four, that is, only D4-D7 (pins 11-14, pins 7-10 are not connected). This is suitable for situations where there are fewer or tight microcontroller interfaces. However, after
[Microcontroller]
Use of 1602 LCD display
LCDE==P2.7      LCD enable DB==P0              data bit RD==P2.6          write mode select WR==P2.5          read and write enable Instruction code:                                binary                    hexadecimal Clear screen:                              10000000                        0x80; Cursor hom
[Microcontroller]
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号