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

Thread: What is the equivalent of the FTM timer for Teensy 4.1

  1. #1
    Junior Member NikCA's Avatar
    Join Date
    Oct 2020
    Posts
    12

    What is the equivalent of the FTM timer for Teensy 4.1

    Hello,

    I've mentioned in another post that I'm trying to implement DShot on the Teensy 4.1. I came across this post that implements it on the Teensy 3.2.

    My question is - What is the best equivalent of the FTM timer in the teensy 4.1?

    (I decided to put this question is a separate post, because I think this issue applies to all projects that require migrating code from Teensy 3.x to Teensy 4.x)

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,779
    FlexPWM is the type most similar to FTM.

  3. #3
    Junior Member NikCA's Avatar
    Join Date
    Oct 2020
    Posts
    12
    Is it possible to generate finite sequences of 0s and 1s needed by DShot with FlexPWM, using DMA to transfer how long a pulse should be?

    I'm trying to wrap my head around how its best to approach the issue.


    *Edit*

    In the description of the FlexPWM timer, there are these lines:

    "Double buffered PWM registers
    • Integral reload rates from 1 to 16
    • Half cycle reload capability"


    What does "buffered PWM registers mean" and what are integral reload rates? And do I need to worry about these things?
    Last edited by NikCA; 11-13-2020 at 11:53 AM. Reason: Added question regarding FlexPWM timer.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,779
    Quote Originally Posted by NikCA View Post
    Is it possible to generate finite sequences of 0s and 1s needed by DShot with FlexPWM, using DMA to transfer how long a pulse should be?
    Yes, this is possible.

    But possible does not mean easy. The reality of "possible" means figuring out the answers to all of the other questions in your message, and many more you'll discover along the way.

    There is also a thorny issue of figuring out exactly what sort of action achknowledges the FlexPWM's DMA request, so you don't end up with an infinite loop of the DMA controller repeatedly triggering. NXP's documentation is very thin on this subject. It can be a huge challenge, even if you're already very familiar with the DMA controller.



    What does "buffered PWM registers mean" and what are integral reload rates? And do I need to worry about these things?
    Yes and no.

    Yes, if you go down this path, you most certainly do need to worry about all those details and so much more.

    But also no, you don't need to do any of this if you take a better path, which I'll recommend on your other thread specifically about that protocol.

    https://forum.pjrc.com/threads/64459...r-(Teensy-4-1)

Posting Permissions

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