Jump to content
43oh

Trouble with precise pin timing on TivaC (dShot protocol)


Recommended Posts

I'm attempting to add support for a pseudo digital protocol to a project of mine. I'm attempting to implement the dShot protocol for controlling ESCs on my thrust stand, and having some issues. The TivaC doesn't appear to have very robust output control. You can see what I'm trying to do here: https://github.com/VirtualEnder/TestStandv2/blob/dev/MQTB_Thrust_Stand/hardwareTimers.ino

Basically the protocol uses a modified PWM signal with each bit being 1.67us period with 1250ns representing a 1 and 635ns representing 0, basically encoding a 2048 bit throttle signal with some CRC data and a telemetry call bit crammed on the ends. After a couple days I've gotten to the point of using a PWM timer synced with a GP timer to attempt to modify the duty cycle for each bit, however I'm not having much luck.  Is there a more precise way of accomplishing this? I'd like to not have to switch MCUs, but I know the ESP32 can do this easily with their RMT methodology and the STM chips can do with with a DMA transfer.  I looked at the uDMA implementation in the TivaC and it doesn't appear to operate in a way that would work to toggle pins like this.

This is the output signal I'm getting on my relatively limited DSO Nano from the TivaC:

image.png.9cead65279bdee74bf6bc54d09a3c70d.png

And this is the output signal as seen from an STM32F405 that is working properly:
 image.png.e6896fa9ac670715075a2382870957b9.png

 

Any help would be very much appreciated.

 

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...