AnsweredAssumed Answered

Can I set a timer in encoder mode and gated mode simultaneously with the STM32F76ZI?

Question asked by Dennis Ai on Mar 9, 2018
Latest reply on Mar 11, 2018 by waclawek.jan

I am using STM32Cube to setup my timers.  I would like to have TIM1 in Encoder Mode.  I would like to do two things:


  1. When the counter overflows, I would like to enable TIM2.  If I look through the reference documentation, is it correct to say I can do this by setting (in code) TIM1 to Master Mode: Update (The update event is selected as trigger output), and setting TIM2 to Slave Mode with Trigger Source ITR0?  Is there any reason I can't set Master Mode in STM32Cube?
  2. I would like to enable TIM1 on the rising edge of an external input.  I notice in STM32Cube, if my timer is NOT set to Encoder Mode, I can set TIM1 to Slave Mode: Gated with Trigger Source: ETR1.  However, if my timer IS set to Encoder Mode, I cannot set the Slave Mode.  Therefore, my question is, what's the best way to ensure that TIM1 starts only on an external trigger?  Should I use the CPU to monitor a GPIO pin and then enable TIM1, or is there an alternative, more elegant solution?


Thanks for all of your help.