Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Using Interval Timer with Teensy Stepper

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    18

    Using Interval Timer with Teensy Stepper

    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?

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,546
    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).

  3. #3
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    631
    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...l=1#post203524 you find an example which uses a interval timer to print out current motor positions in the background while the motors run.

  4. #4
    Junior Member
    Join Date
    Nov 2013
    Posts
    18
    Thanks Luni. Your example also helped me to understand some calibration issues that I had.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •