1 Introduction
LCD has the characteristics of displaying a lot of information, small size, low power consumption, etc., and is widely used in terminal display and human-machine interface. It can be used with the high-performance RabbitCoreRCM2200 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 sending and receiving and other related information plays a very important role. This article introduces the practical interface circuit and software design of RabbitCoreRCM2200 module and M12864-7A7.
2 Introduction to Rabbit2000 and RabbitCoreRCM2200
The Rabbit2000 8-bit microprocessor has a similar structure and high compatibility with the Z80 series microprocessor, but its 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 many 16-bit processors and 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. It is supported by the DynamicC compiler, which has an interactive compiler, editor and debugger. Assembly language code can be embedded in DynamicC code or used as an independent function. Compilation and debugging can be implemented without leaving the DynamicC development environment, shortening development time and making programming easier.
The RabbitCoreRCM2200 module uses a Rabbit2000 microprocessor, has 256KB Flash and 128KB SRAM, 4 serial ports, 26 I/O ports, and a 10Base-T Ethernet port. The RCM2200 can be used to control, monitor, and debug embedded systems through a network or the Internet. There is a software toolkit that supports the RCM2200, providing TCP/IP protocol and DynamicC system software.
3KS0108B LCD controller
KS0108B LCD controller is mostly used for small and medium-sized module graphic dot matrix LCD (Hitachi HD61202 is fully compatible with it and can be directly replaced). Its feature is that it has a built-in 64-bit × 64-bit display memory. The display state 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.
Block diagram and pinout of 4M12864-7A7 LCD module
The M12864-7A7 LCD module uses two KS0108B as column drivers and one KS0107B as row driver. KS0107B is not connected to the MCU and can generate row drive signals and various synchronization signals as long as power is provided. Figure 1 is the structure of the LCD module; block diagram, pin functions are shown in Table 2.
5Hardware interface circuit
There are two ways to connect the built-in KS0108B graphic dot matrix LCD module to MCU (single-chip microcomputer or Rabbit2000, etc.): direct access and indirect control. The direct access method 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 method 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 and some pins in the PB, PD, and PE ports of the parallel port of RCM2200. 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. V0 is the negative voltage required by the LCD, and the voltage can be adjusted by the potentiometer connected to it. The voltage range is -10V~0V to achieve the purpose of adjusting the display contrast.
6DynamicC source code
6.1 Program Description
This article focuses on the subroutine for displaying Chinese characters, which can display specified Chinese characters at specified locations.
Given below are some subroutines of the indirect control method shown in Figure 2. All programs are compiled and debugged using the DynamicC7.32TSE version compiler.
The M12864-7A7 LCD module is 128×64 dot matrix, each Chinese character is 16×16 dot matrix, so each line can display 8 Chinese characters, one screen can display 4 lines. The whole 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; the position of the Chinese characters to be displayed can be determined by pag and col. 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 it takes two pages to display a Chinese character at the same time, so the calculation formula of 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 it takes 16 columns to display each Chinese character, 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 to the left or right screen depending on whether the Chinese characters to be displayed are on the left or right screen. Then, the data is sent to the LCD display until the 32-byte Chinese characters are fully displayed; the display of multiple Chinese characters is operated in the same way.
For the display of multiple information, voidMsg(void) can be changed to voidMsg(flag), that is, different values of flag are used to identify different information to be displayed, and then, in actual use, it can be implemented by calling voidMsg(flaS).
7 Conclusion
The connection between the M12864-7A7 LCD module and the RabbitCoreRCM2200 module adopts indirect control, which is characterized by simple circuits, control timing is implemented by software, and can realize the interface between high-speed MCU and LCD module. The use of DynamicC 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.
Previous article:Temperature acquisition instrument made of CD4051 and AD595
Next article:Design of a dedicated keyboard interface chip using CPLD
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Guess the price and win a surprise - how much does this "good" phone cost? Let's find out!
- ucos ii based on Cortex-M0 can run source code project
- Looking for a logic device like 74HC595
- UDP protocol peer-to-peer (P2P) communication (or NAT traversal) example
- TI-TM4C123x learning record: reading high and low levels
- Competition and adventure in digital circuits
- Record the failure of my first dsp project
- 18 kinds of motor step-down starting circuit diagrams [collection]
- Texas Instruments' solutions for sweeping robot systems
- Detailed explanation of the working principle of transformer-how transformer changes the size of AC voltage or current