You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
380 B
Markdown

2 years ago
# 旋转编码器
- 初始化外部晶振配置SYSCLK与Timer Clock均为72MHz
- 将PA8、PA9分别配置为TIM1_CH1、TIM1_CH2
- 配置TIM1
- 将Combined Channels配置为Encoder Mode
- 可以配置Input Filter启用集成滤波器减少抖动范围0~15
- 配置USART2为Asynchronous
- 启动编码器HAL_TIM_Encoder_Start(&htim1, TIM_CHANNEL_ALL)