NikCA
Member
Hello everyone, 
I'm trying to create a simple DShot implementation with the T4.1 so I can control ESCs of a quadcopter.
I have a general understanding of why DMA is a good choice for DShot and why I need some kind of timer in order to accurately transfer the data to the ESC. (That said I'm certain I don't know everything so any info is always welcome! )
I've gathered some information about the different elements that I think are required to solve this problem:
1. For DMA from various forum posts, I think that its best to use this library: https://github.com/PaulStoffregen/cores/blob/master/teensy4/DMAChannel.h
Making my own would be quite a stretch, considering I haven't worked with DMA up to now.
2. For the pulse length & timing that DShot I think its best if I use the FlexPWM timer (this is based on what I've read from the reference manual)
Info about the DShot protocol >> https://blck.mn/2016/11/dshot-the-new-kid-on-the-block/
So these are the two things I think I need in order to implement DShot on the teensy.
The questions that remains is how do I make them work together:
1. How do I setup the destination of the DMA to be the output of FlexPWM?
2. Once I write something in the DMA source, how do I make the DMA trigger based on the value of the FlexPWM timer and once triggered?
I hope I've explained my question well enough, if there is any confusion please let me know.
I'm trying to create a simple DShot implementation with the T4.1 so I can control ESCs of a quadcopter.
I have a general understanding of why DMA is a good choice for DShot and why I need some kind of timer in order to accurately transfer the data to the ESC. (That said I'm certain I don't know everything so any info is always welcome! )
I've gathered some information about the different elements that I think are required to solve this problem:
1. For DMA from various forum posts, I think that its best to use this library: https://github.com/PaulStoffregen/cores/blob/master/teensy4/DMAChannel.h
Making my own would be quite a stretch, considering I haven't worked with DMA up to now.
2. For the pulse length & timing that DShot I think its best if I use the FlexPWM timer (this is based on what I've read from the reference manual)
Info about the DShot protocol >> https://blck.mn/2016/11/dshot-the-new-kid-on-the-block/
So these are the two things I think I need in order to implement DShot on the teensy.
The questions that remains is how do I make them work together:
1. How do I setup the destination of the DMA to be the output of FlexPWM?
2. Once I write something in the DMA source, how do I make the DMA trigger based on the value of the FlexPWM timer and once triggered?
I hope I've explained my question well enough, if there is any confusion please let me know.