Noob doubt: Is a timer clock frequency relevant for input edge detection?
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:
- Yes, the timer clock freq. is relevant. And for the timer is clocked at 216MHz one can fail to detect pulses narrower than 4.6 ns [4.6 ns = 1/216MHz] (not considering the 10ns minimum pulse width)
- No, the timer clock freq. is not relevant. The edge detection works in a kind of analog way. There is no sampling rate involved and as soon as the pulse goes above a certain amplitude, the rising edge is detected.
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?)