Setting Prescaler and Period for Buzzer
For producing 4KHz resonant frequency sound from a buzzer using 32KHz system clock, what should be the Prescaler value and Period(ARR)? Is there any rules for defining these values?
For producing 4KHz resonant frequency sound from a buzzer using 32KHz system clock, what should be the Prescaler value and Period(ARR)? Is there any rules for defining these values?
You could generate your 4kHz from the 32kHz with prescaler=0 (1 -1) and ARR=7 (8 -1). The product of PRE*ARR must be 8 in your case, although you can also use PRE=1 (2 -1) and ARR=3 (4 -1).
Does it answer your question?
Regards
/Peter
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.