Skip to main content
Visitor II
August 14, 2024
Question

Generate 10us single pulse triggered by software

  • August 14, 2024
  • 2 replies
  • 799 views

Hello,

I would like to generate a 10us wide single pulse using the hardware Timer 1 peripheral that can be triggered by software. Currently, I am setting a pin as GPIO output and manually setting the pin high and low. I was wondering if there was an option with hardware timers. Can some one guide me on how to achieve this with CubeMX and HAL library. Thanks

 

For example

while(1)

{

  HAL_Delay(1000);
  Send_Pulse();

}

This topic has been closed for replies.

2 replies

AScha.3
Super User
August 14, 2024

Hi,

Just look in RM or in Cube for timer -> one pulse mode.

Maybe this doing what you want.

If you feel a post has answered your question, please click on " Best Answer ".
ST Employee
August 16, 2024

Hello @huzeifa

As @AScha.3 said, OPM allows the timer to generate a single pulse with a programmable length after a programmable delay. You can find cube examples following STM32CubeF4 in GitHub 

Also, refer to AN4776 section 3, N pulse waveform using one pulse mode. 

Hope that helps!

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.