- 1、本文档共20页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
51控制舵机(国外英语资料)
51控制舵机(国外英语资料)
I am also doing steering control, which is to control a steering gear procedures, you can refer to!
Through the button to change the microcontroller output pulse width of 1ms~2ms, so that the steering gear at -90 degrees ~+90 degrees between rotation
ORG 0000H
AJMP MAIN; Master Program
ORG 000BH
AJMP INTT0; turn off interrupt subroutine
MAIN:, MOV, SP, #80H
SETB EA; open total interrupt
SETB ET0; allows T0 interrupts
CLR P3.7; the beginning of pulse waveform
MOV, TMOD, #01H; timed, 0
MOV, 30H, #2EH; servo 0 bit, 1.5ms timing initial value, TL0 value stored 30H
MOV, 31H, #0FAH; TH0, 31H
MOV, 32H, #0B2H; 18.5ms timing initialization, TL0 value stored 32H
MOV, 33H, #0B7H; TH0 save 33H
CLR F0; clear flag bit
SETB TR0; start T0
K1:, JB, P1.4, K2; right turn key is not pressed, turn K2, turn left turn key
ACALL D10MS; press, delay, anti shake
JNB, P1.4, $; pending release
ACALL D10MS
MOV, A, 30H
CJNE, A, #3AH, K10; determine whether to 90 degrees
AJMP K2; to 90 degrees, without changing the timing time constant, turn K2
K10: CLR C; less than 90 degrees, clear carry bits, the next instruction is carry less, must first clear carry
SUBB, A, #20; reduce the time constant, that is, to increase the high level pulse width, each time the 0.02ms increases, the steering gear rotates 3.6 degrees
JNC K11
DEC 31H; borrow
K11:, MOV, 30H, A
CLR C
MOV, A, 32H
ADD, A, #20; increase the time constant, that is, to reduce the low level pulse width
JNC K12
INC 33H
K12:, MOV, 32H, A
K2:, JB, P1.5, K3
ACALL D10MS
JNB P1.5, $
ACALL D10MS
MOV, A, 30H
CJNE, A, #22H, K20
AJMP K3
K20: CLR C
ADD, A, #20
JNC K21
INC 31H
K21:, MOV, 30H, A
CLR C
MOV, A, 32H
SUBB, A, #20
JNC K22
DEC 33H
K22:, MOV, 32H, A
CLR C
K3:, JB, P1.6, K1; determine whether the 0 key of the motor is pressed
ACALL D10MS
JNB P1.6, $
ACALL D10MS
MOV, 30H, #2EH; servo 0 bit, pulse width 1.5ms
MOV, 31H, #0FAH
MOV, 32H, #0B2H
MOV, 33H, #0B7H
AJMP K1
INTT0: CPL F0; interrupt service routine
CPL P3.7; outputs high and low le
您可能关注的文档
- 2011.7中国古代历史自考题(国外英语资料).doc
- 2010级创业前锋班招新流程(国外英语资料).doc
- 20110831扬善必先惩恶(国外英语资料).doc
- 2011全球雇员指数调研之:国内人才流动(国外英语资料).doc
- 2010心肺复苏(国外英语资料).doc
- 2011口腔颌面外科学试卷及答案(国外英语资料).doc
- 2011家纺展会信息(国外英语资料).doc
- 2011年02月14日 金黔在线-贵州日报 纳赖村:火红春联谢党恩(图)(国外英语资料).doc
- 2010 高考分析暨 2011 备考建议(国外英语资料).doc
- 2011年4月大学生入党申请书范文3000(国外英语资料).doc
最近下载
- 2024年部编版四年级上册语文大单元作业设计第二单元作业单.pdf VIP
- 美国Megger IDAX300-350绝缘诊断分析仪使用说明书.pdf
- 六年级语文上册1-2单元测试(原卷+答案)2023-2024学年 部编版.docx
- 重油催化裂解增产丙烯研究进展.doc VIP
- 《食品添加剂应用技术》第二版 课件 任务4.2 增稠剂的使用.pptx
- 2023全国青少年文化遗产知识大赛题库附答案(401 -600 题).docx
- 双减背景下新课标单元整体作业分层设计案例 人教版初中英语八年级上册 Unit 1 Where did you go on.docx
- 《哈利波特》书籍分享ppt课件(图文).pptx
- 2.2 中国的气候第1课时 气候复杂多样教学设计 2023-2024学年湘教版地理八年级上册.docx
- 《中国特色社会主义道路的开辟与发展》参考课件.pptx VIP
文档评论(0)