cancel
Showing results for 
Search instead for 
Did you mean: 

Multipurpose timer

instantni
Associate II
Posted on March 13, 2015 at 01:51

Hi, we're using stm32f103c8t6 to generate various PWM signals to various components on the PCB. TIM1,3,4 are used to generate different PWMs and TIM2 is used as a 1ms timer. Recently we've realized that we will need to generate another PWM (500kHz) but there is no other timer left to do it. The pin for the needed PWM is wired to TIM2. Is there any way how to effectively use TIM2 for PWM and normal tick operation?

The PWM frequency on TIM2 is the same as the one TIM4 but the wiring is wrong. We might need to reconsider wiring in the end but I'm just checking if there is maybe an option without need to rewire.

Thanks
3 REPLIES 3
Posted on March 13, 2015 at 02:20

Can't you use SysTick for a general 1ms ticker?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
instantni
Associate II
Posted on March 15, 2015 at 20:13

Hm, not really, using that one as 1us timer. I guess we could just trigger the ms handler every 1000 times of triggering the us timer but that doesn't seem to be very nice.

Posted on March 15, 2015 at 20:58

Interrupting at 1 MHz is excessively rapid, are you sure you can't get microsecond timing more efficiently?

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