当前位置:网站首页>National technology n32g45x series about timer timing cycle calculation

National technology n32g45x series about timer timing cycle calculation

2022-06-30 07:34:00 Old wharf~

frequency Fpwm=TIMER_CLK/(arr+1)*(psc+1)( Company :hz)

①、TIMER_CLK yes TIMEx Hang on the system clock APB1 Clock frequency on the bus ;

②、arr It's a count ;

③、psc It's the prescaled value ;

for example : The timer is timed 500us,arr And psc Corresponding value ?

1、 First confirm the frequency of each part of the system clock :

    RCC_ClocksType RCC_Clocks;
    RCC_GetClocksFreqValue(&RCC_Clocks);

These two programs can get the clock frequency of each part ;

2、Fpwm=1/0.0005s=2000hz

3、 hypothesis TIMER_CLK=72MHz, First set up psc The prescaler is 0;

(arr-1)=72000000/2000/(0+1)=36000, namely arr=35999;

原网站

版权声明
本文为[Old wharf~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202160540567820.html