1 Introduction
Organic electroluminescent display, also known as organic light emitting diode (OLED) or organic light emitting display (OLED), has obvious advantages over the popular liquid crystal display (LCD) on the market, mainly manifested in: self-luminescence (no backlight is required), no viewing angle problem (viewing angle can reach more than 170°), light weight, thin thickness, high brightness, high luminous efficiency, fast response speed (1000 times that of liquid crystal), high dynamic picture quality, wide temperature range (temperature range -40℃~80℃), low power consumption, strong earthquake resistance, low manufacturing cost, and flexible display. It is especially suitable for the instrument industry that requires high brightness, as well as military products with higher conditions. Compared with LCD, which has been mature in all aspects, the development of OLED is still in its early stages, but with the gradual realization of the above advantages, OLED will most likely replace LCD in the market. OLED is recognized by the industry as the next generation display with the most development prospects.
2 Hardware Structure Design
This paper uses the single-chip microcomputer C8051F023 as the control core device of 128×64 monochrome OLED, and adopts a screen VGG12864G from Visionox. It uses the SSD1303 from Solomon as a dedicated driver IC. It realizes the dynamic and static display of text and images. The overall hardware design structure diagram is shown in Figure 1.
Figure 1 Hardware design structure diagram
2.1 SSD1303 driver and interface circuit
The OLED display screen of the VGG12864G module has a 128-column and 64-row structure. Figure 2 is a block diagram of the SSD1303 structure, showing the block diagram of the module logic circuit and interface circuit. The user only needs to provide power to the interface, generate a drive command signal and a display data signal to light up the OLED screen. As can be seen from the figure, the output of the row and column drivers is bonded to the OLED screen through the FPC, and the remaining MCU interface, voltage and current controllers need to be specially designed interfaces and drive circuits, and the external signals of the module are only related to the SSD1303. Therefore, if you understand the input characteristics and instruction system of the SSD1303, you can use this module conveniently.
SSD1303 is an IC for driving monochrome OLED launched by Solomon Corporation, which adopts TAB package. This driver IC based on CMOS process integrates row and column drivers, oscillators, contrast controllers and graphic data memory (GDDRAM), which greatly reduces peripheral devices and power consumption. The maximum resolution supported is 132×64, of which the 132×16 dot matrix area at the bottom of the OLED screen can display 4 local colors and can be programmed to achieve 64 gray levels. When used for monochrome display, 256 levels of contrast can be programmably controlled. Depending on the microprocessor (MPU) used, it provides three communication interface modes: 8-bit 6800 series MPU parallel, 8-bit 8080 series MPU parallel and Serial Peripheral InteRFace (SPI) serial.
The control command is input to the control command decoder through the MCU interface for command decoding, and then the clock, line synchronization, and field synchronization signals are output to control the oscillation frequency of the OLED display, the voltage conversion module of the display device, and the driving module of the row and column offset of the OLED display content; if it is display data (128×64bits), then the display data is input to the GDDRAM cache by the control circuit through the MCU interface, and then the data is decoded by the local color decoder, and finally the decoded display data is driven by the row and column driver to drive the OLED display, presenting a stable display effect on the OLED.
2.2 Power Supply Design
The hardware structure design block diagram is shown in Figure 2. The DC-DC converter of the external hardware circuit uses the TPS7333 chip to convert the 5V power supply into a 3.3V power supply, and the output power signal controls the voltage and current of the entire SSD1303 through the voltage and current controller. The entire system requires 3.3V and 12V power supplies, the MCU (C8051F023 is used in this article) needs to provide a 3.3V power supply voltage, and the OLED needs a 3.3V logic power supply voltage and a 9-12V drive power supply voltage, which is provided by the external power converter circuit.
2.3 Various control signals
Then, how to use MCU to control. MCU controls SSD1303 driver IC through RES#, CS#, D/C, WR#, RD# and D0~D7, a total of 13 interfaces, thereby controlling the OLED display. CS# is the chip select signal. When CS# is connected to a low level, MCU can communicate with the driver IC; RES# is the reset enable terminal. When it is connected to a low level, all control registers are set to the factory default state, and the image register is cleared; D/C is the data/command selection signal; WR# and RD# are write and read selection signals respectively. When CS# is low, reading and writing are valid on its falling edge. By changing the high and low of the three interfaces of D/C, WR# and RD#, the microcontroller has four states of control over OLED, which can be shown in Table 1.
2.4 Timing of reading and writing
As long as you read and write according to the timing waveform of VGG12864G, you can complete the display of OLED. However, if you use software programming to spell the timing, you need to consider many time parameters, which is somewhat difficult. In order to make data and commands easier to read and write, we use another method. As shown in Figure 1, connect WR# and RD# to /WR and /RD of C8051F023, that is, P0.7 and P0.6. When programming in C language, define the pointer type as xdata type, which points to the off-chip memory. By assigning a value to the pointer, the off-chip data storage area is accessed. When accessing the off-chip memory, /RD and /WR will automatically become low during reading and writing. At the same time, the P3 port is the data bus. In the non-multiplexed mode, the high 8 bits of the address bus use the P1 port, and the low 8 bits use the P2 port; in the multiplexed mode, the high 8 bits of the address bus still use the P1 port, and the low 8 bits and the data bus multiplex the P3 port, and the P2 port will not be affected. Therefore, it is best to set it to multiplexing mode (EMIOCF.4=0), so that port P2 can be used as another output port to freely control RES#, CS#, and DC. Although the address bus is not required, the address line will be used when accessing the off-chip memory, so it should still be avoided. The timing waveform of the experimental results is shown in Figure 3. As long as CS# is low, writing (reading) data or commands on the falling edge of WR# (RD#) can effectively complete the reading and writing work.
The entire MCU-controlled OLED display program is written in C language, and the main program flow chart is shown in Figure 4. MCU initialization includes turning off the watchdog, clock initialization, port initialization, and timer and interrupt initialization. OLED initialization includes turning on the display, setting the display mode, setting the contrast controller, contrast setting (1-256), setting the row and column start address, setting the specific position color, and setting the serial port pin configuration. Clearing the OLED screen and OLED display both write data to GDDRAM, including reading status, writing commands, and writing data subroutines. Clearing the OLED screen writes all "0", and the OLED display only needs to write the character code of the text or picture to be displayed. Before each write (command or data), the status must be read to see if the highest bit D7 is "0", which is also called "busy" detection. If it is "1", it means "busy"; otherwise, it is "idle". The write operation can only be performed in the "idle" state.
4 Display of text and images
VGG12864G has a built-in 128×64 bits display memory for storing display data. Figure 5 shows the address structure of the RAM. The RAM capacity is 128×64=8192 bits, which is divided into 8 pages (page0-page7), with 8 rows per page. The first column of each page is exactly one byte, with the low bit at the top and the high bit at the bottom. The display state of each pixel on the display screen corresponds to each bit of binary data in the display memory. The data in the display memory is directly used as the driving signal for the graphic display. When the data is displayed as "1", the corresponding pixel is displayed; when the data is displayed as "0", the corresponding pixel is not displayed.
The character library of the displayed text or picture needs to be created by yourself, but it is almost impossible to do it manually. You can use the font extraction software - "Font Extraction V2.2", which provides two modes of module extraction: horizontal and vertical. Then, according to the RAM address structure of the OLED display data, select the vertical mode of module extraction. Since the byte structure of the OLED module is high at the bottom and low at the top, it should be set to byte reverse order. The font, shape, size and display effect (underline and strikethrough) of the character can be adjusted as needed, and then the C51 format (A51 format if programming in assembly language) is used to generate the dot matrix display code of a single character. Finally, according to the display effect on the OLED screen, the code can be adjusted accordingly to obtain the required character library.
[page]
Generate the required character library according to the text or picture to be displayed, write the character code into the GDDRAM module of SSD1303 through the OLED display program, and then it can be stably displayed. Dynamic display of pictures can also be achieved through software programming, as shown in Figure 6, which shows the text and picture display completed by the system.
5 Conclusion
A method for realizing OLED display based on single-chip microcomputer is designed. According to its functions and characteristics, the circuit design of related parts is solved, and the display of text, dynamic and static pictures is realized on the developed system. Experiments show that the designed circuit is simple, which greatly reduces the cost of the system and enables the system to be applied to small equipment.
Previous article:Wireless identification device system based on 51 single chip microcomputer
Next article:Design of Taxi Meter System Based on AT89S51 Single Chip Microcomputer
Recommended ReadingLatest update time:2024-11-16 15:22
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- ESAM external certification for CPU card design
- Test the high and low local oscillator of DVB-S2 sensitivity
- EEWORLD University Hall----Analog Integrated Circuit Design (Li Zhangquan, Shanghai Jiaotong University)
- Request a free ZVS buck-boost evaluation board!
- Three-cell lithium battery charging management IC-VAS5176 charging current test
- USB TYPE C interface problem urgent help
- Can't find header file when compiling
- NXP Smart Car Northeast Competition First Prize, we will open source after the competition
- Cumulative error analysis and clock frequency optimization for UART communication in MSP430FR2311
- Guess the price and win a surprise - how much does this "good" phone cost? Let's find out!