摘要
为提高8051单片机定时精度,扩展8051系列单片机的用途,本文分析了8051系列单片机定时器溢出中断与CPU响应中断的时间误差。在此基础上,提出了应用C51高级语言对多个定时器进行精确定时的误差补偿方法,并且使用Keil Uvision2仿真调试软件搭建一段数字显示式倒计时的实例程序,通过分析和调试误差补偿算法,使8051单片机在多个定时器同时使用的情况下,定时误差最终小于3个机器周期,是目前8051单片机高精度定时的一种新算法。
In order to improve the timing accuracy of 8051MCU and expand the purpose for the series of 8051MCU, this paper analyzed the timing error between the timer interrupt overflow and interrupt response of CPU. It gives the way of solving the multi-timer timing error by using C51 advanced language. Besides it uses the simulate software —— Keil Uvision2 to build a Single chip control digital display of a counting down program, through analyzing and debug the compensate counting of error, it finally makes the error of timing for 8051MCU below 3 machine period in the condition of using the multi-timer timing.
出处
《电气技术》
2008年第3期34-37,共4页
Electrical Engineering