Jump to content

[Energia Library] Time_Capture

Recommended Posts

So I made a API to help use the Tiva time capture mode with the timers. So I decided to port it to Energia.

For now it only works with the wide timers.

I will try in the future when I have more time to get more info on it.
But for now I will leave this notes:
The possible pins to use are PC4, PC5, PC6, PC7 and from PD0 to PD7, including making a total of 12 inputs. Unlike pulseIn() you can't simply use any pin. 
The functions need to know the pin as parameter. The parameter should be for example "PC4" and not "PC_4".

There are functions to get the direct reading, the reading in nanoseconds (precision of 12.5ns) and reading in microseconds (precision 1us). 

There are functions with timeouts also.
There are also non-blocking functions. An examples shows how to use them.
The time from when the functions are called to the time the end of the pulse should be less than 53 seconds. Like pulseIn() it waits for the pulse to rise (in positive pulse readings) or fall (in negative pulse readings) and then measures the time it takes to change back.

I hope it helps some peeps ;)
Time_Capture.rar <- V1.0
Time_Capture_V2.0.rar <- V2.0 fixed problem described here

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now