cancel
Showing results for 
Search instead for 
Did you mean: 

Generate 10us single pulse triggered by software

huzeifa
Associate

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();

}

2 REPLIES 2
AScha.3
Chief III

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 "Accept as Solution".
Sarra.S
ST Employee

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.