本帖最后由 877049204 于 2019-1-9 16:23 编辑
第2种软件方式:使用TSCL,TSCH寄存器:测试延时函数Delay的时间:
// 延时
TSCL = 0;
TSCH = 0;
beforeL = TSCL;
beforeH = TSCH;
before = _itoll(beforeH,beforeL);
Delay(0x00FFFFFF);
afterL = TSCL;
afterH = TSCH;
after = _itoll(afterH,afterL);
printf("%lld\n",after-before);
|