Skip to main content
Endika Caño de Miguel
Associate III
October 25, 2017
Question

How to multiply TIMers outputs?

  • October 25, 2017
  • 3 replies
  • 729 views
Posted on October 25, 2017 at 11:43

Hello everybody:

I would like to multiply the outputs I get from TIM3_PWM (64KHz signal) and TIM4_PWM(8MHz signal) in order to get a new signal.

The thing is that I don�t know how to do it and I�m pretty lost. 

By the way is it possible to assign variables to the timers? and if so, how can I do it?

Thank you in advance.

Endika 

#timer #stm32-f4 #tim #multiply #variable
This topic has been closed for replies.

3 replies

waclawek.jan
Super User
October 25, 2017
Posted on October 25, 2017 at 12:22

You can set TIM4's OCxREF as TRGO in TIM4_CR2.MMS, set TIM3's TRGI source to TIM4 in TIM3_SMCR.TS, and set TIM3 slave controller to Gated Mode in TIM3_SMCR.SMS - that should suffice.

By the way is it possible to assign variables to the timers?

I don't understand, please explain.

JW

Endika Caño de Miguel
Associate III
October 26, 2017
Posted on October 26, 2017 at 12:03

Yes, I´m asking if this is possible:

HAL_TIM_PWM_Start(&htim3,TIM_CHANNEL_2) = a;  

For example

waclawek.jan
Super User
October 26, 2017
Posted on October 26, 2017 at 12:13

No.

JW