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.
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
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- LSM6DS3 3D Accelerometer and 3D Gyroscope PCB Package and Code
- Two power modules with the same voltage connected in parallel?
- How to choose the inductor of BOOST boost power supply?
- "Invite you to disassemble" Episode 1 --- Xiaomi 45W charging head disassembly
- The experience of debugging L-band RF power amplifier is in "2019.1.1" for your reference
- 2021 ON Semiconductor Avnet RSL10 Bluetooth SoC Development and Design Competition 4th Post (Bluetooth Current)
- MSP430FR5969 Remote Upgrade
- Circuit help, how do you analyze this circuit?
- EEWORLD University Hall----Live Replay: Microchip Security Series 15 Simplifies Security Application Design with dsPIC33/PIC24 and ATECC608 Devices
- EEWORLD University - Designing Wide Input DC/DC Converters for Thermostat Applications