2024-08-14 10:06 AM
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();
}
2024-08-14 10:09 AM - edited 2024-08-14 10:10 AM
Hi,
Just look in RM or in Cube for timer -> one pulse mode.
Maybe this doing what you want.
2024-08-16 01:38 AM
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.