关于OLED清屏不完全的问题请教
时间:10-02
整理:3721RD
点击:
实验用的OLED屏幕是基于SSD1306控制的,不知道这样描述对不对,初始化的指令都是从网络上面找到的,自己也进行过对比,但是在清屏的时候大部分时间是这种情况,偶尔会有完全清屏的事件发生,总觉得自己的哪里配置的不太正常,但是又不知道是那里的问题,故,请教广大发烧友,望给出指点。以下是初始化设置,请参考
WriteCommand(0xAE);//--turn off oled panel
WriteCommand(0x00);//---set low column address
WriteCommand(0x10);//---set high column address
WriteCommand(0x40);//--set start line address Set Mapping RAM Display Start Line (0x00~0x3F)设置显 示开始行
WriteCommand(0XB0);//set page address
WriteCommand(0x81);//--set contrast control register设置对比度
WriteCommand(0xCF);// Set SEG Output Current Brightnes亮度
WriteCommand(0xA0);//--Set SEG/Column Mapping 设置段 重映射A0/A1 : A0,X[0]= 0:列地址0映射到 SEG0(默认值) A1 X[0]= 1:列地址127映射到SEG0
WriteCommand(0xC0);//Set COM/Row Scan Direction 设置COM输出扫描方向C0/C8 ()
WriteCommand(0xA6);//--set normal display设置正常/ 逆显示A6/A7
WriteCommand(0xA8);//--set multiplex ratio(1 to 64)设置多种比列
WriteCommand(0x3f);//--1/64 duty
WriteCommand(0xD3);//-set display offset Shift Mapping RAM Counter (0x00~0x3F)设置显示偏移
WriteCommand(0x00);//-not offset
WriteCommand(0xd5);//--set display clock divide ratio/oscillator frequency设置显示时钟分比/振荡器频率
WriteCommand(0x80);//--set divide ratio, Set Clock as 100 Frames/Sec
WriteCommand(0xD9);//--set pre-charge period设定预充电周期
WriteCommand(0xF1);//Set Pre-Charge as 15 Clocks & Discharge as 1 Clock
WriteCommand(0xDA);//--set com pins hardware configuration 配置COM引脚设置
WriteCommand(0x12);
WriteCommand(0xDB);//--set vcomh
WriteCommand(0x40);//Set VCOM Deselect Level
WriteCommand(0x20);//-Set Page Addressing Mode (0x00/0x01/0x02)设置存储器寻址方式
WriteCommand(0x02);//
WriteCommand(0x8D);//--set Charge Pump enable/disable
WriteCommand(0x14);//--set(0x10) disable
WriteCommand(0xA4);// Disable Entire Display On (0xa4/0xa5)
WriteCommand(0xA6);// Disable Inverse Display On (0xa6/a7)
WriteCommand(0xAF);//--turn on oled panel
WriteCommand(0xAE);//--turn off oled panel
WriteCommand(0x00);//---set low column address
WriteCommand(0x10);//---set high column address
WriteCommand(0x40);//--set start line address Set Mapping RAM Display Start Line (0x00~0x3F)设置显 示开始行
WriteCommand(0XB0);//set page address
WriteCommand(0x81);//--set contrast control register设置对比度
WriteCommand(0xCF);// Set SEG Output Current Brightnes亮度
WriteCommand(0xA0);//--Set SEG/Column Mapping 设置段 重映射A0/A1 : A0,X[0]= 0:列地址0映射到 SEG0(默认值) A1 X[0]= 1:列地址127映射到SEG0
WriteCommand(0xC0);//Set COM/Row Scan Direction 设置COM输出扫描方向C0/C8 ()
WriteCommand(0xA6);//--set normal display设置正常/ 逆显示A6/A7
WriteCommand(0xA8);//--set multiplex ratio(1 to 64)设置多种比列
WriteCommand(0x3f);//--1/64 duty
WriteCommand(0xD3);//-set display offset Shift Mapping RAM Counter (0x00~0x3F)设置显示偏移
WriteCommand(0x00);//-not offset
WriteCommand(0xd5);//--set display clock divide ratio/oscillator frequency设置显示时钟分比/振荡器频率
WriteCommand(0x80);//--set divide ratio, Set Clock as 100 Frames/Sec
WriteCommand(0xD9);//--set pre-charge period设定预充电周期
WriteCommand(0xF1);//Set Pre-Charge as 15 Clocks & Discharge as 1 Clock
WriteCommand(0xDA);//--set com pins hardware configuration 配置COM引脚设置
WriteCommand(0x12);
WriteCommand(0xDB);//--set vcomh
WriteCommand(0x40);//Set VCOM Deselect Level
WriteCommand(0x20);//-Set Page Addressing Mode (0x00/0x01/0x02)设置存储器寻址方式
WriteCommand(0x02);//
WriteCommand(0x8D);//--set Charge Pump enable/disable
WriteCommand(0x14);//--set(0x10) disable
WriteCommand(0xA4);// Disable Entire Display On (0xa4/0xa5)
WriteCommand(0xA6);// Disable Inverse Display On (0xa6/a7)
WriteCommand(0xAF);//--turn on oled panel
清屏不完全效果图
有可能是指令速度太快了。