内容发布更新时间 : 2024/12/26 6:11:33星期一 下面是文章的全部内容请认真阅读。
目 录
[中文摘要] ·································· 1 引 言 ································· 2 一、设计方案 ································· 2 1.1 概述 ································ 3 1.2 方案论证
··························· 3
二、系统硬件简介及组成 ···························· 5 2.1 8051的内部资源和结构特点 ······················ 5 2.1.1 中央处理器 ·························· 6 2.1.2 存储器组织 ··························· 7 2.2 扣扣204440748提供完整版本 ···················· 7 2.2.1 芯片的引脚描述 ························ 7 2.2.2 MCS-51单片机的片外总线结构 ·················· 10 2.3 系统总体设计 ····························· 10 2.3.1 时钟电路设计 ·························· 11 2.3.2 复位电路设计 ·························· 11 2.3.3 16按键键盘电路设计 ······················ 12 2.3.4 8位LED显示器电路设计 ····················· 15 2.3.5 外部存储器扩展电路 ······················· 19 2.3.6 串行接口电路 ·························· 19 2.3.7 蜂鸣器及驱动电路的介绍 ····················· 20 三、软件设计 ································· 20 3.1 编程思路 ································ 20 3.2 播放方法 ······························· 21 3.3 程序清单实例 ······························ 23 四、总结 ··································· 39 致谢及声明 ·································· 40 参考文献 ··································· 41
摘 要
本课题是利用单片机原理设计一个简易的电子音乐盒。以8051单片机为核心(它由5V直流电源供电),利用I/O口产生一定频率的方波,使用运算放大器的同相放大方式进行电路驱动(驱动蜂鸣器),发出不同的音调,从而演奏乐曲;使用七段LED数码管来进行显示歌曲序号(其中LED采用的是动态扫描显示),通过功能选择键并加以必要的外围电路来控制来选择、暂停和播放音乐。软件方面采用C语言和汇编语言综合编程及模块化结构设计,阐述了程序的各个模块和实现过程,使程序设计的逻辑关系更加简洁明了,当知道模块的输入和所要求的输出时,就可直接测试小模块,增加了程序的可读性和可移植性,为了便于扩展和更改。
关键词: 单片机 电路 LED 音乐盒 中断 编程
1