Chicken, creator of dAISy, has released a new Energia Library for counting pulses in the kHz/MHz range.

The library has the following five functions:

  • start() initializes the timer peripheral and I/O pin and starts the counter
  • stop() stops the counter, but does not reset the counter value
  • read() reads the current value of the counter
  • reset() resets the counter to 0, the counter keeps running
  • readAndReset() reads the current value and resets the counter to 0
43oh member, FMilburn's setup showing the CounterLib library counting to 804Khz with <1% error

43oh member, FMilburn’s setup showing the CounterLib library counting to 804Khz with <1% error

Attached is a photograph of a F5529 LaunchPad with a SHARP96 BoosterPack attached and running an example that uses two samples to compensate for overhead. The LaunchPad is displaying 804 KHz while the oscilloscope is reading 810.6 KHz, so less than a percent error.  The signal is coming from another LaunchPad out of the picture.
fmilburn

Links