cancel
Showing results for 
Search instead for 
Did you mean: 

Is It Possible to Set and Reset a GPIO Pin with 10 ns Delay on STM32H747I-DISCO?

Roopesh
Visitor

Hello,

I am using the STM32H747I-DISCO board for my project. I need to set and reset a GPIO pin with a delay of around 10 nanoseconds between the transitions.

My question is:
Is it practically possible to achieve such precise timing (10 ns pulse width) using GPIO on an STM32 board, specifically the STM32H747?

I also tried using direct register-level GPIO access by completely eliminating the HAL drivers. I was able to achieve a minimum pulse width of around 50 to 60 nanoseconds. However, I was still not able to achieve the desired 10 ns set/reset timing

I have tried using TIM3 PWM but the minimum pulse I’m able to observe is around 102 ns.I would like to know if there is any reliable method.

Any guidance or clarification would be appreciated.

Thank you!

3 REPLIES 3
MHoll.2
Senior III

The STM32H7 family is based on the CM7, this are quite complex beast's, so toggling a GPIO in 10ns is not the way to go. You should be able to use a Timer for this (The max. Timer clock is 240 MHz). So if You want 10ns probably You have to reduce the clock to 200 MHz and generate a puls with this. Please remember to set the Timer output Pin in High-speed

mƎALLEm
ST Employee

Hello @Roopesh and welcome to the community,


@Roopesh wrote:

My question is:
Is it practically possible to achieve such precise timing (10 ns pulse width) using GPIO on an STM32 board, specifically the STM32H747?


No, not possible. STM32H74x/STM32H75x MCUs are not intended to perform this very high frequency GPIO toggling. Moreover, it could not be precise for many reasons: architecture, CPU pipeline, cache etc .. As said by @MHoll.2 use a GP timer for a such kind of application or use HRTIM for high resolution timings.

See also this thread: How to toggle a GPIO pin very fast in STM32H750?

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.
Ozone
Principal

And, adding to the existing comments, most probably for another reason.

Basically all GPIOs of STM32s have configurable glitch filters which limits the bandwidth.
The 10ns mentioned is beyond the maximal setting of all STM32 MCUs I dealt with.

You would have to check the datasheet and reference manual for you variant.