Increase PWM Frequency to ~17 kHz to prevent annoying sound

This commit is contained in:
Mario Hüttel 2021-05-10 19:23:43 +02:00
parent 93d15fc549
commit 677bf2c9b5

View File

@ -69,8 +69,8 @@ int main(void)
TIM14->ARR = 0x00FFu;
TIM14->CNT = 0u;
TIM14->CCR1 = 0u;
/*! -# Set prescaler to 16 ==> ca. 11 KHz */
TIM14->PSC = 15u;
/*! -# Set prescaler to 11 ==> ca. 17 KHz */
TIM14->PSC = 11u - 1u;
/*! -# PWM Mode 1 + prefetch */
TIM14->CCMR1 = TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1PE;
/*! -# Enable Output compare 1 */