cancel
Showing results for 
Search instead for 
Did you mean: 

Is it a problem to use TIM1 PWM ch1..3 under Arduino?

WOGoos
Associate II

Dear reader,

I have a question about the use of TIM1 on the Blue Pill STM32F103. I want to build a synchronous Buck Converter using the Blue Pill and need to use PWM on TIM1 ch1..3 with its complementary outputs and the programmable dead time for that.

I heard someone saying that using TIM1 for PWM was not a good idea. The Pill Blue has these function only on TIM1 ch1..3 so what can be the reason that using TIM1 for PWM is not a good idea.

I don't use HALL and program Bare Metal, but program with Arduino liberties. Is TIM1 used for other function under Arduino? Anyone has an idea

3 REPLIES 3

Not a lot of interest here with Arduino Libraries, perhaps there's a better forum for that?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

>>I heard someone saying that using TIM1 for PWM was not a good idea. The Pill Blue has these function only on TIM1 ch1..3 so what can be the reason that using TIM1 for PWM is not a good idea.

Perhaps ask them? Or cite specific instances of who, where, what..

TIM1 is only 16-bit, is an advanced timer, has to have PWM pins specifically enabled to output.

More generally STM32 TIM each have a single counting element, and several latches, so can only do a single frequency across all channels. Fine for Servos, but for sound generation, or complex modulation, perhaps not so much.

The things are diagrammed in the Reference Manual, might shed light on their features / limitations.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
WOGoos
Associate II

@Tesla DeLorean Yes I know what that TIM1 can and can not do. Any platform has is pro and cons and I understand that yours is not the Arduino IDE. Thanks for telling me that, but that was not the question.