• 大小: 12.6MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-29
  • 语言: 其他
  • 标签: FPGAOLED  

资源简介

最近比较火的OLED,以其更加出众的色彩效果和低功耗特色深受广大用户喜欢,买了一块128*32的OLED显示屏,网上查阅资料全部都是使用单片机驱动,找不到FPGA驱动OLED的资料,就自己动手写了一个,给大家分享下。

资源截图

代码片段和文件信息

/********************************************
使用说明:
OLED电源使用3.3V。   
----------------
G    电源地
3.3V 接3.3V电源
D0   P1.0  
D1  P1.1
RST  P1.2 
DC   P1.3
CS   已接地,不用接
============================================
OLED电源使用5V。   
----------------
G    电源地
3.3V 接5V电源,电源跟模块之间串接100欧姆电阻,并加3.3V钳位二极管
D0   P1.0 单片机跟模块之间串接1k-3.3k电阻 
D1  P1.1 单片机跟模块之间串接1k-3.3k电阻 
RST  P1.2 单片机跟模块之间串接1k-3.3k电阻 
DC   P1.3 单片机跟模块之间串接1k-3.3k电阻 
CS   已接地,不用接     
============================================     
如果用户使用的是5V单片机,请看用户手册,切勿烧毁模块! 
*********************************************************/
#include “reg52.h“
#include “intrins.h“
#include “LQ12864.h“
#include “GB1616.h“ //16*16汉字字模

sbit LCD_SCL=P0^5;  
sbit LCD_SDA=P0^4;
sbit LCD_RST=P0^7; 
sbit LCD_DC =P0^6; 

#define XLevelL 0x00
#define XLevelH 0x10
#define XLevel ((XLevelH&0x0F)*16+XLevelL)
#define Max_Column 128
#define Max_Row 64
#define Brightness 0xCF 

/*
4线SPI使用说明:
VBT 供内部DC-DC电压,3.3~4.3V,如果使用5V电压,为保险起见串一个100~500欧的电阻
VCC 供内部逻辑电压 1.8~6V   
GND 地

BS0 低电平
BS1 低电平
BS2 低电平

CS  片选管脚
DC  命令数据选择管脚
RES 模块复位管脚 
D0(SCLK) ,时钟脚,由MCU控制
D1(MOSI) ,主输出从输入数据脚,由MCU控制

D2 悬空      
D3-D7 , 低电平 , 也可悬空,但最好设为低电平
RD  低电平 ,也可悬空,但最好设为低电平
RW  低电平 ,也可悬空,但最好设为低电平
RD  低电平 ,也可悬空,但最好设为低电平   
*/

#define X_WIDTH 128
#define Y_WIDTH 64
//======================================

const unsigned char F14x16[] = {  
//“中“ 
0x000x000x800x9E0x920x920x920x920x920x920x920xDF0x820x000x000x00
0x040x840x840x440x440x240x1C0x070x0C0x140x240x440xC40x460x040x00
//“亚“ 
0x000x420x820x020x020xFE0x020x020x020xFE0x020x020xC30x820x000x00
      0x400x400x410x460x400x7F0x400x400x400x7F0x440x430x400x600x400x00

//“举“ 
0x100x100x110x920x560x300x110xD60x100x380x540x920x130x180x100x00
      0x020x020x090x080x090x090x090xFF0x090x090x090x0C0x090x030x010x00
};

const unsigned char code 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 0x

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     436046  2015-11-25 13:29  Atmel_OLED\Atmel-42077-OLED1-Xplained-Pro_User-Guide\Atmel-42077-OLED1-Xplained-Pro_User-Guide.pdf

     文件    4172466  2013-02-01 18:48  Atmel_OLED\Atmel-42077-OLED1-Xplained-Pro_User-Guide\OLED_Xplained_PRO_design_documentation_release_rev3.PDF

     文件    4710352  2015-11-25 13:33  Atmel_OLED\Atmel-42077-OLED1-Xplained-Pro_User-Guide.zip

     文件       2077  2012-08-03 19:15  Atmel_OLED\LQ-STC&52-OLED\GB1616.h

     文件      23568  2011-09-04 18:33  Atmel_OLED\LQ-STC&52-OLED\LQ-STC 52-OLED

     文件      26107  2011-09-04 18:33  Atmel_OLED\LQ-STC&52-OLED\LQ-STC 52-OLED.M51

     文件         73  2011-09-04 18:33  Atmel_OLED\LQ-STC&52-OLED\LQ-STC&52-OLED.lnp

     文件       1037  2011-09-17 23:55  Atmel_OLED\LQ-STC&52-OLED\LQ-STC&52-OLED.opt.bak

     文件      14976  2011-09-04 18:33  Atmel_OLED\LQ-STC&52-OLED\LQ-STC&52-OLED.plg

     文件       2124  2011-09-04 20:53  Atmel_OLED\LQ-STC&52-OLED\LQ-STC&52-OLED.Uv2.bak

    .......     57470  2012-09-15 09:48  Atmel_OLED\LQ-STC&52-OLED\LQ-STC&52-OLED.uvopt

    .......     13582  2012-09-14 21:26  Atmel_OLED\LQ-STC&52-OLED\LQ-STC&52-OLED.uvproj

     文件       1166  2011-09-17 23:50  Atmel_OLED\LQ-STC&52-OLED\LQ-STC&52-OLED_Opt.Bak

     文件          0  2011-09-04 17:40  Atmel_OLED\LQ-STC&52-OLED\LQ-STC&52-OLED_Uv2.Bak

    .......     57465  2012-09-15 08:58  Atmel_OLED\LQ-STC&52-OLED\LQ-STC&52-OLED_uvopt.bak

    .......     13582  2012-08-01 09:00  Atmel_OLED\LQ-STC&52-OLED\LQ-STC&52-OLED_uvproj.bak

     文件      22662  2012-09-15 09:43  Atmel_OLED\LQ-STC&52-OLED\LQ12864.c

     文件        762  2012-09-15 08:26  Atmel_OLED\LQ-STC&52-OLED\LQ12864.h

     文件      34831  2012-09-15 09:43  Atmel_OLED\LQ-STC&52-OLED\LQ12864.LST

     文件      22488  2012-09-15 09:43  Atmel_OLED\LQ-STC&52-OLED\LQ12864.OBJ

     文件        466  2012-09-15 08:54  Atmel_OLED\LQ-STC&52-OLED\LQ12864main.c

     文件       1519  2012-09-15 08:54  Atmel_OLED\LQ-STC&52-OLED\LQ12864main.LST

     文件       4294  2012-09-15 08:54  Atmel_OLED\LQ-STC&52-OLED\LQ12864main.OBJ

     文件         47  2012-09-15 08:54  Atmel_OLED\LQ-STC&52-OLED\LQ12864main.__i

     文件      23561  2012-09-15 09:43  Atmel_OLED\LQ-STC&52-OLED\LQ_OLED

     文件      12439  2012-09-15 09:43  Atmel_OLED\LQ-STC&52-OLED\LQ_OLED.hex

     文件         66  2012-09-15 09:43  Atmel_OLED\LQ-STC&52-OLED\LQ_OLED.lnp

     文件      22971  2012-09-15 09:43  Atmel_OLED\LQ-STC&52-OLED\LQ_OLED.M51

     文件        214  2012-09-18 00:06  Atmel_OLED\LQ-STC&52-OLED\LQ_OLED.plg

     文件       5115  2004-12-02 17:12  Atmel_OLED\LQ-STC&52-OLED\STARTUP.A51

............此处省略85个文件信息

评论

共有 条评论

相关资源