Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
stm32:peripherals:timer_base [2022/12/28 08:41] ruanstm32:peripherals:timer_base [2023/10/19 09:49] (current) frtt
Line 78: Line 78:
  
 /* configure timer */ /* configure timer */
-TIM2->PSC = 84000u - 1u;              /* Counting with f = 84MHz / 84000 1kHz */ +TIM2->PSC = 0u;              /* Counting with f = 84MHz / 84MHz */ 
-TIM2->ARR = 512u;                     /* Count to 512 */+TIM2->ARR = 84000u - 1u;                     /* Count to 84000 */
  
 TIM2->CR1 |= (0x1 << 0u);             /* Start timer */ TIM2->CR1 |= (0x1 << 0u);             /* Start timer */
 </code> </code>
 \\ \\
  • stm32/peripherals/timer_base.1672216875.txt.gz
  • Last modified: 2022/12/28 08:41
  • by ruan