Interface design between OLED display module and AT91RM9200

Publisher:码梦创想Latest update time:2007-02-27 Source: 单片机及嵌入式系统应用Keywords:driver Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

OLED stands for Organic Light-Emitting Diode, which is an organic light-emitting diode display. It refers to a technology in which organic semiconductor materials and luminescent materials are driven by current to emit light and realize display. OLED has many advantages over LCD: ultra-light, ultra-thin (thickness can be less than 1 mm), high brightness, large viewing angle (up to 170°), emitting light from the pixels themselves without the need for a backlight, low power consumption, It has fast response speed (about 1,000 times the speed of LCD), high definition, low heat generation, excellent shock resistance, low manufacturing cost, and bendability. Therefore, OLED is more capable of displaying perfect videos and consumes less power. It can be used as a display screen for mobile phones, digital TVs and other products. It is recognized by the industry as the next generation display technology with the most development prospects.

1 Characteristics of P13501 display module

The P13501 launched by Taiwan Ribao Company is a 128×64 dot matrix monochrome, character, and graphic display module. It has the following main characteristics: the light-emitting color is blue; the number of dots is 128×64; the built-in driver IC is SSD1303; the contrast ratio is 500:1; the viewing angle is 160°; the interface is 6800 series parallel interface, 8-bit Intel 8080 series parallel interface and Serial external interface; operating temperature is -20~+70℃.

2 Controller and structural block diagram of the display module

OLED display P13501 mainly includes the SSD1303 built-in controller and OLED display panel produced by Taiwan Solomon Company.

The controller is an OLED driver chip that integrates row drivers, column drivers and controllers. The driver is designed for 132×64 dot matrix OLED graphics displays and includes row drivers, column drivers, current reference generators, contrast control, oscillators and several MCU interface modes. The working logic voltage is 2.4~3.5 V; it has rich software functions, supports 4 color selections and 64 levels of control for each color, and its software contrast has 256 levels of control; embedded 132×64-bit graphic dynamics Random access memory (GDDRAM) provides row remapping, column remapping, vertical scrolling and partial display functions, making the driver suitable for a variety of OLED displays with different pixel sizes and colors.

The SSD1303 controller has 2 sets of timing circuits in the interface control circuit, which can meet different timing requirements through corresponding settings of the timing adaptation circuit. The setting terminals of the timing adaptation circuit are BS1 and BS2, and their timing settings are listed in Table 1.

The structural block diagram of the module is shown in Figure 1.
3. Interface design between display module and AT91RM9200

The interface of SSD1303 includes data input buffer, data output latch, instruction register and decoder, busy state flip-flop and timing control circuit, etc. It has a high-performance interface control circuit. The computer can access the SSD1303 at any time without determining its current status. Since OLED uses Intel 8080 timing, both BS1 and BS2 are connected to high level; and since there is no command/data selection line in AT91RM9200, one line PB10 in its general port PB is used as the command/data selection line of OLED. When PB1O is low level, it means that the data written to OLED is a command word; when it is high level, it means that the data written to OLED is a data word. The 16-pin RES of OLED is the reset pin and can be directly connected to the reset circuit of ARM. However, in order to facilitate the reset control of OLED, another port line PB11 is specially used for reset control. The OLED chip select signal USER1_CS is generated by decoding the NCS4 of the AT91RM9200 and the address lines A25, A23, and A22 through a 38-bit decoder. After calculation, its physical address is 0x52800000. The interface circuit design between OLED and AT91RM9200 is shown in Figure 2.
4 One of the functions of the OLED-driven programming

operating system is to shield the users from the particularities of the hardware, making the application irrelevant to the underlying specific physical device. Device drivers are the bridge between applications and specific hardware. Linux supports three types of hardware devices: character devices, block devices and network devices. They are written in roughly the same way. Among them, character devices and block devices can be accessed like files. The main difference between character devices and block devices is that every I/O operation of an application on a character device will be directly passed to the corresponding driver of the system kernel; while an application's operations on a block device must go through the system's buffer management. , passed indirectly to the driver for processing. Here, OLED is a character device.

Usually, character devices provide a process control interface to applications, mainly including open, close (or release), read, write, ioctl, poll, mmap, etc. Adding a character device driver to the system actually means adding corresponding code to the above operations. For character devices and block devices, the Linux kernel provides a unified abstraction of these operations and defines them in the structure file_operations. For most character devices, only a few of these operations are required for the driver to work just fine.

As needed, the OLED device driver only implements some device operations and declares its file_operations structure in a tokenized format, as follows:


oled_write is responsible for displaying the data to be displayed on the OLED screen; oled_ioctl is used to implement various control commands for OLED; oled_open is responsible for opening the OLED display; oled_release is responsible for closing the OLED display. Here we mainly introduce the specific implementation of oled_write. Others can be implemented according to actual needs with reference to oled_write. The specific program to implement oled_write is as follows:
 
 
5 Driver Compilation


After the driver is written, it needs to be compiled. In the Linux operating system, there are generally two compilation methods for drivers, namely static compilation and dynamic compilation. During static compilation, the driver is directly compiled into the kernel and can be freely tailored when configuring the kernel. Assume that the written driver of P13501 is myoled. c, the specific operations to statically compile it into the kernel are as follows:

①Invert myoled. c Copy to the drivers/char directory, and modify drivers/char/Config. in file. Add the following code there:

dep_tristate my oled support' CONFIG_MY_OLED

$CONFIG_ARCH_AT91RM9200

The meaning is: as long as CONFIG_ARCH_AT91RM9200 is defined as y or m, when configuring the kernel (such as "make menuconfig"), under the Character devices category, the my oled support option will appear, which is the same as CONFIG_MY_OLED The definition corresponds. To link the driver into the kernel, CONFIG_MY_OLED should be defined as y.

②Add the following code to the Makefile in the drivers/char directory:

obj-$(CONFIG_MY_OLED)+=myoled. o

Makefile will be compiled according to obj-m and obj-y, and linked to generate the corresponding code.

During dynamic compilation, the driver is compiled into a module, and then the device driver module is dynamically loaded and unloaded. Using the module loading method, you can repeatedly debug and modify the module without restarting the system, and you can debug the written driver conveniently and effectively. In practice, in the initial stage of writing a driver, it is often compiled into a module, the module is repeatedly loaded and unloaded, and the original code of the driver is modified until the entire driver meets the requirements, and then it is statically compiled into the kernel.

When compiling dynamically, the method is as follows:

/usr/local/arm/2.95.3/bin/arm-linux-gcc-O2-DMODULE-D__KERNEL__-I/home/sum/linux-2.4.19/include-c myoled. c

It is assumed here that the cross-compiler path is: /usr/local/. The storage path of the kernel is: /home/sum/linux-2.4.19. If there are no errors during compilation, myoled will be generated after completion. ofile. Copy it to a directory in the embedded system (for example: /home), and you can load it dynamically:

insmod myoled. oGenerate

device number:

mknod/dev/fftoled c 254 OIn

this way, the P13501 driver is dynamically loaded into the kernel, and the application can display output on the OLED.

To uninstall the module, proceed as follows:

rmmod myoled

Repeated loading and unloading can complete the debugging of the OLED driver.

6 Conclusion

This article introduces the interface circuit design of OLED display module P13501 and AT91RM9200, as well as the writing, compilation and loading of OLED driver under embedded Linux. This circuit and driver have been successfully used to display system parameters in a control system with good results; with a simple matrix scanning keyboard, relevant parameter settings can also be performed. Due to the many features of Linux and the many advantages of OLED display technology, it is believed that their combination will have broad application prospects in consumer electronics, industrial control, and even all aspects of life.

Keywords:driver Reference address:Interface design between OLED display module and AT91RM9200

Previous article:Interface and display design of liquid crystal controller SED1520 and microcontroller mPSD3334D
Next article:LED lamp life cycle assessment shows that LED lamps have excellent environmental performance

Recommended ReadingLatest update time:2024-11-16 23:39

MCU stepper motor driver ULN2003 28BYJ-48 5-wire 4-phase motor
/*************** writer:shopping.w ******************/ #include reg52.h #define uint unsigned int #define uchar unsigned char uchar code FFW = { 0x01, 0x03, 0x02, 0x06, 0x04, 0x0c, 0x08, 0x09 }; uchar code REV = { 0x09, 0x08, 0x0c, 0x04, 0x06, 0x02, 0x03, 0x01 }; sbit K1 = P3 ^ 0; sbit K2 = P3 ^ 1; s
[Microcontroller]
MCU stepper motor driver ULN2003 28BYJ-48 5-wire 4-phase motor
High brightness LED drive circuit
Preface High-brightness LEDs are highly efficient and reliable, and are a very promising low-energy power source. Due to the large range of forward voltage variations of LEDs and the steep V/I relationship curve, constant current drive is required. Different applications have their own power supply
[Power Management]
High brightness LED drive circuit
Analysis of the application of LED driver power supply in LED lamps
LED is short for light emitting diode. Due to its many advantages such as environmental protection, long life, high photoelectric efficiency (the current luminous efficiency has reached 100LM/W), and earthquake resistance, its application in various industries has been rapidly developed in recent years. In theory, t
[Power Management]
Driving LED offline lighting to its full potential
 While it may be years before a  viable screw-in  LED replaces incandescent bulbs, the use of LEDs in architectural lighting is growing, offering greater reliability and energy savings potential. Like most electronics, a power supply is needed to convert the input power into a form usable by the LEDs. In a streetlight
[Power Management]
Driving LED offline lighting to its full potential
EPC's new 100 V GaN FET enables smaller motor drives for e-bikes, robots and drones
The EPC9194 GaN-based inverter reference design significantly improves the efficiency and torque of the motor drive system while more than doubling the power per unit weight (specific power) . The inverter is so small that it can be integrated into the motor housing, achieving the lowest electromagnetic interf
[robot]
EPC's new 100 V GaN FET enables smaller motor drives for e-bikes, robots and drones
Introduction to HR8828 integrated micro-stepping motor driver with built-in stepper table
describe HR8828 is an integrated micro-stepping motor driver with built-in stepper table, providing solutions for printers, scanners and other automation equipment. It is designed to enable bipolar stepper motors to operate in full, half, 1/4, 1/8, 1/16, 1/32 stepping modes. The stepping mode is selected by the
[Embedded]
STM8L052C6T6 LCD driving process
LCD screen used MCU Pins The LCD's COM1-COM4 correspond to the MCU's LCD_COM0-LCD_COM3 respectively.   By default, LSI (internal low-speed clock) is turned on and is generally not operated. If it is turned off, turn on LSI first. So let's look at the program first void LCD_GLASS_Init(void) {  /* Enable LCD/RTC c
[Microcontroller]
STM8L052C6T6 LCD driving process
The world's leading high-efficiency, high-reliability LED lighting driver solution
The development of LED lighting is inseparable from driver chips. LED green lighting promotes the development of driver ICs towards innovative designs, so LED lighting driver ICs with multiple functions are needed. These requirements can be summarized as: high efficiency, high reliability, wide application compatibilit
[Power Management]
Latest Power Management 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号