各位大侠,STM8S103
tim2、Tim4能定时GPIO输出最20ns脉冲吗?看有的朋友2M可以定时1us?怎么我用16MHz时钟不分频最小却只有4.4us ?
CLK->CKDIVR |= 0x00;
void TIM4_Init(void)
{
TIM4_EGR =0x01;
TIM4_PSCR =0x00; //设置时钟分频 2M/2=1MHz---1us
TIM4_ARR =0x01;
TIM4_CNTR =0x00; //计数器值
TIM4_CR1 |= 0x81;
TIM4_IER |= 0x01;
}
一周热门 更多>