请问:TIM1 input clock、TIM1 counter clock、TIM1 output clock什么关系呀?
TIM1 input clock (TIM1CLK) is set to APB1 clock (PCLK1),since APB1 prescaler is equal to 1.
TIM1CLK = PCLK1
PCLK1 = HCLK
=> TIM1CLK = HCLK = SystemCoreClock =80MHz
To get TIM1 counter clock at 16 MHz, the prescaler is computed as follows:
Prescaler = (TIM1CLK / TIM1 counter clock) - 1
Prescaler = ((SystemCoreClock) /16 MHz) - 1
To get TIM1 output clock at 24 KHz, the period (ARR)) is computed as follows:
ARR = (TIM1 counter clock / TIM1 output clock) - 1
= 665
TIM1 input clock不就是直接从端口输出了吗?为什么还有TIM1 counter clock、TIM1 output clock? |