Difference between revisions of "0.96inch OLED Module (IIC-4P SKU:MC096VX)"

From LCD wiki
Jump to: navigation, search
(Software description)
(Using Instructions)
 
(11 intermediate revisions by 2 users not shown)
Line 12: Line 12:
  
 
==<font color="blue">Product description</font> ==
 
==<font color="blue">Product description</font> ==
 +
 
*High resolution: 128x64 (have the same resolution as 12864, high PPI)
 
*High resolution: 128x64 (have the same resolution as 12864, high PPI)
 
*Large viewing angle: greater than 160° (a screen with the largest viewing angle in the monitor)
 
*Large viewing angle: greater than 160° (a screen with the largest viewing angle in the monitor)
Line 72: Line 73:
 
|-
 
|-
 
|power dissipation
 
|power dissipation
| colspan="3" |Full on is about 25mA,Full off is about 1.5mA。
+
| colspan="3" |Max:25mA,Min: 1.5mA
 
|-
 
|-
 
|product weight
 
|product weight
Line 118: Line 119:
 
it indicates that the IIC slave address is 0x7A.
 
it indicates that the IIC slave address is 0x7A.
  
==<font color="blue">Software description</font> ==
+
==<font color="blue">Using Instructions</font> ==
This module provides testing programs for three platforms,namely, C51, STM32, and Arduino,
+
'''Arduino platform instructions'''
  
The test program for each platform consists of roughly three parts:Platform related code,
+
1.Wiring instructions
  
OLED operation related code, and IIC operation related code.With the exception of platform-related
+
{| class="wikitable" border="1" style="width: 800px; background-color: white;"
 +
! colspan="2" |connection to UNO development board
 +
! colspan="2" |connect to Mega2560 development board
 +
|-
 +
! align="center" |the pin on module
 +
! align="center" |the pin on UNO single chip
 +
! align="center" |the pin on module
 +
! align="center" |the pin on Mega2560 single chip
 +
|-
 +
| align="center" |VCC
 +
| align="center" |5V
 +
| align="center" |VCC
 +
| align="center" |5V
 +
|-
 +
| align="center" |GND
 +
| align="center" |GND
 +
| align="center" |GND
 +
| align="center" |GND
 +
|-
 +
| align="center" |SCL
 +
| align="center" |A5
 +
| align="center" |SCL
 +
| align="center" |21
 +
|-
 +
| align="center" |SDA
 +
| align="center" |A4
 +
| align="center" |SDA
 +
| align="center" |20
 +
|}
  
code that varies from platform to platform, the other two parts of the code are similar in principle
+
2.operation instructions
  
and implementation, and have nothing to do with the platform used.On the same platform,
+
a.Connect the OLED module to the Arduino development board according to the wiring instructions and then power on
  
the code can be ported directly, just by modifying the relevant pin definitions to work properly.
+
b.Download the package (see the driver download column for details), unzip and open the "1-Arduino测试程序\Arduino_OLED_Demo_UNO&Mega2560_IIC_V1.0\Example" folder,
  
'''C51 code description'''
+
There are test programs inside,See the figure below (see the test procedure documentation for a description):
  
Open the C51 code project and find the following file:
+
[[file:MC096-016.jpg|750px]]
  
[[file:MC096-007.jpg|558x236px]]
+
c.Then open the "1-Arduino测试程序\Arduino_OLED_Demo_UNO&Mega2560_IIC_V1.0\Install libraries" folder,
  
REG51. H is platform-related code that defines some platform-related parameters.
+
which contains the U8glib open source library, as shown in the following figure:
  
Oledfont.h and bmp.h store pictures and Chinese characters after taking the lattice array.
+
[[file:MC096-038.jpg|750px]]
  
Oled.h stores some of the parameters associated with OLEDs, including pin definitions.
+
d.Copy U8glib to the directory where the Arduino IDE run lib is located, which can be viewed and set from the following figure:
  
Oled.c stores some functions related to OLED screen operations, including IIC read and write, OLED screen data writing, etc.
+
[[file:MC096-039.jpg|750px]]
  
Main.c is the main program operation.
+
e.Select any test program to run the test, for example select Example03-show_BMP test program
  
As we can see from the above description, we just need to modify the pin definition in the oled.h file.
+
f.When you open the test program,click tools-> Board to select the development board model,then click tools-> Port
  
Open the oled.h file and find the following:
+
to select the com port to connect,as shown in the following figure:
  
[[file:MC096-008.jpg|558x236px]]
+
[[file:MC096-028.jpg|750px]]
  
Just modify the values of OLED_SCL and OLED_SDIN on it.
+
g.After both the development board model and the com port have been selected correctly,click the right arrow button to compile and download,
  
In this modules,the P23 pin is defined as the clock signal pin, and the P24 pin is defined as the data signal pin.
+
as shown in the following figure:
  
Find the following content, you can modify the IIC slave address:
+
[[file:MC096-029.jpg|750px]]
  
[[file:MC096-009.jpg|558x236px]]
+
h.When Done upload appears,the compilation and download are successful,as shown in the following figure:
  
The IIC address of this OLED module is 0x78.
+
[[file:MC096-030.jpg|750px]]
  
'''STM32 code description'''
+
i.The OLED module displays the pictures below,which indicates that the test program is running successfully and the operation is successful
  
Open the STM32 code project and find the following file:
+
[[file:MC096-002.jpg|300px]]
  
[[file:MC096-010.jpg|750x300px]]
 
  
In addition to main.c, oled.c, oled.h, bmp.h, oledfont.h, the other is platform-specific code.
 
  
Oledfont.h and bmp.h store pictures and Chinese characters after taking the lattice array.
+
'''C51 platform instructions'''
  
Oled.h stores some of the parameters associated with OLEDs, including pin definitions.
+
1.Wiring instructions
  
Oled.c stores some functions related to OLED screen operations, including IIC read and write, OLED screen data writing, etc.
+
{| class="wikitable" border="1" style="width: 500px; background-color: white;"
 +
!the pin on module
 +
! align="center" |the pin on C51 single chip
 +
|-
 +
| align="center" |VCC
 +
| align="center" |5V
 +
|-
 +
| align="center" |GND
 +
| align="center" |GND
 +
|-
 +
| align="center" |SCL
 +
| align="center" |P23
 +
|-
 +
| align="center" |SDA
 +
| align="center" |P24
 +
|}
  
Main.c is the main program operation.
+
2.operation instructions
  
Since the STM32 is more GPIO port initialization operation than C51,the migration code needs to modify both the oled.h and oled.c files.
+
a.Connect the OLED module to the C51 development board according to the wiring instructions and then power on
  
Open the oled.h file and find the following:
+
b.Download the package (see the driver download column for details), unzip and open the "2-C51测试程序" folder,
  
[[file:MC096-011.jpg|558x236px]]
+
[[file:MC096-020.jpg|750px]]
  
According to your own definition,modify the GPIO group and pin of GPIO_ResetBits and GPIO_SetBits.
+
c.There are two kinds of C51 single-chip test program,just choose one,for example,select STC12C5A60S2 microcontroller test program
  
In this modules, the pin 13 of GPIOB is defined as the clock signal pin, and the pin 14 of GPIOB is defined as the data signal pin.
+
(for related instructions, see the test program documentation)
  
Find the following content, you can modify the IIC slave address:
+
d.Open the "C51_OLED_Demo_STC12C5A60S2_IIC_V1.0" folder and find the "OLED.uvproj" file,double-click to open the test program project
  
[[file:MC096-009.jpg|558x236px]]
+
e.Click the Compile button to compile the entire project.When "creating hex file from ".OBJ\TEST_OLED"..." appears,
  
The IIC address of this OLED module is 0x78.
+
the compilation is successful, as shown in the following figure:
  
Open the oled.c file and find the following:
+
[[file:MC096-031.jpg|750px]]
  
[[file:MC096-012.jpg|558x236px]]
+
f.Then open the STC-ISP software to download.The relevant settings are shown in the following figure:
  
The output mode,rate,and setting of the pin are set separately.
+
[[file:MC096-032.jpg|750px]]
  
'''Arduino code description'''
+
g.Then select the compiled hex file to burn.The burning file is in the directory of "C51_OLED_Demo_STC12C5A60S2_IIC_V1.0\OBJ",
  
The Arduino uses hardware IIC. the IIC pins have been defined inside the chip,so there is no need to define IIC in software.
+
as shown in the following figure:
  
It is only that different types of microcontrollers have different definitions of IIC which need to be adjusted on the wiring.
+
[[file:MC096-033.jpg|750px]]
  
Since the software uses the U8glib open source library, when initializing,  
+
h.After the download is clicked,the MCU needs to be powered on again, when appear "successful operation", it means successful burning,
  
you need to select the correct class based on the type of OLED screen driver IC.
+
the operation is shown in the following figure:
  
For example, this module uses U8GLIB_SSD1306_128X64 u8g (U8G_I2C_OPT_NONE) for initialization.
+
[[file:MC096-034.jpg|750px]]
  
If you want to modify the IIC slave device address, you need to open the u8g_com_arduino_ssd_i2c.c file and find the following:
+
i.The OLED module displays the pictures below,which indicates that the test program is running successfully and the operation is successful
  
[[file:MC096-013.jpg|558x236px]]
+
[[file:MC096-002.jpg|300px]]
  
The IIC address of this OLED module is 0x3c*2(0x78).
+
'''STM32 platform instructions'''
  
==<font color="blue">Using Instructions</font> ==
+
1.Wiring instructions
 +
 
 +
{| class="wikitable" border="1" style="width: 500px; background-color: white;"
 +
!the pin on module
 +
! align="center" |the pin on STM32 single chip
 +
|-
 +
| align="center" |VCC
 +
| align="center" |5V
 +
|-
 +
| align="center" |GND
 +
| align="center" |GND
 +
|-
 +
| align="center" |SCL
 +
| align="center" |PB13
 +
|-
 +
| align="center" |SDA
 +
| align="center" |PB14
 +
|}
 +
 
 +
2.operation instructions
 +
 
 +
a.Connect the OLED module to the STM32 development board according to the wiring instructions and then power on
 +
 
 +
b.Download the package (see the driver download column for details), unzip and open the "3-STM32测试程序" folder,
 +
 
 +
[[file:MC096-025.jpg|750px]]
 +
 
 +
c.there are two kinds of STM32 single-chip test program,just choose one,for example,select STM32F103RCT6 microcontroller test program
 +
 
 +
(for related instructions, see the test program documentation)
 +
 
 +
d.Open the "STM32_OLED_Demo_STM32F103RCT6_IIC_V1.0\USER" folder and find the "OLED.uvproj" file,double-click to open the test program project
 +
 
 +
e.Click on the compile button to compile the entire project,and when "from ELF: creating hex file.\ OBJ\ TESTOLED.axf" appears,
 +
 
 +
the compilation is successful, as shown in the following figure:
 +
 
 +
[[file:MC096-035.jpg|750px]]
 +
 
 +
f.Connect to JTAG and click the download button.When "Programming Done.Verify OK."appears,
 +
 
 +
the download is successful, as shown in the following figure:
 +
 
 +
[[file:MC096-036.jpg|750px]]
 +
 
 +
g.The OLED module displays the pictures below,which indicates that the test program is running successfully and the operation is successful
 +
 
 +
[[file:MC096-002.jpg|300px]]
  
 
==<font color="blue">Driver download</font> ==
 
==<font color="blue">Driver download</font> ==

Latest revision as of 15:47, 14 June 2018


语言选择

Languages

➤中文
➤EN


Product picture

MC096-002.jpg MC096-004.jpg MC096-003.jpg

Product description

  • High resolution: 128x64 (have the same resolution as 12864, high PPI)
  • Large viewing angle: greater than 160° (a screen with the largest viewing angle in the monitor)
  • Ultra-low power consumption: it's 0.06w in normal condition(far less than TFT display)
  • Wide voltage supply (3V~5V), 3.3V and 5V level logic compatible, no level shifter IC
  • IIC interface and only requires 2 IOs to light up easily
  • The range of working temperature is industrial (-20°C~70°C)
  • Military-grade process standards, long-term work steadily
  • Provide rich multi-platform routines and the technology support of underlying driver
  • Have three color display schemes of yellow and blue,white,blue to choose from

Product parameters

name color category
display color white blue Blue and yellow
SKU MC096VW MC096VB MC096VY
size 0.96(inch)
type OLED
OLED driver chip SSD1306
resolution 128*64 (Pixel)
Module interface IIC,4PIN
Effective display area 21.744x10.864(mm)
Module size 27.3x27.8(mm)
Field of View >160°
Working temperature -20℃~70℃
storage temperature -30℃~80℃
Working voltage 3.3V / 5V
power dissipation Max:25mA,Min: 1.5mA
product weight 15(g)

Interface definition

PIN label Pin description
1 VCC OLED positive pole of power(3.3V~5V)
2 GND OLED GND of power
3 SCL OLED clock signal of IIC bus
4 SDA OLED data signal of IIC bus

Product size

Product size drawing:0.96 inch OLED Product size drawing

Hardware description

Hardware schematic:QD electronic 0.96 inch OLED display module hardware schematic.pdf

IIC hardware adjustment instructions of device address to slave device:

MC096-006.jpg

As the picture shows,in the red rectangle,if the resistor is connected to 0x78,

it indicates that the IIC slave address is 0x78,if the resistor is connected to 0x7A,

it indicates that the IIC slave address is 0x7A.

Using Instructions

Arduino platform instructions

1.Wiring instructions

connection to UNO development board connect to Mega2560 development board
the pin on module the pin on UNO single chip the pin on module the pin on Mega2560 single chip
VCC 5V VCC 5V
GND GND GND GND
SCL A5 SCL 21
SDA A4 SDA 20

2.operation instructions

a.Connect the OLED module to the Arduino development board according to the wiring instructions and then power on

b.Download the package (see the driver download column for details), unzip and open the "1-Arduino测试程序\Arduino_OLED_Demo_UNO&Mega2560_IIC_V1.0\Example" folder,

There are test programs inside,See the figure below (see the test procedure documentation for a description):

MC096-016.jpg

c.Then open the "1-Arduino测试程序\Arduino_OLED_Demo_UNO&Mega2560_IIC_V1.0\Install libraries" folder,

which contains the U8glib open source library, as shown in the following figure:

MC096-038.jpg

d.Copy U8glib to the directory where the Arduino IDE run lib is located, which can be viewed and set from the following figure:

MC096-039.jpg

e.Select any test program to run the test, for example select Example03-show_BMP test program

f.When you open the test program,click tools-> Board to select the development board model,then click tools-> Port

to select the com port to connect,as shown in the following figure:

MC096-028.jpg

g.After both the development board model and the com port have been selected correctly,click the right arrow button to compile and download,

as shown in the following figure:

MC096-029.jpg

h.When Done upload appears,the compilation and download are successful,as shown in the following figure:

MC096-030.jpg

i.The OLED module displays the pictures below,which indicates that the test program is running successfully and the operation is successful

MC096-002.jpg


C51 platform instructions

1.Wiring instructions

the pin on module the pin on C51 single chip
VCC 5V
GND GND
SCL P23
SDA P24

2.operation instructions

a.Connect the OLED module to the C51 development board according to the wiring instructions and then power on

b.Download the package (see the driver download column for details), unzip and open the "2-C51测试程序" folder,

MC096-020.jpg

c.There are two kinds of C51 single-chip test program,just choose one,for example,select STC12C5A60S2 microcontroller test program

(for related instructions, see the test program documentation)

d.Open the "C51_OLED_Demo_STC12C5A60S2_IIC_V1.0" folder and find the "OLED.uvproj" file,double-click to open the test program project

e.Click the Compile button to compile the entire project.When "creating hex file from ".OBJ\TEST_OLED"..." appears,

the compilation is successful, as shown in the following figure:

MC096-031.jpg

f.Then open the STC-ISP software to download.The relevant settings are shown in the following figure:

MC096-032.jpg

g.Then select the compiled hex file to burn.The burning file is in the directory of "C51_OLED_Demo_STC12C5A60S2_IIC_V1.0\OBJ",

as shown in the following figure:

MC096-033.jpg

h.After the download is clicked,the MCU needs to be powered on again, when appear "successful operation", it means successful burning,

the operation is shown in the following figure:

MC096-034.jpg

i.The OLED module displays the pictures below,which indicates that the test program is running successfully and the operation is successful

MC096-002.jpg

STM32 platform instructions

1.Wiring instructions

the pin on module the pin on STM32 single chip
VCC 5V
GND GND
SCL PB13
SDA PB14

2.operation instructions

a.Connect the OLED module to the STM32 development board according to the wiring instructions and then power on

b.Download the package (see the driver download column for details), unzip and open the "3-STM32测试程序" folder,

MC096-025.jpg

c.there are two kinds of STM32 single-chip test program,just choose one,for example,select STM32F103RCT6 microcontroller test program

(for related instructions, see the test program documentation)

d.Open the "STM32_OLED_Demo_STM32F103RCT6_IIC_V1.0\USER" folder and find the "OLED.uvproj" file,double-click to open the test program project

e.Click on the compile button to compile the entire project,and when "from ELF: creating hex file.\ OBJ\ TESTOLED.axf" appears,

the compilation is successful, as shown in the following figure:

MC096-035.jpg

f.Connect to JTAG and click the download button.When "Programming Done.Verify OK."appears,

the download is successful, as shown in the following figure:

MC096-036.jpg

g.The OLED module displays the pictures below,which indicates that the test program is running successfully and the operation is successful

MC096-002.jpg

Driver download

baiduyun download:0.96 inch OLED display module data of QD electronic V1.0

Common software description

the software description is in the software package and the download address as follows:

PCtoLCD2002:PCtoLCD2002