1. The screen don't display completely.
- 1.1 The cause
Since the 1.3 inch screen requires a larger current to ensure the normal brightness of the LCD panel,the more powerful SH1106 is used as the driver chip, and its register size is 132×64.
Since the dot matrix on the screen is 128×64, the array of registers is four columns more than OLED(there are two columns on the left and the right)，If you are working on a screen, write data from the first column as usual….There is a problem with the screen display.
- 1.2 The solution
When you write the data to the screen, the X-axis starts at 2 (the third point) and writes to the right.
The sample code：
/***************OLED Set the coordinates**********************/
void OLED_Set_Pos(unsigened char x,unsigende char y)
3.How to set screen brightness?
- 3.1 The solution：
The brightness adjustment needs to set the contrast register 0x81, which has 256 (0x00~0xFF) brightness position adjustable.It means：Write 0x81 on the screen first, then write the brightness values you need to the screen.
#define Brightness 0xCF // Brightness value 0 XCF macro definition to the Brightness
OLED_WrCmd(0x81); // set contrast control register
5.Can the screen be set back?
- 5.1 Solution：The 0xa6 and 0xa7 commands in the SH1106 register are used to control the positive and negative display.
OLED_WrCmd(0xa6); //Full screen forward display.
OLED_WrCmd(0xa7); //Full screen reverse display.
2.On the right, there is a vertical line or spot.
- 2.1 The cause
The reason is the same as problem 1,The data in the first column of the register and the second column are driven by the chip and it is shown in the last column of the display screen.
- 2.2 The solution
Change the value of the “all X” axis in the program to 132，the X-axis and Y-axis are defined as follows.
The code is shown below：
#define Brightness 0xCF
#define X_WIDTH 128 /*Preset on macros，Replace the points on the 128 X axes with the “X_WIDTH” character.*/
#define Y_WIDTH 64
4.How does the screen turn upside down?
- 4.1 The solution：
Just put the left and right sides, and then put them up and down ，you can turn the screen upside down to make it easier for the device to be wired and installed. As shown below，0xa1/0xa0 Commands can control the order in which the screen is left and right，0xc8/0xc0 can control the upper and lower order of the screen.
OLED_WrCmd(0xa1); // –Set SEG/Colum Mapping 0xa0 Left and right inversion，0xa1 normal
OLED_WrCmd(0xc8); // –Set COM/Row Scan Direction 0xc0 up and down inversion，0xc8 normal
OLED_WrCmd(0xa1); OLED WrCmd(0xC8); //full inversion display
6.How do you get the screen into hibernation mode?
- 6.1 The solution：The OLED module produced by our company USES the charge pump (a booster) on the drive chip to provide sufficient driving voltage for the LCD panel,The energy consumption of charge pump occupies a high proportion in the whole module.So to make the screen sleep, you have to turn off the screen and turn off the charge pump.Specific code ：
- /**********Close OLED display–Allow OLED to go into hibernation mode******/void OLED_OFF(void)
OLED_WrCmd(0x8D); //Set power pump
OLED_WrCmd(0x10); //Power off pump
OLED_WrCmd(0xAE); //OLED dormancy
- Wake up/***********Open OLED display**********/void OLED_ON(void)
OLED_WrCmd(0x8D); //Set charge pump
OLED_WrCmd(0x14); //close charge pump
OLED_WrCmd(0xAF); //wake up charge pump