SSD1312

指令

指令解释
0x00Set lower column address
0x10Set higher column address
0x20, 0xXXSet Memory addressing mode, 0x00, 0x02, 0x09 ?
0x21?Set Memory addressing mode
0x22?
0x40?set display start lines
0x81, 0xXX设置对比度0x00~0xFF,默认为0x80,0x00为关闭显示器
0x8D, 0xXXenable charge pump,0x12:7.5V (一般选这个?); 0x52:8V; 0x72:9V; 0x92:10V
0xA1, 0xXXSet segment remap, 0xC0?, 上下翻转显示:0xC8
0xA4全屏点亮?Entire display ON
0xA5?全屏熄灭Entire display OFF
0xA6正常显示(1为像素点亮)
0xA7反色显示(0为像素点亮)
0xA8, 0xXXset multiplex,0x1F:128x32,0x3F:128x64
0xAF开启OLED
0xAE关闭OLED
0xB0set page address
0xDA, 0xXXSet SEG Pins Hardware Configuration, 0x10
0xD3, 0xXXset display offset , 0x00
0xD5, 0xXXset osc division,0x80
0xD9, 0xXXset pre-charge period, 0x22
0xDA, 0xXX? set COM pins hardware configuration to sequential, 0x02, 0x10
0xDB, 0xXXSet VCOMH Deselect Level, 0x30

初始化

  • 初始化指令
#define SSD1312_12864_INIT_LEN   15
const uint8_t SSD1312_12864_INIT_CMD[] PROGMEM = {
  0xA8, 0x3F,       // set multiplex (HEIGHT-1): 0x3F for 128x64 
  0x22, 0x00, 0x03, // set min and max page
  0x20, 0x00,       // set horizontal memory addressing mode
  0x81, 0x01,       // set contrast default 0x80, 0x00 will set the display off
  0xDA, 0x10,       // set COM pins hardware configuration to sequential
  0x8D, 0x12,       // enable charge pump
  0xA1, 0xC0        // flip the screen, or "0xA0, 0xC8"
};
  • 在清空屏幕缓存后使用0xAF启动屏幕

显示方向

  • 命令,第一个字节为0xA00xA1,第二个字节为0xC00xC8
  // https://www.buydisplay.com/download/ic/SSD1312_Datasheet.pdf Pg. 51 Section 2.1.19
  //            normal    inverted
  // normal     A1 C8       A0 C0
  // mirrored   A0 C8       A1 C0
  • 默认方向,与命令0xA0, 0xC0相同(若排线在左时为正,左右镜像)
  • 使用命令0xA0, 0xC8配置方向(若排线在左时为正,正常图像)
  • 使用命令0xA1, 0xC0配置方向(若排线在右时为正,正常图像)
  • 使用命令0xA1, 0xC8配置方向(若排线在左时为正,左右镜像)

显示错误

  • Segment错误
  • 初始化代码中0xDA, 0x02改为0xDA, 0x10