AnsweredAssumed Answered

How to implement a frequency counter (tachometer) with K22F

Question asked by Tim Hutt on Oct 30, 2014
Latest reply on Dec 19, 2017 by William Carlisle

Hi,

 

I'm trying to accurately count the frequency of a square wave input. I.e. over exactly 1 second, how many pulses were there? I'm using a FRDM-K22F board.

 

To do that I looked at using the FlexTimer module which seems to support an external clock. Unfortunately it also seems like that really was intended to be an external crystal rather than an arbitrary signal. You can only connect it to two pins and neither of those are exposed.

 

Can anyone suggest anything else? Ideally I'd like to do everything in hardware rather than interrupts, for accuracy.

 

I've previously used Nordic's nRF51822 and that has counters that can be driven from external inputs, and also a "Programmable Peripheral Interface" (or something) which allowed you to connect events together (e.g. so when the 1 second timer runs out it automatically stops the counter). Is there anything like that for Kenetis?

 

Cheers,

 

Tim

Outcomes