51控制舵机(国外英文资料).docVIP

  1. 1、本文档共23页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  5. 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  6. 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  7. 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  8. 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
51控制舵机(国外英文资料)

51控制舵机(国外英文资料) I am also in the steering machine control now, this is the program that controls a steering machine, can be referenced! Changing MCU by keys, the output pulse width 1 ~ 2 ms, ms in steering gear - 90 ° ~ + 90 ° rotation ORG 0000 h AJMP MAIN; Turn the main program ORG 000 bh AJMP INTT0; Turn the timer interrupt subroutine MAIN: MOV SP, # 80 h SETB EA. Open always interrupt SETB ET0; Allow the T0 interrupt The CLR P3.7; The initial state of the pulse waveform MOV TMOD # 01H; Timing and mode 0 MOV h, 30 # 2 eh; The steering gear is 0, 1.5 ms time initializer, and TL0 value is 30H 31 h MOV, # 0 fah; TH0 values to save 31 h MOV 32 h # 0 b2h; 18.5 ms time initial value, TL0 value is 32H MOV 33 h # 0 b7h; TH0 33 h The CLR F0; Clear sign bit SETB TR0; Start the T0 K1: JB P1.4, K2; Turn the right button, turn K2, and turn the left key ACALL D10MS; Press, delay, shake JNB P1.4, $; Waiting for the release of ACALL D10MS MOV. A, 30 h CJNE A. Determine whether to 90 ° AJMP K2. To 90 °, dont change timing time constant, K2 K10: CLR C; Not to 90 °, clear the carry bit, under the instruction to carry, must carry SUBB A, # 20; Reduce the time constant, that is, more high level pulse width, increasing every 0.02 ms, steering gear rotational 3.6 ° JNC K11 DEC 31 h; A borrow K11: MOV 30 h, A The CLR C MOV. A, 32 h ADD A, # 20; Increasing the time constant means reducing the low level pulse width JNC K12 INC 33 h K12: MOV 32 h, A K2: JB P1.5, K3 ACALL D10MS JNB P1.5, $ ACALL D10MS MOV. A, 30 h CJNE A, # 22 h, K20 AJMP K3 K20: CLR C ADD A, # 20 JNC K21 31 h INC. K21: MOV 30 h, A The CLR C MOV. A, 32 h SUBB A, # 20 JNC K22 DEC 33 h K22: MOV 32 h, A The CLR C K3: JB P1.6, K1; Determine whether the motor return 0 is pressed ACALL D10MS JNB P1.6, $ ACALL D10MS MOV h, 30 # 2 eh; The steering gear is 0, pulse width 1.5 ms 31 h MOV, # 0 fah MOV 32 h # 0 b2h MOV 33 h # 0 b7h AJMP K1 INTT0: CPL F0; Interrupt service routine CPL P3.7; Output high, low level pulse JB F0, HIGH1 LOW0:

文档评论(0)

f8r9t5c + 关注
实名认证
文档贡献者

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

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档