没有合适的资源?快使用搜索试试~ 我知道了~
首页中南大学微机实验报告.docx
资源详情
资源评论
资源推荐

微机原理课程设计
实验名称 彩灯控制器
学生姓名
***
学生学号
***
指导教师 彭春华
学 院 计算机学院
专业班级 通信**班
2019 年 9 月 20 日

摘要:本彩灯控制器实现了 8 种彩灯效果,其中 6 种为普通模式:左移
(在 8 个彩灯里只有一个灯亮,亮的状态依次左移,后面类似)、右移、两边
向中间靠拢、中间向两边发散、前四个灯与后四个灯交替亮灭、奇偶灯交替亮
灭,这 6 种模式中,我们设置了 8 次循环,闪烁完便会自动停止,等输入新的
模式号彩灯才会再次闪烁。而后两种模式则有所区别,模式效果分别为循环左
移与循环全亮全灭,不同的是彩灯并不会自动停止,而是一直循环闪烁直至有
新的模式号输入,才会切换其他模式。除了模式号的设置,此控制器还可根据
调节 AD 输入量的大小来控制彩灯效果的移动速度。
本设计的创新点为不仅实现了用 8279 键盘获取模式号,还添加了使用串口
通讯获取模式号以控制彩灯闪烁模式。
Abstract:The color lamp controller achieves eight kinds of color lamp effects,
six of which are normal modes: left shift (only one lamp is on in eight color lamps,
the state of light shifts left in turn, similar behind), right shift, two sides close to the
middle, the middle diverges to both sides, the first four lights turn on and off
alternately with the last four lights, odd and even lights turn on alternately. Out of the
six modes, we set up 8 cycles, and the flashing will stop automatically after it is
finished. Only when the new mode number is input, the color lamp will flicker again.
The latter two modes are different. The effect of the mode is that the cycle moves left
and the cycle turns on and off completely. The difference is that the color lights will
not stop automatically, but will continue to flicker until a new mode number is input
before switching to other modes. In addition to setting the mode number, the
controller can also control the moving speed of the color lamp effect by adjusting the
size of AD input.
The innovation of this design is not only to acquire the mode number with 8279
keyboard, but also to control the flashing mode of the color lamp by using serial
communication.

关键字:彩灯控制器;模式;移动速度;串口通讯
Key words: color lamp controller;mode;moving speed;serial communicatio

目录
一、 需求分析....................................................................................................................................1
1.1 设计意义...............................................................................................................................1
1.2 设计内容...............................................................................................................................1
1.3 设计要求...............................................................................................................................2
1.4 系统功能...............................................................................................................................2
1.4.1 基础功能....................................................................................................................2
1.4.2 扩展功能....................................................................................................................3
1.5 功能描述...............................................................................................................................3
二、 硬件电路设计及描述................................................................................................................4
2.1 硬件电路图...........................................................................................................................5
2.2 设计中使用到的芯片...........................................................................................................6
2.2.1 8279 和 键盘..............................................................................................................7
1) 引脚功能......................................................................................................................7
3) 8279A 的控制命令....................................................................................................10
4) FIFO 状态字..............................................................................................................13
2.2.2 8250 与 RS232.........................................................................................................13
1)数据发送过程.............................................................................................................15
2)数据接收.....................................................................................................................15
三、 软件设计思想及流程..............................................................................................................19
四、 软、硬件调试..........................................................................................................................21
五、 源程序代码..............................................................................................................................25
六、 课程设计体会..........................................................................................................................43
七、 参考文献..................................................................................................................................45
[1] 周荷清,吴秀清.《微型计算机原理与接口技术》.中国科技大学出版社,2008..............45
[2] 舒贞权,任伟利.《微机计算机原理》[M].西安交通大学出版社 ,1997...........................45
[3] 顾元刚,韩燕.《汇编语言与微机原理教程》[M].电子工业出版社,2000........................45
[4] 楼顺天,周社佳,《微机原理与接口技术》[M].科学出版社,2006.................................45

1
一、 需求分析
1.1 设计意义
现代生活中,彩灯越来越成为人们的装饰品,它不仅能美化环境、渲染气
氛,还可用于娱乐场所和电子玩具中,用途十分广泛。彩灯的作用在大多数的
人看来都是起到一个装饰的作用的,但是彩灯的作用远远不只有着一些而已。
我们清楚彩灯在很早之前就出现了,并且人们在一些特定的日子里都会点亮彩
灯的,所以彩灯的使用不仅仅只是起到装饰而已。
在现在很多的大型商场或者是其他的一些超市中,这些彩灯的使用不仅可
以给商场增添更加绚丽多彩的一笔,同时有了这些漂亮彩灯的装饰,一些商品
在这些彩色灯光的照耀下也会变得更加的精致,从而可以吸引到更多顾客们的
注意的,这一点对大多数的商店来说是一个非常好的良性循环的,因此人们也
就可以见到现在不管是在哪些商场中,彩灯的身影一直是少不了的。
因此,本系统采用可编程并行 I/O 接口直接控制 LED 小灯,实现彩灯闪烁
的的各种功能。同时,本系统具有实用性强、操作方便、美观大方等特点。
1.2 设计内容
采用 8255 实现对 8 个彩灯的直接控制,运用 8279 将键盘按键的输入内容
显示到数码管上,8250 实现串口通信,将用户在 PC 机键盘上输入的数字发送
到 CPU 实现模式的选择。使用 ADC0809 将 0~5V 模拟量的输入采样量化为数值
剩余48页未读,继续阅读









安全验证
文档复制为VIP权益,开通VIP直接复制

评论0