郭焰昌:基于液晶显示的乘法口诀测试仪的设计
Design of Multiplication Table Tester Based on LCD
Abstract
Multiplication table tester based on SCM and LCD SCM can test and correct results. The scope of application can give our basic primary education technical sustain. Along with the rapid development of electronic devices for education, on the market the demand of learning machines, electronic dictionaries in teaching and testing products is growing. By using the SCM, we can learn more expertise of SCM knowledge.
On e-learning products will greatly enhance our country's level of education, and breakthrough this stage of the inherent teaching mode. The application of electronic products will stimulate primary and secondary school students to love scientific knowledge, By designing a Multiplication table tester, we will get more understanding about how to extend I extend the function of SCM, how to save the source of design, also how to make the design convenient and more rapid, in order to design more intelligent machines, and analysis the problem from various angles, in order to resolve difficulties.
The independent development of SCM and researching can bring the application of scientific knowledge to real life, and give good benefits to the community, that is the pride of our contemporary college students, also can break through the stage of our country inherent in the teaching mode. Our country is a country with a large population, also is a big education country, so only by our own research and development to meet the special needs of domestic. Design a simple Multiplication Table Tester only a small area of examples, but by the development and design we can accumulate more knowledge of the SCM for the future, but also can give more benefits for our country's children education career.
Key words: SCM; Liquid Crystal Display; Multiplication Table; Tester
- II -
安徽工程科技学院机电学院毕业设计(论文)
目 录
摘 要 ..................................................................................................................................... I Abstract .................................................................................................................................... II 插图清单 ................................................................................................................................... V 表格清单 .................................................................................................................................. VI 引 言 .................................................................................................................................... 1 第1章 绪论 .............................................................................................................................. 2 1.1 单片机的发展历史和未来展望 ......................................................................................... 2 1.2 单片机发展过程存在的问题 ............................................................................................. 3 1.3 单片机设计液晶显示的乘法口诀测试仪的任务与意义 ................................................. 4 第2章 总体方案设计 .............................................................................................................. 5 2.1 课题设计内容 ..................................................................................................................... 5
2.1.1 硬件设计模块选择 ................................................................................................... 5 2.1.2 硬件设计模块与原始方案比较 ............................................................................... 5 2.1.3 软件设计选择 ........................................................................................................... 5 2.2 设计方案总体框图 ............................................................................................................. 6
2.2.1 方案总体框图 ........................................................................................................... 6 2.2.2 设计框图原理说明 ................................................................................................... 6 第3章 硬件设计 ...................................................................................................................... 7 3.1 主芯片AT89S52介绍 ........................................................................................................ 7
3.1.1 引脚功能特性描述 ................................................................................................... 7 3.1.2 AT89S52的引脚图 .................................................................................................... 8 3.1.3 AT89S52存储器结构 ................................................................................................ 9 3.1.4 AT89S52定时、振荡分析 ........................................................................................ 9 3.1.5AT89S52 节电模式 .................................................................................................... 9 3.1.6 AT89S52编程与中断 .............................................................................................. 10 3.2 矩阵键盘简介 ................................................................................................................... 10
3.2.1 矩阵键盘的电路和外观图 ..................................................................................... 11 3.2.2 4×4矩阵键盘的工作原理 ....................................................................................... 11 3.2.3 矩阵键盘键值查找程序设计的思路 ..................................................................... 12 3.2.4 如何扫描矩阵键盘按键 ......................................................................................... 12 3.2.5 键盘的防抖动技术在设计里的应用 ..................................................................... 12 3.3 单片机复位电路 ............................................................................................................... 13 3.4 LCD1602液晶模块功能 ................................................................................................... 13
3.4.1 LCD1602主要参数介绍 ......................................................................................... 13 3.4.2 LCD1602基本操作程序 ......................................................................................... 13 3.4.3 LCD1602引脚在设计中如何应用 ......................................................................... 14 3.4.4 LCD1602指令系统 ................................................................................................. 14 3.4.5 LCD1602液晶显示特性 ......................................................................................... 15 3.4.6 1602LCD的RAM地址映射和复位(初始化)过程 .......................................... 15 3.4.7 LCD1602液晶显示器与AT89S52接线分析 ........................................................ 16 3.4.8 如何在LCD1602上显示显示数字 ....................................................................... 16
- III -
郭焰昌:基于液晶显示的乘法口诀测试仪的设计
3.4.9 对测试者输入的结果判断 ..................................................................................... 17 3.5 蜂鸣器 ............................................................................................................................... 17 3.6 本章设计总结 ................................................................................................................... 17 第4章 软件设计 .................................................................................................................... 19 4.1 主程序 ............................................................................................................................... 19
4.1.1 主程序流程图 ......................................................................................................... 19 4.2 子程序 ............................................................................................................................... 20
4.2.1 数据比较子程序流程图 ......................................................................................... 20 4.2.2 写指令数据到LCD子程序流程图 ....................................................................... 21 4.2.3 写显示数据到LCD流程图 ................................................................................... 22 4.2.4 检测LCD控制器忙状态,读数据流程图 ........................................................... 22 4.2.5 LCD初始化设定子程序流程图 ............................................................................. 23 4.2.6 发送字符串子程序流程图 ..................................................................................... 24 4.2.7 矩阵键盘键值查找程序流程图 ............................................................................. 26 4.2.8 延时120ms子程序流程图 .................................................................................... 27 4.2.9 延时5ms子程序使LCD初始化流程图 .............................................................. 27 4.2.10 数据转换子程序流程图 ....................................................................................... 28 4.2.11 模拟出题器子程序流程图 ................................................................................... 28 4.3 程序调试 ........................................................................................................................... 29 结论与展望 .............................................................................................................................. 31 致 谢 .................................................................................................................................. 32 参考文献 .................................................................................................................................. 33 附录A 电路原理图 ................................................................................................................ 34 附录B 一篇引用的外文文献及其译文 ................................................................................ 35 附录C 主要参考文献的题录及摘要 .................................................................................... 40 附录D 总程序清单 ................................................................................................................ 42
- IV -
安徽工程科技学院机电学院毕业设计(论文)
插图清单
图2-1 设计总框图 .................................................................................................................... 6 图3-1 AT89S52芯片引脚图 ..................................................................................................... 8 图3-2振荡电路图 ..................................................................................................................... 9 图3-3 矩阵键盘电路 .............................................................................................................. 11 图3-4 矩阵按键排列 .............................................................................................................. 11 图3-5 开关复位与上电复位 .................................................................................................. 13 图3-6 1602LCD内部显示地址 .............................................................................................. 15 图3-7 LCD1602液晶显示器与AT89S52接线图 ................................................................. 16 图4-1 主程序流程图 .............................................................................................................. 19 图4-2 数据比较子程序图 ...................................................................................................... 20 图4-3 写指令数据到LCD流程图 ........................................................................................ 21 图4-4 写显示数据到LCD流程图 ........................................................................................ 22 图4-5 LCD忙检测、读数据流程图 ...................................................................................... 23 图4-6 LCD初始化设定子程序流程图 .................................................................................. 24 图4-7 发送字符串子程序流程图 .......................................................................................... 25 图4-8 矩阵键盘键值查找程序流程图 .................................................................................. 26 图4-9 延时子程序流程图 ...................................................................................................... 27 图4-10 延时5ms子程序使LCD初始化流程图 ................................................................. 27 图4-11 数据转换子程序流程图 ............................................................................................ 28 图4-12 模拟出题器子程序流程图 ........................................................................................ 29 图4-13 调试程序图 ................................................................................................................ 30
- V -
郭焰昌:基于液晶显示的乘法口诀测试仪的设计
表格清单
表3-1 LCD1602主要技术参数 .............................................................................................. 13 表3-2 寄存器选择功能 .......................................................................................................... 14
- VI -