摘 要 本文主要以SPCE061A为基础介绍了如何应用SPCE061A芯片进行语音控制小车的硬件和软件设计。 本文首先介绍了SPCE061A的主要性能及其引脚的功能,然后在硬件上为了满足其运行条件设计了电源电路、复位电路、键盘电路等;为了实现语音控制,设计了MIC输入电路,SPEAKER输出电路;为了实现对步进电机的控制,设计了电机行驶控制电路板。在软件编程上,设计了相应的程序语句来实现这些硬件的功能。 设计和调试表明,在环境背景噪音不太大,MIC接受距离不太远,控制者的发音清晰的前提下,语音控制小车能对特定的语音指令做出反应,实现预定的功能,做出预想中的有限的动作。如果要其他人也能指挥它,则必须重新训练。 由于此次设计中只使用了SPCE061A自带的非常有限的存储空间和I/O端口,来实现最基本的有限的功能,所以小车的控制非常的不够智能,而且控制者只能是一人,换人后需要重新训练。如果能对其存储空间和IO端口进行扩展,再增加相应的传感器和程序段,这个语音控制小车的智能化程度将会更高,功能将会更加完善。 关键词:单片机;语音控制 ABSTRACT This article mainly takes SPCE061A as a foundation, and introduces how to carry on the hardware and the software design of the voice controlled car with the application of the SPCE061A chip. This article first introduces SPCE061A’s main performance and its pin function, in order to satisfy its working condition, I design the power circuit、the reset circuit、the keyboard circuit and so on; In order to realize the voice control, I design the MIC input circuit, the SPEAKER output circuit; In order to realize the control to step motor, I design the motor control circuit. At the same time, I also designed the corresponding procedure statement to realize these hardware functions. The design and the debugging indicates that, when we use it under the premises that the background noise is not too big, the MIC accepts range is not too far, and the master's pronunciation is clear, this voice controlled car can make the preset responses to the specific voice commands, realizes the limited movements. If someone else want to control it himself, then must retrain it . Because in this design I use the extremely limited storage space and the I/O ports only which SPCE061A brings, realizes the most basic and limited function, therefore the car control is very unintelligent, moreover, The master can only be one person, and it should be retrained if the master changes. If its storage space and the I/O ports be expanded and more sensors and segments installed in it, this voice controlled car will be more intelligent and the function will be more perfect. Key words:Monolithic Processor; Voice Control 目 录 第1章 绪论 1 1.1 单片机概述 1 1.1.1 单片机概述 1 1.1.2 单片机性能特点 1 1.1.3 单片机的应用 1 1.1.4 单片机的发展趋势 2 1.2 凌阳16 位u’nSP™系列单片机 2 1.2.1 凌阳16 位u’nSP™系列单片机的结构 2 1.2.2 凌阳16 位u’nSP™系列单片机的特点 3 第2章 SPCE061A芯片 4 2.1 SPCE061A 介绍 4 2.1.1 SPCE061A芯片介绍 4 2.1.2 SPCE061A芯片主要性能 4 2.1.3 SPCE061A结构概览 5 2.1.4 SPCE061A芯片引脚排列 6 2.1.5 SPCE061A芯片引脚描述 7 2.2 SPCE061A开发方式 8 2.3 SPCE061A的应用 8 2.4 基于SPCE061A芯片的最小系统 8 2.5 本章小结 9 第3章 SPCE061A的硬件平台设计 10 3.1 61板简介 10 3.1.1 电源电路 12 3.1.2 复位电路 12 3.2 键盘的工作原理及其应用 13 3.2.1 键盘简介 13 3.2.2 键盘扫描工作原理 14 3.3 语音信号处理电路设计 15 3.3.1 MIC输入电路 15 3.3.2 音频数-模转换 16 3.3.3 SPEAKER输出电路 17 3.4 电机行驶状态控制电路 17 3.4.1 电机行驶控制电路方框图 17 3.4.2 继电器驱动电路的设计 18 3.4.3 行驶状态控制电路的设计 19 3.5 本章小结 20 第4章 SPCE061A的软件结构设计 21 4.1 中断系统 21 4.1.1 中断概述 21 4.1.2 SPCE061A的中断系统 21 4.1.3 SPCE061A 的中断类型 22 4.1.4 中断向量和中断源 22 4.2 程序设计介绍 22 4.3 程序设计步骤说明 28 4.3.1 定义端口,设置初值 28 4.3.2 编写子程序,实现特定功能 29 4.3.3 编写主程序段 30 4.4 程序设计流程图 31 4.5 本章小结 31 第5章 软件和硬件的调试 34 5.1 硬件调试步骤 34 5.1.1 硬件焊接 34 5.2 调试过程中的问题及其解决方法 36 5.3 使用方法 38 结 论 39 参考文献 40 致 谢 41 第1章 绪论 1.1 单片机概述 1.1.1 单片机概述 单片机是单片微型计算机的简称,它是把组成微型计算机的各部件:中央处理器、存储器、输入输出接口电路、定时器/计数器等制作在一块集成电路芯片中,构成一个完整的微型计算机。从1971年Intel公司首次推出4004的4位单片微处理器以来,字长不断增加,现在普遍使用8位,并向16位过渡。 1.1.2 单片机性能特点 单片机的性能特点有:高集成度,在平方毫米级别的芯片上可制造上万个晶体管电路;结构紧凑,可*性高;功耗小,成本低。 1.1.3 单片机的应用 由于单片机超小型化,结构紧凑,可*性高,价格低廉,在国民经济中得到了广泛的应用: 工业方面:电机控制,工业机器人,过程控制,数字控制 仪器仪表:智能仪器,医疗器械,色谱仪,示波器 民用方面:电子玩具,电视游戏机,录像机,激光盘驱动 电讯方面:调制解调器,智能线路运行控制 导航控制:导弹控制,鱼雷制导,智能武器,航天导航 数据处理:图形终端,彩色黑白复印机,硬盘驱动器,磁带机,打印机 汽车方面:点火控制,ABS防滑,尾气排放控制 其他方面… |