Application design based on ACM12864J LCD display module

Publisher:神光骑士Latest update time:2012-03-13 Source: 微计算机信息 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0. Introduction
Dot-matrix flat-panel graphic LCDs are widely used in various portable products. There are many types of LCD controllers at the core of the display, and various control chips have differences in control circuit logic, control instructions, index parameters, etc. However, for flat-panel dot-matrix graphic LCDs that already have control circuits, users do not need to care about the integrated chip of its control core and several signals of the control circuit, and can easily use it for development.

1. Characteristics of ACM12864J LCD Module

ACM12864J is a small LCD module produced by United Electronics Corporation. The module is low-priced, has readable and writable data, has its own negative voltage generating circuit, single +5V power supply, backlight, can be directly controlled by various microcontrollers, data read and write operations are not controlled by an external clock, does not have a Chinese character library, has a duty cycle of 1/64, and has a total of 20 pins for external interface.

The data transmission method adopted by ACM12864J is vertical data transmission method. The 64 lines are divided into pages 0 to 7, with 8 lines per page, and displayed page by page. The steps of sending data are as follows: first send the first column of page 0, with the high bit at the bottom, which is one byte; then send the second column until the end of 128 lines; then send the first column of page 2, and so on, until the entire screen of data is sent. This data display method uses font extraction software and adopts the "vertical 8-point lower high bit" output format to extract the model. Without any modification, it can be displayed well. Its write timing is shown in Figure 1.
2. Hardware design of ACM12864J LCD display module application

ACM12864J data is an 8-bit parallel data interface, plus several control lines. If it is directly interfaced with a single-chip microcomputer, it will occupy too many lines. SPCE061A has a built-in SIO interface, which can be used to transmit 8-bit parallel data through serial-to-parallel conversion performed by 74HC164. In this way, even the backlight control signal line only occupies 8 I/O ports. If no read operation is performed, it can be reduced to 7 control signal lines. There are four interface modes for the SIO interface, namely, the address is 8-bit, 16-bit, 24-bit and no address interface. The interface with ACM12864J adopts no address transmission. After setting the register working state, data can be directly transmitted. The maximum transmission rate of the SIO interface of SPCE061A can reach 5Mb/S. The read and write control lines of the data are controlled by the I/O lines of the single-chip microcomputer, and the timing delay required by the LCD is directly controlled by the programmed bit operation function. When programming, there is no need to consider the time requirements of the SPCE061A and ACM12864J interface, which simplifies programming. The hardware circuit is shown in Figure 2.

3. Software Programming
3.1 SIO Initialization and Data Writing

SPCE061A single-chip microcomputer is a microcontroller with SOC system produced by Taiwan Lingyang Technology Co., Ltd. The controller has built-in A/D conversion, SIO port, etc. Before transmitting data, the serial peripheral device interface SIO of SPCE061A must initialize the SIO port control register. The SIO port control register P_SIO_Ctrl mainly sets the working mode of SIO port communication, including device address, transmission speed, read and write settings, function settings, etc. The SIO port data register P_SIO_Data is mainly responsible for receiving and sending data during the reading and writing process. The start control register P_SIO_Start of the SIO port is also a status control register. According to the status of P_SIO_Start, it is judged whether the data is received or sent.

SPCE061A does not provide bit operation instructions. When operating on a bit, in order not to affect the status of other bits, the "read-modify-write" method can be used, that is: first read the value of a certain bit, perform logical AND and logical OR operations, and then write it back to the current byte, which changes the status of the I/O port. To this end, write the bit operation functions Set_IOA_Bit (n, dir, attrib, buffer, data) and Set_IOB_Bit (n, dir, attrib, buffer, data) to solve the above problem. The parameters of the function are defined as follows: n-the number of bits for bit operation; dir, attrib, buffer-the attributes of bit operation; data-the data for bit operation. The procedure for transmitting data is as follows:

[page]

3.2 Display of ASCII characters

The most common method is to use font extraction software to extract fonts. This method is suitable under the condition of relatively few resources. The disadvantage is that it is more troublesome, needs to be changed back and forth, and is not easy to address. A more practical method is to make an ASCII font table and define it as a one-dimensional array. If there is an operation of digital variables in the program, the variables must be converted into characters for display. Therefore, first determine whether the displayed characters or numbers are numbers. If they are numbers, they should be converted into characters first. Then subtract 32 from the ASCII value to get the index value, and directly look up the table according to the index value to find the 8*16 dot matrix font and send it out for display. In the program, variables can be used to directly represent numbers and perform operations, and only variables are sent when displaying. For SPCE061A, there is a built-in 32K word flash ROM, and the table is not large. Add "const" before the array to store the array in the internal flash ROM. In ACM12864J, each ASCII font is 8*16, each ASCII font occupies 16 bytes, and is arranged in ascending order of ASCII to facilitate searching.

3.3 Display of Chinese characters

There are generally two modes of Chinese characters on ACM12864J: one is 12*12 dot matrix, which can display 5 lines of Chinese characters, but the disadvantage is that programming is more difficult; the other is 16*16 dot matrix, which can display 4 lines of Chinese characters and is relatively simple to program. Taking 16*16 dot matrix as an example, each Chinese character occupies 32 bytes. According to the requirements of LCD display, using font extraction software, the "vertical 8-dot lower high position" can meet the requirements.
When designing a Chinese menu, 8 Chinese characters can be displayed per line. There is a "focus" problem. When programming, a "focus pointer" can be set. The ones under focus are highlighted, and the others are displayed normally. In this way, each line of display can be compiled into a function to control the focus, and the display line sub-function is called once when displaying. The Chinese character display program is as follows (fb=1, highlighted):

3.4 Display of graphics and animations

Graphics and animations are usually displayed on the entire screen. You can use the brush tool under Windows to select fonts. Create a 128*64 pixel picture, edit it, and save it as a black and white image. Then open it in the font software and extract the font. Each picture takes up 128*8 bytes of space. According to the characteristics of image data storage, the extracted adjacent font data is the same. If there are many pictures or animations are displayed, it is best to compress and save them to save valuable controller resources. When reading, write the controller software to decompress.

3.5 Curve Display and Drawing

Points are the basic units that make up a curve. Drawing a curve means calling point functions multiple times to display it. The idea of ​​compiling point functions is to determine a point based on the horizontal coordinate X (1<=X<=128) and the vertical coordinate Y (1& lt;=Y<=64). When drawing a function, the X coordinate is from left to right, which just fits people's habits. But the Y coordinate increases from top to bottom, which is opposite to people's habits, so it must be corrected. Taking the drawing of a two-cycle sine function as an example, you can include the header file "math.h" and call the library function y=sinf(x), where x is a floating point radian display and the value of y is between -1 and 1. To display it on the full screen, you must add 1 to become positive and magnify it 31 times; the x coordinate is 128 points, and the step size is 0.1 radians. You can refer to the following program:

4. Conclusion

This article introduces the interface technology between ACM12864J and SPCE061A without Chinese character library, and proposes a skillful programming solution. Using ACM12864J LCD display module, it can display characters, Chinese characters, graphics and animations, etc., which improves the visual interface of the system and has been widely used in industrial instruments. SPCE061A produced by Lingyang Company has not only the functions of general controllers, but also its unique voice processing function, which can develop many intelligent products.

References
[1] Shenzhen United Electronics Company LCD Display Module ACM12864J User Manual
[2] Lingyang Technology Co., Ltd. μ'nSPTM MCU [R]. 2001
[3] Xue Junyi et al. Lingyang 16-bit MCU Principle and Application. Beijing University of Aeronautics and Astronautics Press, 2003

Reference address:Application design based on ACM12864J LCD display module

Previous article:A Method of Real-time Data Monitoring Using VB6.0 Digital Oscilloscope Single Chip Microcomputer
Next article:Hardware and software interface technology and its application for single chip microcomputer controlled mobile phone

Recommended ReadingLatest update time:2024-11-17 03:03

Design of hip force tester based on SPCE061A single chip microcomputer
Abstract: This paper introduces the system structure and some software writing process of the hip force tester based on SPCE061A single-chip microcomputer, focusing on the force measurement method of the tester and the principle of using photoelectric encoder for speed measurement and phase discrimination. The teste
[Medical Electronics]
Design of hip force tester based on SPCE061A single chip microcomputer
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号