msp430乒乓球游戏机.doc
文本预览下载声明
中国地质大学(北京)
实 验 报 告
实验名称:采用MSP430G2553 实现乒乓球游戏机
姓 名:
学 号:
指导教师: 张启升
实验时间: 2016年月 - 2 -
二、实验内容与步骤 - 2 -
2.1实验内容: - 2 -
2.2实验步骤: - 2 -
三、系统设计 - 3 -
3.1 总体设计 - 3 -
3.2硬件: - 3 -
3.3软件: - 4 -
四、软件单元电路设计 - 4 -
4.1 PWM波信号产生单元 - 4 -
4.2 串口发送模块 -6-
4.3 定时中断程序 - 8 -
4.4 按键中断模块 - 8 -
4.5 Flash模块 - 10 -
六、硬件单路整体外观与显示效果 - 12 -
显示效果 - 12-
七、 个人感想 - 15-
八、 参考文献 与 附录 - 15-
8.1参考文献: - 15-
8.2附录: - 15-
8.3全部代码: - 16 -
摘要
MSP430单片机通过两条I/O 信号输出两组脉宽调制波,经过低通滤波器提取脉宽调制的均值电压,输入到双通道示波器中。示波器工作在X/Y 模式。示波器屏幕上的光电代表乒乓球。乒乓球在X/Y 电压的控制下在屏幕上移动。
Abstract
MSP430 single chip microcomputer through two I/O signal output, two groups of pulse width modulation wave through a low-pass filter to extract the average voltage of pulse width modulation, the input to the double-channel oscillograph.Oscilloscope work in X/Y mode.Photoelectric oscillograph screen on behalf of table tennis.Table tennis in the X/Y voltage under the control of movement on the screen.MSP430 single chip microcomputer through two I/O signal output, two groups of pulse width modulation wave through a low-pass filter to extract the average voltage of pulse width modulation, the input to the double-channel oscillograph.Oscilloscope work in X/Y mode.Photoelectric oscillograph screen on behalf of table tennis.Table tennis in the X/Y voltage under the control of movement on the screen.
实验题目:采用MSP430G2553 实现乒乓球游戏机
一、实验目的
1、通过此次实验掌握采用MSP430G2553编程的具体步骤;
2、串口编程中要掌握的包括串口的设置、串口的读写操作等;
3、熟悉模电硬件电路的设计与焊接;
4、掌握如何调试电路和软件编程的结合。
二、实验内容与步骤
2.1实验内容:
1.构造两组无源低通滤波器,使得msp430 可以用脉宽调制方式控制球的位置
2.用给定的运放制作一放大器,使光点运动范围在示波器的X 轴,Y 轴方向上可调
3.乒乓球可按抛物线自动在屏幕上左右弹射,球的落点为屏幕两侧边的中间
4.使用两个按钮分别作为左侧击球按钮和右侧击球钮。当乒乓球靠近屏幕左边时
按下左侧击球钮,可将球击回右侧。右侧击球钮亦然
5.建立成败机制。即球抵达边沿而未按下击球按钮,记为击球失败,用LED 灯光表示
6.建立记分机制,用串口在电脑上上显示双方得分
7.特殊功能,在不调整放大器的情况下,连按两下击球钮能击出高抛球,轨迹抛物线曲率变大
8.利用片内flash 加入比分断电自保存功能
2.2实验步骤:
先确定方案和硬件电路设计图。
开始软件编程和硬件电路的焊接。
下载程序,进行调试,优化程序。
三、系统设计
3.1 总体设计
总体设计框图
3.2硬件:
杜邦线连接P1.3、P1.4口到两个按键,P2.1和P2.5分别是两个PWM波输出分别连接
显示全部