下载

1下载券

加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 微机原理与接口技术课程设计实验报告1_电子时钟,汇编,8253+8255+8259

微机原理与接口技术课程设计实验报告1_电子时钟,汇编,8253+8255+8259.docx

微机原理与接口技术课程设计实验报告1_电子时钟,汇编,8253…

据说恋爱回来过_
2017-06-11 0人阅读 举报 0 0 暂无简介

简介:本文档为《微机原理与接口技术课程设计实验报告1_电子时钟,汇编,8253+8255+8259docx》,可适用于其他资料领域

微机原理与接口技术课程设计实验报告电子时钟,汇编,目录一、课程设计目的·······································································································二、课程设计任务·····································································错误!未定义书签。、内容···················································································································、要求···················································································································、设计环境···········································································································、设计所用设备···································································································三、设计所用芯片结构·······························································································、A芯片的内部结构及引脚·······································································、芯片的内部结构及引脚··········································································、芯片的内部结构及引脚··········································································四、具体模块设计·······································································································、概述···················································································································、主程序模块·······································································································、小键盘模块·······································································································、显示模块···········································································································、定时模块···········································································································五、程序流程图··········································································································主程序流程图:··································································································键盘扫描程序流程图:(KEY)······································································中断处理程序流程图:·······················································································六、心得体会··············································································································附录一:参考书目·····································································································附录二:部分源代码·································································································一、课程设计目的和意义通过本次课程设计要掌握此三种芯片使用的方法灵活运用课本知识加深所学的知识对所学的相关芯片的原理、内部结构、使用方法等有更加深刻的了解学会利用课本知识联系实际应用及编程。同时并了解综合问题的程序设计掌握实时处理程序的编制和调试方法掌握一般的设计步骤和流程使我们以后搞设计时逻辑更加清晰。二、开发环境及设备①设计环境PC机一台、windowsXP系统、实验箱、导线若干。②设计所用设备定时器:用于产生秒脉冲其输出信号可作为中断请示信号送IRQ。并口:用做接口芯片和小键盘相连。中断控制器:用于产生中断。LED:六个LED用于显示时:分:秒值。小键盘:用于控制设置。三、设计思想与原理、设计思想本系统设计的电子时钟以微处理器作为CPU用做定时计数器产生时钟频率做可编程并行接口显示时钟和键盘电路做中断控制器产生中断。在此系统中的功能是定时接入的CLK信号为周期性时钟信号。采用计数器工作于方式使的OUT端输出周期性的负脉冲信号。即每隔ms的OUT端就会输出一个负脉冲的信号此信号接的IR当中断到次数后CPU即处理使液晶显示器上的时间发生变化。其中只需初始化ICW其功能是向表明IRx输入是电瓶触发方式还是上升沿触发方式是单片还是多片。接收到信号后产生中断信号送CPU处理。、设计原理利用实验台上提供的定时器和扩展板上提供的以及键盘和数码显示电路设计一个电子时钟由中断定时小键盘控制电子时钟的启停及初始值的预置。电子时钟的显示格式HH:MM:SS由左到右分别为时、分、秒最大记时::超过这个时间时分秒位都清零从::重新开始。基本工作原理:每百分之一秒对百分之一秒寄存器的内容加一并依次对秒、分、小时寄存器的内容加一六个数码管动态显示时、分、秒的当前值。利用实验台上提供的定时器和扩展板上提供的以及键盘和数码显示电路设计一个电子时钟由中断定时小键盘控制电子时钟的启停及初始值的预置。电子时钟的显示格式HH:MM:SS由左到右分别为时、分、秒最大记时::超过这个时间时分秒位都清零从::重新开始。本实验要求设计一个定时显示装置用六个数码管显示时间用小键盘控制计时设置和显示时间。系统一运行就从点分秒开始计时并在数码管上显示时、分、秒当前值而且可以用键盘设置当前时间。基本工作原理:每百分之一秒对百分之一秒寄存器的内容加一并依次对秒、分、小时寄存器的内容加一六个数码管动态显示时、分、秒的当前值。C键:置初值显示::G键:显示动态变化(启动表)D键:显示静态不变(表停止)E键:终止程序返回DOSP键:设置时:分:秒的值、设计环境PC机一台、windowsXP系统、实验箱导线若干。、设计所用设备定时器:用于产生秒脉冲其输出信号可作为中断请示信号送IRQ。并口:用做接口芯片和小键盘相连。中断控制器:用于产生中断。LED:六个LED用于显示时:分:秒值。小键盘:用于控制设置。三、设计所用芯片结构、A芯片的内部结构及引脚中断控制器A是Intel公司专为控制优先级中断而设计开发的芯片。它将中断源优先排队、辨别中断源以及提供中断矢量的电路集中于一片中。因此无需附加任何电路只需对A编程就可以管理级中断并选择优先模式和中断请求方式即中断结构可以由用户编程来设定。在MD微机系统中芯片工作于单片方式。引脚图如图各引脚功能如下。D~D八条双向数据线WR(低电平有效)写输入信号RD(低电平有效)读输入信号CS(低电平有效)片选输入信号A地址信号INT中断请求信号INTA(低电平有效)中断响应信号CAS~CAS级联信号形成一条专用A总线以便多片A的级联SPEN从编程允许级联。在缓冲方式中可用做输出信号以控制总线缓冲器的接收和发送。在非缓冲方式中作为输入信号用于表示主片还是从片IR~IR外部中断请求输入线。要求输入的中断请求信号是由低电平到高电平的上升沿(并保持高电平到CPU响应时为止)或者是高电平。中断矢量地址与中断信号之间的关系如表所示:可编程定时计数器是Intel公司生产的通用外围芯片之一有个独立的十六位计数器技术频率范围为~MHZ它所有的技术方式和操作方式都通过编程控制。的功能用途是:()()()()()()()延时中断可编程频率发生器事件计数器二进倍频器实时时钟数字单稳复杂的电机控制器有六种工作方式:()()()()()方式:计数结束中断方式:可编程频率发生器方式:频率发生器方式:方波频率发生器方式:软件触发的选通信号()方式:硬件触发的选通信号引脚图如图示各引脚功能如下。D~D八条双向数据线WR(低电平有效)写输入信号RD(低电平有效)读输入信号CS(低电平有效)片选输入信号A、A片内寄存器地址输入信号CLK计数输入用于输入定时基准脉冲或计数脉冲OUT输出信号以相应的电平指示计数的完成或输出脉冲波形GATE选通输入(门控输入)用于启动或禁止计数器的操作以使计数器和计测对象同步。、端口地址表端口地址表四、具体模块设计本系统设计的电子钟以微处理器作为CPU用做定时计数器产生时钟频率做可编程并行接口显示时钟和键盘电路做中断控制器产生中断。在此系统中的功能是定时接入的CLK信号为周期性时钟信号。采用计数器工作于方式使的OUT端输出周期性的负脉冲信号。即每隔ms的OUT端就会输出一个负脉冲的信号此信号接的IR当中断到次数后CPU即处理使液晶显示器上的时间发生变化。程序由以下模块组成:系统共有个功能模块分别为主控模块显示模块定时模块中断模块小键盘模块。系统框图如下:、主程序模块图一系统框图主控模块是系的核心模块对、A进行初始化设置中断向量扫描键盘根据按键值作相应的处理。主要由软件实现。它的主要功能是调用其它模块对系统工作进行协调它的主要功能是读小键盘输入键值并执行要做的工作如果键值为C则将显示初始值::置入显示缓冲并调用显示模块显示。如果键值为G则开中断(中断程序为秒最低位加一)。如果键值为D则关中断停止动态显示。如健值为P则连续六次调用小键盘模块将键值依次存入显示缓冲。并调用显示模块显示。如果健值为E则终止程序返回DOS。、小键盘模块小键盘模块送入主控模块的子功能模块。由软件和硬件实现硬件上由小键盘和互连将小键值由送入主控模块。软件上使用行扫描法获得键值并送回主控模块。本课题只考虑去抖动。执行一个约ms的延时程序后再扫描键盘若F=表示真正有键按下从而消除了抖动影响。实现代码如下:KEYROCNEARPUSHCXKST:MOVAL,HMOVDX,PCTLOUTDX,ALMOVAL,HMOVDX,PAOUTDX,ALMOVDX,PBINAL,DXORAL,FHCMPAL,FFHJZDELAYMOVCX,HDLY:LOOPDLYMOVCL,HMOVAH,FEHSCAN:MOVDX,PAMOVAL,AHOUTDX,ALMOVDX,PBINAL,DXORAL,FHCMPAL,FFHJNZKEYNROLAH,DECCLJNZSCANJMPKSTKEYN:PUSHAXMOVDX,PBRELEA:INAL,DXORAL,FHCMPAL,FFHJNZRELEAPOPAXNOTAXMOVSI,OFFSETTABLEMOVDI,OFFSETCHARMOVCX,TT:CMPAX,SIJZNNDECCXJZKSTADDSI,INCDIJMPTTNN:MOVDL,DIMOVCHAR,DLMOVAH,HINTHPOPCXJMPYANGDELAY:CALLDISPLYJMPKSTYANG:RETKEYENDP、显示模块显示模块是将显示缓冲区的数值送到LED显示的功能模块显示缓冲区是由六个字节构成分别保存小时的高位和低位分钟的高位和低位秒钟的高位和低位。硬件上由六个LED构成软件上由扫描显示的方法实现。实现代码如下:DISPLAYPROCNEARMOVCX,FFHLED:CALLDISUPLOOPLEDDISUP:PUSHCXMOVDI,OFFSETMINMOVCL,DISUP:MOVAL,MOVDX,PORTBITOUTDX,ALMOVAL,DIMOVBX,OFFSETLEDXLATMOVDX,PORTSEGOUTDX,ALMOVAL,CLMOVDX,PORTBITOUTDX,ALMOVBX,HDELAY:DECBXJNZDELAYCMPCL,HJZDISUPINCDISHLCL,JMPDISUPDISUP:POPCXRETDISPLAYENDP、定时模块定时模块是为提供中断请求信号的。由一片实现选用定时器#工作在方式由时钟应该秒走动一次所以输出值应为S其输出信号可作为的中断请求信号。、中断处理模块中断模块实现动态显示的硬件为一片由于中断请求信号为每秒一次中断程序该为时间按秒增加并显示只要开中断便可实现每秒显示时间增加一秒从而达到动态显示的效果。、按如下接线图连接好试验箱上的芯片引脚主要用到器件有,,LED,,小键盘。的片选接地址FOUT,OUT接灯(测试用)GATE,GATE接VCLK接的IRQCLK接Q(分频)。键盘扫描程序流程图:(KEY)中断处理程序流程图:六、心得体会附录一:参考书目、戴梅萼史嘉权编著微型计算机技术及应用(第三版)北京:清华大学出版社,、周明德编著微型计算机系统原理及应用(第四版)北京:清华大学出版社,、李顺增吴国东赵河明等微机原理及接口技术北京:机械工业出版社,、杨立新微型计算机原理和应用M北京:科学技术文献出版社、李大友微型计算机原理M北京:清华大学出版社、眭碧霞微型计算机原理与组成M人民邮电出版社附录二:部分源代码目录一、课程设计目的·······································································································二、课程设计任务·····································································错误!未定义书签。、内容···················································································································、要求···················································································································、设计环境···········································································································、设计所用设备···································································································三、设计所用芯片结构·······························································································、A芯片的内部结构及引脚·······································································、芯片的内部结构及引脚··········································································、芯片的内部结构及引脚··········································································四、具体模块设计·······································································································、概述···················································································································、主程序模块·······································································································、小键盘模块·······································································································、显示模块···········································································································、定时模块···········································································································五、程序流程图··········································································································主程序流程图:··································································································键盘扫描程序流程图:(KEY)······································································中断处理程序流程图:·······················································································六、心得体会··············································································································附录一:参考书目·····································································································附录二:部分源代码·································································································一、课程设计目的和意义通过本次课程设计要掌握此三种芯片使用的方法灵活运用课本知识加深所学的知识对所学的相关芯片的原理、内部结构、使用方法等有更加深刻的了解学会利用课本知识联系实际应用及编程。同时并了解综合问题的程序设计掌握实时处理程序的编制和调试方法掌握一般的设计步骤和流程使我们以后搞设计时逻辑更加清晰。二、开发环境及设备①设计环境PC机一台、windowsXP系统、实验箱、导线若干。②设计所用设备定时器:用于产生秒脉冲其输出信号可作为中断请示信号送IRQ。并口:用做接口芯片和小键盘相连。中断控制器:用于产生中断。LED:六个LED用于显示时:分:秒值。小键盘:用于控制设置。三、设计思想与原理、设计思想本系统设计的电子时钟以微处理器作为CPU用做定时计数器产生时钟频率做可编程并行接口显示时钟和键盘电路做中断控制器产生中断。在此系统中的功能是定时接入的CLK信号为周期性时钟信号。采用计数器工作于方式使的OUT端输出周期性的负脉冲信号。即每隔ms的OUT端就会输出一个负脉冲的信号此信号接的IR当中断到次数后CPU即处理使液晶显示器上的时间发生变化。其中只需初始化ICW其功能是向表明IRx输入是电瓶触发方式还是上升沿触发方式是单片还是多片。接收到信号后产生中断信号送CPU处理。、设计原理利用实验台上提供的定时器和扩展板上提供的以及键盘和数码显示电路设计一个电子时钟由中断定时小键盘控制电子时钟的启停及初始值的预置。电子时钟的显示格式HH:MM:SS由左到右分别为时、分、秒最大记时::超过这个时间时分秒位都清零从::重新开始。基本工作原理:每百分之一秒对百分之一秒寄存器的内容加一并依次对秒、分、小时寄存器的内容加一六个数码管动态显示时、分、秒的当前值。利用实验台上提供的定时器和扩展板上提供的以及键盘和数码显示电路设计一个电子时钟由中断定时小键盘控制电子时钟的启停及初始值的预置。电子时钟的显示格式HH:MM:SS由左到右分别为时、分、秒最大记时::超过这个时间时分秒位都清零从::重新开始。本实验要求设计一个定时显示装置用六个数码管显示时间用小键盘控制计时设置和显示时间。系统一运行就从点分秒开始计时并在数码管上显示时、分、秒当前值而且可以用键盘设置当前时间。基本工作原理:每百分之一秒对百分之一秒寄存器的内容加一并依次对秒、分、小时寄存器的内容加一六个数码管动态显示时、分、秒的当前值。C键:置初值显示::G键:显示动态变化(启动表)D键:显示静态不变(表停止)E键:终止程序返回DOSP键:设置时:分:秒的值、设计环境PC机一台、windowsXP系统、实验箱导线若干。、设计所用设备定时器:用于产生秒脉冲其输出信号可作为中断请示信号送IRQ。并口:用做接口芯片和小键盘相连。中断控制器:用于产生中断。LED:六个LED用于显示时:分:秒值。小键盘:用于控制设置。三、设计所用芯片结构、A芯片的内部结构及引脚中断控制器A是Intel公司专为控制优先级中断而设计开发的芯片。它将中断源优先排队、辨别中断源以及提供中断矢量的电路集中于一片中。因此无需附加任何电路只需对A编程就可以管理级中断并选择优先模式和中断请求方式即中断结构可以由用户编程来设定。在MD微机系统中芯片工作于单片方式。引脚图如图各引脚功能如下。D~D八条双向数据线WR(低电平有效)写输入信号RD(低电平有效)读输入信号CS(低电平有效)片选输入信号A地址信号INT中断请求信号INTA(低电平有效)中断响应信号CAS~CAS级联信号形成一条专用A总线以便多片A的级联SPEN从编程允许级联。在缓冲方式中可用做输出信号以控制总线缓冲器的接收和发送。在非缓冲方式中作为输入信号用于表示主片还是从片IR~IR外部中断请求输入线。要求输入的中断请求信号是由低电平到高电平的上升沿(并保持高电平到CPU响应时为止)或者是高电平。中断矢量地址与中断信号之间的关系如表所示:

VIP免券下载文档

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/12

微机原理与接口技术课程设计实验报告1_电子时钟,汇编,8253+8255+8259

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利