Implementation of 51 single-chip microcomputer and graphic LCD interface technology

Publisher:mmsg3814Latest update time:2012-01-16 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
In recent years, LCD has been increasingly used in instruments controlled by single-chip microcomputers. A good human-machine interface for instrument display has always been people's pursuit. Recently, a single-chip microcomputer was used to successfully display pictures on the EDM240128 graphic LCD.

1. Features of LCD module:

EDM240128 graphic LCD is a 240*128 dot matrix LCD produced by Dalian Shenxun Information Co., Ltd. It has a built-in 8K data memory, and the LCD display control chip is T6963C produced by Toshiba. Its bus can be directly adapted to the MCS51 bus. It allows the single-chip microcomputer to access the display buffer at any time, and even perform bit operations to directly control a certain point. At the same time, this LCD also has the function of automatically adding/subtracting 1 to the read/write address, which provides convenience for the transmission programming of large amounts of data.

2. Hardware implementation:

Using the 89S52 single-chip microcomputer, which has an 8K FLASH ROM inside, the picture data and program to be displayed are directly stored in it, making the implementation of this circuit function very simple.

Figure 1 is the interface circuit between 89S52 and LCD display module in parallel mode.

P1.0 is connected to the reset of LCD, and VEE is used to adjust the grayscale of the display screen. The voltage range given in the manual is 8V~ -23V. It is found that the display color is too dark and cannot be seen clearly when it exceeds -15V. The actual test shows that the appropriate voltage range is -13.8V~-14.8V. Adjusting the voltage at this point can change the depth of the color of the characters and graphics on the display screen. Since the current at this point is extremely small, it can be adjusted with an ordinary potentiometer.

3. Extraction of image data

A dedicated program can be used to convert images into byte-type data. This article uses PICtoCODE [Image Data Generator] V1.0, designed by hy_zhangwang. This software can be downloaded for free from the Internet.

PICtoCODE can convert black and white monochrome images (supporting BMP, JPEG, JPG, GIF and other formats) into data files in A51, C51, HEX and other formats. The order of data generation is from top to bottom and from left to right. The upper left corner pixel corresponds to the first byte, and the lower right corner corresponds to the last byte. The software requires that the image width must be an integer multiple of 8. If the image width to be processed is not an integer multiple of 8, it is necessary to pre-process it with a graphics editing software (such as the drawing program that comes with the Windows system).

If the image is not a black and white monochrome image, you can use the "Color>>Black and White..." function to convert the image to a black and white image, and then export the data or code.

4. Software Design

The control instructions of EDM240128 can have two parameters, one parameter, or no parameters. Each instruction first enters the parameter and then the instruction code. If the number of parameters sent exceeds the specified number, the last one entered is valid. The status word must be checked before each operation. Because the status bit has different functions, different status bits should be checked when executing different instructions. The 240*128 points on the display, each 8 points is a byte of data, and they all correspond to the data in the display buffer one by one. One point corresponds to one bit, bit=1, the point displays a black dot, bit=0, the point disappears.

LCD has a display ON/OFF command. When display ON, the data in the display buffer corresponds to the display screen. When display OFF, the screen disappears, but the data in the buffer still exists and is not lost. For more information about the command, please refer to the T6963C user manual.

The software is written in C51, which greatly improves the development efficiency.

MCU program:

#define ming 0x4000 //Instruction port address
#define shuju 0x0000 //Data port address
#include
void delay(unsigned int i) //Delay
{/*-----------*/}
void writed(char a) //Write data subroutine
{/*----------*/}
void writec(char a) //Write instruction subroutine
{/*-----------*/}
void busy() //Judge whether the flag is busy
{*/-----------*/}
main()
{ unsigned char ji=0;
code char seg[3840]={/*-----------*/};///Picture data to be displayed
P1_0=0;
delay(100);
P1_0=1;
busy();
writed(0x00);
busy();
writec(0x24);
busy();
writec(0xb0); /////Set automatic writing, add one to the address
busy();
for(ji=0;ji<3840;ji++)
{ writed(seg[ji]);
busy();
}
writec(0xb3); // Automatic writing ends
busy();
writec(0x98); // Open display
//-----------------------------------
}

5. Conclusion

T6963C control chip is widely used in various graphic dot matrix LCDs. In addition to EDM240128 and EDM12864 graphic LCDs of Dalian Shenxun Company, OCM128*64, OCM240*128 of Jinpeng Okola Company, CA12864A of Shenzhen Songshan Company, and MPG240128A of Truly Company all use this chip. We can easily make various friendly human-machine interfaces.

Reference address:Implementation of 51 single-chip microcomputer and graphic LCD interface technology

Previous article:The realization of MP3 bus station announcer
Next article:Fast Algorithm for Binary-to-Decimal Conversion of 51 Single-Chip Microcomputer Integers

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号