8 years, 9 months ago.

Nucleo F411re, High frequency PWM

Hi. I'm using current sensor for measuring torque of DC motor(current->voltage->ADC). But my current sensor has 10khz bandwidth. (When PWM signal changing high and low, it is reflected in sensor voltage). Because of this problem, I want to make very high frequency (over 20khz) PWM signal. Can I get some code example?

Thank you for reading and really sorry about my terrible English.

1 Answer

8 years, 9 months ago.

20 kHz is a period of 50 us.

The handbook for PWM is here and it shows you can use:

pwm.period_us	(50)	

Accepted Answer