当前位置:网站首页>以梦为马之89c51单片机驱动lcd
以梦为马之89c51单片机驱动lcd
2022-06-13 11:14:00 【璞楞登斯沃】
路有千万条,我要选择那条最难的走,这才是我该走的路
控制LCD实际上就是控制两个牛屎芯片
观察lcd1602,它有16个引脚,其含义如下图所示
查看数据手册看到如下时序图
再看说明书看到时序图介绍:
芯片手册混合写的,对于刚入门的朋友来说理解,理解起来回会有难度,于是我把这个分开写帮助大家理解。
对于1602来说他的芯片处理时间都是ns的量纲远大于80c52的us,在实际运用中是不用增加延迟功能的。
但是要是使用仿真软件的话,那必须要使用延迟,要不然会出现屏幕不显示的BUG
- 写命令
(1)RS低电平,R/W低电平
(2)开始写命令,E升高延迟,迟最少30ns;E最少保持时间为400ns。
(3)E保持不变开始写命令
(4)命令结束后拉低E,使E变成低电平。
- 写数据
- 1)RS高电平,R/W低电平
(2)开始写命令,E升高延迟,迟最少30ns;E最少保持时间为400ns。
(3)E保持不变开始写命令
(4)命令结束后拉低E,使E变成低电平。
在实际情况中不需要延迟,很浪费资源的。
下图是仿真图,实物接线与仿真图一样。仿真图接LCD要注意使用上拉电阻将电压拉上去,否则连屏幕都不会亮。
下图是判忙函数的来源
字符定位的原因
功能选择图已经帮你们列好了

放大
按照说明书所写,使用1602显示屏的流程如下
- 开始
- 初始化
- 定义显示位置
- 显示内容
实验流程如图所示
main函数
将hello y存储在table1数组中。
delay_time汇编延时函数
请大家注意这里的延迟函数,我只延迟了3μs,而根据实际的芯片操作延迟需要延迟的量纲是ns级别的,然而1μs=1000ns。
但是如果使用此程序的朋友没有实物而需要使用Proteus 8的话,那么是需要加延迟的。
lcd_init 初始化函数
清屏原理
点阵设置
当DL=1,N=1,F=1的时候及00011100=0X38
lcd_write_com 写命令函数
lcd_write_date 写数据函数
lcd_busy 判忙函数

lcd_show 显示函数

实验结果
https://download.csdn.net/download/qq_43161960/79744524
边栏推荐
- Performance monster on arm64: installation and performance test of API gateway Apache APIs IX on AWS graviton3
- socket编程(上)
- 关于 SAP Spartacus CmsService.getComponentData 可能的优化思路
- 2021ccpc online competition list
- 21世纪以来的历次“粮食危机”,发生了什么?
- Web3 系统构建:去中心化的原则、模型和方法(上)
- Vivo large scale kubernetes cluster automation operation and maintenance practice
- 【ROS】MoveIt-rviz-七自由度机械臂仿真
- [tcapulusdb knowledge base] tcapulusdb tmonitor module architecture introduction
- 宝塔添加一个网站:PHP项目
猜你喜欢

【ROS】MoveIt-rviz-七自由度机械臂仿真

Go 要加个箭头语法,这下更像 PHP 了!

宝塔添加一个网站:PHP项目

Easyclick run code snippet out null

Codeforces Round #798 (Div. 2)ABCD

Performance monster on arm64: installation and performance test of API gateway Apache APIs IX on AWS graviton3

Database learning notes (Chapter 15)
![[ROS] moveit rviz seven DOF Manipulator Simulation](/img/e6/4000ffa06a5c538b30faed33b6c0a2.png)
[ROS] moveit rviz seven DOF Manipulator Simulation
![[tcapulusdb knowledge base] Introduction to tmonitor stand-alone installation guidelines (I)](/img/f5/7ad04670229b99ea727f942d82328b.png)
[tcapulusdb knowledge base] Introduction to tmonitor stand-alone installation guidelines (I)

【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍
随机推荐
[ROS] moveit rviz seven DOF Manipulator Simulation
[tcapulusdb knowledge base] Introduction to new models of tcapulusdb
程序员面试这么重视考察概念还是第一次见
MIIdock文件分布
pyepics下载和安装
Private computing fat core concepts and stand-alone deployment
Vivo large scale kubernetes cluster automation operation and maintenance practice
vivo大规模 Kubernetes 集群自动化运维实践
Vivo large scale kubernetes cluster automation operation and maintenance practice
Chapter VI i/o management
Apache APISIX v2.14.1 探索性版本发布,进军更多领域
Euler function and finding Euler function by linear sieve
很妙的贪心(F2. Nearest Beautiful Number (hard version))
[tcapulusdb knowledge base] Introduction to tcapulusdb general documents
Count the number of special subsequences (0, 1, 2) DP
【TcaplusDB知识库】TcaplusDB机型管理介绍
数位DP例题
Anonymity in Web3 and NFT
【TcaplusDB知识库】TcaplusDB运维单据介绍
服务器的使用