0.96寸OLED显示屏介绍续

0.96 寸OLED 显示屏使用方法

      (以中景园电子的0.96 寸OLED 显示屏为例)

0.96寸OLED显示屏实物图

      七针SPI/IIC 0.96寸OLED显示屏使用方法:

      七针SPI/IIC 0.96寸OLED显示屏共有七个管脚,1~7 分别为 GDN、VCC、D0、D1、RES、DC、CS。此模块支持四线SPI、三线SPI、IIC 接口。

      0.96寸OLED显示屏裸屏是支持五种不同接口的,除了前面的三种还有6800、8080 并口方式;由于这两种接口占用数据线比较多; 而且不太常用, 所以模块在设计的时候没有引出来。

 

      模块的通信接口是通过BS0,BS1,BS2三个管脚来配置的。

      在SPI 接口中,R1,R2,R8 三个电阻是不焊接的。

      在IIC 接口中,需要将R3换到R1上,R8 可以焊接也可不焊接。

      七针SPI/IIC 0.96寸OLED显示屏正面丝印如下,如果想用IIC接口,在IIC接口中需要将RES接高电平,可以与VCC对接,使OLED复位脚一直操持高电平,也就是不复位的状态;同时需要将DC,CS 接电源地;IIC 通信中只需要GND ,VCC,D0(时钟信号),D1(数据信号)四根线。

      如果感觉比较麻烦;也可以直接选用四针的IIC接口的0.96寸OLED显示屏。四针IIC接口相对比较简单一些,只有两个信号线。

      1、GND:电源地。

      2、VCC:电源正(3~5.5V)。

      3、SCL:OLED 的D0 脚,在IIC 通信中为时钟管脚。

      4、SDA:OLED 的D1 脚,在IIC 通信中为数据管脚。

0.96 寸OLED 显示屏例程

/****************0.96英寸OLED显示信息*****************

处理器:STM32F103C8T6

程序功能:开发板上电后在oled液晶屏中显示一些提示信息。

************************************************************/

#include "sys.h"   

#include "stdlib.h"

#define OLED_RST_Clr() PCout(13)=0       //RST

#define OLED_RST_Set() PCout(13)=1      //RST

#define OLED_RS_Clr() PBout(4)=0           //DC

#define OLED_RS_Set() PBout(4)=1          //DC

#define OLED_SCLK_Clr()  PCout(15)=0   //SCL

#define OLED_SCLK_Set()  PCout(15)=1   //SCL

#define OLED_SDIN_Clr()  PCout(14)=0    //SDA

#define OLED_SDIN_Set()  PCout(14)=1   //SDA

#define OLED_CMD  0                                //写命令

#define OLED_DATA 1                                //写数据

void delay_init(u8 SYSCLK);

void delay_ms(u16 nms);

void delay_us(u32 nus);

void OLED_WR_Byte(u8 dat,u8 cmd);      

void OLED_Display_On(void);

void OLED_Display_Off(void);

void OLED_Refresh_Gram(void);                                   

void Oled_Init(void);

void OLED_Clear(void);

void OLED_DrawPoint(u8 x,u8 y,u8 t);

void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 size,u8 mode);

void OLED_ShowNumber(u8 x,u8 y,u32 num,u8 len,u8 size);

void OLED_ShowString(u8 x,u8 y,const u8 *p);

void Oled_Show(void);

u8 OLED_GRAM[128][8];

const unsigned char oled_asc2_1206[95][12]={

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},   /*" "*/

{0x00,0x00,0x00,0x00,0x3F,0x40,0x00,0x00,0x00,0x00,0x00,0x00},   /*"!"*/

{0x00,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x40,0x00,0x00,0x00},   /*"""*/

{0x09,0x00,0x0B,0xC0,0x3D,0x00,0x0B,0xC0,0x3D,0x00,0x09,0x00},/*"#"*/

{0x18,0xC0,0x24,0x40,0x7F,0xE0,0x22,0x40,0x31,0x80,0x00,0x00},  /*"$"*/

{0x18,0x00,0x24,0xC0,0x1B,0x00,0x0D,0x80,0x32,0x40,0x01,0x80}, /*"%"*/

{0x03,0x80,0x1C,0x40,0x27,0x40,0x1C,0x80,0x07,0x40,0x00,0x40}, /*"&"*/

{0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},  /*"'"*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x20,0x40,0x40,0x20},  /*"("*/

{0x00,0x00,0x40,0x20,0x20,0x40,0x1F,0x80,0x00,0x00,0x00,0x00},  /*")"*/

{0x09,0x00,0x06,0x00,0x1F,0x80,0x06,0x00,0x09,0x00,0x00,0x00},  /*"*"*/

{0x04,0x00,0x04,0x00,0x3F,0x80,0x04,0x00,0x04,0x00,0x00,0x00},  /*"+"*/

{0x00,0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},  /*","*/

{0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x00},  /*"-"*/

{0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},  /*"."*/

{0x00,0x20,0x01,0xC0,0x06,0x00,0x38,0x00,0x40,0x00,0x00,0x00}, /*"/"*/

{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},  /*"0"*/

{0x00,0x00,0x10,0x40,0x3F,0xC0,0x00,0x40,0x00,0x00,0x00,0x00}, /*"1"*/

{0x18,0xC0,0x21,0x40,0x22,0x40,0x24,0x40,0x18,0x40,0x00,0x00}, /*"2"*/

{0x10,0x80,0x20,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00}, /*"3"*/

{0x02,0x00,0x0D,0x00,0x11,0x00,0x3F,0xC0,0x01,0x40,0x00,0x00}, /*"4"*/

{0x3C,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x23,0x80,0x00,0x00}, /*"5"*/

{0x1F,0x80,0x24,0x40,0x24,0x40,0x34,0x40,0x03,0x80,0x00,0x00},  /*"6"*/

{0x30,0x00,0x20,0x00,0x27,0xC0,0x38,0x00,0x20,0x00,0x00,0x00}, /*"7"*/

{0x1B,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00}, /*"8"*/

{0x1C,0x00,0x22,0xC0,0x22,0x40,0x22,0x40,0x1F,0x80,0x00,0x00}, /*"9"*/

{0x00,0x00,0x00,0x00,0x08,0x40,0x00,0x00,0x00,0x00,0x00,0x00},  /*":"*/

{0x00,0x00,0x00,0x00,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00},  /*";"*/

{0x00,0x00,0x04,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0x40,0x40},  /*"<"*/

{0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x00,0x00},  /*"="*/

{0x00,0x00,0x40,0x40,0x20,0x80,0x11,0x00,0x0A,0x00,0x04,0x00},  /*">"*/

{0x18,0x00,0x20,0x00,0x23,0x40,0x24,0x00,0x18,0x00,0x00,0x00},  /*"?"*/

{0x1F,0x80,0x20,0x40,0x27,0x40,0x29,0x40,0x1F,0x40,0x00,0x00},  /*"@"*/

{0x00,0x40,0x07,0xC0,0x39,0x00,0x0F,0x00,0x01,0xC0,0x00,0x40}, /*"A"*/

{0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00}, /*"B"*/

{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x30,0x80,0x00,0x00}, /*"C"*/

{0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00}, /*"D"*/

{0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x40,0x30,0xC0,0x00,0x00}, /*"E"*/

{0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x00,0x30,0x00,0x00,0x00}, /*"F"*/

{0x0F,0x00,0x10,0x80,0x20,0x40,0x22,0x40,0x33,0x80,0x02,0x00},  /*"G"*/

{0x20,0x40,0x3F,0xC0,0x04,0x00,0x04,0x00,0x3F,0xC0,0x20,0x40}, /*"H"*/

{0x20,0x40,0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x00,0x00}, /*"I"*/

{0x00,0x60,0x20,0x20,0x20,0x20,0x3F,0xC0,0x20,0x00,0x20,0x00}, /*"J"*/

{0x20,0x40,0x3F,0xC0,0x24,0x40,0x0B,0x00,0x30,0xC0,0x20,0x40}, /*"K"*/

{0x20,0x40,0x3F,0xC0,0x20,0x40,0x00,0x40,0x00,0x40,0x00,0xC0}, /*"L"*/

{0x3F,0xC0,0x3C,0x00,0x03,0xC0,0x3C,0x00,0x3F,0xC0,0x00,0x00},/*"m"*/

{0x20,0x40,0x3F,0xC0,0x0C,0x40,0x23,0x00,0x3F,0xC0,0x20,0x00}, /*"N"*/

{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},   /*"O"*/

{0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x00,0x18,0x00,0x00,0x00},  /*"P"*/

{0x1F,0x80,0x21,0x40,0x21,0x40,0x20,0xE0,0x1F,0xA0,0x00,0x00},  /*"Q"*/

{0x20,0x40,0x3F,0xC0,0x24,0x40,0x26,0x00,0x19,0xC0,0x00,0x40}, /*"R"*/

{0x18,0xC0,0x24,0x40,0x24,0x40,0x22,0x40,0x31,0x80,0x00,0x00}, /*"S"*/

{0x30,0x00,0x20,0x40,0x3F,0xC0,0x20,0x40,0x30,0x00,0x00,0x00}, /*"T"*/

{0x20,0x00,0x3F,0x80,0x00,0x40,0x00,0x40,0x3F,0x80,0x20,0x00},  /*"U"*/

{0x20,0x00,0x3E,0x00,0x01,0xC0,0x07,0x00,0x38,0x00,0x20,0x00}, /*"V"*/

{0x38,0x00,0x07,0xC0,0x3C,0x00,0x07,0xC0,0x38,0x00,0x00,0x00},/*"W"*/

{0x20,0x40,0x39,0xC0,0x06,0x00,0x39,0xC0,0x20,0x40,0x00,0x00},/*"X"*/

{0x20,0x00,0x38,0x40,0x07,0xC0,0x38,0x40,0x20,0x00,0x00,0x00}, /*"Y"*/

{0x30,0x40,0x21,0xC0,0x26,0x40,0x38,0x40,0x20,0xC0,0x00,0x00},/*"Z"*/

{0x00,0x00,0x00,0x00,0x7F,0xE0,0x40,0x20,0x40,0x20,0x00,0x00}, /*"["*/

{0x00,0x00,0x70,0x00,0x0C,0x00,0x03,0x80,0x00,0x40,0x00,0x00}, /*"\"*/

{0x00,0x00,0x40,0x20,0x40,0x20,0x7F,0xE0,0x00,0x00,0x00,0x00}, /*"]"*/

{0x00,0x00,0x20,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00}, /*"^"*/

{0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10}, /*"_"*/

{0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`"*/

{0x00,0x00,0x02,0x80,0x05,0x40,0x05,0x40,0x03,0xC0,0x00,0x40},/*"a"*/

{0x20,0x00,0x3F,0xC0,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"b"*/

{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x06,0x40,0x00,0x00},/*"c"*/

{0x00,0x00,0x03,0x80,0x04,0x40,0x24,0x40,0x3F,0xC0,0x00,0x40},/*"d"*/

{0x00,0x00,0x03,0x80,0x05,0x40,0x05,0x40,0x03,0x40,0x00,0x00},/*"e"*/

{0x00,0x00,0x04,0x40,0x1F,0xC0,0x24,0x40,0x24,0x40,0x20,0x00},/*"f"*/

{0x00,0x00,0x02,0xE0,0x05,0x50,0x05,0x50,0x06,0x50,0x04,0x20},/*"g"*/

{0x20,0x40,0x3F,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"h"*/

{0x00,0x00,0x04,0x40,0x27,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"i"*/

{0x00,0x10,0x00,0x10,0x04,0x10,0x27,0xE0,0x00,0x00,0x00,0x00},/*"j"*/

{0x20,0x40,0x3F,0xC0,0x01,0x40,0x07,0x00,0x04,0xC0,0x04,0x40},/*"k"*/

{0x20,0x40,0x20,0x40,0x3F,0xC0,0x00,0x40,0x00,0x40,0x00,0x00},/*"l"*/

{0x07,0xC0,0x04,0x00,0x07,0xC0,0x04,0x00,0x03,0xC0,0x00,0x00},/*"m"*/

{0x04,0x40,0x07,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"n"*/

{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"o"*/

{0x04,0x10,0x07,0xF0,0x04,0x50,0x04,0x40,0x03,0x80,0x00,0x00},/*"p"*/

{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x50,0x07,0xF0,0x00,0x10},/*"q"*/

{0x04,0x40,0x07,0xC0,0x02,0x40,0x04,0x00,0x04,0x00,0x00,0x00},/*"r"*/

{0x00,0x00,0x06,0x40,0x05,0x40,0x05,0x40,0x04,0xC0,0x00,0x00},/*"s"*/

{0x00,0x00,0x04,0x00,0x1F,0x80,0x04,0x40,0x00,0x40,0x00,0x00},/*"t"*/

{0x04,0x00,0x07,0x80,0x00,0x40,0x04,0x40,0x07,0xC0,0x00,0x40},/*"u"*/

{0x04,0x00,0x07,0x00,0x04,0xC0,0x01,0x80,0x06,0x00,0x04,0x00},/*"v"*/

{0x06,0x00,0x01,0xC0,0x07,0x00,0x01,0xC0,0x06,0x00,0x00,0x00},/*"w"*/

{0x04,0x40,0x06,0xC0,0x01,0x00,0x06,0xC0,0x04,0x40,0x00,0x00},/*"x"*/

{0x04,0x10,0x07,0x10,0x04,0xE0,0x01,0x80,0x06,0x00,0x04,0x00},/*"y"*/

{0x00,0x00,0x04,0x40,0x05,0xC0,0x06,0x40,0x04,0x40,0x00,0x00},/*"z"*/

{0x00,0x00,0x00,0x00,0x04,0x00,0x7B,0xE0,0x40,0x20,0x00,0x00},/*"{"*/

{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF0,0x00,0x00,0x00,0x00},/*"|"*/

{0x00,0x00,0x40,0x20,0x7B,0xE0,0x04,0x00,0x00,0x00,0x00,0x00},/*"}"*/

{0x40,0x00,0x80,0x00,0x40,0x00,0x20,0x00,0x20,0x00,0x40,0x00},/*"~"*/

};

const unsigned char oled_asc2_1608[95][16]={    

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xCC,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/

{0x00,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x00,0x00},/*""",2*/

{0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x00,0x00},/*"#",3*/

{0x00,0x00,0x0E,0x18,0x11,0x04,0x3F,0xFF,0x10,0x84,0x0C,0x78,0x00,0x00,0x00,0x00},/*"$",4*/

{0x0F,0x00,0x10,0x84,0x0F,0x38,0x00,0xC0,0x07,0x78,0x18,0x84,0x00,0x78,0x00,0x00},/*"%",5*/

{0x00,0x78,0x0F,0x84,0x10,0xC4,0x11,0x24,0x0E,0x98,0x00,0xE4,0x00,0x84,0x00,0x08},/*"&",6*/

{0x08,0x00,0x68,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x18,0x18,0x20,0x04,0x40,0x02,0x00,0x00},/*"(",8*/

{0x00,0x00,0x40,0x02,0x20,0x04,0x18,0x18,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00},/*")",9*/

{0x02,0x40,0x02,0x40,0x01,0x80,0x0F,0xF0,0x01,0x80,0x02,0x40,0x02,0x40,0x00,0x00},/*"*",10*/

{0x00,0x80,0x00,0x80,0x00,0x80,0x0F,0xF8,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x00},/*"+",11*/

{0x00,0x01,0x00,0x0D,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/

{0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80},/*"-",13*/

{0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/

{0x00,0x00,0x00,0x06,0x00,0x18,0x00,0x60,0x01,0x80,0x06,0x00,0x18,0x00,0x20,0x00},/*"/",15*/

{0x00,0x00,0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"0",16*/

{0x00,0x00,0x08,0x04,0x08,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"1",17*/

{0x00,0x00,0x0E,0x0C,0x10,0x14,0x10,0x24,0x10,0x44,0x11,0x84,0x0E,0x0C,0x00,0x00},/*"2",18*/

{0x00,0x00,0x0C,0x18,0x10,0x04,0x11,0x04,0x11,0x04,0x12,0x88,0x0C,0x70,0x00,0x00},/*"3",19*/

{0x00,0x00,0x00,0xE0,0x03,0x20,0x04,0x24,0x08,0x24,0x1F,0xFC,0x00,0x24,0x00,0x00},/*"4",20*/

{0x00,0x00,0x1F,0x98,0x10,0x84,0x11,0x04,0x11,0x04,0x10,0x88,0x10,0x70,0x00,0x00},/*"5",21*/

{0x00,0x00,0x07,0xF0,0x08,0x88,0x11,0x04,0x11,0x04,0x18,0x88,0x00,0x70,0x00,0x00},/*"6",22*/

{0x00,0x00,0x1C,0x00,0x10,0x00,0x10,0xFC,0x13,0x00,0x1C,0x00,0x10,0x00,0x00,0x00},/*"7",23*/

{0x00,0x00,0x0E,0x38,0x11,0x44,0x10,0x84,0x10,0x84,0x11,0x44,0x0E,0x38,0x00,0x00},/*"8",24*/

{0x00,0x00,0x07,0x00,0x08,0x8C,0x10,0x44,0x10,0x44,0x08,0x88,0x07,0xF0,0x00,0x00},/*"9",25*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0C,0x03,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/

{0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/

{0x00,0x00,0x00,0x80,0x01,0x40,0x02,0x20,0x04,0x10,0x08,0x08,0x10,0x04,0x00,0x00},/*"<",28*/

{0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x00,0x00},/*"=",29*/

{0x00,0x00,0x10,0x04,0x08,0x08,0x04,0x10,0x02,0x20,0x01,0x40,0x00,0x80,0x00,0x00},/*">",30*/

{0x00,0x00,0x0E,0x00,0x12,0x00,0x10,0x0C,0x10,0x6C,0x10,0x80,0x0F,0x00,0x00,0x00},/*"?",31*/

{0x03,0xE0,0x0C,0x18,0x13,0xE4,0x14,0x24,0x17,0xC4,0x08,0x28,0x07,0xD0,0x00,0x00},/*"@",32*/

{0x00,0x04,0x00,0x3C,0x03,0xC4,0x1C,0x40,0x07,0x40,0x00,0xE4,0x00,0x1C,0x00,0x04},/*"A",33*/

{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x11,0x04,0x0E,0x88,0x00,0x70,0x00,0x00},/*"B",34*/

{0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x04,0x10,0x08,0x1C,0x10,0x00,0x00},/*"C",35*/

{0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"D",36*/

{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x17,0xC4,0x10,0x04,0x08,0x18,0x00,0x00},/*"E",37*/

{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x17,0xC0,0x10,0x00,0x08,0x00,0x00,0x00},/*"F",38*/

{0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x44,0x1C,0x78,0x00,0x40,0x00,0x00},/*"G",39*/

{0x10,0x04,0x1F,0xFC,0x10,0x84,0x00,0x80,0x00,0x80,0x10,0x84,0x1F,0xFC,0x10,0x04},/*"H",40*/

{0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x00,0x00,0x00,0x00},/*"I",41*/

{0x00,0x03,0x00,0x01,0x10,0x01,0x10,0x01,0x1F,0xFE,0x10,0x00,0x10,0x00,0x00,0x00},/*"J",42*/

{0x10,0x04,0x1F,0xFC,0x11,0x04,0x03,0x80,0x14,0x64,0x18,0x1C,0x10,0x04,0x00,0x00},/*"K",43*/

{0x10,0x04,0x1F,0xFC,0x10,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x0C,0x00,0x00},/*"L",44*/

{0x10,0x04,0x1F,0xFC,0x1F,0x00,0x00,0xFC,0x1F,0x00,0x1F,0xFC,0x10,0x04,0x00,0x00},/*"M",45*/

{0x10,0x04,0x1F,0xFC,0x0C,0x04,0x03,0x00,0x00,0xE0,0x10,0x18,0x1F,0xFC,0x10,0x00},/*"N",46*/

{0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"O",47*/

{0x10,0x04,0x1F,0xFC,0x10,0x84,0x10,0x80,0x10,0x80,0x10,0x80,0x0F,0x00,0x00,0x00},/*"P",48*/

{0x07,0xF0,0x08,0x18,0x10,0x24,0x10,0x24,0x10,0x1C,0x08,0x0A,0x07,0xF2,0x00,0x00},/*"Q",49*/

{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x11,0xC0,0x11,0x30,0x0E,0x0C,0x00,0x04},/*"R",50*/

{0x00,0x00,0x0E,0x1C,0x11,0x04,0x10,0x84,0x10,0x84,0x10,0x44,0x1C,0x38,0x00,0x00},/*"S",51*/

{0x18,0x00,0x10,0x00,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x00,0x18,0x00,0x00,0x00},/*"T",52*/

{0x10,0x00,0x1F,0xF8,0x10,0x04,0x00,0x04,0x00,0x04,0x10,0x04,0x1F,0xF8,0x10,0x00},/*"U",53*/

{0x10,0x00,0x1E,0x00,0x11,0xE0,0x00,0x1C,0x00,0x70,0x13,0x80,0x1C,0x00,0x10,0x00},/*"V",54*/

{0x1F,0xC0,0x10,0x3C,0x00,0xE0,0x1F,0x00,0x00,0xE0,0x10,0x3C,0x1F,0xC0,0x00,0x00},/*"W",55*/

{0x10,0x04,0x18,0x0C,0x16,0x34,0x01,0xC0,0x01,0xC0,0x16,0x34,0x18,0x0C,0x10,0x04},/*"X",56*/

{0x10,0x00,0x1C,0x00,0x13,0x04,0x00,0xFC,0x13,0x04,0x1C,0x00,0x10,0x00,0x00,0x00},/*"Y",57*/

{0x08,0x04,0x10,0x1C,0x10,0x64,0x10,0x84,0x13,0x04,0x1C,0x04,0x10,0x18,0x00,0x00},/*"Z",58*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x40,0x02,0x40,0x02,0x40,0x02,0x00,0x00},/*"[",59*/

{0x00,0x00,0x30,0x00,0x0C,0x00,0x03,0x80,0x00,0x60,0x00,0x1C,0x00,0x03,0x00,0x00},/*"\",60*/

{0x00,0x00,0x40,0x02,0x40,0x02,0x40,0x02,0x7F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00},/*"]",61*/

{0x00,0x00,0x00,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00},/*"^",62*/

{0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01},/*"_",63*/

{0x00,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/

{0x00,0x00,0x00,0x98,0x01,0x24,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xFC,0x00,0x04},/*"a",65*/

{0x10,0x00,0x1F,0xFC,0x00,0x88,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"b",66*/

{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x00},/*"c",67*/

{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x11,0x08,0x1F,0xFC,0x00,0x04},/*"d",68*/

{0x00,0x00,0x00,0xF8,0x01,0x44,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xC8,0x00,0x00},/*"e",69*/

{0x00,0x00,0x01,0x04,0x01,0x04,0x0F,0xFC,0x11,0x04,0x11,0x04,0x11,0x00,0x18,0x00},/*"f",70*/

{0x00,0x00,0x00,0xD6,0x01,0x29,0x01,0x29,0x01,0x29,0x01,0xC9,0x01,0x06,0x00,0x00},/*"g",71*/

{0x10,0x04,0x1F,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"h",72*/

{0x00,0x00,0x01,0x04,0x19,0x04,0x19,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"i",73*/

{0x00,0x00,0x00,0x03,0x00,0x01,0x01,0x01,0x19,0x01,0x19,0xFE,0x00,0x00,0x00,0x00},/*"j",74*/

{0x10,0x04,0x1F,0xFC,0x00,0x24,0x00,0x40,0x01,0xB4,0x01,0x0C,0x01,0x04,0x00,0x00},/*"k",75*/

{0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"l",76*/

{0x01,0x04,0x01,0xFC,0x01,0x04,0x01,0x00,0x01,0xFC,0x01,0x04,0x01,0x00,0x00,0xFC},/*"m",77*/

{0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"n",78*/

{0x00,0x00,0x00,0xF8,0x01,0x04,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0xF8,0x00,0x00},/*"o",79*/

{0x01,0x01,0x01,0xFF,0x00,0x85,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"p",80*/

{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x05,0x01,0xFF,0x00,0x01},/*"q",81*/

{0x01,0x04,0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x04,0x01,0x00,0x01,0x80,0x00,0x00},/*"r",82*/

{0x00,0x00,0x00,0xCC,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x98,0x00,0x00},/*"s",83*/

{0x00,0x00,0x01,0x00,0x01,0x00,0x07,0xF8,0x01,0x04,0x01,0x04,0x00,0x00,0x00,0x00},/*"t",84*/

{0x01,0x00,0x01,0xF8,0x00,0x04,0x00,0x04,0x00,0x04,0x01,0x08,0x01,0xFC,0x00,0x04},/*"u",85*/

{0x01,0x00,0x01,0x80,0x01,0x70,0x00,0x0C,0x00,0x10,0x01,0x60,0x01,0x80,0x01,0x00},/*"v",86*/

{0x01,0xF0,0x01,0x0C,0x00,0x30,0x01,0xC0,0x00,0x30,0x01,0x0C,0x01,0xF0,0x01,0x00},/*"w",87*/

{0x00,0x00,0x01,0x04,0x01,0x8C,0x00,0x74,0x01,0x70,0x01,0x8C,0x01,0x04,0x00,0x00},/*"x",88*/

{0x01,0x01,0x01,0x81,0x01,0x71,0x00,0x0E,0x00,0x18,0x01,0x60,0x01,0x80,0x01,0x00},/*"y",89*/

{0x00,0x00,0x01,0x84,0x01,0x0C,0x01,0x34,0x01,0x44,0x01,0x84,0x01,0x0C,0x00,0x00},/*"z",90*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x3E,0xFC,0x40,0x02,0x40,0x02},/*"{",91*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},/*"|",92*/

{0x00,0x00,0x40,0x02,0x40,0x02,0x3E,0xFC,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"}",93*/

{0x00,0x00,0x60,0x00,0x80,0x00,0x80,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x20,0x00},/*"~",94*/

};

static u8  fac_us=0;                     //us延时倍乘数

static u16 fac_ms=0;                     //ms延时倍乘数

void delay_init(u8 SYSCLK)

{

 SysTick->CTRL&=0xfffffffb;              //bit2清空,选择外部时钟  HCLK/8

 fac_us=SYSCLK/8;          

 fac_ms=(u16)fac_us*1000;

}  

void delay_ms(u16 nms)

{                

 u32 temp;        

 SysTick->LOAD=(u32)nms*fac_ms;         //时间加载(SysTick->LOAD为24bit)

 SysTick->VAL =0x00;                    //清空计数器

 SysTick->CTRL=0x01 ;                   //开始倒数 

 do{temp=SysTick->CTRL;}

 while(temp&0x01&&!(temp&(1<<16)));     //等待时间到达  

 SysTick->CTRL=0x00;                    //关闭计数器

 SysTick->VAL =0X00;                    //清空计数器            

}  

                                               

void delay_us(u32 nus)

{      

 u32 temp;           

 SysTick->LOAD=nus*fac_us;              //时间加载           

 SysTick->VAL=0x00;                     //清空计数器

 SysTick->CTRL=0x01 ;                   //开始倒数  

 do{temp=SysTick->CTRL;}

 while(temp&0x01&&!(temp&(1<<16)));     //等待时间到达  

 SysTick->CTRL=0x00;                    //关闭计数器

 SysTick->VAL =0X00;                    //清空计数器   

}  

void OLED_Refresh_Gram(void)

{

 u8 i,n;           

 for(i=0;i<8;i++) 

 { 

  OLED_WR_Byte (0xb0+i,OLED_CMD);    //设置页地址(0~7)

  OLED_WR_Byte (0x00,OLED_CMD);      //设置显示位置—列低地址

  OLED_WR_Byte (0x10,OLED_CMD);      //设置显示位置—列高地址  

  for(n=0;n<128;n++)

  {OLED_WR_Byte(OLED_GRAM[n][i],OLED_DATA);}

 }  

}

void OLED_WR_Byte(u8 dat,u8 cmd)

{  

 u8 i;           

 if(cmd){OLED_RS_Set();}

 else{OLED_RS_Clr();}        

 for(i=0;i<8;i++)

 {           

  OLED_SCLK_Clr();

  if(dat&0x80){OLED_SDIN_Set();}

  else{OLED_SDIN_Clr();}

  OLED_SCLK_Set();

  dat<<=1;  

 }                       

 OLED_RS_Set();       

}

void OLED_Display_On(void)

{

 OLED_WR_Byte(0X8D,OLED_CMD);            //SET DCDC命令

 OLED_WR_Byte(0X14,OLED_CMD);            //DCDC ON

 OLED_WR_Byte(0XAF,OLED_CMD);            //DISPLAY ON

}

void OLED_Display_Off(void)

{

 OLED_WR_Byte(0X8D,OLED_CMD);            //SET DCDC命令

 OLED_WR_Byte(0X10,OLED_CMD);            //DCDC OFF

 OLED_WR_Byte(0XAE,OLED_CMD);            //DISPLAY OFF

}

 

void OLED_Clear(void) 

 u8 i,n; 

 for(i=0;i<8;i++)for(n=0;n<128;n++)OLED_GRAM[n][i]=0X00; 

 OLED_Refresh_Gram();                    //更新显示

}

              

void OLED_DrawPoint(u8 x,u8 y,u8 t)

{

 u8 pos,bx,temp=0;

 if(x>127||y>63)return;                  //超出范围了.

 pos=7-y/8;

 bx=y%8;

 temp=1<<(7-bx);

 if(t)OLED_GRAM[x][pos]|=temp;

 else OLED_GRAM[x][pos]&=~temp;    

}

void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 size,u8 mode)

{                   

 u8 temp,t,t1;

 u8 y0=y;

 chr=chr-' ';                             //得到偏移后的值                

 for(t=0;t<size;t++)

 {  

  if(size==12)                            //调用1206字体

  {temp=oled_asc2_1206[chr][t];}

  else                                    //调用1608字体

  {temp=oled_asc2_1608[chr][t];}                             

  for(t1=0;t1<8;t1++)

  {

   if(temp&0x80){OLED_DrawPoint(x,y,mode);}

   else{OLED_DrawPoint(x,y,!mode);}

   temp<<=1;

   y++;

   if((y-y0)==size)

   {y=y0;x++;break;}

  }      

 }         

}

u32 oled_pow(u8 m,u8 n)

{

 u32 result=1; 

 while(n--)result*=m;   

 return result;

}

                          

void OLED_ShowNumber(u8 x,u8 y,u32 num,u8 len,u8 size)

{          

 u8 t,temp;

 u8 enshow=0;                         

 for(t=0;t<len;t++)

 {

  temp=(num/oled_pow(10,len-t-1))%10;

  if(enshow==0&&t<(len-1))

  {

   if(temp==0)

   {OLED_ShowChar(x+(size/2)*t,y,' ',size,1);continue;}

   else{enshow=1;}           

  }

  OLED_ShowChar(x+(size/2)*t,y,temp+'0',size,1);

 }

}

void OLED_ShowString(u8 x,u8 y,const u8 *p)

{

 #define MAX_CHAR_POSX 122

 #define MAX_CHAR_POSY 58         

 while(*p!='\0')

 {      

  if(x>MAX_CHAR_POSX){x=0;y+=16;}

  if(y>MAX_CHAR_POSY){y=x=0;OLED_Clear();}

  OLED_ShowChar(x,y,*p,12,1);  

  x+=8;

  p++;

 } 

}

                    

void Oled_Init(void)

{        

 RCC->APB2ENR|=1<<3;                  //使能PORTB时钟       

 GPIOB->CRL&=0XFFF0FFFF;

 GPIOB->CRL|=0X00020000;              //PB4 推挽输出  

 RCC->APB2ENR|=1<<4;                  //使能PORTC时钟 

 RCC->APB2ENR|=1<<0;                  //使能AFIO时钟   

 GPIOC->CRH&=0X000FFFFF;              //PC13,14,15设置成输出 2MHz 推挽输出  

 GPIOC->CRH|=0X22200000;

 PWR->CR|=1<<8;                       //取消备份区写保护

 RCC->BDCR&=0xFFFFFFFE;               //外部低俗振荡器关闭 PC14,PC15成为普通IO   

 BKP->CR&=0xFFFFFFFE;                 //侵入检测TAMPER引脚作为通用IO口使用

 PWR->CR&=0xFFFFFEFF;                 //备份区写保护

 OLED_RST_Clr();

 delay_ms(100);

 OLED_RST_Set();

                     

 OLED_WR_Byte(0xAE,OLED_CMD);         //关闭显示

 OLED_WR_Byte(0xD5,OLED_CMD);         //设置时钟分频因子,震荡频率

 OLED_WR_Byte(80,OLED_CMD);           //[3:0],分频因子;[7:4],震荡频率

 OLED_WR_Byte(0xA8,OLED_CMD);         //设置驱动路数

 OLED_WR_Byte(0X3F,OLED_CMD);         //默认0X3F(1/64)

 OLED_WR_Byte(0xD3,OLED_CMD);         //设置显示偏移

 OLED_WR_Byte(0X00,OLED_CMD);         //默认为0

 OLED_WR_Byte(0x40,OLED_CMD);         //设置显示开始行 [5:0],行数.

                                                       

 OLED_WR_Byte(0x8D,OLED_CMD);         //电荷泵设置

 OLED_WR_Byte(0x14,OLED_CMD);         //bit2,开启/关闭

 OLED_WR_Byte(0x20,OLED_CMD);         //设置内存地址模式

 OLED_WR_Byte(0x02,OLED_CMD);         //[1:0],00,列地址模式;01,行地址模式;10,页地址模式;默认10;

 OLED_WR_Byte(0xA1,OLED_CMD);         //段重定义设置,bit0:0,0->0;1,0->127;

 OLED_WR_Byte(0xC0,OLED_CMD);         //设置COM扫描方向;bit3:0,普通模式;1,重定义模式 COM[N-1]->COM0;N:驱动路数

 OLED_WR_Byte(0xDA,OLED_CMD);         //设置COM硬件引脚配置

 OLED_WR_Byte(0x12,OLED_CMD);         //[5:4]配置

         

 OLED_WR_Byte(0x81,OLED_CMD);         //对比度设置

 OLED_WR_Byte(0xEF,OLED_CMD);         //1~255;默认0X7F (亮度设置,越大越亮)

 OLED_WR_Byte(0xD9,OLED_CMD);         //设置预充电周期

 OLED_WR_Byte(0xf1,OLED_CMD);         //[3:0],PHASE 1;[7:4],PHASE 2;

 OLED_WR_Byte(0xDB,OLED_CMD);         //设置VCOMH 电压倍率

 OLED_WR_Byte(0x30,OLED_CMD);         //[6:4] 000,0.65*vcc;001,0.77*vcc;011,0.83*vcc;

 OLED_WR_Byte(0xA4,OLED_CMD);         //全局显示开启;bit0:1,开启;0,关闭;(白屏/黑屏)

 OLED_WR_Byte(0xA6,OLED_CMD);         //设置显示方式;bit0:1,反相显示;0,正常显示                                

 OLED_WR_Byte(0xAF,OLED_CMD);         //开启显示   

 OLED_Clear();

}

void Oled_Show(void)

{  

 OLED_ShowString(0,0,"****************");  

 OLED_ShowString(30,20,"OLED-TEST");

 OLED_ShowString(5,30,"YOU ARE WELCOME");

 OLED_ShowString(0,50,"****************"); 

 OLED_Refresh_Gram();

}

int main(void)

{                    

 Stm32_Clock_Init(9);              //系统时钟设置

 delay_init(72);                   //延时初始化

 JTAG_Set(JTAG_SWD_DISABLE);       //关闭JTAG接口

 JTAG_Set(SWD_ENABLE);             //打开SWD接口

 Oled_Init();  

 while(1){Oled_Show();}

}

  • 5
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
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.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嵌入式硬件与代码

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值