Temporary disabling ETR's
- March 29, 2026
- 4 replies
- 292 views
Background: I am designing a high-speed imaging system for an industrial press. I am using an STM32 to synchronize a camera (TIM3) and two flashes (TIM4) based on an external hardware trigger.
The Setup:
- Both timers are in One-Pulse Mode (OPM) and Combined Reset + Trigger Mode (SMS = 1000).
- Both are triggered by the exact same physical edge using HAL_TIMEx_RemapConfig(&htim4, TIM_TIM4_ETR_TIM3_ETR)
- The digital filter is set to 16 µs for both (ClockDivision = DIV4, TriggerFilter = 0xf).
The Goal: When a valid trigger arrives, both timers start automatically. TIM3 fires its pulse almost immediately. TIM4 counts down a configurable delay (via CCR) before firing the flashes.
To prevent mechanical double-triggers from the sensor, I need a firmware "blind window." Once the initial valid trigger is received, I want to completely ignore the ETRF pin for a few milliseconds.
The Catch: I want to disable the ETR input from inside TIM3's HAL_TIM_PWM_PulseFinishedCallback (which fires right after the initial trigger). However, at this exact moment, TIM4 is already running its delay countdown.
Whatever method I use to disable the ETR input must not kill or reset the delayed pulses from TIM4 that are already "in-flight."
My Question for the STM Team: What is the recommended, most robust, and glitch-free method to dynamically disable/mask the ETR input "on the fly" under these conditions?
Thank you
