9 years ago.

How fast can the digital in detect chagne? [STM32F401RE] Can I sample a clock with the digitalIN?

[STM32F401RE]

For instance, If I feed a clock of 2MHz, can the digital input detect all the highs and lows of that clock?

The second question is, how can I sample a clock of 2MHz with digitalIN?

Thanks,

Question relating to:

1 Answer

9 years ago.

Here are some performance numbers: http://developer.mbed.org/users/Sissors/code/FastIO/

However what does it need to do? Purely reading at that speed should be possible, but if it needs to do anything else it won't cut it.

Accepted Answer

I'm trying to see if I can sample it and tell what Frequency the clock is running at. Need to code for that. However, the most reliable way to check would really be see it under an oscilloscope.

thx for the help!

posted by Peter Xian 03 Apr 2015

If you just need to check it once, indeed use a scope. Need to do it often, then you should setup a timer in either external counter mode or in input capture mode. Thats better than using a DigitalIn for it.

posted by Erik - 03 Apr 2015