找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 826|回复: 2
收起左侧

关于uc1697的问题

[复制链接]
ID:1091661 发表于 2023-9-21 19:39 | 显示全部楼层 |阅读模式
在网上买了一块TFT屏幕,驱动是UC1697,请问各位有没有驱动程序,或者兼容的芯片型号,是否兼容UC1698?

UC1697.pdf

891.38 KB, 下载次数: 2

UC1698uc_1.1.pdf

655.42 KB, 下载次数: 1

COG-C144MVGL-01.pdf

468.19 KB, 下载次数: 1

回复

使用道具 举报

ID:628113 发表于 2023-10-2 23:27 | 显示全部楼层
初始代码:
#define UC1697_NOP  0xE3
#define UC1697_RST  0xE2
#define UC1697_PUMP   0x2F   // internal volt up
#define UC1697_COL_L  0x0   // & 0xf
#define UC1697_COL_H  0x10  // & 0xf
#define UC1697_ROW_L  0x60  // & 0xf
#define UC1697_ROW_H  0x70  // & 0x7
#define UC1697_STAT  0xA8     // & 0x7     [Green Enhance]  [Gray mode]  [sleep]  => 1 1 1  = 0xAF
#define UC1697_ON  0xAF
#define UC1697_SLEEP  0xAE
#define UC1697_ALLON  0xA5
#define UC1697_NO_ALLON  0xA4
#define UC1697_INV  0xA7
#define UC1697_NO_INV  0xA6
#define UC1697_SCAN   0x88  // & 0x7  [2][1][0]  [0]行列到边是否WARP  [1]行ROW列COL进位那个优先(0-列,1-行) [2]行ROW进位的方向
#define UC1697_MAPPING   0xC0  // & 0x7    [MY LC2] [MX LC1] [ICON LC0]
#define UC1697_PATTERN   0xD0  // & 0x1    1- RGB   0- BGR
#define UC1697_COLOR_MODE  0xD4  // [H] [L]  00-RGB 332  01- RGB 444  10- RGB 565    0xD6=565   
#define UC1697_BIAS      0xE8   // &7   000-6  001-10  010-11   011-12  100-9
#define UC1697_ROWEND    0xF1 // + 1 byte & 0x7F
#define UC1697_COL_START  0xF4  // + 1byte & 0x7f
#define UC1697_COL_END     0xF6 // + 1byte & 0x7f
#define UC1697_ROW_START   0xF5  // + 1byte & 0x7f
#define UC1697_ROW_END   0xF7  // + 1byte & 0x7f
#define UC1697_INSIDE    0xF8  // DRAW WITHIN WINDOW
#define UC1697_VOLT      0x81 // + 1byte & 0xFF
                const u16 UC1697_INIT_CODE[] =          //LCD的初始化指令,具体含义写在后面  00xx CMD   01XX Dat  02XX delay
                                   {
                                                 
                                                 UC1697_RST,UC1697_NOP,UC1697_NOP,UC1697_NOP,UC1697_NOP,UC1697_NOP,UC1697_NOP,UC1697_NOP,UC1697_NOP,UC1697_NOP,
                                                 0x02ff,// soft reset
             UC1697_PUMP ,   //2F
                                                 UC1697_VOLT,0xAA,    //81
                                                 UC1697_PATTERN+1,    //D0+1 RGB
                                                 UC1697_COLOR_MODE+2, //D4+2 565
                                                 
                                                 UC1697_BIAS+1 ,//E8+1
                                                 
//                                                 UC1697_SCAN|01,  //88|5
//                                                 UC1697_MAPPING|0x6, // C0+6
                                                 0x2B,  //Set Panel Loading
                                                 0x24, //Set Temp. Compensation       


                                                 0xC0,  //SCAN
                                                 0xA1,  //Set Line Rate  A0-A3

//                                                 0x83, 0x27, //set the 4/8 Gray-shade
                                 
//                                                 0x84, //Partial Display
//                                                 0xC8,0x10, //Set N-Line Inversion
//                                                 0xDA, //Set COM Scan Function
//                                                 0xF4,0x25, //UC1697_COL_START
//                                                 0xF6,0x5A, //UC1697_ROW_START
//                                                 0xF5,0x0,//UC1697_COL_END
//                                                 0xF7,0x9F,    //UC1697_ROW_END         
//                                                 0xF8,//UC1697_INSIDE
//                                                 UC1697_SCAN+1, // AC =-
//                                                 0x40,0x50, //SCROLL
//                                                 0x90,0x0,//Set Fixed Lines
//                                                 0x84, //Partial Display
//                                                 0xF1,0x9F, //UC1697_ROWEND
//                                                 0xF2,0,//Set Partial Display Start
//                                                 0xF3,159,//Set Partial Display Start

         UC1697_NO_ALLON,//  0xA4
         UC1697_NO_INV, // 0xA6
                                 UC1697_ON,    //AF
                                 };
                                                 
回复

使用道具 举报

ID:628113 发表于 2023-10-2 23:29 | 显示全部楼层

显示方向控制:

                 if(dir==0) {DISP_CMD(dif,0x88|1) ;DISP_CMD(dif,0xC0);  }
                 if(dir==1) {DISP_CMD(dif,0x88|1|0x6) ;DISP_CMD(dif,0xC2);  }                 
                 if(dir==2) {DISP_CMD(dif,0x88|1) ;DISP_CMD(dif,0xC6);  }
                 if(dir==3) {DISP_CMD(dif,0x88|1|0x6) ;DISP_CMD(dif,0xC4);  }       
                 
UC1697_SetColumn(u8 dif,u16 xs, u16 xe)
                   DISP_CMD(dif,0x10|((from>>4)&0x7));
                   DISP_CMD(dif,(from&0xf));
UC1697_SetRow(u8 dif,u16 ys, u16 ye)
                   DISP_CMD(dif,0x70|((from>>4)&0x7));
                   DISP_CMD(dif,0x60|(from&0xf));
UC1697_SetWindow(u8 dif, u16 xs,u16 ys,u16 xe, u16 ye)
                        if(lcd_dir==0 ||lcd_dir==2 )       
                                        {
                                                DISP_CMD(dif,0xf4);  //set column start address
                                                DISP_CMD(dif,xsd&0x7f);  //column start address=00
                                                DISP_CMD(dif,0xf6);  //set column end address
                                                DISP_CMD(dif,xed&0x7f);  //column end address=11*3RGB=33 segment
                                                DISP_CMD(dif,0xf5);  //set row start address
                                                DISP_CMD(dif,ysd&0x7f);  // row start address=00
                                                DISP_CMD(dif,0xf7);  //set row end address
                                                DISP_CMD(dif,yed&0x7f);  // row end address=32
                                                DISP_CMD(dif,0xF8); // inside mode , pixel display within window                       
                                        }
                        else
                                        {
                                                DISP_CMD(dif,0xf4);  //set column start address
                                                DISP_CMD(dif,ysd&0x7f);  //column start address=00
                                                DISP_CMD(dif,0xf6);  //set column end address
                                                DISP_CMD(dif,yed&0x7f);  //column end address=11*3RGB=33 segment
                                                DISP_CMD(dif,0xf5);  //set row start address
                                                DISP_CMD(dif,xsd&0x7f);  // row start address=00
                                                DISP_CMD(dif,0xf7);  //set row end address
                                                DISP_CMD(dif,xed&0x7f);  // row end address=32
                                                DISP_CMD(dif,0xF8); // inside mode , pixel display within window                       
                                        }

是从实际运行项目中截取的, 就是这款屏的驱动。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表