欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    微型计算机控制技术课程设计步进电机讲解学习.doc

    • 资源ID:68307028       资源大小:176.50KB        全文页数:11页
    • 资源格式: DOC        下载积分:20金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要20金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    微型计算机控制技术课程设计步进电机讲解学习.doc

    Good is good, but better carries it.精益求精,善益求善。微型计算机控制技术课程设计步进电机-课程设计课程名称微型计算机控制技术题目名称_步进电机角度控制(2)学生学院_自动化_专业班级_学号学生姓名_指导教师_李传芳_2013年06月28日-一、软件设计流程图如下图所示:开始判断键值设定8255A工作方式,A、B口输出,C口PC4PC7输入,PC0PC3输出,故控制字为88H延时驱动电机动作LED显示返回调用延时扫描键盘否是否有键按下是判断键值二、心得与体会这次的课程设计主要针对键盘及可编程接口芯片8255A的编程,在上机调试过程中由于自己的疏忽及算法的不完善导致了程序不能实现预期的功能,经过一遍又一遍的检查和思考,终于完成了这次课程设计的任务。虽然上机调试的经历是痛苦的,但是期间的细节错误给了我们应有的教训,使我们在以后的学习及工作中尽量避免,对于汇编语言的编程也有了进一步的了解加深了对步进电机的理解和使用技巧,设计中,需要对步进电机进行角度控制,即需要对步进电机的角度进行计算分析,以得到所需的步数。总之,这次课程设计锻炼了我解决问题的能力,激发了我的思考,相信通过这次课程设计对我以后对微机的继续学习及以后的工作会有很大的帮助。任务1连接数码管显示电路和键盘电路,实现如下表所示的按键控制,并能够左移显示:360AB72F1.2源程序:STACKSEGMENTSTACKDB64DUP(?)STACKENDSDATASEGMENTORG0030HVAR1DB0FCH,0FCH,0FCH,0FCHVAR5DBOF7H,0FBH,0FDH,0FEHVAR2DB0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCHVAR3DB00H,00H,00H,00H,00H,00H,00H,00HVAR4DB00H,00H,00H,00H,00H,00H,00H,00HTABLE1DB0FCH,60H,0DAH,0F2H,66H,0B6H,0BEH,0E0H,0FEH,0F6H,0EEH,3EH,9CH,7AH,9EH,8EHDATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVAL,88H;8255初始化MOVDX,0606HOUTDX,ALSTT:MOVAL,60HMOVDX,0604HOUTDX,ALNEXT:MOVDX,0604HINAL,DXANDAL,60HCMPAL,60HJNZKEYABCCALLDISPJMPSTT;.键盘扫描.KEYABC:CALLTIMEMOVDX,0604HINAL,DXANDAL,60HCMPAL,60H;PC6PC5=01100000JNZKEYJMPSTTKEY:MOVAL,0FEH;扫描PC0口PC0=0MOVDX,0604HOUTDX,ALMOVDX,0604HINAL,DXTESTAL,20H;检测PC5JNZKEY_FCALLKEYAJMPSTTKKEY_F:TESTAL,040H;检测PC6口JNZKEY_0CALLKEYFJMPSTTKKEY_0:MOVAL,0FDH;扫描PC1口,PC1=0MOVDX,0604HOUTDX,ALMOVDX,0604HINAL,DXTESTAL,20H;检测PC5JNZKEY_2CALLKEY0JMPSTTKKEY_2:TESTAL,040H;检测PC6口JNZKEY_6CALLKEYF;否则是按键2JMPSTTKKEY_6:MOVAL,0FBH;PC2=0MOVDX,0604HOUTDX,ALMOVDX,0604HINAL,DXTESTAL,20H;检测PC5JNZKEY_7CALLKEY6JMPSTTKKEY_7:TESTAL,040H;检测PC6口JNZKEY_3CALLKEY7JMPSTTKKEY_3:MOVAL,0F7HPC3=0MOVDX,0604HOUTDX,ALMOVDX,0604HINAL,DXTESTAL,20H;检测PC5JNZKEY_BCALLKEY3JMPSTTKKEY_B:TESTAL,040H;检测PC6口JNZKEY_111CALLKEYBKEY_111:JMPSTTK;.数字XIANSHI.KEYA:CMPBH,00HJZKEYA_1KEYA_1:CALLLP1MOVAL,0EEHMOVSI,ALMOVAL,0AHMOVDI,ALCALLDISPRETKEYF:CMPBH,00HJZKEYE_1KEYF_1:CALLLP1MOVAL,8EHMOVSI,ALMOVAL,0FHMOVDI,ALCALLDISPRETKEY0:CMPBH,00HJZKEY1_1KEY0_1:CALLLP1MOVAL,0FCHMOVSI,ALMOVAL,00HMOVDI,ALCALLDISPRETKEY2:CMPBH,00HJZKEYF_1KEY2_1:CALLLP1MOVAL,0DHMOVSI,ALMOVAL,02HMOVDI,ALCALLDISPRETKEY6:CMPBH,00HJZKEY7_1KEY6_1:CALLLP1MOVAL,0BEHMOVSI,ALMOVAL,06HMOVDI,ALCALLDISPRETKEY7:CMPBH,00HJZKEYA_1KEY7_1:CALLLP1MOVAL,0E0HMOVSI,ALMOVAL,07HMOVDI,ALCALLDISPRETKEY3:CMPBH,00HJZKEY8_1KEY3_1:CALLLP1MOVAL,0F2HMOVSI,ALMOVAL,03HMOVDI,ALCALLDISPRETKEYB:CMPBH,00HJZKEYB_1KEYB_1:CALLLP1MOVAL,3EHMOVSI,ALMOVAL,0BHMOVDI,ALCALLDISPRETLP1:MOVSI,OFFSETVAR1PUSHAXMOVAL,SI+2MOVSI+3,ALMOVAL,SI+1MOVSI+2,ALMOVAL,SIMOVSI+1,ALPOPAXMOVSI,ALRET;.显示.DISP:PUSHDXPUSHCXMOVSI,OFFSETVAR1MOVDX,0604HMOVAL,11111110BOUTDX,ALMOVDX,0602HMOVAL,SI+3OUTDX,ALDECSICALLTIMEMOVDX,0604HMOVAL,11111101BOUTDX,ALMOVDX,0602HMOVAL,SI+3OUTDX,ALDECSICALLTIMEMOVDX,0604HMOVAL,11111011BOUTDX,ALMOVDX,0602HMOVAL,SI+3OUTDX,ALDECSICALLTIMEMOVDX,0604HMOVAL,11110111BOUTDX,ALMOVDX,0602HMOVAL,SI+3OUTDX,ALDECSICALLTIMEPOPAXPOPDXRET;.延时.TIME:PUSHAXPUSHCXMOVCX,0006HTIME1:MOVAX,0100HTIME2:DECAXJNZTIME2LOOPTIME1POPCXPOPAXRET;.放键测试.STTK:CALLDISPMOVAL,00HMOVDX,0604HOUTDX,ALMOVDX,0604HINAL,DXANDAL,60HCMPAL,60HJNZSTTKJMPSTTCODEENDSENDSTART任务2实现:定义键盘按键:5个为数字键:0、1、3、5、9;3个功能键:设置SET、清零CLR、开始START;按键分布如下表所示:0365SET4STARTCLR2.2源程序:STACKSEGMENTSTACKDB100DUP(?)STACKENDSDATASEGMENTVAR1DBOF7H,0FBH,0FDH,0FEHVAR2DB0FCH,0FCH,0FCH,0FCHVAR5DB00H,00H,00H,00H,00H,00HTABLDB0FCH,60H,0DH,0F2H,66H,0B6H,0BEH,0E0H,0FEH,0F6H,0EEH,3EH,9CH,7AH,9EH,8EHTAB_CDW00HORG0100HVAR3DB64DUP(?)ORG0200HVAR4DW64DUP(?)COUNTDB00HTABLEDB08H,18H,10H,30H,20H,60H,40H,48HD_COUNTDB00HD_TIMESDB00HDATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXPUSHDXMOVAL,88H;8255初始化MOVDX,0606HOUTDX,ALMOVBX,0000HMOVCOUNT,00HMOVD_COUNT,00HMOVD_TIMES,00HSTT:MOVAL,00HMOVDX,0604HOUTDX,ALNEXT:MOVDX,0604HINAL,DXANDAL,60HCMPAL,60HJNZKEYABCCALLDISPJMPSTTPOPDX;.键盘扫描.KEYABC:PUSHDXCALLTIMEMOVDX,0604HINAL,DXANDAL,60HCMPAL,60H;PC6PC5=01100000JNZKEY_5JMPSTTPOPDXKEY_5:MOVAL,0FEH;扫描PC0口MOVDX,0604HOUTDX,ALMOVDX,0604HINAL,DXTESTAL,20H;检测PC5JNZKEY_CLRCALLKEY5;否则是按键5JMPSTTKKEY_CLR:TESTAL,40H;检测PC6口JNZKEY_6CALLKEYCLRJMPSTTKKEY_6:MOVAL,0FDHMOVDX,0604HOUTDX,ALMOVDX,0604HINAL,DXTESTAL,20H;检测PC5JNZKEY_STARTCALLKEY6JMPSTTKKEY_START:TESTAL,40H;检测PC6口JNZKEY_3CALLKEYSTARTJMPSTTKKEY_3:MOVAL,0FBHMOVDX,0604HOUTDX,ALMOVDX,0604HINAL,DXTESTAL,20H;检测PC5JNZKEY_4CALLKEY3JMPSTTKKEY_4:TESTAL,40H;检测PC6口JNZKEY_0CALLKEY4JMPSTTKKEY_0:MOVAL,0F7HMOVDX,0604HOUTDX,ALMOVDX,0604HINAL,DXTESTAL,20H;检测PC5JNZKEY_SETCALLKEY0JMPSTTKKEY_SET:TESTAL,40H;检测PC6口JNZKEY_111CALLKEYSETKEY_111:JMPSTTK;.KEY0:CALLLP1MOVAL,00HMOVDI,ALMOVAL,0FCHMOVSI,ALCALLDISPRETKEY3:CALLLP1MOVAL,03HMOVDI,ALMOVAL,0F2HMOVSI,ALCALLDISPRETKEY4:CALLLP1MOVAL,04HMOVDI,ALMOVAL,66HMOVSI,ALCALLDISPRETKEY5:CALLLP1MOVAL,05HMOVDI,ALMOVAL,0B6HMOVSI,ALCALLDISPRETKEY6:CALLLP1MOVAL,06HMOVDI,ALMOVAL,0BEHMOVSI,ALCALLDISPRET;.KEYSTART:CMPCOUNT,00HJZSTA1MOVAL,COUNTCBWPUSHAXMOVSI,OFFSETVAR4MOVDI,OFFSETTABLEMOVDL,00HSTA4:MOVBX,SIMOVAX,SI+2MOVDH,0FHDIVDHMOVDH,04HMULDHINCSIINCSIINCSIINCSIPUSHAXSTA5:POPAXMOVCX,AXPUSHAXSTA2:PUSHDXMOVAL,DIMOVDX,0600HOUTDX,ALPOPDXINCDIINCDLCALLDISP1CALLDALLY1CMPDL,08HJNZSTA3MOVDL,00HMOVDI,OFFSETTABLESTA3:LOOPSTA2CALLDISP1DECBXJNZSTA5INCD_COUNTMOVAL,COUNTPOPAXCALLDISP1DECCOUNTJNZSTA4POPAXCALLDISP1DECCOUNTJNZSTA4POPAXMOVCOUNT,ALMOVD_COUNT,00HMOVTAB_C,DIMOVCL,DLSTA1:RET;.KEYSET:LEASI,VAR2LEADI,VAR3MOVAL,COUNTCBWADDDI,AXADDDI,AXADDDI,AXADDDI,AXMOVCX,0004HSET1:MOVAL,SIMOVDI,ALINCDIINCSILOOPSET1LEASI,VAR5MOVDX,0000HMOVDI,OFFSETVAR4MOVAL,COUNTCBWADDDI,AXADDDI,AXADDDI,AXADDDI,AXMOVAL,SIMOVDI,ALMOVAL,SI+1MOVBL,64HMULBLADDDX,AXMOVAL,SI+2MOVCL,0AHMULBLADDDX,AXMOVBL,SI+3CBWADDAX,DXMOVDI+2,AXMOVCX,0004HLEASI,VAR2LEADI,VAR5SET2:MOVSI,0FCHMOVDI,00HINCSIINCDILOOPSET2CALLDISPINCCOUNTRET;.KEYCLR:CMPCOUNT,00HJZCLR1MOVDI,TAB_CMOVSI,OFFSETVAR4MOVDL,CLTESTDL,DLJNZCLR6MOVDL,08HMOVDI,OFFSETTABLEMOVAL,07HCBWADDDI,AXCLR6:DECDIDECDLCLR4:MOVBX,SIMOVAX,SI+2MOVDH,0FHDIVDHMOVDH,04HMULDHINCSIINCSIINCSIINCSIPUSHAXCLR5:POPAXMOVCX,AXPUSHAXCLR2:PUSHDXMOVAL,DIMOVDX,0600HOUTDX,ALPOPDXDECDIDECDLCALLDALLYTESTDL,DLJNZCLR3MOVDL,08HMOVDI,OFFSETTABLEMOVAL,07HCBWADDDI,AXCLR3:LOOPCLR2DECBXJNZCLR5MOVAL,COUNTPOPAXDECCOUNTJNZCLR4MOVCOUNT,00HCLR1:MOVCX,0004HLEASI,VAR3LEADI,VAR4CLR7:MOVSI,0FCHMOVDI,00HINCSIINCDILOOPCLR7CALLCLRRCALLDISPRET;.DISP1:PUSHAXPUSHBXPUSHCXPUSHDXPUSHSIPUSHDIMOVD_TIMES,BLMOVAL,D_COUNTCBWMOVBX,OFFSETTABLMOVSI,OFFSETVAR1MOVDI,OFFSETVAR3ADDDI,AXADDDI,AXADDDI,AXADDDI,AXMOVAL,SIMOVDX,0604HOUTDX,ALMOVAL,D_TIMESXLATMOVDX,0602HOUTDX,ALCALLTIMEINCSIINCDIMOVCX,0003HDIR1:MOVAL,SIMOVDX,0604HOUTDX,ALMOVAL,DIMOVDX,0602HOUTDX,ALCALLTIMEINCSIINCDILOOPDIR1POPDIPOPSIPOPDXPOPCXPOPBXPOPAXRET;LP1:MOVCX,0003HLEASI,VAR2LEADI,VAR5LP2:MOVAL,SI+1MOVSI,ALMOVAL,DI+1MOVDI,ALINCDIINCSILOOPLP2RET;DISP:LEASI,VAR1LEADI,VAR2MOVCX,0004HDIR:MOVAL,SIMOVDX,0604HOUTDX,ALMOVAL,DIMOVDX,0602HOUTDX,ALCALLTIMEINCSIINCDILOOPDIRRET;.CLRR:MOVCX,0004HLEASI,VAR2LEADI,VAR5CLR8:MOVSI,0FCHINCSILOOPCLR8RET;.TIME:PUSHAXPUSHCXMOVCX,0010HTIME1:MOVAX,00300HTIME2:DECAXJNZTIME2LOOPTIME1POPCXPOPAXRETDALLY:PUSHCXPUSHAXMOVCX,1000HA6:MOVAX,0010HA7:DECAXJNZA7LOOPA6POPAXPOPCXRETDALLY1:PUSHCXPUSHAXMOVCX,0010HAA6:MOVAX,0500HAA7:DECAXJNZAA7LOOPAA6POPAXPOPCXRET;.放键测试.STTK:CALLDISPMOVAL,00HMOVDX,0604HOUTDX,ALMOVDX,0604HINAL,DXANDAL,60HCMPAL,60HJNZSTTKJMPSTTCODEENDSENDSTART

    注意事项

    本文(微型计算机控制技术课程设计步进电机讲解学习.doc)为本站会员(1595****071)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开