51控制舵机(国外英语资料).doc

  1. 1、本文档共20页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 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

文档评论(0)

jgx3536 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:6111134150000003

1亿VIP精品文档

相关文档