I’m trying to use an argon to read an encoder. I dont need full quadrature, just a single input is fine. I need to extract how fast its clocking. It could go up to 10 or 20khz which is a bit faster the the the software times can handle for poling.
Is there a high speed counter (timer with external clock is fine) I can read and clear periodically?
I read the ADC DMA which I can do and process each buffer periodically but scanning through the whole thing could take too long.
I need to do this on 2 clocking inputs with independent sources.
Application in short: I need to read in 2 clocking inputs, save a ratio of speed (teach button while at stead state), and then open a relay if the ratio of these clocking inputs differ from the ratio by more then 10%-ish.
@ScriffR How many Input Capture pins does the Boron MCU have, and is there an easy way to set them up?
I could eliminate an entire separate microcontroller I am using alongside Boron, for frequency measurement just like the OP, if this is possible on Boron.
External interrupts are not sufficient because of latency.
The low-level MCU Input Capture feature will actually store the exact nanoseconds of the edge into a buffer, then trigger an interrupt that will eventually get serviced where you grab that timestamp and store it in a ring buffer.
Teensy’s FreqMeasureMulti library is priceless for this purpose and is why I am not using a 100% Particle solution.