Rabbit2000 LCD display controller KS0108B interface

Publisher:Zhenai5201314Latest update time:2015-04-16 Source: eechinaKeywords:Rabbit2000 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction

LCD has the characteristics of displaying a lot of information, small size and low power consumption, and is widely used in terminal display and human-machine interface. It can be used with the high-performance RabbitCore RCM2200 module to form an advanced intelligent instrument. In the Bluetooth wireless data receiving and sending system we developed, the display of Bluetooth device link information and data transmission and reception and other related information plays a very important role. This article introduces the practical interface circuit and software design of RabbitCore RCM2200 module and M12864-7A7.

2 Introduction to Rabbit2000 and RabbitCore RCM2200 The

Rabbit2000 8-bit microprocessor has a similar structure and high compatibility with the Z80 series microprocessor, but the performance has been greatly improved. It has 4 serial ports, 40 general-purpose I/O pins, built-in calendar, clock, watchdog, timer, multi-level interrupt, dual DMA channels, and can expand 4MB~8MB Flash for data storage. For microprocessors with 8-bit buses, Rabbit has constructed most of its external 8-bit buses and has a concise instruction set. Its performance is the same as that of many 16-bit processors and it can perform 16-bit operations. Rabbit2000 uses an interface cable to connect the PC serial port and the target system based on Rabbit2000 to realize software development, which is supported by the Dynamic C compiler, which has an interactive compiler, editor and debugger. Assembly language code can be embedded in Dynamic C code or used as an independent function. Compilation and debugging can be achieved without leaving the Dynamic C development environment, which shortens the development time and makes programming easier.

RabbitCore RCM2200 module uses Rabbit 2000 microprocessor, has 256 KB Flash and 128 KB SRAM, 4 serial ports, 26 I/O ports, and 10Base-T Ethernet port. Using RCM2200, you can control, monitor and debug embedded systems through the network or Internet. There is a software toolkit that supports RCM2200, providing TCP/IP protocol and Dynamic C system software.

3 KS0108B LCD controller

KS0108B LCD display controller is mostly used for graphic dot matrix LCD displays of small and medium modules (Hitachi's HD61202 is fully compatible with it and can be directly replaced). Its characteristics are built-in 64-bit × 64-bit display memory. The display status of each pixel on the display screen corresponds to each bit of data in the display memory. The data in the display memory is directly used as the driving signal for graphic display. When the display data is "1", the corresponding pixel is displayed, and when it is "0", the corresponding pixel is not displayed. KS0108B needs to be matched with the corresponding row driver KS0107B with oscillator and display timing engine to form a complete LCD drive and control system. The instructions and functions of KS0108B are shown in Table 1.



4 Block diagram and pins of M12864-7A7 LCD module

M12864-7A7 LCD module uses two KS0108B as column drivers and one KS0107B as row driver. KS0107B is not connected to MCU and can generate row drive signals and various synchronization signals as long as power is provided. Figure 1 is the structure of LCD module; block diagram, pin functions are shown in Table 2.



5 Hardware interface circuit

There are two ways to connect the built-in KS0108B graphic dot matrix LCD module with MCU (single-chip microcomputer or Rabbit2000, etc.): direct access mode and indirect control mode. The direct access mode is to directly hang the interface of the LCD module as a memory or I/O device on the MCU bus, and the MCU operates the work of the LCD module by accessing the memory or I/O device. The indirect control mode is that the MCU connects to the LCD module through the parallel interface in itself or the system. The application given below uses the PA port in the parallel port of RCM2200 and some pins in the PB, PD, and PE ports. The MCU controls the LCD module by operating these interfaces.

In the circuit shown in Figure 2, the PA port of RCM2200 is used as the data port, PB7 is RET, PD3 is D/I, PD4 is R/W, PD5 is E, PE5 is CS1, and PE7 is CS2 and other signals. V0 is the negative voltage required by the LCD display. The voltage can be adjusted by the potentiometer connected to it. The voltage range is -10V to 0V, which can achieve the purpose of adjusting the display contrast.
6 Dynamic C source program

6.1 Program description

This article focuses on the subroutine for displaying Chinese characters, which can display specified Chinese characters at specified locations. The 7 subroutines are the LCD initialization subroutine, screen clearing subroutine, command writing subroutine, data writing subroutine, delay subroutine, single Chinese character display at specified location and information display subroutine.

The following are some subroutines of the indirect control method shown in Figure 2. All programs are compiled and debugged using the Dynamic C 7.32TSE version compiler. [page]


 
 
 
 
 
 
 
 

The M12864-7A7 LCD module is a 128×64 dot matrix, and each Chinese character is a 16×16 dot matrix, so each line can display 8 Chinese characters, and one screen can display 4 lines. The entire screen can display up to 32 Chinese characters.

The parameters pag and col in the function represent the page address (X address) and Y address, and *hzk is a pointer to the dot matrix of the Chinese characters to be displayed. Among them, 0<=pag<=7, col is any value of 0, 16, 32 or 48; pag and col can determine the position of the Chinese characters to be displayed. From Table 1, we can know that the starting value of the page address (X address) is Oxb8 (defined as Page_Add in the program), and a Chinese character needs to span two pages to be displayed, so the formula for calculating the page address is Page_Add+pag+j, 0≤j≤l; and the starting value of the Y address is 0x40 (defined as Col_Add in the program), and each Chinese character needs 16 columns to be displayed, so the formula for calculating the Y address is Col_Add+col. The Y address calculator has an automatic addition function, which automatically adds 1 after each read/write data, so when reading/writing data continuously, it is not necessary to set the Y address counter every time. At

the beginning of the program, the LCD initialization subroutine must be called first, then the screen is cleared, and then the LCD display is turned on to the left or right screen depending on whether the Chinese character to be displayed is on the left or right screen, and then the data is sent to the LCD display until the 32-byte Chinese character is fully displayed; the display of multiple Chinese characters is operated in the same way.

For the display of multiple information, void Msg(void) can be changed to void Msg(flag), that is, different values ​​of flag are used to identify different information to be displayed, and then, in actual use, it can be realized by calling void Msg(flaS).

7 Conclusion

The connection between the M12864-7A7 LCD module and the RabbitCore RCM2200 module adopts an indirect control method, which is characterized by a simple circuit, the control sequence is realized by software, and the interface between the high-speed MCU and the LCD module can be realized. The use of Dynamic C can easily realize the display function of the LCD module, which requires more complex logic in assembly language, and can shorten the development and debugging time.
Keywords:Rabbit2000 Reference address:Rabbit2000 LCD display controller KS0108B interface

Previous article:The minimum system and development of Lingyang 16-bit single-chip microcomputer SPCE061A
Next article:Circuit Design of Thermistor Temperature Measurement System Based on MSP430 Single Chip Microcomputer

Latest Microcontroller Articles
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号