2023-11-14 07:56 AM
Hi everyone,
I am trying to implement a system that counts pulses that can be as narrow as 20 nanoseconds using an STM32F746 MCU clocked at its max 216MHz.
The first thought was: "Can such narrow pulse even be detected by the MCU?"
To confirm, and inspired by this query: "minimum-pulse-width-sensed-by-the-gpio-of-the-stm32", I grabbed the datasheet and looked for "tEXTIpw" which for the STM32F746 is 10ns. So, looks we are fine here.
Then the implementation approach: Use a timer to count the rising edges of each pulse. "But which Timer?" Since the STM32f746 has two APB buses with different max clock frequencies, I thought: "Lets use a timer hanging on the APB with the higher frequency so that the timer can sample the pulse line at a higher rate"
But then the real noob doubt kicked in: "Is a timer clock frequency even relevant for input edge detection?"
I can imagine two possible answers:
Regardless of whether any of the previous two options is correct I could not find the confirmation in the STM32F746 datasheet and Ref. Manual.
So, could someone please clarify this noob doubt? And, if possible, point me in the direction of the documentation where the answer can be found? (What to look for? And which doc?)
Solved! Go to Solution.
2023-11-15 12:55 AM
2023-11-14 11:03 AM
Minimum EXTI pulse width and timer operation have nothing to do with each other. The timers are all synchronous circuitry. You would be using your signal as an "external clock" for the timer. That external clock needs to be synchronized with the timer's internal clock. So that limits the minimum pulse you can detect to the timer's frequency (not the BUS frequency, the timer freq).
2023-11-15 12:55 AM
2023-11-22 12:51 PM
Both previous answers were useful and would mark both as "Accept as Solution" if I could.
Thank you!