本帖最后由 电脑圆圆 于 2009-11-13 17:15 编辑
__delay_cycles延迟那可是惊人的精确
测试程序:
TCNT3=0;
USART0_Send(TCNT3>>8);
USART0_Send(TCNT3&0xFF);
TCCR3B |= 0x04; //启动计数器3,256分频
__delay_cycles(11059200);
TCCR3B = 0; //停止计数器3
USART0_Send(TCNT3>>8);
USART0_Send(TCNT3&0xFF);
串口接收:00 00 A8 C0
OxA8C0*256 == 11059200! |