2015-11-10 12:42 AM
Hi,
unfortunately I haven't understood how to connect two timers. I want to achieve a 3,2kHz PWM switch signal that turns on and off a 1 MHz signal. I try to setup TIM3 as a master timer; in STM32CubeMX I have selected ''Master/Slave Mode: Enable (sync between this TIM (Master) and its Slaves (through TRGO))'' and ''Trigger Event Selection: Output Compare (OC2REF)''. For TIM4 as slave timer I selected ''Slave Mode: Gated Mode'' and ''Trigger Source: ITR0'' And that's where my understanding ends. As trigger source for TIM4 I would have expected something like TIM3-TRGO. Or some assignment for ITR0 to TIM3-TRGO. Can someone please explain how TIM3 can be connected to TIM4? That would be great. Thanks in advance for your help.2015-11-10 01:02 AM
> And that's where my understanding ends. As trigger source for TIM4 I would have expected something like TIM3-TRGO. Or some assignment for ITR0 to TIM3-TRGO.
Read the fine manual, '' TIMx internal trigger connection'' sub-chapter of the relevant TIM chapter. JW2015-11-10 03:00 AM
Thanks.
For anybody who is curious what the fine manual is, here is the link:http://www.st.com/web/en/resource/technical/document/reference_manual/DM00031020.pdf
2015-11-10 09:17 AM
Try to read and run the ''TIM_Synchronization'' FW example of the STM32Cube_FW_F4.
It talks about the synchronization between TIM1 as master and TIM3/TIM4 as slave which is configured in gated mode to output a PWM switched by the updated event comming from TIM1 with a configured rate (TIM1 Frequency/ repetition counter). Explanation (Readme.txt): The TIM1 counter clock is 180 MHz.The Master Timer TIM1 is running at:
TIM1 frequency = TIM1 counter clock / (TIM1_Period + 1) = 703 KHzThe TIM3 is running at:
(TIM1 frequency)/ ((TIM3 period +1)* (TIM1_Repetition_Counter+1)) = 46.866 KHz and Good luck.2015-11-11 04:53 AM
Thanks.
Should have had a look into that Reference Manual before. Haven't found it before. The answer is pretty simple. It's just a lookup for the slave's internal trigger ITRx to the master's trigger output TIMx_TRGO.