What is the equivalent of the FTM timer for Teensy 4.1

Status
Not open for further replies.

NikCA

Member
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)
 
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:
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/6445...-to-use-FlexPWM-and-DMA-together-(Teensy-4-1)
 
Status
Not open for further replies.
Back
Top