1、 1 / 16 摘要 1 为了实现单片机控制音乐播放,此次毕业设计做出了尝试,即电子音乐盒的设 计。本设计采用了通过单片机编写程序来控制蜂鸣器发声来实现歌曲的播放,能 保持基本音调不变,流畅播放出歌曲。 2 选用AT89C51 单片机。音乐程序控制蜂鸣器发声部分,由P3.0口输出。 3 彩灯部分。两个发光二极管能实现彩灯效果。一个是单色长亮彩灯,另一个是 通过单片机定时系统控制的闪灯,由P3.4口输出。 4 本设计虽然简单,但用到了了单片机的程序控制和定时的功能。虽然简单,但 学到真知是关键,能够学以致用是最重要的。知识不论简单与复杂,能够学以所 用已是做好。 关键词:单片机, LED, 音乐
2、程序, 定时器。 Abstract 1 in order to achieve single-chip microcomputer to control the playback of music, graduating from the design made an attempt, electronic music box design. This design adopts SCM through program control buzzer to achieve songs, canTo maintain the basic tone unchanged, smooth playbac
3、k song. 2 selection of AT89C51 single chip microcomputer. The music program control buzzer sound, from the output port P3.0. Part 3 lantern. The two light emitting diodes can achieve effects. A long light is monochromatic lights, another is through the single-chip timing control system of strobe lig
4、hts. 4 the design simple, but used the microcomputer program control and timing function. Although simple, but the truth is the key to learn, to learn in order to practise is the most important. Knowledge of both simple and complex, can learn to use is good. Key words: SCM, LED, music program, timer. 2 / 16 目录 摘要 2 关键词 2 Abstract 2 Key words 2 绪论 3 1. 单片机芯片介绍 4 1.1 单片机芯片的管脚介绍 4 1.2 单片机芯片管脚的功能简介 5 2 . 单片机简介 7 2.1 单片机的概念和发展史 8 2.2 单片机的选择