1、 I 目录目录 摘要 . III Abstract IV 第 1 章 绪论 1 1.1 课题背景 1 1.2 课题目的与意义 2 1.3 课题研究现状 3 1.4 本文主要内容及结构安排 5 第 2 章 硬件设计 6 2.1 硬件器件的选择 6 2.1.1 SPCE061A 单片机 6 2.1.2 MMA7260QT 三轴加速度传感器 10 2.2 系统电路的连接 . 11 2.3 单片机控制单元的硬件设计 . 13 2.3.1 输入/输出控制单元设计 13 2.3.2 模拟数字转换设计 . 16 2.3.3 DAC 方式音频输出设计 23 2.4 传感器控制单元设计 . 24 2.5 本章小
2、结 . 26 第 3 章 软件设计 . 27 3.1 软件系统的开发设计 . 27 3.2 音频设计 . 29 3.2.1 音频处理方案 . 29 3.2.2 语音自动播放函数设计 . 30 3.2.3 语音文件压缩设计 . 33 3.3 I/O 接口及 A/D 转换设计 . 34 3.3.1 I/O 接口设计 34 3.3.2 A/D 转换设计 34 3.4 主程序设计 . 36 II 3.5 本章小结 . 40 结论 41 参考文献 43 致谢 45 附录一: 46 附录二: 63 III 摘要 现代快节奏的生活和工作中,人们往往承受着巨大的压力。本设计拟采 用 SPCE061A 开发板控
3、制加速度传感器实现一个“出气宝宝”系统,在人们 发泄情绪打击“出气宝宝”的时候,根据打击力度发出对应的“哭声” 。这 样,人们以娱乐的方式合理表达了攻击性实现了心理调节。 整个系统主要由 SPCE061A 开发板与加速度传感器两大模块来实现。外 部的“击打”会使传感器输出模拟电压信号。61 板通过 I/O 接口读入信号, 经过 A/D 转换和程序处理,提取出能表征外部运动程度的量,并以此控制音 频函数中的音量指数,改变扬声器的“哭声”大小。 系统设计的内容大致可分为硬件设计与软件设计两部分。 硬件设计主要 包括外围电路的设计与连接,对 I/O 接口、A/D 转换、音频输出的数据单元 控制。软件
4、设计主要包括自动声音播放函数、声音文件的压缩与连接、I/O 接口与 A/D 转换的设置、主程序函数的编写等。 经过整个系统连接调试,摇动传感器,扬声器发出“哭声” ,且音量大 小与运动剧烈程度正相关,系统的基本功能实现。 关键词:SPCE061A;加速度传感器;I/O 接口;A/D 转换;音频 IV Abstract With the fast pace of modern life and work, people are often under huge pressure.This design uses SPCE061A development board to control acce
5、leration sensor to realize a “venting baby“ system. When the emotional outburst people strike “venting baby“, the system could give out corresponding “cries“ according to the degree of blow. So, people express their aggressiveness in reasonable way to realize psychological adjustment. The system mai
6、nly consists of SPCE061A development board module and acceleration sensor module. External “strike“ will make sensor output analog signal. 61 board reads signals through the I/O interface, and extracts a value which can characterize the amount of movement level outside after A/D conversion and process. Then the value could control the volume index of audio function to change the sound size of the “cries“. The design of the System can roughly content of hardware design and software design. The