Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 12 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
10 years, 12 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)