基于DSP微控制器定时器设计_毕业设计论文 下载本文

内容发布更新时间 : 2024/11/10 10:49:47星期一 下面是文章的全部内容请认真阅读。

基于DSP微控制器定时器设计

摘 要

随着时代的进步,电子行业的发展,定时器的应用也越来越广泛。传统的机械式定时器,电动式定时器都是通过发条、交流同步步进电机或者石英步进电机进行驱动的。这种定时器精度不高,定时误差较大。相对于前两种定时器,电子式定时器体积小、重量轻、造价低、精度高、寿命长、而且安全可靠、调整方便、适于频繁使用。

本次设计的题目是基于DSP微控制器定时器设计。本文设计了一种以TMS320F28335 DSP微控制器为核心的定时器。利用内部定时器0和PIE外设中断扩展模块产生定时中断,并进行逆行计数。通过SPI串行外设接口在DSP和74HC164之间进行通信,进而实现在数码管上通过动态扫描显示定时时间。本系统通过矩阵键盘控制定时器开启和暂停。在定时器暂停时,还可以通过键盘重新输入定时初值。当定时结束时,还会通过LED灯闪烁报警,提示定时结束。

关键词:定时器,DSP,TMS320F28335 ,串行外设接口,矩阵键盘

第1页

Abstract

With the progress of the times and the development of electronic industry, the timer is used more and more widely. The traditional mechanical timer, electric timer is drived through the spring, AC synchronous motor or quartz stepper motor .The accuracy of this timer is not high and the error is large. Compared with the former two timer, electronic timer has small volume, light weight, low cost, high precision, long service life, and electronic timer is safety and reliability, convenient adjustment, suitable for frequent use.

The topic of this design is timer design based on the DSP microcontroller.This paper designs a timer with the core of TMS320F28335 DSP microcontroller. Generating a timer interrupt and counting retrogradely by using the internal timer 0 and PIE peripheral interrupt expansion module. Communicate between DSP and 74HC164 through the SPI serial peripheral interface, so as to achieve displaying time on the digital tube by dynamic scanning. The system is turned on and paused through the matrix keyboard. In the timer pause,initial value can be inputed through the keyboard . When the timing is over, system will alarm through LED lights flashing, prompting the end of timing.

Key Words: timer ,DSP ,TMS320F28335 ,SPI, matrix keyboard

第2页

目 录

1 绪论 .......................................................................................................................... 1

1.1系统背景 ........................................................................................................ 1

1.1.1 定时器的分类 .................................................................................... 1 1.1.2 定时器的应用 .................................................................................... 1 1.2 定时器系统概述 ........................................................................................... 2 1.3 定时器设计及实现的功能 ........................................................................... 2

1.3.1 设计过程 ............................................................................................ 2 1.3.2 定时器方案的确定 ............................................................................ 2 1.3.3 定时器的功能 .................................................................................... 2

2 定时器系统的硬件设计 .......................................................................................... 4

2.1 总体硬件设计 ............................................................................................... 4 2.2 DSP微控制器 ............................................................................................... 5 2.3定时器中断的实现 ........................................................................................ 5

2.3.1 DSP内部定时器 ................................................................................ 5 2.3.2 PIE外设中断扩展模块 ...................................................................... 6 2.4 数码管显示电路 ........................................................................................... 8

2.4.1 SPI串行外设接口 .............................................................................. 8 2.4.2 74HC164 ........................................................................................... 11 2.4.3 数码管 .............................................................................................. 12 2.5按键控制电路 .............................................................................................. 13

第3页