摘要
在单片机控制应用中,经常会碰到较短的时间延时情况,当使用定时器/计数器不方便实现时,利用软件延时子程序完成一些延时的需求非常有必要。从研究软件延时子程序基本模式出发,给出三层循环所需机器周期数的计算方法,并在此基础上考虑到加入空操作指令以后计算所需机器周期数要注意的问题。
In the application of single chip microcomputer control,we often encounter a relatively short time delay.It is inconvenient and unrealistic to use the timer/counter every time.It is necessary to use the assembly software delay subroutine to complete some delay requirements.Based on the study of the basic mode of software delay subroutine,the calculation method of the number of machine cycles required by three-layer cycle is given.On this basis,the problems that should be paid attention to in calculating the number of machine cycles after adding null operation instructions are considered.
作者
乔道迹
QIAO Daoji(School of Big Data,North University of China,Taiyuan Shanxi 030051,China)
出处
《信息与电脑》
2021年第16期1-3,共3页
Information & Computer
关键词
单片机
延时子程序
汇编语言
single chip microcomputer
delay subroutine
assembly language