当前位置:网站首页>[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 .
边栏推荐
- MongoDB主配置文件
- Download and install node, NPM and yarn
- 别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!
- 2020-01-01t00:00:00.000000z date format conversion
- labelme标记的文件转换为yolov5格式
- [combinatorics] number of solutions of indefinite equations (number of combinations of multiple sets R | number of non negative integer solutions of indefinite equations | number of integer solutions
- Why does thread crash not cause JVM crash
- 使用InputFilter限制EditText时踩坑及解决方案
- Mongodb master profile
- LVGL使用心得
猜你喜欢
随机推荐
el-tree搜索方法使用
MySQL practice 45 lecture [transaction isolation]
C programming learning notes [edited by Mr. Tan Haoqiang] (Chapter III sequence programming) 05 data input and output
渤、黄海的潮汐特征
[pyg] understand the messagepassing process, GCN demo details
@Accessors注解作用指定前缀遵守驼峰命名
PAT乙级“1104 天长地久”DFS优化思路
用Three.js做一個簡單的3D場景
程序员新人上午使用 isXxx 形式定义布尔类型,下午就被劝退?
Limit of one question per day
softmax的近似之NCE详解
简易版 微信小程序开发之for指令、上传图片及展示效果优化
Don't use the new Dede collection without the updated Dede plug-in
VS 2019 配置tensorRT生成engine
Ansible introduction [unfinished (semi-finished products)]
MongoDB主配置文件
[set theory] partial order relation (partial order relation definition | partial order set definition | greater than or equal to relation | less than or equal to relation | integer division relation |
Mysql Mac版下载安装教程
[algebraic structure] group (definition of group | basic properties of group | proof method of group | commutative group)
QT based tensorrt accelerated yolov5