- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
各种汇编延时程序大集合(A large collection of assembly delay programs)
各种汇编延时程序大集合(A large collection of assembly delay programs)
All kinds of delay assembler collection
Tags: 51 assembly delay
See a lot of good delay procedures at the forum, share as follows:
Accurate delay calculation:
The delay time (n 2* first layer cycle +3) * second layer third layer +3]* cycle +5 cycle
Delay 5 seconds;
DELAY5S:PUSH 04H
PUSH 05H
PUSH 06H
MOV R4, #50
DELAY5S_0:MOV R5, #200
DELAY5S_1:MOV R6, #245
DJNZ R6, $
DJNZ R5, DELAY5S_1
DJNZ R4, DELAY5S_0
POP 06H
POP 05H
POP 04H
RET
513 microsecond delay procedures;
DELAY: MOV R2, #0FEH
DELAY1: DJNZ R2, DELAY1
RET
10 millisecond delay procedures;
DL10MS: MOV R3, #14H
DL10MS1:LCALL DELAY
DJNZ R3, DL10MS1
RET
0.1s 12Mhz delay procedures;
DELAY: MOV R6, #250
DL1: MOV R7, #200
DL2: DJNZ R6, DL2
DJNZ R7, DL1
RET
Delay 1046549 microseconds (12Mhz);
The specific formula is:
; ((((r7*2+1) +2) *r6+1) +2 (*r5+1+4) = (r7*2+3) *r6+3)
*r5+5
DEL: MOV R5, #08H
DEL1: MOV R6, #0FFH
DEL2: MOV R7, #0FFH
DJNZ R7, $
DJNZ R6, DEL2
DJNZ R5, DEL1
RET
1; delay subroutine in 12MHz crystal
Delay1S:mov R1, #50
Del0: mov R2, #91
Del1: mov R3, #100
Djnz R3, $
Djnz R2, DEL1
Djnz R1, del0
Ret
1; delay subroutine with 12MHz crystal as an example an instruction cycle time
KK: MOV R5, #10; 1 instruction cycle 1
K1: MOV R6, #0FFH; 1 instruction cycle 10
K2: MOV R7, #80H; 1 256*10=2560 instruction cycle
K3: NOP; 1 instruction cycle
128*256*10=327680
DJNZ R7, K3; 2 instruction cycle
2*128*256*10=655360
DJNZ R6, K2; 2 instruction cycle
2*256*10=5120
DJNZ R5, K1; 2 2*10=20 instruction cycle
RET
2 21+10+2560+327680+655360+5120+20+2=990753 instruction cycle;
Approximately equal to 1 second =1000000; 1 microseconds
This; doing only 0.998 copy
T_0: MOV R7, #10;
D1: MOV R6, #200;
D2: MOV R5, #248;
DJNZ R5, $
DJNZ R6, D2;
DJNZ R7, D1;
RET
In so doing; it should be 1.000011 seconds
T_0: MOV R7, #10;
D1: MOV R6, #200;
D2: NOP
MOV R5, #248;
DJNZ R5, $
DJNZ R6, D2;
DJNZ R7, D1;
RET
DELAY_2S:; 10MS (11.0592Mhz)
MOV R3, #200
JMP DELAY10MS
DELAY_100MS:; 100MS (
您可能关注的文档
- 八月十五 你的月亮有多圆(August fifteen, how round is your moon).doc
- 八种常用的考研英语词汇记忆法(推荐)(Eight commonly used English vocabulary retention methods for postgraduate studies (recommended)).doc
- 八款紧凑车型比较(Comparison of eight compact models).doc
- 八种常用的考研英语词汇记忆法(Eight commonly used methods of memorizing English vocabulary for postgraduate studies).doc
- 八种词汇记忆法(Eight lexical mnemonics).doc
- 八级单词容易错的词(Eight word is easy to wrong word).doc
- 公仆精神视野下以人为本的理性三向度.(The rational three dimension of human orientation under the vision of public servant spirit).doc
- 公众成本理论与对外政策决策(Public cost theory and foreign policy decision making).doc
- 公会大师全攻略(Guild Master Raiders).doc
- 公共政策概论问答题(An introduction to public policy questions and answers).doc
- 各种延时程序(Various delay procedures).doc
- 各种汤类做法(A variety of soups).doc
- 各种猫的用户名及密码(User name and password for all cats).doc
- 各种电缆标准及适用范围(Various cable standards and scope of application).doc
- 各种纸艺简单介绍(This paper briefly introduces the paper).doc
- 各类职位名称(Various job titles).doc
- 各种音频格式特点(Various audio format features).doc
- 合格会计人员应具备的素质(Quality of qualified accounting personnel).doc
- 合理设计厨卫的六招数(Reasonable design of kitchen and toilet six tricks).doc
- 合理选择数控加工中的刀具和切削用量(Reasonable selection of cutting tools and cutting parameters in NC machining).doc
文档评论(0)