当前位置:网站首页>[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 .
边栏推荐
- [leetcode question brushing day 34] 540 Unique element in array, 384 Disrupt array, 202 Happy number, 149 Maximum number of points on a line
- 【AI实战】应用xgboost.XGBRegressor搭建空气质量预测模型(一)
- [pyg] understand the messagepassing process, GCN demo details
- C# WebRequest POST模式 ,基于“Basic Auth”口令认证模式,使用multipart/form-data方式上传文件及提交其他数据
- 简易版 微信小程序开发之for指令、上传图片及展示效果优化
- [mathematical logic] normal form (conjunctive normal form | disjunctive normal form | major item | minor item | maximal item | minor item | principal conjunctive normal form | principal disjunctive no
- Introduction to mongodb
- QT based tensorrt accelerated yolov5
- The file marked by labelme is converted to yolov5 format
- BigVision代码
猜你喜欢

Pytorch multi card distributed training distributeddataparallel usage

Idea format code idea set shortcut key format code

FileZilla Client下载安装

Hi3536c v100r001c02spc040 cross compiler installation

Docker install and start MySQL service

node,npm以及yarn下载安装

Elsevier latex submitted the article pdftex def Error: File `thumbnails/cas-email. jpeg‘ not found: using draf
![Learning notes of C programming [compiled by Mr. Tan Haoqiang] (Chapter III sequence programming) 04 C sentence](/img/60/bae0e8d92a53bcd2b2de3fb22b3b99.jpg)
Learning notes of C programming [compiled by Mr. Tan Haoqiang] (Chapter III sequence programming) 04 C sentence

Pytorch配置

机械臂速成小指南(八):运动学建模(标准DH法)
随机推荐
Converts a timestamp to a time in the specified format
Application of derivative in daily question
基于QT的tensorRT加速的yolov5
监听对象中值变化及访问
idea 加载不了应用市场解决办法(亲测)
MySQL MAC download and installation tutorial
Summary of matrix knowledge points in Chapter 2 of Linear Algebra (Jeff's self perception)
Idea set method call ignore case
Pat class B "1104 forever" DFS optimization idea
@Accessors注解作用指定前缀遵守驼峰命名
umi 路由拦截(简单粗暴)
Solve high and send system Currenttimemillis Caton
【AI实战】应用xgboost.XGBRegressor搭建空气质量预测模型(一)
文件重命名
基于Qt的yolov5工程
别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!
MongoDB簡介
Don't use the new Dede collection without the updated Dede plug-in
Bid farewell to artificial mental retardation: Mengzi open source project team received RMB 100 million financing to help NLP develop
navicat 导出数据库的表结构