当前位置:网站首页>[embedded module] OLED display module
[embedded module] OLED display module
2022-07-03 03:29:00 【Record the years of ignorance】
Preface
OLED Except for LCD Besides, the most frequently used display module , There are also many very detailed information about the use of this module on the Internet , This blog is a summary , Second, for the record .
Reference link
- 0.96inch SPI OLED Module—— The information is very detailed , It is suggested that you must visit !
- Read and OLED Display principle —— Get along well with OLED Various methods of using modules - CSDN
- SSD1306(OLED Driver chip ) Instruction, 【 The translated version 】- CSDN
- 【 Common modules 】OLED Display module ( Principle explanation 、STM32 Example operation )- CSDN—— Including parallel transmission
OLED summary
The basic principle
Get a module , First of all, we need to have a framework understanding of the overall structure of this device . On this point , I highly recommend checking the reference link 1 Medium Specifications .
Simply speaking , common OLED It's all chip based SSD1306 's display , It's usually 0.96inch, A resolution of 128x64, That is, a line has 128 Pixels , One column has 64 Pixels , These pixels are connected to SSD1306 On the output of the chip , These outputs are generated by SSD1306 Inside GDDRAM(Graphic Display Data RAM) Chinese data determines , The RAM It's just the size of 1024 byte , Corresponding 8192 Pixels . therefore , All users need to do is give SSD1306 Input instruction , And output the content to be displayed to GDDRAM in , So as to control the displayed content . So this display screen does not have a font , You need to use the module software to get the displayed binary data .
Electrical aspects ,OLED The compatible supply voltage is 3.0~5.5V, So it is compatible 3.3V and 5V Single chip microcomputer .
Schematic diagram
The schematic diagram of the module is as follows :【 The document is from the reference link 1】
As can be seen from the above figure , Different communication protocols can be achieved by adjusting the internal resistance and capacitance . Besides ,OLED Modules can also adopt parallel The way of transmission , and LCD12864 equally .OLED Support 8 position 6800 and 8 position 8080 Two parallel communication protocols , The choice of different communication protocols is determined by BS0、BS1 Two pins control .
The corresponding relationship is shown in the table below :
Pin | 4 Line SPI | IIC | 8 position 6800 | 8 position 8080 |
---|---|---|---|---|
BS0 | 0 | 1 | 0 | 1 |
BS1 | 0 | 0 | 1 | 1 |
This module is wired , Ground the parallel data input and output port , Therefore, it can only be configured as 4 Line SPI or IIC Two serial data transmission protocols , and , In serial transmission mode , Data can only be entered , No output , Therefore, the MCU pin can be directly configured as the output mode .
model
common OLED The model of the module is the one except for the parallel data transmission port , Usually four pins or 7 Root pin , As shown in the figure below :
among , The four pin module is generally configured as IIC agreement ; The default protocol of the seven pin module is 4 Line SPI, among ,D0 Corresponding SCK,D1 Corresponding SDA.RES Is the reset pin ,CS Select the pin for the chip , Low level active ,DC To choose whether to input instructions or data 【DC=0 Input the command ,DC=1 Input data 】. in addition , There is another kind. OLED The module only has 6 Root pin , That's a CS and GND come together , Make the module always valid .
OLED Use
GDDRAM
In the use of OLED When displaying the module , First of all, we need to understand its internal GDDRAM Structure , As shown in the figure below :
In short , The display module has 64 That's ok , Can be divided into 8 page (Page0 ~ Page7), each page 8 That's ok (COM0 ~ COM7,COM8 ~ COM15,…), altogether 128 Column (SEG0~SEG127), At least... Will be displayed at one time each time 8 position , namely A column on a page , The upper one is the lower one (LSB), The following is the high order (MSB), And low 4 Position as List the addresses , high 4 Position as Column address , The reason for this distinction , Because there are specific setting instructions behind .
Three working modes
By setting instructions ,OLED The module can be configured in three display modes : Page address mode 、 Horizontal address mode 、 Vertical address mode , In fact, the difference is that after displaying this position , Where do you want to show the next question .
- Page address mode
In page mode , Show RAM After reading and writing , The column address pointer is automatically incremented by one . If the column address pointer reaches the end of the column address , The column address pointer returns to the beginning of the column address , But the page address pointer does not change . Users need to set new page pointers and column pointers to get the next page RAM The content of . - Horizontal address mode
In horizontal address , Show RAM After reading and writing , The column address pointer is automatically incremented by one . If the column address pointer reaches the end of the column address , The column address pointer returns to the column start address , At the same time, the page address pointer is also increased by one . and PAGE The model of scanning each page address with the column address pointer is shown below . When both the column address pointer and the page pointer reach the end , The two pointers will return to the position where the column address and page address pointers start ( The dotted line in the figure shows ). - Vertical address mode
In the vertical address , Show RAM After reading and writing , The page address pointer automatically adds one . If the page address pointer reaches the end of the page address , The page address pointer returns to the page start address , At the same time, the column address pointer is also increased by one . and PAGE The model of scanning address with column address pointer is shown below . When both the column address pointer and the page pointer reach the end , The two pointers will return to the position where the column address and page address pointers start ( The dotted line in the figure shows ).
It should be noted that ,OLED The default state during power on reset is Page address mode , And this is also the most commonly used display mode , So you can see a lot OLED This item is not configured during initialization in the code of .
Understanding and use of instructions
initialization OLED when , Need to give OLED The module transmits relevant control instructions , This instruction refers to its internal chip SSD1306 Set of instructions , This can be found in the reference link 1 Download from , Is an English version of the data manual . You can go to COMMAND TABLE and COMMAND DESCRIPTIONS In two chapters , View all instruction operations , As shown in the figure below :
Two points need to be noted in the above figure :1、 Look carefully at the meter , Distinguish between different types of instructions , Some complex instructions , If the instructions of the screen scrolling class can be temporarily ignored , Increase of efficiency ;2、 Pay attention to the format of the instruction , Some instructions have only one line , It means that the relevant settings are set after transmitting an instruction , Some instructions have multiple lines , Be similar to First select the register address , Then write data to the register , But the transmission of these things is instruction transmission , Not data .
Commonly used instructions
This section briefly summarizes the commonly used control commands .
If the set page address is low 4 Position as 0x03, high 4 Position as 0x11, Then the listed address is 0x13( Each register is low 4 Bits make up a byte ).
How to use
Mastered OLED Basic control instructions , Then you can start writing programs . Generally speaking ,OLED The procedure has the following steps : initialization -> Set the display position -> Output display data
among , Select the corresponding instruction according to your needs during initialization , The following is a relatively complete initialization instruction , For reference only . Part of it is to reset the default state , Don't write .【 Therefore, it is recommended to reset before initialization 】
Besides , Set the display position That is, enter the page address in the page address mode , And column address low 4 position 、 high 4 position .
As for display data , It needs to be displayed according to the actual situation and needs . From the above, we can see that , The data transmitted and displayed each time can only be 8 position , therefore , If you want to show 16x8(16 That's ok ,8 Column ) The data of , It must be displayed across pages , So you should locate the corresponding position to display the corresponding number . Again , If you need to display pictures , Then you only need to use the modeling software to get its 16 Hexadecimal display . But pay attention to the way of taking mold : From top to bottom 8 position ( The upper part is low , The following is the high position ) For a byte , Increase from left to right .
边栏推荐
- numpy之 警告VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences
- Réglez la hauteur et lancez le système. Currenttimemillis catton
- Positioning (relative positioning, absolute positioning, fixed positioning, Z-index) 2022-2-11
- 用Three.js做一个简单的3D场景
- Bigvision code
- 45 lectures on MySQL [index]
- Why does thread crash not cause JVM crash
- MySQL MAC download and installation tutorial
- navicat 导出数据库的表结构
- [combinatorics] brief introduction to generating function (definition of generating function | Newton binomial coefficient | commonly used generating function | correlation with constant | correlation
猜你喜欢
Introduction to mongodb
Nanning water leakage detection: warmly congratulate Guangxi Zhongshui on winning the first famous brand in Guangxi
Idea set method call ignore case
The idea cannot be loaded, and the market solution can be applied (pro test)
PHP generates PDF tcpdf
3D drawing example
Limit of one question per day
Mongodb replication set [master-slave replication]
【PyG】理解MessagePassing过程,GCN demo详解
Don't use the new Dede collection without the updated Dede plug-in
随机推荐
C programming learning notes [edited by Mr. Tan Haoqiang] (Chapter III sequence programming) 03 operators and expressions
Vs Code configure virtual environment
Convert binary stream to byte array
numpy之 警告VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences
@Accessors annotation function specifies that the prefix follows the hump naming
MySQL practice 45 lecture [transaction isolation]
ffmpeg录制屏幕和截屏
[leetcode question brushing day 34] 540 Unique element in array, 384 Disrupt array, 202 Happy number, 149 Maximum number of points on a line
C programming learning notes [edited by Mr. Tan Haoqiang] (Chapter III sequence programming) 05 data input and output
Téléchargement et installation du client Filezilla
小程序获取用户头像和昵称
45 lectures on MySQL [index]
Summary of matrix knowledge points in Chapter 2 of Linear Algebra (Jeff's self perception)
MongoDB复制集【主从复制】
el-tree搜索方法使用
Summary of electromagnetic spectrum
MongoDB简介
监听对象中值变化及访问
MySQL practice 45 [SQL query and update execution process]
The file marked by labelme is converted to yolov5 format