Skip to content

Commit 7e47245

Browse files
committed
unoq: modify prescalers for 16bits timers to achieve low frequency PWM signals
timer1 and timer8 are 16bits timers instead of being 32bits as all other timers.In UNO Q overlay, prescaler is set to 4, so it means which is not possible to achieve 50Hz PWM signal frequency on related pins. This frequence is used to control RC Servo motors. By changing to 63, it is now possible to achieve 50Hz, maintaining unchanged 500Hz, used by default by analogWrite. At 500Hz is still possible to use 12bits resolution. Maximum frequency available is 1.25MHz with only 50% duty option.
1 parent b3c71df commit 7e47245

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

variants/arduino_uno_q_stm32u585xx/arduino_uno_q_stm32u585xx.overlay

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
/* Enable PWM timers */
9898
&timers1 {
9999
status = "okay";
100-
st,prescaler = <4>;
100+
st,prescaler = <63>;
101101

102102
pwm1: pwm {
103103
status = "okay";
@@ -160,7 +160,7 @@
160160
/* Currently only the pins marked with ~ on the pin headers are enabled */
161161
&timers8 {
162162
status = "okay";
163-
st,prescaler = <4>;
163+
st,prescaler = <63>;
164164

165165
pwm8: pwm {
166166
status = "okay";

0 commit comments

Comments
 (0)