informations about teensy 3.6 timers

Status
Not open for further replies.

alfredDebug

New member
Hey, i'm would have some informations about the teensy 3.6 timers. Exactly, i'd like to control the counter of one timer. I searched for a long and i don't understand.

1 The counter of the timer can start counting from zero, if we order it, whithout loading some value. OR we should load some value first?
2 How can i access to the counter and load some value?
3 How can i enable start counting and the overflow bit?

Thank u for your help
 
Teensy 3.6 has many different types of timers. Here's a quick summary.

https://www.pjrc.com/teensy/techspecs.html

They're all fully documented in the reference manual, available here:

https://www.pjrc.com/teensy/datasheets.html

The timers involve many complex details. Perhaps a good first step would be to see if IntervalTimer (which uses the PIT timers) can meet your needs?

https://www.pjrc.com/teensy/td_timing_IntervalTimer.html

If not, perhaps start reading the FTM timers info in chapter 45 starting on page 1127. I believe all the things you've asked can be found in just 2 or 3 registers. The main one is FTM0_SC documented on page 1144. The following pages document the actual count register. If you want to pre-load the count to something other than zero, also look at FTM0_CNTIN on page 1150.

The FTM timers have a ton of complex waveform features. It's a huge amount of reading material. But just starting, stopping, and setting the timer to a specific value are pretty simple.

However, if your purpose (which you didn't explain... so this message isn't nearly as helpful at it could have been) is merely to run a function as an interrupt every time the timer overflows, your needs will probably be met by the easy-to-use IntervalTimer object. Then again, if you need more or just enjoy digging into hardware details, it's all there waiting for you...
 
Status
Not open for further replies.
Back
Top