资源描述:
《计算机控制课程设计--步进电机角度控制》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、课程设计课程名称_计算机控制技术题目名称_步进电机角度控制(1)学生学院_自动化学院________专业班级_自动化10____学号____学生姓名________指导教师__李传芳______2013年7月1日二、步进电机角度控制程序流程图:显示清零电机反转开始扫描键盘是否有按键?是否按set键?是否按start键?是否按set键?显示子程序A/D转换扫描键盘电机正转数据储存数据处理是否完成所有?YYYYYNNNNN初始化程序:STACKSEGMENTSTACKDW256DUP(?)STACKENDSDATASEGMENTOR
2、G0000HTABLEDB03FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH,77H,7CH,39H,5EH,79H,71HORG0010HSBUF1DB4DUP(0)MAXDW1DUP(0)SBUF3DB0F7H,0FBH,0FDH,0FEHJIAODUDW2DUP(0)ADRESULTDB1DUP(0)PAISHUDB1DUP(0)JIPAIDB1DUP(0)BUXUBIAODB01H,03H,02H,06H,04H,0CH,08H,09HSIGNDB4DUP(0)DATAENDSCODESEG
3、MENTASSUMECS:CODE,DS:DATA,SS:STACKSTART:MOVAX,DATAMOVDS,AXMOVAL,88HMOVDX,0606HOUTDX,ALMOVBX,0000HSTT:MOVAL,00HMOVDX,0602H;OUTDX,ALNEXT:MOVDX,0604HINAL,DXANDAL,0C0HCMPAL,0C0HJNZKEYABCCALLDISPJMPBUJIKEYABC:CALLTIMEMOVDX,0604HINAL,DXANDAL,0C0HCMPAL,0C0HJNZKEY_3KEY_3:MOV
4、AL,0FEHMOVDX,0602HOUTDX,ALMOVDX,0604HINAL,DXTESTAL,80H;JNZKEY_CLR;CALLKEY3JMPSTTKKEY_CLR:TESTAL,40HJNZKEY_6CALLKEYCLRJMPSTTKKEY_6:MOVAL,0FDHMOVDX,0602HOUTDX,ALMOVDX,0604HINAL,DXTESTAL,80HJNZKEY_STARTCALLKEY6JMPSTTKKEY_START:TESTAL,40HJNZKEY_SETCALLKEYSTARTJMPSTTKKEY_
5、SET:MOVAL,0FBHMOVDX,0602HOUTDX,ALMOVDX,0604HINAL,DXTESTAL,80HJNZKEY_7CALLKEYSETJMPSTTKKEY_7:TESTAL,40HJNZKEY_0CALLKEY7JMPSTTKKEY_0:MOVAL,0F7HMOVDX,0602HOUTDX,ALMOVDX,0604HINAL,DXTESTAL,80HJNZKEY_2CALLKEY0JMPSTTKKEY_2:TESTAL,40HJNZKEY_NOCALLKEY2KEY_NO:JMPSTTKKEY0:LEAS
6、I,SIGNMOVBL,[SI]CMPBL,01HJNEKEY0_1CALLLP1MOVAL,00HMOV[SI+3],ALCALLDISPKEY0_1:RETKEY2:LEASI,SIGNMOVBL,[SI]CMPBL,01HJNEKEY2_1CALLLP1MOVAL,02HMOV[SI+3],ALCALLDISPKEY2_1:RETKEY3:LEASI,SIGNMOVBL,[SI]CMPBL,01HJNEKEY3_1CALLLP1MOVAL,03HMOV[SI+3],ALCALLDISPKEY3_1:RETKEY6:LEAS
7、I,SIGNMOVBL,[SI]CMPBL,01HJNEKEY6_1CALLLP1MOVAL,06HMOV[SI+3],ALCALLDISPKEY6_1:RETKEY7:LEASI,SIGNMOVBL,[SI]CMPBL,01HJNEKEY7_1CALLLP1MOVAL,07HMOV[SI+3],ALCALLDISPKEY7_1:RETKEYSET:LEASI,SIGNMOVBL,01HMOV[SI],BLRETKEYSTART:LEASI,SIGNMOVBL,[SI]CMPBL,01HJNEKEYSTART_1MOVAX,0M
8、OVBX,0MOVCX,0LEASI,SBUF1LEADI,MAXMOVAL,[SI]ADDCX,AXMOVAL,[SI+1]MOVBL,10MULBLADDCX,AXMOVAX,0MOVAL,[SI+2]MOVBL,100MULBLADDCX,AXMOV[DI