Timer » Historie » Version 1
Maximilian Seesslen, 22.07.2022 18:57
1 | 1 | Maximilian Seesslen | h1. Timer |
---|---|---|---|
2 | |||
3 | |||
4 | |||
5 | HCLK / Prescaler / period |
||
6 | |||
7 | Period = TPeriod * ( HCLK / Prescaler ) |
||
8 | |||
9 | |||
10 | Period * Prescaler = TPeriod * HCLK |
||
11 | |||
12 | 1Khz: |
||
13 | TPeriod = 0.001 * |
||
14 | |||
15 | Period * Prescaler = HCLK / freq |
||
16 | |||
17 | freq = HCLK/(Period*Prescaler) |
||
18 | |||
19 | Period = HCLK / freq / Prescaler |
||
20 | |||
21 | 80000000/1000=80000 |
||
22 | Period * Prescaler = 80000 |
||
23 | |||
24 | Sqrt: 282 |
||
25 | |||
26 | 80000000/(282*282) = 1005,9856 |
||
27 | |||
28 | 80000000/1000/282 |
||
29 | |||
30 | Period = HCLK / freq / Prescaler = 80000000/1000/1000 = 80 |
||
31 | |||
32 | freq = 80000000/(80*1000) |