OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 4084|回复: 2

stm8l 的lcd写ram的时候出了问题,帮忙解决以下

[复制链接]

1

主题

2

帖子

0

精华

新手入门

积分
26
金钱
26
注册时间
2015-9-9
在线时间
0 小时
发表于 2015-9-30 11:17:21 | 显示全部楼层 |阅读模式
5金钱
lcd其他的都配置好了,但是,lcd_ram0里写数据的时候,发现lcd全部点亮了,com0对应的seg口,都不知道如何解决,
我发现都是那些单独一个com的lcd_ram区,都是些数据会导致出错,有人遇到这样的问题吗
[mw_shl_code=c,true]void LCD_Conv_Serial_Number(uint8_t SerialNumber) { uint8_t temp; LCD_ClearFlag(); while(!LCD_GetFlagStatus()); temp = SerialNumber / 100; LCD_PageSelect(LCD_PageSelection_SecondPage); LCD->RAM[LCD_RAMRegister_14] = (LCD->RAM[LCD_RAMRegister_14] & ~0x02) | ((CapNumberMap[temp] >> 6) & 0X02);//A LCD->RAM[LCD_RAMRegister_16] = (LCD->RAM[LCD_RAMRegister_16] & ~0x02) | ((CapNumberMap[temp] >> 5) & 0X02);//B LCD->RAM[LCD_RAMRegister_18] = (LCD->RAM[LCD_RAMRegister_18] & ~0x02) | ((CapNumberMap[temp] >> 4) & 0X02);//C LCD->RAM[LCD_RAMRegister_20] = (LCD->RAM[LCD_RAMRegister_20] & ~0x02) | ((CapNumberMap[temp] >> 3) & 0X02);//D LCD->RAM[LCD_RAMRegister_14] = (LCD->RAM[LCD_RAMRegister_14] & ~0x01) | ((CapNumberMap[temp] >> 2) & 0X01); //F LCD->RAM[LCD_RAMRegister_16] = (LCD->RAM[LCD_RAMRegister_16] & ~0x01) | ((CapNumberMap[temp] >> 1) & 0X01); //G LCD->RAM[LCD_RAMRegister_18] = (LCD->RAM[LCD_RAMRegister_18] & ~0x01) | ((CapNumberMap[temp] >> 3) & 0X01); //E //temp = SerialNumber % 100 / 10; //LCD_PageSelect(LCD_PageSelection_SecondPage); LCD->RAM[LCD_RAMRegister_14] = (LCD->RAM[LCD_RAMRegister_14] & ~0x08) | ((CapNumberMap[temp] >> 4) & 0X08);//A LCD->RAM[LCD_RAMRegister_16] = (LCD->RAM[LCD_RAMRegister_16] & ~0x08) | ((CapNumberMap[temp] >> 3) & 0X08);//B LCD->RAM[LCD_RAMRegister_18] = (LCD->RAM[LCD_RAMRegister_18] & ~0x08) | ((CapNumberMap[temp] >> 2) & 0X08);//C LCD->RAM[LCD_RAMRegister_20] = (LCD->RAM[LCD_RAMRegister_20] & ~0x08) | ((CapNumberMap[temp] >> 1) & 0X08);//D LCD->RAM[LCD_RAMRegister_14] = (LCD->RAM[LCD_RAMRegister_14] & ~0x04) | ((CapNumberMap[temp] >> 0) & 0X04);//F LCD->RAM[LCD_RAMRegister_16] = (LCD->RAM[LCD_RAMRegister_16] & ~0x04) | ((CapNumberMap[temp] << 1) & 0X04);//G LCD->RAM[LCD_RAMRegister_18] = (LCD->RAM[LCD_RAMRegister_18] & ~0x04) | ((CapNumberMap[temp] >> 1) & 0X04);//E temp = SerialNumber % 10; LCD_ClearFlag(); while(!LCD_GetFlagStatus()); //LCD_PageSelect(LCD_PageSelection_SecondPage); LCD->RAM[LCD_RAMRegister_0] = (LCD->RAM[LCD_RAMRegister_0] & ~(0x04)) | ((CapNumberMap[temp] >> 5) & 0X04); //A LCD->RAM[LCD_RAMRegister_3] = (LCD->RAM[LCD_RAMRegister_3] & ~(0x40)) | ((CapNumberMap[temp] >> 4) & 0X40); //B LCD->RAM[LCD_RAMRegister_7] = (LCD->RAM[LCD_RAMRegister_7] & ~(0x04)) | ((CapNumberMap[temp] >> 3) & 0X04); //C LCD->RAM[LCD_RAMRegister_10] = (LCD->RAM[LCD_RAMRegister_10] & (~0x40)) | ((CapNumberMap[temp] >> 2) & 0X40);//D LCD->RAM[LCD_RAMRegister_0] = (LCD->RAM[LCD_RAMRegister_0] & (~0x02)) | ((CapNumberMap[temp] >> 1) & 0X02); //F LCD->RAM[LCD_RAMRegister_3] = (LCD->RAM[LCD_RAMRegister_3] & (~0x20)) | ((CapNumberMap[temp] >> 0) & 0X20); //G LCD->RAM[LCD_RAMRegister_7] = (LCD->RAM[LCD_RAMRegister_7] & (~0x02)) | ((CapNumberMap[temp] >> 2) & 0X02); //E }[/mw_shl_code]

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165309
金钱
165309
注册时间
2010-12-1
在线时间
2108 小时
发表于 2015-9-30 22:17:00 | 显示全部楼层
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复

使用道具 举报

2

主题

14

帖子

0

精华

初级会员

Rank: 2

积分
87
金钱
87
注册时间
2014-10-7
在线时间
9 小时
发表于 2015-10-13 10:28:16 | 显示全部楼层
刚用的stml052 正常显示

回复

使用道具 举报

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

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-11-22 19:13

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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