基于单片机的计数器课程设计

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

课程设计(论文)说明书

题目:计数器

院(系):信息与通信学院

专业:电子信息工程

学生姓名: *******

学号: ************

指导教师:唐 * *

职称:讲师

2013 年 12 月 24 日注:论文附有原理图和PCB图。点击下载

摘要

随着计数器技术的不断发展与进步,计数器的种类越来越多,应用的范围越来越广,现计数器的种类以增加到:电磁计数器、电子计数器、机械计数器(拉动机械计数器、转动机械计数器、按动机械计数器、测长机械计数器)、液晶计数器等。

本课设设计的是由AT89S52单片机控制的计数器.通过驱动电路驱动两个共阴数码管进行显示数字。另外,在计数的方式上通过两个轻触开关进行控制是手动计数还是自动计数。在计数过程中可以通过复位按键进行复位,然后在进行下一次的计数。计数范围00~59,进行软件编程是本课设设计的是手动计数时从59开始,没按一次P3^7所接的轻触开关就减一,直到减到00又跳回59依次进行。而当P3^6外接的轻触开关按下一次就进行自动从00~59的加一计数。再按一次数值停止自动,保持显示原数,再按下接着进行自动计数。

关键词:单片机;计数器;数码管;

Abstract

As technology continues to counter the development and progress, the type of the counter more and more increasingly wide range of applications, in order to counter the kind now: electromagnetic counters, electronic counters, mechanical counters (pulling mechanical counter, counter rotating machinery , pressing the mechanical counter, length measuring mechanical counter), LCD counters.

This course is designed to set up controlled by the microcontroller AT89S52 counter through the drive circuit to drive two common cathode LED display numbers. Further, the count mode switch via two touch controls are counted manually or automatically counting. In the counting process can be reset by a reset button, and then during the next count. Count range 00 to 59, is a software program designed for this course is set up from the 59 to start the manual count, not the connected by a P3 ^ 7 touch switch on minus one, until reduced to 00 and 59 to jump back in turn. When P3 ^ 6 external touch switch is pressed once automatically from 00 to 59 plus one count. Press again to stop the automatic value, maintaining the original number is displayed, press followed by automatic counting.

Keywords: microcontroller; counters; digital;

目录

1 硬件电路的设计 (1)

1.1设计原理图 (1)

1.2 主控部分的选择 (1)

2系统的功能要求及方案选择 (1)

2.1系统功能要求 (1)

2.2方案选择 (2)

3 硬件系统设计介绍.....................................................................23.1 系统芯片介绍 (2)

3.1.1 单片机AT89S52功能介绍 (2)

3.1.2数码管的介绍 (5)

3.2 硬件设计 (6)

3.2.1 复位电路 (6)

3.2.2 晶振电路 (8)

3.2.3 最小系统电路 (9)

3.2.4 数码管显示电路 (10)

3.2.5 数码管驱动电路 (10)

3.2.6 单片机P0I/O上拉 (10)

4 系统软件设计 (11)

4.1主程序流程图 (11)

4.2计数器程序 (12)

4.3 Proteus仿真 (14)

5 总结 (15)

谢辞 (16)

参考文献 (17)

附录 (18)

1硬件电路的设计

1.1 设计原理图

图(1)电路原理图

1.2主控部分的选择

本设计采用的主控部分是常见的单片机AT89S52,实现控制与处理的功能。单片机具有资源丰富、速度快、编程容易等优点。利用单片机内部的随机存储器(RAM)和只读存储器(ROM)及其引脚资源,外接数码管,通过轻触开关接地输入到P3^7实现计数脉冲的传输;另外,利用P3^6的高低电平和软件编程启动或停止定时器零进行00~59的计数。每隔一秒记一次;

2系统的功能要求及方案选择

2.1系统功能要求

要求:

1.计数范围:00~59

2.精确显示数字

应解决问题:

相关文档
最新文档