ElectricRCAircraftGuy / eRCaGuy_TimerCounter

An Arduino micros()-like function (encapsulated in a library) with 0.5us precision (since the built-in Arduino micros() function has only 4us precision)
http://www.electricrcaircraftguy.com/2014/02/Timer2Counter-more-precise-Arduino-micros-function.html
31 stars 13 forks source link

THIS LIBRARY IS IN THE PROCESS OF BEING UPGRADED. IT MAY NOT CURRENTLY BE IN A WORKING CONDITION, THOUGH THE ONE AT THE GUMROAD LINK BELOW IS.

Readme for eRCaGuy_TimerCounter

My Gabriel Staples
Readme last updated: 4 Aug. 2015

License: GPLv3 or later (ignore whatever the files say; it is GPLv3)

-I'll correct the license in the files later.

Readme Update History (newest on top)
-20150804 - updated links & formatting
-20140517 - readme written

Click Here to Donate & Download (via Gumroad)

Instructions

Donate and download above. Install the library into the Arduino IDE (using Sketch --> Include Library --> Add .ZIP Library), then run the examples to see how to use the library. You may view the examples in the IDE under File --> Examples --> eRCaGuy_TimerCounter.

Basic Summary

I wrote a libary to get 0.5us precision on a "micros()" replacement function, so that I can get repeatable results reading a PWM or PPM signal, to within 1us. I searched all around the internet and could not find something comparable (or that was easy to use, and maintained the Arduino's ability to write PWM signals via the Servo Libary (which uses the ATmega328's only 16-bit timer/counter, Timer1), so I think this is my first real contribution to the world of Arduino and Radio Control.

Description

For more information on this code see here: http://electricrcaircraftguy.com/2014/02/Timer2Counter-more-precise-Arduino-micros-function.html and here: http://www.instructables.com/id/How-to-get-an-Arduino-micros-function-with-05us-pr/

Be sure to check out the links above. I hope you find this useful.
Sincerely,
Gabriel Staples
http://www.ElectricRCAircraftGuy.com