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
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.
- Hardware Counter Library for MSP430 discussion thread
- Chicken’s CounterLib Github link
- Chicken’s famous dAISy – A Simple Automatic Identification System(AIS) Receiver