Increase PWM Frequency to ~17 kHz to prevent annoying sound
This commit is contained in:
parent
93d15fc549
commit
677bf2c9b5
@ -69,8 +69,8 @@ int main(void)
|
|||||||
TIM14->ARR = 0x00FFu;
|
TIM14->ARR = 0x00FFu;
|
||||||
TIM14->CNT = 0u;
|
TIM14->CNT = 0u;
|
||||||
TIM14->CCR1 = 0u;
|
TIM14->CCR1 = 0u;
|
||||||
/*! -# Set prescaler to 16 ==> ca. 11 KHz */
|
/*! -# Set prescaler to 11 ==> ca. 17 KHz */
|
||||||
TIM14->PSC = 15u;
|
TIM14->PSC = 11u - 1u;
|
||||||
/*! -# PWM Mode 1 + prefetch */
|
/*! -# PWM Mode 1 + prefetch */
|
||||||
TIM14->CCMR1 = TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1PE;
|
TIM14->CCMR1 = TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1PE;
|
||||||
/*! -# Enable Output compare 1 */
|
/*! -# Enable Output compare 1 */
|
||||||
|
Loading…
Reference in New Issue
Block a user