Skip to main content
Valkan Pavlov
Associate III
January 16, 2025
Question

STM32 TIMer controlled pin output

Hey folks,

I need assistance with resetting an Analog Devices ADC. I need to generate high output for 1000 or 4000 ns from my Nucleo F401RE board.

As shown in the attached image, I need to set the pin low, then high for a specific duration, and then low again. I tried using TIM4 with Output Compare CH1 and One Pulse Mode, as well as other modes, but it does not seem to provide the required low-high-low sequence. At least, I was unable to achieve this.

I had slightly more success with PWM generation on CH1, where the curve appears correct, but it is repetitive. However I can stop the timer but the goes high again.

Could someone with relevant experience provide a roadmap? Any advice would be greatly appreciated.

Thanks!

This topic has been closed for replies.

1 reply

ST Technical Moderator
January 21, 2025

Hello @Valkan Pavlov 

Please refer to the example Projects/STM32446E_EVAL/Examples/TIM/TIM_OnePulse to generate one pule signal. 

This example shows how to use the TIM peripheral to generate a single pulse when a rising edge of an external signal is received on the timer Input pin.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om