专家
公告
财富商城
电子网
旗下网站
首页
问题库
专栏
标签库
话题
专家
NEW
门户
发布
提问题
发文章
STM32
STM32F103RBT6驱动UC1698控制芯片的160*160黑白点阵液晶的程序,在上面移植了ZLG_GUI
2019-12-12 18:20
发布
×
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
站内问答
/
STM32/STM8
9443
67
68
STM32F103RBT6驱动UC1698控制芯片的160*160黑白点阵液晶的程序,在上面移植了ZLG_GUI.
由于本人刚接触STM32,本想移植UCGUI,发现UCGUI比较复杂,一时半会搞不明白,黑白液晶的也发挥不了UCGUI的特长,
先移植了ZLG的,这款160*160的液晶在电力行业用的比较多。
请轻些拍砖。
(原文件名:DSC00086.JPG)
点击此处下载
ourdev_523183.rar(文件大小:222K)
(原文件名:KEIL_STM32.rar)
友情提示:
此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
67条回答
HYLG
1楼-- · 2019-12-18 16:36
效果不错。
加载中...
dragonwww
2楼-- · 2019-12-18 17:13
初始化貌似可以了,但显示数据老是不对呢,那个初始化参数到底该为多少啊?看了几个初始化参数都不一样呢!晕!
加载中...
LCRPN
3楼-- · 2019-12-18 19:12
运气不好,最近找的资料都是“老论坛附件”,下不了……
加载中...
yc21
4楼-- · 2019-12-19 00:36
精彩回答 2 元偷偷看……
加载中...
starlu163
5楼-- · 2019-12-19 02:40
为什么在STM32F107上不能运行
加载中...
starlu163
6楼-- · 2019-12-19 06:44
楼主 好 刚好我也用到这款屏,初始化后就一直满屏麻点,然后写入图像数据后,屏幕一闪而过,之后白屏也不知道怎么回事。帮忙看看我代码
void LCD_Pins_Config(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOE , ENABLE);
/*配置160*160数据端口*/
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 |
GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 |
GPIO_Pin_14 | GPIO_Pin_15;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOE, &GPIO_InitStructure);
/*配置160*160控制端口*/
//LCD_Pin_WR
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOE, &GPIO_InitStructure);
//LCD_Pin_RS
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOE, &GPIO_InitStructure);
//LCD_Pin_RD
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPD;
GPIO_Init(GPIOE, &GPIO_InitStructure);
//LCD_Pin_BLK
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOC, &GPIO_InitStructure);
//LCD_Pin_CS
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOC, &GPIO_InitStructure);
//LCD_Pin_RES
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOC, &GPIO_InitStructure);
}
void SdCmd(u8 Command)
{
ClrRs(); //选择指令通道
SetRd();
ClrCs(); // 选择模块
LCD_Write(Command << 8); // 将指令送至数据接口
ClrWr(); // 写信号为低电平
// Delay(1000);
SetWr(); // 写信号为高电平
SetCs(); // 封锁模块
}
void SdData(u8 Ddata)
{
SetRs(); // 选择数据通道
SetRd();
ClrCs();
LCD_Write(Ddata << 8); // 将指令送至数据接口
ClrWr(); // 写信号为低电平
// Delay(1000);
SetWr(); // 写信号为高电平
SetCs(); // 封锁模块
}
void initLCDM(void)
{
ClrRES(); Delay(1000); //硬件复位
SetRES(); Delay(80000); //复位后延迟800ms以上时间
SetBlk();
ContrastLevel=0xbf;
SdCmd(0x25); // 设置温度补偿系数-0.05%/C
SdCmd(0x2b); // 内部DC-DC
SdCmd(0xc4); // LCD映像MY=1,MX=0,LC0=0
SdCmd(0xa3); // 设置行扫描频率
SdCmd(0xd1); // 彩 {MOD}数据格式R-G-B
SdCmd(0xd5); // 设置数据位为12位RRRR-GGGG-BBBB
SdCmd(0xc8); SdCmd(0x00); // 设置M信号为0行翻砖
SdCmd(0xe9); // 设置偏压比1/10
SdCmd(0xa6); // 正性显示
SdCmd(0xa4); // 正常显示
SdCmd(0x81); SdCmd(ContrastLevel); //设置对比度bf
SdCmd(0xd8); // 设置扫描模式
SdCmd(0xad); // 开显示
}
int main(void)
{
SystemInit(); //系统初始化
LCD_Pins_Config();
SetRES();
SetCs();
Set_DB();
SetWr();
SetRd();
initLCDM();
ShowBMP(0,0,160,160,DISPLOGO);
}
拜谢
加载中...
首页
上一页
5
6
7
8
9
10
11
12
下一页
一周热门
更多
>
相关问题
STM32F4上I2C(在PROTEUS中模拟)调试不通的问题
6 个回答
芯片供应紧张,准备换个MCU,MM32L系列替换STM32L系列的怎么样?
7 个回答
STM32同时使用两个串口进行数据收发时数据丢包的问题
5 个回答
STM32F103串口通信死机问题
4 个回答
STM32WLE5CC连接SX1268在LoRa模式下能与 SX1278互通吗?
2 个回答
STM32开发板免费用活动
7 个回答
stm32 处理 DHT11占用太多时间,大家程序是怎么设计的
8 个回答
分享一个STM32单片机做的离线编程器代码
9 个回答
相关文章
ST公司第一款无线低功耗单片机模块有效提高物联网设计生产效率
0个评论
如何实现对单片机寄存器的访问
0个评论
通过USB用STM32片内自带Bootloader下载程序及注意事项
0个评论
欲练此功必先自宫之STM32汇编启动,放慢是为了更好的前行
0个评论
×
关闭
采纳回答
向帮助了您的网友说句感谢的话吧!
非常感谢!
确 认
×
关闭
编辑标签
最多设置5个标签!
STM32
保存
关闭
×
关闭
举报内容
检举类型
检举内容
检举用户
检举原因
广告推广
恶意灌水
回答内容与提问无关
抄袭答案
其他
检举说明(必填)
提交
关闭
×
关闭
您已邀请
15
人回答
查看邀请
擅长该话题的人
回答过该话题的人
我关注的人
void LCD_Pins_Config(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOE , ENABLE);
/*配置160*160数据端口*/
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 |
GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 |
GPIO_Pin_14 | GPIO_Pin_15;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOE, &GPIO_InitStructure);
/*配置160*160控制端口*/
//LCD_Pin_WR
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOE, &GPIO_InitStructure);
//LCD_Pin_RS
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOE, &GPIO_InitStructure);
//LCD_Pin_RD
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPD;
GPIO_Init(GPIOE, &GPIO_InitStructure);
//LCD_Pin_BLK
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOC, &GPIO_InitStructure);
//LCD_Pin_CS
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOC, &GPIO_InitStructure);
//LCD_Pin_RES
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOC, &GPIO_InitStructure);
}
void SdCmd(u8 Command)
{
ClrRs(); //选择指令通道
SetRd();
ClrCs(); // 选择模块
LCD_Write(Command << 8); // 将指令送至数据接口
ClrWr(); // 写信号为低电平
// Delay(1000);
SetWr(); // 写信号为高电平
SetCs(); // 封锁模块
}
void SdData(u8 Ddata)
{
SetRs(); // 选择数据通道
SetRd();
ClrCs();
LCD_Write(Ddata << 8); // 将指令送至数据接口
ClrWr(); // 写信号为低电平
// Delay(1000);
SetWr(); // 写信号为高电平
SetCs(); // 封锁模块
}
void initLCDM(void)
{
ClrRES(); Delay(1000); //硬件复位
SetRES(); Delay(80000); //复位后延迟800ms以上时间
SetBlk();
ContrastLevel=0xbf;
SdCmd(0x25); // 设置温度补偿系数-0.05%/C
SdCmd(0x2b); // 内部DC-DC
SdCmd(0xc4); // LCD映像MY=1,MX=0,LC0=0
SdCmd(0xa3); // 设置行扫描频率
SdCmd(0xd1); // 彩 {MOD}数据格式R-G-B
SdCmd(0xd5); // 设置数据位为12位RRRR-GGGG-BBBB
SdCmd(0xc8); SdCmd(0x00); // 设置M信号为0行翻砖
SdCmd(0xe9); // 设置偏压比1/10
SdCmd(0xa6); // 正性显示
SdCmd(0xa4); // 正常显示
SdCmd(0x81); SdCmd(ContrastLevel); //设置对比度bf
SdCmd(0xd8); // 设置扫描模式
SdCmd(0xad); // 开显示
}
int main(void)
{
SystemInit(); //系统初始化
LCD_Pins_Config();
SetRES();
SetCs();
Set_DB();
SetWr();
SetRd();
initLCDM();
ShowBMP(0,0,160,160,DISPLOGO);
}
拜谢
一周热门 更多>