cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411E Disco Board - PWM

HL1
Associate II

I have been trying to get a PWM output from PE9 by following some example online. However no PWM output at PE9 pin. The desires PWM frequency is 20kHz and duty cycle is 50%. Any suggestion what is the problem ?. Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Are you sure that PE9 is not used by anything else on the Disco board?

Check the User Manual and Schematics.

Can you toggle it using just a simple GPIO write?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

View solution in original post

4 REPLIES 4
KnarfB
Principal III

The period is 50 and TIM1->CCR1 = 50; This won't work. For 50% PWM set period to 50-1 and TIM1->CCR1 = 25;

hth

KnarfB

Are you sure that PE9 is not used by anything else on the Disco board?

Check the User Manual and Schematics.

Can you toggle it using just a simple GPIO write?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
HL1
Associate II

Yes .. you are right. I overlooked this value.

I had checked the schematic, PE9 is free and it is not used for other things. As mentioned by KnarfB, i had set the pulse width to 100%. Hence i only see a straight line instead of a PWM signal. I did though to toggle using simple GPIO write but i need to vary the pulse width.