Circuit design and programming method of OLED display module based on single chip microcomputer

In recent years, intelligent control has been widely used in tobacco leaf curing systems. Because the baking automatic control system usually operates under high temperature or even strong light in summer, and the tobacco leaf baking process is complicated, the baking process data needs to be manually set under the information prompt, so the system needs a high-brightness, containing text Display terminal for display functions.

In recent years, intelligent control has been widely used in tobacco leaf curing systems. Because the baking automatic control system usually operates under high temperature or even strong light in summer, and the tobacco leaf baking process is complicated, the baking process data needs to be manually set under the information prompt, so the system needs a high-brightness, containing text Display terminal for display functions. At present, the digital tube or LCD display methods generally used in tobacco leaf curing automatic control systems cannot fully meet the system requirements. In view of this situation, this paper proposes a new solution, that is, the organic light-emitting display OLED (Organic Light Emitting Display) display is embedded in the tobacco leaf curing automatic control system, which solves the urgent problems existing in the current tobacco leaf curing automatic control system. OLED is the most promising new generation of display technology. Compared with LCD display technology, OLED has the advantages of ultra-thin, high brightness, wide viewing angle, self-illumination, fast response, wide temperature range, strong shock resistance, low power consumption, and high reliability. Achieve superior performance such as soft display. For this reason, this paper expounds the structure principle of tobacco leaf curing automatic control system and the function of OLED display module VGG12864G-S002, and introduces the circuit design and programming method of this module based on single chip W78E54B control in detail.

1. System structure

Figure 1 shows the structural block diagram of the tobacco leaf curing automatic control system. According to the traditional curing process, the data collected by the automatic control system includes two sensor parameters of dry and wet bulbs. The entire tobacco leaf curing process is controlled around the temperature and humidity in the curing room. The skylight and the floor window are humidity control equipment in the barn. They act once in each inspection cycle. Since the motor drive circuit has strong interference to the system, in order to improve the anti-interference ability of the system, the system has designed a photoelectric coupling isolation circuit. Due to the vertical gradient difference in the temperature in the baking room, the baking room must be equipped with a hot air circulation fan, and the rotation of the fan is used to form air convection, so that the temperature can be relatively balanced. The heat source of the barn comes from burning coal, and the air intake delivered by the coal furnace fan determines the degree of coal combustion, and the system controls the temperature in the barn by regulating the speed of the coal furnace fan. In addition, the system is also equipped with an alarm device, which can prompt the staff to take corresponding measures when there is an abnormality in the baking process. The real-time clock not only records the system bake time, but also provides minute interrupt signals to control peripherals. Usually a complete tobacco leaf curing process will last nearly 120 hours. In order to prevent the system from shutting down due to power failure, the system is equipped with a backup dry battery and a data protection circuit to ensure continuous baking. In order to improve the stability of temperature control, the system also uses a single bus digital temperature sensor. A watchdog circuit can restore the system to normal operation in the event of an unexpected shutdown. The display and keyboard are necessary equipment for human-computer interaction. The data input in the baking process and the reading of baking information all need to pass through the display, so the performance of the display device plays a vital role in the system.

Circuit design and programming method of OLED display module based on single chip microcomputer

2. OLED module

VGGl2864G-S002 is the latest OLED monochrome 128×64 dot matrix display module with high brightness and high contrast introduced by Visionox. The controller chip SSDl303 integrated in the module includes the row and column drive module, power control module, GDDRAM (Graphic Display Data RAM), NPU interface, command control module, oscillator and timing generator. The complete module structure and rich instruction set of VGGl2864G-S002 determine that its external interface and software design are very convenient and flexible. The module emits green light, and the working temperature range is: -40℃~+80℃. Its external interface and internal structure are shown in Figure 2, and the pin description is listed in Table 1.

3. Hardware Design

3.1 Interface Design

The external interface of OLED display module VGGl2864G adopts 8-bit parallel data transmission mode. The reading and writing of the module by the CPU does not need to consider the internal structure, so the control is very convenient. To ensure the drive capability of the data bus, the data bus (DO~D7) can be connected to a pull-up resistor of about 10 kΩ.

3.2 Power Design

The module integrates a high-efficiency power supply, but the external logic voltage VDD (+3V) needs to be provided, while the voltages required by Winbond MCU W78E54B and peripheral chips are both VCC (+5 V), so it must be specially designed by + 5 to +3 V DC voltage conversion circuit, its power supply design circuit shown in Figure 4. Among them, the voltage regulator chip SPXlll7T-3.0 has stable performance and can output a maximum current of 800 mA, while the maximum driving current of the OLED module is 450 mA, which is enough to drive the display module.

Circuit design and programming method of OLED display module based on single chip microcomputer

4. Software design

The read and write timing of the OLED display module VGGl2864G-S002 is compatible with two bus modes, Motorola 6800 and Intel 8080. This system adopts Intel 8080 bus control mode.

4.1 Control method

The control of VGGl2864G-S002 is divided into two types: data and command, which can be realized by controlling the level of D/C: transmit display data at high level, and transmit operation commands at low level. Figure 5 is the write timing diagram and time parameter table of VGGl2864G-S002. The write command subroutine to the OLED module is as follows (write data (WriteData()) only needs to set DC to l):

Circuit design and programming method of OLED display module based on single chip microcomputer

Circuit design and programming method of OLED display module based on single chip microcomputer

4.2 0LED setting

Before displaying the information, the system must prepare the OLED for display, and the setting command that should be written to 0LED is as follows:

0x81: Set the brightness and contrast, 0xC0: Contrast level from 0 to 255, 0xA6: Set the normal display

0xA8: set the number of lines used, 0x40: display 64 lines, 0xAE: display panel on

0xD3: Set scrolling, Ox00: Disable scrolling

The display data buffer of VGGl2864G-S002 adopts paging (B0~B7 total 8 pages) management mode, each page is 128×8 dot matrix. Each byte of data display corresponds to an 8×1 dot matrix. Before writing the displayed content, the page address is sent first, and then the 16-bit row offset address is sent. ×H0-3+L0-3, wherein L4-7=0000, H4-7=000l. For example, to write the command code (0xB2, 0x03, 0x00) from the fourth column of the third page, and then write the display data (OxFF), then the pointer position and display of the display buffer RAM are shown in Figure 6.

Circuit design and programming method of OLED display module based on single chip microcomputer

4.3 Program Flow

Tobacco leaf curing automatic control system has many management peripherals, which requires the system to have strong real-time operation performance. In order to improve the response speed, the system adopts the interrupt management method. In this automatic control system, the software management flow of the CPU to the OLED display module and peripherals is shown in Figure 7. The inspection cycle, cycle cycle and accumulated alarm time N (hours) in the flow chart can be set by the user.

Circuit design and programming method of OLED display module based on single chip microcomputer

4.4 Chinese character display

The Chinese character or image display code of the VGGl2864G-S002 module can be obtained through the font extraction software Zimo2l. The software options are set to vertical modulo and byte reverse order. According to the actual needs of the tobacco leaf baking automatic control system, the font and size should be set to 12, that is, a Chinese character corresponds to 16×16 dot matrix (32-byte display code), and Western characters are 8×16 dot matrix (16-byte display code) code). Since each Chinese character or character spans two adjacent pages up and down, the display code of each character can be written in two batches. Its display procedure is as follows:

Circuit design and programming method of OLED display module based on single chip microcomputer

The 128×64 dot matrix can display 8 Chinese characters per line, while the tobacco leaf curing automatic control system needs to display 4 to 5 Chinese characters per line, and the display needs 1 to 4 Western characters (dry and wet bulb target, actual temperature, stage time and heating rate), and several space characters are attached, so the 128×64 dot matrix display panel can just meet the system requirements.

5. Conclusion

The tobacco leaf baking automatic control system is embedded in the OLED display, and with the keyboard, a good human-computer interaction interface can be established, and its operation and display performance are significantly improved. Compared with monitors such as P13501, VGGl2864Z and VGGl2864K, the software and hardware design of this module is more flexible and convenient, and can be widely used in other mobile instruments.

The Links:   1MBI100L-060 SKM50GB123D

Related Posts