欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: SSD1306 OLED驅(qū)動(dòng)程序和資料下載 帶pcb做成了12864的轉(zhuǎn)接接口 [打印本頁(yè)]

作者: 51hei學(xué)習(xí)技術(shù)中    時(shí)間: 2016-10-20 21:23
標(biāo)題: SSD1306 OLED驅(qū)動(dòng)程序和資料下載 帶pcb做成了12864的轉(zhuǎn)接接口
SSD1306 OLED做成了12864的液晶接口,下面是所有資料下載:
OLED12864 pcb文件.rar (452.6 KB, 下載次數(shù): 170)
OLED裸屏用戶資料.rar (2.76 MB, 下載次數(shù): 86)
SSD1306 OLED程序.zip (3.99 KB, 下載次數(shù): 124)

用了這個(gè)12864轉(zhuǎn)接板以后,可以直接插入單片機(jī)開發(fā)板的12864接口來(lái)驅(qū)動(dòng)這個(gè)SSD1306 OLED
下面是pcb圖:


SSD1306 OLED源程序預(yù)覽:
  1. #include "oled.h"
  2. #include "AsciiLib.h"
  3. #include "HzLib.h"


  4. #define     XLevelL                    0x00
  5. #define     XLevelH                    0x10
  6. #define     XLevel                    ((XLevelH&0x0F)*16+XLevelL)
  7. #define     Max_Column            128
  8. #define     Max_Row                    64
  9. #define            Brightness            0xCF



  10. #define     X_WIDTH         128
  11. #define     Y_WIDTH         64
  12. #define                Page                        8
  13. void OLED_WB(uint8_t data)
  14. {
  15.     /* Loop while DR register in not emplty */
  16.     while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
  17.     /* Send byte through the SPI2 peripheral */
  18.     SPI_I2S_SendData(SPI1, data);
  19. }
  20. /*******************一個(gè)字節(jié)數(shù)據(jù)寫入***********************/
  21. void LCD_WrDat(unsigned char dat)
  22. {
  23.     OLED_DC_H;
  24.         OLED_WB(dat);
  25. }

  26. /********************一條指令寫入**********************/
  27. void LCD_WrCmd(unsigned char cmd)
  28. {
  29.     OLED_DC_L;
  30.     OLED_WB(cmd);
  31. }

  32. /**********************設(shè)置顯示位置**********************/
  33. void LCD_Set_Pos(unsigned char x, unsigned char y)
  34. {
  35.         /* Page addressing mode */
  36.     LCD_WrCmd(0xb0+(y&0x07));/* set page start address */
  37.     LCD_WrCmd(x&0x0f);/* set lower nibble of the column address */
  38.     LCD_WrCmd(((x&0xf0)>>4)|0x10); /* set higher nibble of the column address */
  39. }

  40. /**********************寫滿屏數(shù)據(jù)**********************/
  41. void LCD_Fill(unsigned char bmp_dat)
  42. {
  43.         unsigned char y,x;

  44.     LCD_WrCmd(0x20);//-Set Page Addressing Mode (0x00/0x01/0x02)
  45.     LCD_WrCmd(0x00);//

  46.         LCD_WrCmd(0x21);//-Set Column Address
  47.         LCD_WrCmd(0x00);
  48.         LCD_WrCmd(0x7f);

  49.         LCD_WrCmd(0x22);//-Set Page Address
  50.         LCD_WrCmd(0x00);
  51.         LCD_WrCmd(0x07);

  52.         LCD_DLY_ms(1);/* 等待內(nèi)部穩(wěn)定   */

  53.     for(y=0;y<Page;y++)
  54.     {
  55.             for(x=0;x<X_WIDTH;x++)
  56.             {
  57.                     LCD_WrDat(bmp_dat);
  58.             }
  59.     }
  60. //    LCD_WrCmd(0xaf);//--turn off oled panel
  61. }

  62. /*********************清屏函數(shù)***********************/
  63. void LCD_CLS(void)
  64. {
  65.         unsigned char y,x;
  66.         for(y=0;y<8;y++)
  67.         {
  68.                 LCD_WrCmd(0xb0+y);
  69.                 LCD_WrCmd(0x01);
  70.                 LCD_WrCmd(0x10);
  71.                 for(x=0;x<X_WIDTH;x++)
  72.                 LCD_WrDat(0);
  73.                 LCD_DLY_ms(200);
  74.         }
  75. }

  76. /*********************延時(shí)函數(shù)***********************/
  77. void LCD_DLY_ms(unsigned int ms)
  78. {
  79.     unsigned int a;
  80.     while(ms)
  81.     {
  82.         a=1335;
  83.         while(a--);
  84.         ms--;
  85.     }
  86.     return;
  87. }


  88. /*********************12864初始化***********************/
  89. void LCD_Init(void)
  90. {
  91.         OLED_RST_L;
  92.         LCD_DLY_ms(50);
  93.         OLED_RST_H;
  94.         //從上電到下面開始初始化要有足夠的時(shí)間,即等待RC復(fù)位完畢

  95.     LCD_WrCmd(0xae);//--turn off oled panel

  96.     LCD_WrCmd(0xa8);//--set multiplex ratio(1 to 64)
  97.     LCD_WrCmd(0x3f);//--1/64 duty
  98.     LCD_WrCmd(0xd3);//-set display offset        Shift Mapping RAM Counter (0x00~0x3F)
  99.     LCD_WrCmd(0x00);//-not offset
  100.     LCD_WrCmd(0x40);//--set start line address  Set Mapping RAM Display Start Line (0x00~0x3F)
  101.     LCD_WrCmd(0xa0);//--Set SEG/Column Mapping     0xa0左右反置 0xa1正常
  102.     LCD_WrCmd(0xc0);//Set COM/Row Scan Direction   0xc0上下反置 0xc8正常
  103.     LCD_WrCmd(0xda);//--set com pins hardware configuration
  104.     LCD_WrCmd(0x12);
  105.     LCD_WrCmd(0x81);//--set contrast control register
  106.     LCD_WrCmd(0xcf); // Set SEG Output Current Brightness
  107.     LCD_WrCmd(0xa4);// Disable Entire Display On (0xa4/0xa5)
  108.     LCD_WrCmd(0xa6);// Disable Inverse Display On (0xa6/a7)
  109.     LCD_WrCmd(0xd5);//--set display clock divide ratio/oscillator frequency
  110.     LCD_WrCmd(0x80);//--set divide ratio, Set Clock as 100 Frames/Sec
  111.     LCD_WrCmd(0x8d);//--set Charge Pump enable/disable
  112.     LCD_WrCmd(0x14);//--set(0x10) disable
  113.     LCD_WrCmd(0xaf);//--turn on oled panel

  114.     LCD_WrCmd(0xd9);//--set pre-charge period
  115.     LCD_WrCmd(0xf8);//Set Pre-Charge as 15 Clocks & Discharge as 1 Clock

  116.     LCD_WrCmd(0xdb);//--set vcomh
  117.     LCD_WrCmd(0x40);//Set VCOM Deselect Level

  118.     LCD_Fill(0x00);  //初始清屏
  119. }
復(fù)制代碼

作者: powerxia    時(shí)間: 2017-2-25 16:38
好東東,頂你下先!!
作者: qiu7854867    時(shí)間: 2017-4-15 14:16
為什么 第一個(gè) 里面什么都沒有
作者: lyl_420819    時(shí)間: 2017-4-19 15:59
好資料,學(xué)習(xí)了。
作者: lyl_420819    時(shí)間: 2017-4-19 16:48
下載學(xué)習(xí)一下,謝謝。
作者: jhzxzss    時(shí)間: 2017-5-28 16:57
謝謝分享
作者: szb0321    時(shí)間: 2017-11-30 08:51
oled屏幕的資料 正在學(xué)習(xí)研究
作者: gang8013    時(shí)間: 2018-1-6 10:34

oled屏幕的資料 正在學(xué)習(xí)
作者: gang8013    時(shí)間: 2018-1-6 10:48
下載看看~,正在學(xué)習(xí)研究
作者: gang8013    時(shí)間: 2018-1-6 11:46
能下不------------------------------
作者: ppccxin    時(shí)間: 2018-1-7 07:16
非常好,正在學(xué)習(xí),感謝分享
作者: xudaxi    時(shí)間: 2018-2-4 13:33

非常好,正在學(xué)習(xí),感謝分享
作者: qvchat    時(shí)間: 2018-4-12 01:51
下載學(xué)習(xí),感謝樓主無(wú)私分享
作者: huichen90    時(shí)間: 2019-2-25 20:15
好東西,謝謝分享,都找了好久了
作者: Lign    時(shí)間: 2019-4-24 18:13
想要,有一個(gè)類似的屏幕




歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1