<form id="lpvjh"><nobr id="lpvjh"><th id="lpvjh"></th></nobr></form>

<form id="lpvjh"></form>
<form id="lpvjh"><th id="lpvjh"></th></form>

<form id="lpvjh"></form>

<address id="lpvjh"></address>

    <span id="lpvjh"><th id="lpvjh"></th></span>

      新聞詳情

      清達光電12832OLED顯示屏 SSD1305測試程序

      日期:2021-12-03 21:46
      瀏覽次數:1018
      摘要:
      清達光電為您提供多種OLED顯示屏,詳情可以QQ 453189731 或者13701081790 劉小姐
      --------------------------------------------------------------------------------------------------------------- 
      清達光電12832OLED顯示屏 SSD1305測試程序,示例程序如下:
      (基于*基本的51單片機)

      #include <reg52.h>
      #include <intrins.h>
      #include <math.h>
      #include <stdio.h>
      #define   lcddata P1
      #define   uchar  unsigned char
      #define   uint   unsigned char
      #define I80
       
         sbit  RW=P3^1;
         sbit  E=P3^3;
         sbit  _WR=P3^1;   
         sbit  _RD=P3^3;
         sbit  CS=P3^4;
         sbit  DC=P3^0;
         sbit  RES=P3^5;
         sbit  SCLK=P1^0;
         sbit  SDIN=P1^1;


      uchar code tab16[][32]={
      /* 點陣:16x16
         提取點陣方向:縱向
         字節掉轉:是
         字節方式:C語言 */
      0x10,0x22,0x64,0x0C,0xC0,0x44,0x54,0x54,    // 清
      0x54,0x7F,0x54,0x54,0xD6,0x44,0x40,0x00,
      0x04,0x04,0xFE,0x01,0x00,0x00,0xFF,0x15,
      0x15,0x15,0x55,0x95,0x7F,0x01,0x00,0x00,
       
      0x40,0x42,0xCC,0x00,0x20,0x20,0x20,0xA0,    // 達
      0x7F,0x20,0x20,0x20,0x30,0x20,0x00,0x00,
      0x40,0x20,0x1F,0x20,0x50,0x48,0x46,0x41,
      0x40,0x41,0x42,0x4C,0x58,0x60,0x20,0x00,
       
      0x40,0x40,0x42,0x44,0x58,0xC0,0x40,0x7F,    // 光
      0x40,0xC0,0x50,0x48,0x46,0x64,0x40,0x00,
      0x00,0x80,0x40,0x20,0x18,0x07,0x00,0x00,
      0x00,0x3F,0x40,0x40,0x40,0x40,0x70,0x00,
       
      0x00,0x00,0xC0,0x40,0x40,0x40,0x7F,0x48,    // 點
      0x48,0x48,0x48,0xE8,0x4C,0x08,0x00,0x00,
      0x80,0x40,0x37,0x04,0x14,0x64,0x04,0x14,
      0x24,0x64,0x04,0x17,0x20,0xC0,0x00,0x00,
       
      0x10,0x22,0x64,0x0C,0x80,0x04,0xC4,0x34,    // 液
      0x05,0xC6,0xBC,0x24,0x24,0xE6,0x04,0x00,
      0x04,0x04,0xFE,0x01,0x02,0x01,0xFF,0x42,
      0x21,0x16,0x08,0x15,0x23,0x60,0x20,0x00,
       
      0x00,0x00,0x00,0x00,0xFF,0x49,0x49,0x49,    // 晶
      0x49,0x49,0xFF,0x00,0x00,0x80,0x00,0x00,
      0x00,0xFF,0x49,0x49,0x49,0x49,0xFF,0x00,
      0xFF,0x49,0x49,0x49,0x49,0xFF,0x01,0x00,
       
      0x10,0x10,0xD0,0xFF,0x94,0x14,0xE4,0xBF,    // 模
      0xA4,0xA4,0xA4,0xBF,0xF4,0x26,0x04,0x00,
      0x04,0x03,0x00,0xFF,0x08,0x89,0x8B,0x4A,
      0x2A,0x1E,0x2A,0x2A,0x4B,0xC8,0x48,0x00,
       
      0x20,0x20,0x20,0xFF,0x20,0x20,0x10,0x10,    // 塊
      0xFF,0x10,0x10,0x10,0xF8,0x10,0x00,0x00,
      0x08,0x18,0x08,0x0F,0x84,0x46,0x22,0x1A,
      0x07,0x0A,0x12,0x22,0x43,0xC2,0x42,0x00,
      };
      void uDelay(unsigned char l)
      {
      while(l--);
      }
      void delay(unsigned char n)
      {
      unsigned char i,j,k;
       
      for(k=0;k<n;k++)
      {
      for(i=0;i<131;i++)
      {
      for(j=0;j<15;j++)
      {
      uDelay(80);
      }
      }
      }
      }
      #ifdef M68 // 8-bit 68XX Parallel
      void Writecom(unsigned char Data)
      {
      DC=0;
      CS=0;
      RW=0;
      E=1;
      lcddata=Data;
      E=0;
      RW=1;
      CS=1;
      DC=1;
      }
       
       
      void Writedata(unsigned char Data)
      {
      DC=1;
      CS=0;
      RW=0;
      E=1;
      lcddata=Data;
      E=0;
      RW=1;
      CS=1;
      DC=1;
      }
      #endif
      #ifdef I80 // 8-bit 80XX Parallel
      void  Writecom(uchar com)
      {
      DC=0;
      CS=0;
       
      _WR=0;
              _nop_();
       lcddata=com;
              _nop_();
      _WR=1;
              _nop_();
              _nop_();
      CS=1;
      DC=1;
      }
      void Writedata(uchar dat)
      {
      DC=1;
      CS=0;
       
      _WR=0;
               _nop_();
           lcddata=dat;
              _nop_();
      _WR=1;
               _nop_();
              _nop_();
      CS=1;
      DC=1;
      }
      uchar Readcom()
      {
             uchar com;
      DC=0;
      CS=0;
              lcddata=0xff;
      _RD=0;
              _nop_();
              _nop_();
               com=lcddata;
      _RD=1;
              _nop_();
              _nop_();
      CS=1;
      DC=1;
              return com;
      }
      uchar Readdata()
      {
             uchar dat;
      DC=1;
      CS=0;
              lcddata=0xff;
      _RD=0;
               _nop_();
              _nop_();
              dat= lcddata;
      _RD=1;
               _nop_();
              _nop_();
      CS=1;
      DC=1;
              return dat;
      }
      #endif
       
      #ifdef SPI // 4-wire SPI
      void Writecom(unsigned char Data)
      {
      unsigned char i;
       
      CS=0;
      DC=0;
      for (i=0; i<8; i++)
      {
      SCLK=0;
      SDIN=(Data&0x80)>>7;
      Data = Data << 1;
      SCLK=1;
      }
      DC=1;
      CS=1;
      }
       
       
      void Writedata(unsigned char Data)
      {
      unsigned char i;
       
      CS=0;
      DC=1;
      for (i=0; i<8; i++)
      {
      SCLK=0;
      SDIN=(Data&0x80)>>7;
      Data = Data << 1;
       
      SCLK=1;
       
      }
       
      DC=1;
      CS=1;
      }
      #endif


      /**********************
         主程序
      ************************/
      void main(void)
      {
          INT();
       
              clear(0xff);
      delay(1);
      clear(0x55);
      delay(1);
      clear(0xaa);
      delay(1);
      reset(0x55);
      delay(1);
      reset(0xaa);
      delay(1);
      clear(0x00);
      display_8(0,2);
              display_8(0,3);
      display_16(0,0);
      while(1);
      }

      更詳細程序請聯系QQ 453189731索取
         
      新博体育