基于at89c52单片机的16键简易电子琴的设计(编辑修改稿)内容摘要:

延时子程序 === DELY10MS: MOV R6,10 D1: MOV R7,248 DJNZ R7,$ DJNZ R6,D1 RET 中断服务子程序。 ==== 中断服务子程序 === INT_T0: MOV TH0,STH0 MOV TL0,STL0 CPL RETI 武汉纺织大学 2020 届毕业设计论文 23 音符参数表。 ==== 音符参数表 === TABLE: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H DB 7FH,6FH,77H,7CH,39H,5EH,79H,71H 计数器初值表。 ==== 计数器初值表 == TABLE1: DW 64021,64103,64260,64400 DW 64524,64580,64684,64777 DW 64820,64898,64968,65030 DW 65058,65110,65157,65178 预存歌曲表。 === 预存歌曲表 === TABLE2: DW 2202H,2902H,2902H,2902H,2906H,2702H。 DW 2502H,2702H,2502H,2402H,2208H。 DW 2E02H,2E02H,2E02H,2E02H,2E06H,2C02H。 DW 2902H,2C02H,2D02H,2A02H,2908H。 DW 2902H,2E02H,2E02H,2C02H,2906H,2702H。 DW 2502H,2702H,2502H,2402H,2206H,1D02H。 DW 1D02H,2502H,2502H,2402H,2206H,2902H。 DW 2702H,2502H,2402H,2020H,2208H。 DW 0000H。 END 4 结 束 语 单片机作为一门软硬件相结合的学科,让许多像我这样的非电子专业的学生武汉纺织大学 2020 届毕业设计论文 24 头疼不已。 起初,我也属于一个比较“怕硬”的计算机学生,由于大一大二的数电模电没学好,所以一提到硬件方面的东 西,我就觉得头疼。 最初听余老师讲的单片机的课的时候,属于余老师每问必倒的学生之一。 因此,最初对于这门课并没有多少兴趣。 最初从指令系统,寻址方式,到单片机的内部资源,一点概念都没有。 虽然每次课都看着大屏幕,听着老师讲课,但还是觉得整门课听的比较吃力。 我觉得单片机作为微型计算机的一种,必然和计算机有一定的共性。 后来有一段时间,我在课余的时间去旁听了几堂韩建民老师的《计算机组成原理》,对计算机的指令系统和寻址方式有了点认识,再回过头来看单片机的指令系统的时候觉得慢慢的有头绪了,不再像原先那样摸不着头脑。 实验课做实 验的时候也不再像之前那样呆在实验室不知道该干什么。 当我第一次在试验仪上成功的调试出三角波的程序,看到示波器上的三角波图形,突然觉得单片机也是蛮有意思的,那种感觉就像第一次用 CFREE 第一次在计算机上编写出第一个“ Hello world”程序一样。 之后也就开始慢慢加紧补前面落下的知识。 到要做课程设计的时候,发现依然学到用时方恨少,到图书馆里借书,上网查资料,费了不少劲才完成这次课程设计,虽然做的蛮吃力的,但通过这次课程设计我比较好的对指令系统,内部资源和人机交互的知识大体复习了一遍,发现了不少缺漏,很好的补 缺补漏了一遍。 因为平时时间没合理的安排和利用,课程设计到了最后这一周才完成,可能有不少缺漏或者错误,希望老师加以批评指正。 在此,我要对要求我们做这次课程设计的余老师致以衷心的感谢,因为余老师给了我一次难得的锻炼的机会。 最后,我还要感谢韩建民老师和电子 071 的张琦同学,他们曾多次不厌其烦地为我解答了不少疑惑,使我在对指令系统的理解上少走了不少弯路。 武汉纺织大学 2020 届毕业设计论文 25 参考文献 [1] 张鑫 ,华臻 ,陈书谦 .单片机原理与应用 .[M].电子工业出版社, [2] 肖婧 .单片入门与趣味实验设计 [M].北京航空航天大学出版社, [3] 陈明荧 .8051 单片机课程设计实训教材 [M].清华大学出版社, [4] 赵建领 .51 系列单片机开发宝典 [M].电子工业出版社, [5] 求是科技 .8051 系列单片机 C 程序设计完全手册 [M].人民邮电出版社, [6] 楼然苗 ,李光飞 .51系列单片机设计实例 [M].北京航空航天大学出版社 , [7] 侯媛彬等,凌阳单片机原理及其毕业设计精选 2020 年,科学出版社 [8] 罗亚非,凌阳十六位单片机应用基础 2020 年 北京航空航天大学出版社 [9] 北京北阳电子有限公司, 061A 凌阳单片机及其附带光盘 2020 年 [10]张毅刚等, MCS51 单片机应用设计,哈工大出版社, 2020 年第 2版 [11]霍孟友等,单片机原理与应用,机械工业出版社, [12]霍孟友等,单片机原理与应用学习概要及题解,机械工业出版社, [13]许泳龙等,单片机原理及应用,机械工业出版社, 武汉纺织大学 2020 届毕业设计论文 26 外文资料 Description The AT89C51 is a lowpower, highperformance CMOS 8bit microputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s highdensity nonvolatile memory technology and is patible with the industrystandard MCS51 instruction set and pinout. The onchip Flash allows the program memory to be reprogrammed insystem or by a conventional nonvolatile memory programmer. By bining a versatile 8bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microputer which provides a highlyflexible and costeffective solution to many embedded control applications. Function characteristic The AT89C51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16bit timer/counters, a five vector twolevel interrupt architecture, a full duplex serial port, onchip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The Powerdown Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset. Pin Description VCC: Supply voltage. GND: Ground. Port 0: Port 0 is an 8bit opendrain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as highimpedance 0 may also be configured to be the multiplexed loworder 武汉纺织大学 2020 届毕业设计论文 27 address/data bus during accesses to external program and data memory. In this mode P0 has internal 0 also receives the code bytes during Flash programming,and outputs the code bytes during programverification. External pullups are required during programverification. Port 1 Port 1 is an 8bit bidirectional I/O port with internal Port 1 output buffers can sink/source four TTL 1s are written to Port 1 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 1 pins that are externally being pulled low will source current (IIL) because of the internal 1 also receives the loworder address bytes during Flash programming and verification. Port 2 Port 2 is an 8bit bidirectional I/O port with internal Port 2 output buffers can sink/source four TTL 1s are written to Port 2 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 2 pins that are externally being pulled low will source current, because of the internal 2 emits the highorder address byte during fetches from external program memory and during accesses to external data memory that use 16bit addresses. In this application, it uses strong internal pullupswhen emitting 1s. During accesses to external data memory that use 8bit addresses, Port 2 emits the contents of the P2 Special Function 2 also receives the highorder address bits and some control signals during Flash programming and verification. Port 3 Port 3 is an 8bit bidirectional I/O port with internal Port 3 output buffers can sink/source four TTL 1s are written to Port 3 pins they are pulled high by the internal pullups and can be used as inputs.。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。