Using Interval Timer with Teensy Stepper

Status
Not open for further replies.

mariusl

Active member
Hi
I am using TeensyStepper library and I want to use the IntervalTimer to generate a 100ms interval for general timeouts. My question is does the TeensyStepper use the same timer as IntervalTimer? If so how do I go about getting a regular 100ms interrupt?
 
The IntervalTimer object uses one of the 4 internal PITs (programmable interrupt timer) of the Teensy. You need to look into the source code of the stepper library to see if it uses one or more PITs, too (potential conflicts), or the Flextimers (FTM).
 
My question is does the TeensyStepper use the same timer as IntervalTimer?
Yes it does. To be precise each controller requires its own timer. But as Theremingenieur pointed out, there are 4 of them. So if you use less than 4 TeensyStep controllers you'll have spare interval timers for your use.

In the second code block of this post https://forum.pjrc.com/threads/54529-TeensyStep-How-to-switch-from-1-speed-to-another?p=203524&viewfull=1#post203524 you find an example which uses a interval timer to print out current motor positions in the background while the motors run.
 
Status
Not open for further replies.
Back
Top