0.96寸OLED(SSD1306)屏幕显示(一)——基础功能介绍

0.96寸OLED(SSD1306)屏幕显示

 

(一)基础功能介绍

(二)超长文字水平滚动

(三)屏幕垂直水平滚动


前言

最近,我突发奇想去翻阅了一些我本科期间所做的一些小项目,发现都挺有意思的!当年做这些项目的时候可走了很多弯路,所以想着可以将它们上传到网络上,并通过我的讲解文章可以帮助你们少走一些弯路!

今天,我要分享的是一个0.96寸OLED(SSD1306)屏幕显示的学习笔记,因为我想要讲的详细一点,所以打算做成一个系列,手把手地教你学习和认识屏幕显示。由于我知识有限,如果出现一些错误,希望大家可以帮助我指出来,我们一起学习进步!!!


一、0.96寸OLED屏幕介绍

OLED,即有机发光二极管( Organic Light Emitting Diode )。OLED由于同时具备自发光,不需背光源、对比度高、厚度薄、视角广、反应速度快、可用于挠曲性面板、使用温度范围广、构造及制程较简单等优异之特性,被认为是下一代的平面显示器新兴应用技术。

图 1 0.96寸七针OLED屏幕

 本文采用的是7针的0.96寸OLED显示进行讲解,采用的是SPI协议,速度会比采用I2C协议的更快,但这两者的显示驱动都一样,本质上没有太大差别。屏幕整体分辨率为128*64,有黄蓝、白、蓝三种颜色可选,驱动芯片为SSD1306,下面是引脚功能介绍。

表 1 0.96寸OLED屏幕显示引脚介绍
名称注释
GND接地
VCC3.3-5v
D0SPI中的时钟管脚——SCK
D1SPI中的数据管脚——MOSI
RES复位引脚(低电平有效)
DC数据/命令控制脚
CS片选引脚

二、SSD1306驱动芯片

1)图像显示RAM(GDDRAM)

GDDRAM是位映射静态RAM,大小为 128x64 位。GDDRAM分为8页(PAGE0~PAGE7),每页内 1个SEG对应1Byte数据,一页由 128 Byte 组成。一帧显示数据为 1024 Byte(1KB)。即屏幕每8行像素点(8*PIXEL)记为一页(PAGE),64行即为8页,则屏幕变为128列(ROW)8页(PAGE),若要显示整个屏幕,则需要128*8个1字节数

图 3 GDDRAM(Graphic Display Data RAM )内部结构

2)最为常见的GDDRAM寻址模式——页模式

页寻址模式下,寻址只在一页(PAGEn)内进行,地址指针不会跳到其他页。每次向GDDRAM写入1byte显示数据后,列指针会自动+1。当128列都寻址完之后,列指针会重新指向SEG0而页指针仍然保持不变。通过页寻址模式我们可以方便地对一个小区域内数据进行修改。

图 4 页寻址模式

一个数据字节写入GDDRAM时,当前列(SEG)同一页(PAGE)的所有行(COM)图像数据都被填充(即由列地址指针指向的整列(8位)被填充)。数据位D0写入顶行,数据位D7写入底行(由上到下,由低到高)。还有水平寻址垂直寻址,本系列文章并没有用到,故不进行介绍,想要了解的小伙伴可以自行了解。

图 5 页寻址模式下GDDRAM访问指针设置示例

3)SSD1306常见驱动命令

1、设置屏幕显示开启与关闭(AEH / AFH)

  • AEH 关闭屏幕
  • AFH 开启屏幕

2、设置GDDRAM寻址模式(20H + A[1:0])

  • 00H 水平寻址
  • 01H 垂直寻址
  • 02H 页寻址

3、设置起始页地址(B0H ~ B7H)

  • B0H~B7H 分别设置起始页为 0~7

4、设置输出行扫描顺序(C0H / C8H)

  • C0H 显示上下颠倒
  • C8H 正常

5、设置输出列扫描顺序(A0H / A1H)

  • A0H 显示左右颠倒
  • A1H 正常

6、设置颜色显示方式(A0H / A1H)

  • A7H 反相显示
  • A6H 正常显示

7、设置起始行地址(40H / 7FH)

  • 40H 设置显示起始行地址为第0行
  • 7FH 设置显示起始行地址为第63行

8、设置屏幕对比度(81H + 00H~FFH)

  • 00H~FFH 默认0X7F(亮度设置,越大越亮)

9、设置复用率(A8H + A[5:0])

  • 0FH~3FH  复用率为 1~64

10、设置全屏全亮(A4H / A5H)

  • A4H 设置显示模式为正常模式,此时屏幕输出GDDRAM中的显示数据
  • A5H 设置显示模式为全亮模式,此时屏幕无视GDDRAM中的数据,并点亮全屏

11、设置分频因子与震荡频率D5H + {A[3:0]:分频系数,A[7:4]震荡频率}

  • F0H 频率设置成最高407 kHz,分频系数为1

12、设置预充电周期D9H + A[7:0]

  • 22H 设置为默认值2DCLK

13、设置Vcomh电压DBH + A[6:4]

  • 00H ~0.65 x VCC
  • 20H ~0.77 x VCC (RESET)
  • 30H ~0.83 x VCC (RESET)

14、设置COM引脚硬件配置DAH + A[5:4]

  • 12H 使用备选引脚配置,并禁用左右反置

15、设置电荷泵8DH + A[2]

  • 14H 使能电荷泵
  • 10H 关闭电荷泵

4)OLED初始化代码

void OLED_SSD1306_Init(void)
{
	// GPIO初始化
	OLED_GPIO_Init();
	// SPI初始化
	OLED_SPI_Init();
	
	//延时1秒稳定端口状态
	SysTick_Delay_ms(1000);
	
	/* 复位 */
	OLED_RES_LOW();
	SysTick_Delay_ms(10);
	/* 复位正常信号 SSD1306: RES引脚高电平 */
	OLED_RES_HIGH();
	
	OLED_Write_Cmd(0xAE); //关闭显示
	
	OLED_Write_Cmd(0x20); //设置模式
	OLED_Write_Cmd(0x10); //设置为页显示模式
	OLED_Write_Cmd(0xb0);	// 设置起始页的地址模式 0-7
	
	OLED_Write_Cmd(0xc8); // 0xc0上下反置 0xc8正常

//	OLED_Write_Cmd(0x00); // ---set low column address,初始化设置了没用,因为OLED_SetPos函数中会重设
//	OLED_Write_Cmd(0x10); // ---set high column address,初始化设置了没用,因为OLED_SetPos函数中会重设

	OLED_Write_Cmd(0x40); //--set start line address,从RAM中哪一行起读取显示内容

	OLED_Write_Cmd(0x81); //设置对比度
	OLED_Write_Cmd(0xff); //亮度调节 0x00~0xff
	
	OLED_Write_Cmd(0xa1); // 0xa0左右反置 0xa1正常
	OLED_Write_Cmd(0xa6); //设置显示方式;bit0:1,反相显示;0,正常显示

	OLED_Write_Cmd(0xa8); //--set multiplex ratio(1 to 64)
	OLED_Write_Cmd(0x3F); //

	OLED_Write_Cmd(0xa4); //全局显示开启;0xa4正常,0xa5无视命令点亮全屏

	OLED_Write_Cmd(0xd3); //-set display offset
	OLED_Write_Cmd(0x00); //-not offset

	OLED_Write_Cmd(0xd5); //设置时钟分频因子,震荡频率
	OLED_Write_Cmd(0xf0); //[3:0],分频因子;[7:4],震荡频率
	
	OLED_Write_Cmd(0xd9); //--set pre-charge period
	OLED_Write_Cmd(0x22); //

	OLED_Write_Cmd(0xda); //--set com pins hardware configuration
	OLED_Write_Cmd(0x12);
	
	OLED_Write_Cmd(0xdb); //--set vcomh
	OLED_Write_Cmd(0x20); //0x20,0.77xVcc


	OLED_Write_Cmd(0x8d); //设置电荷泵开关
	OLED_Write_Cmd(0x14); //开

	OLED_Write_Cmd(0xaf); //开启显示
}

三、取字模软件介绍

取字模软件使用的是PCtoLCD2002完美版,使字符串和图像变成字节数据,从而可以显示在OLED屏幕上。由于我们上文中OLED屏幕寻址模式选择的是页寻址以及硬件结构,所以一定要在字模选项中选择阴码、列行式、逆向、C51格式。

图 6 PCtoLCD2002软件主页面
图 7 PCtoLCD2002软件字模选项页面

 四、屏幕中英文显示示例及部分代码

0.96寸OLED显示中英文字符串动态图

 

英文字符串显示

/**
  * @brief  OLED_ShowStr,显示codetab.h中的ASCII字符,有6*8和8*16可选择
  * @param  x,y : 起始点坐标(x:0~127, y:0~7);
	*		ch[] :- 要显示的字符串; 
	*		TextSize : 字符大小(1:6*8 ; 2:8*16)
	* @retval 无
  */
void OLED_ShowStr(unsigned char x, unsigned char y, unsigned char ch[], unsigned char TextSize)
{	
	unsigned char c = 0,i = 0,j = 0,k = 0;
	switch(TextSize)
	{
		case 1:
		{
			while(ch[j] != '\0')
			{
				c = ch[j] - 32;
				if(x > 122)
				{
					x = 0;
					y++;
				}
				/**/
				for(i=0;i<6;i++)
				{
					for(k=0;k<8;k++)
					{
						// 先取低位
						if(F6x8[c][i]&(0x01<<k))
						{
							OLED_Set_Pixel(x+i, y*8+k,1);
						}
						else
						{
							OLED_Set_Pixel(x+i, y*8+k,0);
						}
					}
				}
				x += 6;
				j++;
			}
		}break;
		case 2:
		{
			while(ch[j] != '\0')
			{
				c = ch[j] - 32;
				if(x > 120)
				{
					x = 0;
					y=y+2;
				}
				/*先构建上半部分*/
				for(i=0;i<8;i++)
				{
					for(k=0;k<8;k++)
					{
						// 先取低位
						if(F8X16[c*16+i]&(0x01<<k))
						{
							OLED_Set_Pixel(x+i, y*8+k,1);
						}
						else
						{
							OLED_Set_Pixel(x+i, y*8+k,0);
						}
					}
				}
				for(i=0;i<8;i++)
				{
					// 先取低位
					for(k=0;k<8;k++)
					{
						if(F8X16[c*16+i+8]&(0x01<<k))
						{
							OLED_Set_Pixel(x+i, (y+1)*8+k,1);
						}
						else
						{
							OLED_Set_Pixel(x+i, (y+1)*8+k,0);
						}
					}
				}
				x += 8;
				j++;

			}
		}break;
	}
	
	OLED_Refresh_Gram();
}

中文字符串显示

/**
  * @brief  GUI_ShowFont16,将Font16*16的中文字符显示出来
  * @param  x : 中文字符串显示的起始位置x(0-127)
            y : 中文字符串显示的起始位置y(0-63)
            *s : 中文字符串的指针
            mode : 0 - 白背景显示黑字符
			       1 - 黑背景显示白字符
  *                2 - 将数据放到长数组里
  * @retval 无
  */
void GUI_ShowFont16(uint16_t x,uint8_t y,uint8_t *s,uint8_t mode)
{
	uint8_t i,j,k,tmp;
	uint16_t num;
	num = sizeof(cfont16)/sizeof(typFNT_GB16);
	for(i=0;i<num;i++)
	{
		// 中文字符串进行匹配
		if((cfont16[i].Index[0]==*s)&&(cfont16[i].Index[1]==*(s+1)))
		{
			for(j=0;j<32;j++)
			{
				if(mode)
				{
					tmp = cfont16[i].Msk[j];
				}
				else if(mode==0)
				{
					tmp = ~(cfont16[i].Msk[j]);
				}
				for(k=0;k<8;k++)
				{
					if(tmp&(0x01<<k))
					{
						if(mode == 2)
						{
							OLED_Set_Pixel(x+(j%16), y+(j/16)*8+k,11);
						}
						else
						{
							OLED_Set_Pixel(x+(j%16), y+(j/16)*8+k,1);
						}
					}
					else
					{
						if(mode == 2)
						{
							OLED_Set_Pixel(x+(j%16), y+(j/16)*8+k,10);
						}
						else
						{
							OLED_Set_Pixel(x+(j%16), y+(j/16)*8+k,0);
						}
					}
				}
			}	
			break;
		}	
	}
}

  		   
 /**
  * @brief  OLED_ShowCN显示中文字符串
  * @param  x : 中文字符串显示的起始位置x(0-127)
            y : 中文字符串显示的起始位置y(0-7)
            *str : 中文字符串的指针
            mode : 0 - 白背景显示黑字符
			       1 - 黑背景显示白字符
  * @retval 无
  */
void OLED_ShowCN(uint8_t x,uint8_t y,uint8_t *str,uint8_t mode)
{
	// 字符串宽度是16
	uint8_t hsize=16;
	y = y*8;
	while(*str!='\0')
	{
		if(hsize == 16)
		{
			GUI_ShowFont16(x,y,str,mode);
		}
		else
		{
			return;
		}
		x+=hsize;
		// 最大128行
		if(x>128-hsize)
		{
			x=0;
			y+=hsize;
		}
		str+=2;
	}

	// 刷新屏幕
	OLED_Refresh_Gram();	
}

codetab.h

// GB16中文显示结构体
typedef struct 
{
	unsigned char Index[2];	// 一个汉字占2个字节,16位
	char Msk[32];// 
}typFNT_GB16; 



// 宏定义最多显示的中文字符串长度
#define     LONG_CN_LEN          20


/***************************点阵字体取模方式:共阴——列行式——逆向输出*********/

const typFNT_GB16 cfont16[] = 
{
	"  ",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",0*/
	"我",0x20,0x24,0x24,0x24,0xFE,0x23,0x22,0x20,0x20,0xFF,0x20,0x22,0x2C,0xA0,0x20,0x00,0x00,0x08,0x48,0x84,0x7F,0x02,0x41,0x40,0x20,0x13,0x0C,0x14,0x22,0x41,0xF8,0x00,/*"我",0*/
	"是",0x00,0x00,0x00,0x7F,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x7F,0x00,0x00,0x00,0x00,0x81,0x41,0x21,0x1D,0x21,0x41,0x81,0xFF,0x89,0x89,0x89,0x89,0x89,0x81,0x81,0x00,/*"是",1*/
	"羌",0x00,0x08,0x48,0x48,0x49,0x4E,0xC8,0x78,0x48,0x4C,0x4B,0x48,0x48,0x08,0x00,0x00,0x82,0x82,0x42,0x22,0x12,0x0E,0x03,0x02,0x7E,0x82,0x82,0x82,0x82,0x82,0xE2,0x00,/*"羌",3*/
	"族",0x10,0x10,0xF1,0x96,0x90,0x90,0x10,0x08,0xF7,0x44,0xC4,0x44,0x44,0x44,0x04,0x00,0x80,0x60,0x1F,0x40,0x80,0x7F,0x04,0x85,0x44,0x34,0x0F,0x34,0x44,0x84,0x84,0x00,/*"族",4*/
	"小",0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x20,0x40,0x80,0x00,0x00,0x08,0x04,0x03,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x01,0x0E,0x00,/*"小",5*/
	"煞",0x10,0x28,0x27,0x24,0x34,0x2C,0xE0,0x20,0x10,0x6C,0x8B,0x08,0x88,0x78,0x08,0x00,0x88,0x69,0x09,0x09,0x29,0xC9,0x0F,0x00,0x30,0xC8,0x05,0x02,0x25,0xC8,0x10,0x00,/*"煞",6*/
};


/************************************6*8的点阵************************************/
const unsigned char F6x8[][6] =
{
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// sp
	0x00, 0x00, 0x00, 0x2f, 0x00, 0x00,// !
	0x00, 0x00, 0x07, 0x00, 0x07, 0x00,// "
	0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14,// #
	0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12,// $
	0x00, 0x62, 0x64, 0x08, 0x13, 0x23,// %
	0x00, 0x36, 0x49, 0x55, 0x22, 0x50,// &
	0x00, 0x00, 0x05, 0x03, 0x00, 0x00,// '
	0x00, 0x00, 0x1c, 0x22, 0x41, 0x00,// (
	0x00, 0x00, 0x41, 0x22, 0x1c, 0x00,// )
	0x00, 0x14, 0x08, 0x3E, 0x08, 0x14,// *
	0x00, 0x08, 0x08, 0x3E, 0x08, 0x08,// +
	0x00, 0x00, 0x00, 0xA0, 0x60, 0x00,// ,
	0x00, 0x08, 0x08, 0x08, 0x08, 0x08,// -
	0x00, 0x00, 0x60, 0x60, 0x00, 0x00,// .
	0x00, 0x20, 0x10, 0x08, 0x04, 0x02,// /
	0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E,// 0
	0x00, 0x00, 0x42, 0x7F, 0x40, 0x00,// 1
	0x00, 0x42, 0x61, 0x51, 0x49, 0x46,// 2
	0x00, 0x21, 0x41, 0x45, 0x4B, 0x31,// 3
	0x00, 0x18, 0x14, 0x12, 0x7F, 0x10,// 4
	0x00, 0x27, 0x45, 0x45, 0x45, 0x39,// 5
	0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30,// 6
	0x00, 0x01, 0x71, 0x09, 0x05, 0x03,// 7
	0x00, 0x36, 0x49, 0x49, 0x49, 0x36,// 8
	0x00, 0x06, 0x49, 0x49, 0x29, 0x1E,// 9
	0x00, 0x00, 0x36, 0x36, 0x00, 0x00,// :
	0x00, 0x00, 0x56, 0x36, 0x00, 0x00,// ;
	0x00, 0x08, 0x14, 0x22, 0x41, 0x00,// <
	0x00, 0x14, 0x14, 0x14, 0x14, 0x14,// =
	0x00, 0x00, 0x41, 0x22, 0x14, 0x08,// >
	0x00, 0x02, 0x01, 0x51, 0x09, 0x06,// ?
	0x00, 0x32, 0x49, 0x59, 0x51, 0x3E,// @
	0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C,// A
	0x00, 0x7F, 0x49, 0x49, 0x49, 0x36,// B
	0x00, 0x3E, 0x41, 0x41, 0x41, 0x22,// C
	0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C,// D
	0x00, 0x7F, 0x49, 0x49, 0x49, 0x41,// E
	0x00, 0x7F, 0x09, 0x09, 0x09, 0x01,// F
	0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A,// G
	0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F,// H
	0x00, 0x00, 0x41, 0x7F, 0x41, 0x00,// I
	0x00, 0x20, 0x40, 0x41, 0x3F, 0x01,// J
	0x00, 0x7F, 0x08, 0x14, 0x22, 0x41,// K
	0x00, 0x7F, 0x40, 0x40, 0x40, 0x40,// L
	0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F,// M
	0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F,// N
	0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E,// O
	0x00, 0x7F, 0x09, 0x09, 0x09, 0x06,// P
	0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E,// Q
	0x00, 0x7F, 0x09, 0x19, 0x29, 0x46,// R
	0x00, 0x46, 0x49, 0x49, 0x49, 0x31,// S
	0x00, 0x01, 0x01, 0x7F, 0x01, 0x01,// T
	0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F,// U
	0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F,// V
	0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F,// W
	0x00, 0x63, 0x14, 0x08, 0x14, 0x63,// X
	0x00, 0x07, 0x08, 0x70, 0x08, 0x07,// Y
	0x00, 0x61, 0x51, 0x49, 0x45, 0x43,// Z
	0x00, 0x00, 0x7F, 0x41, 0x41, 0x00,// [
	0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55,// 55
	0x00, 0x00, 0x41, 0x41, 0x7F, 0x00,// ]
	0x00, 0x04, 0x02, 0x01, 0x02, 0x04,// ^
	0x00, 0x40, 0x40, 0x40, 0x40, 0x40,// _
	0x00, 0x00, 0x01, 0x02, 0x04, 0x00,// '
	0x00, 0x20, 0x54, 0x54, 0x54, 0x78,// a
	0x00, 0x7F, 0x48, 0x44, 0x44, 0x38,// b
	0x00, 0x38, 0x44, 0x44, 0x44, 0x20,// c
	0x00, 0x38, 0x44, 0x44, 0x48, 0x7F,// d
	0x00, 0x38, 0x54, 0x54, 0x54, 0x18,// e
	0x00, 0x08, 0x7E, 0x09, 0x01, 0x02,// f
	0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C,// g
	0x00, 0x7F, 0x08, 0x04, 0x04, 0x78,// h
	0x00, 0x00, 0x44, 0x7D, 0x40, 0x00,// i
	0x00, 0x40, 0x80, 0x84, 0x7D, 0x00,// j
	0x00, 0x7F, 0x10, 0x28, 0x44, 0x00,// k
	0x00, 0x00, 0x41, 0x7F, 0x40, 0x00,// l
	0x00, 0x7C, 0x04, 0x18, 0x04, 0x78,// m
	0x00, 0x7C, 0x08, 0x04, 0x04, 0x78,// n
	0x00, 0x38, 0x44, 0x44, 0x44, 0x38,// o
	0x00, 0xFC, 0x24, 0x24, 0x24, 0x18,// p
	0x00, 0x18, 0x24, 0x24, 0x18, 0xFC,// q
	0x00, 0x7C, 0x08, 0x04, 0x04, 0x08,// r
	0x00, 0x48, 0x54, 0x54, 0x54, 0x20,// s
	0x00, 0x04, 0x3F, 0x44, 0x40, 0x20,// t
	0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C,// u
	0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C,// v
	0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C,// w
	0x00, 0x44, 0x28, 0x10, 0x28, 0x44,// x
	0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C,// y
	0x00, 0x44, 0x64, 0x54, 0x4C, 0x44,// z
	0x14, 0x14, 0x14, 0x14, 0x14, 0x14,// horiz lines
};

总结

本系列所用单片机型号为STM32F103VE,后续我会把本节所涉及的工程及相关资料放在评论区,大家自取!请大家多多点赞、多多收藏、感谢支持!!!我会继续输出优质内容的!!!加油!加油!🌸🌸🌸

  • 96
    点赞
  • 660
    收藏
    觉得还不错? 一键收藏
  • 13
    评论
Pin Number Symbol I/O Function P Po o we er r S Su up pp pl ly y 9 VDD P P Po o we er r S Su up pp pl ly y f fo or r L Lo og gi ic c This is a voltage supply pin. It must be connected to external source. 8 VSS P G Gr ro ou un nd d o of f L Lo og gi ic c C Ci ir rc cu ui it t This is a ground pin. It acts as a reference for the logic pins. It must be connected to external ground. 28 VCC P P Po o we er r S Su up pp pl ly y f fo or r OE EL L P Pa an ne el l This is the most positive voltage supply pin of the chip. A stabilization capacitor should be connected between this pin and V SS when the converter is used. It must be connected to external source when the converter is not used. 29 VLSS P G Gr ro ou un nd d o of f A An na al lo og g C Ci ir rc cu ui it t This is an analog ground pin. It should be connected to V SS externally. D Dr ri iv ve er r 26 IREF I C Cu ur rr re en nt t R Re ef fe er re en nc ce e f fo or r B Br ri ig gh ht tn ne es ss s A Ad dj ju us st t me en nt t This pin is segment current reference pin. A resistor should be connected between this pin and V SS . Set the current at 12.5μA maximum. 27 VCOMH O V Vo ol lt ta ag ge e Ou ut tp pu ut t Hi ig gh h L Le ev ve el l f fo or r C C O M S Si ig gn na al l This pin is the input pin for the voltage output high level for COM signals. A capacitor should be connected between this pin and V SS . D DC C/ /D DC C C Co on nv ve er rt te er r 6 VDDB P P Po o we er r S Su up pp pl ly y f fo or r DC C/ / DC C C Co on nv ve er rt te er r C Ci ir rc cu ui it t This is the power supply pin for the internal buffer of the DC/DC voltage converter. It must be connected to external source when the converter is used. It should be connected to V DD when the converter is not used. 4 / 5 2 / 3 C1P / C1N C2P / C2N I P Po os si it ti iv ve e T Te er r mi in na al l o of f t th he e F Fl ly yi in ng g I In nv ve er rt ti in ng g C Ca ap pa ac ci it to or r Ne eg ga at ti iv ve e T Te er r mi in na al l o of f t th he e F Fl ly yi in ng g B Bo oo os st t C Ca ap pa ac ci it to or r The charge-pump capacitors are required between the terminals. They must be floated when the converter is not used. I In nt te er rf fa ac ce e 10 11 12 BS0 BS1 BS2 I C Co o m mu un ni ic ca at ti in ng g P Pr ro ot to oc co ol l S Se el le ec ct t These pins are MCU interface selection input. See the following table: BS0 BS1 BS2 I 2 C 0 1 0 3-wire SPI 1 0 0 4-wire SPI 0 0 0 8-bit 68XX Parallel 0 0 1 8-bit 80XX Parallel 0 1 1 14 RES# I P Po o we er r R Re es se et t f fo or r C Co on nt tr ro ol ll le er r a an nd d Dr ri iv ve er r This pin is reset signal input. When the pin is low, initialization of the chip is executed. Keep this pin pull high during normal operation. 13 CS# I C Ch hi ip p S Se el le ec ct t This pin is the chip select input. The chip is enabled for MCU communication only when CS# is pulled low. 15 D/C# I Da at ta a/ /C Co o m ma an nd d C Co on nt tr ro ol l This pin is Data/Command control pin. When the pin is pulled high, the input at D7~D0 is treated as display data. When the pin is pulled low, the input at D7~D0 will be transferred to the command register. When the pin is pulled high and serial interface mode is selected, the data at SDIN will be interpreted as data. When it is pulled low, the data at SDIN will be transferred to the command register. In I 2 C mode, this pin acts as SA0 for slave address selection. For detail relationship to MCU interface signals, please refer to the Timing Characteristics Diagrams. 17 E/RD# I R Re ea ad d/ / Wr ri it te e E En na ab bl le e o or r R Re ea ad d This pin is MCU interface input. When interfacing to a 68XX-series microprocessor, this pin will be used as the Enable (E) signal. Read/write operation is initiated when this pin is pulled high and the CS# is pulled low. When connecting to an 80XX-microprocessor, this pin receives the Read (RD#) signal. Data read operation is initiated when this pin is pulled low and CS# is pulled low. When serial or I 2 C mode is selected, this pin must be connected to V SS . GoldenMorning Electronic 4 1.5 Pin Definition (Continued) Pin Number Symbol I/O Function I In nt te er rf fa ac ce e ( (C Co on nt ti in nu ue ed d) ) 16 R/W# I R Re ea ad d/ / Wr ri it te e S Se el le ec ct t o or r Wr ri it te e This pin is MCU interface input. When interfacing to a 68XX-series microprocessor, this pin will be used as Read/Write (R/W#) selection input. Pull this pin to “High” for read mode and pull it to “Low” for write mode. When 80XX interface mode is selected, this pin will be the Write (WR#) input. Data write operation is initiated when this pin is pulled low and the CS# is pulled low. When serial or I 2 C mode is selected, this pin must be connected to V SS . 18~25 D0~D7 I/O Ho os st t Da at ta a I In np pu ut t/ / Ou ut tp pu ut t B Bu us s These pins are 8-bit bi-directional data bus to be connected to the microprocessor’s data bus. When serial mode is selected, D1 will be the serial data input SDIN and D0 will be the serial clock input SCLK. When I 2 C mode is selected, D2 & D1 should be tired together and serve as SDA out & SDA in in application and D0 is the serial clock input SCL. Unused pins must be connected to V SS except for D2 in serial mode. R Re es se er rv ve e 7 N.C. - R Re es se er rv ve ed d P Pi in n The N.C. pin between function pins are reserved for compatible and flexible design. 1, 30 N.C. (GND) - R Re es se er rv ve ed d P Pi in n ( (S Su up pp po or rt ti in ng g P Pi in n) ) The supporting pins can reduce the influences from stresses on the function pins. These pins must be connected to external ground as the ESD protection circuit.
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值