Skip to content

Marian-Vittek/raspberry-pi-dshot-smi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an implementation of the DSHOT protocol to control ESCs via
the GPIO pins of a Raspberry Pi.  It works with 32-bit OS on Raspberry
Pi 3, 4 and Zero 2, other versions were not tested. It will not work
on Raspberry Pi 5. It may not work safely on 64-bit OS. It also does
not work with vc4-fkms-v3d driver. You have to change it to
vc4-kms-v3d if configured in /boot/firmware/config.txt.

There is a restriction to GPIO pins where ESC can be connected. It
works for pins between GPIO 8 and GPIO 25 only!

Comparing to a simple implementation based on busy wait loop this
implementation is using SMI interface and DMA to generate dshot
protocol. It is less CPU consuming and works well even if CPU is
loaded by other tasks.

SMI and DMA implementation is using Jeremy Benthem work
https://iosoft.blog/category/secondary-memory-interface/.

To compile and run a simple test that spins 4 motors connected to GPIO
pins 16, 19, 20 and 21, type

    	   make test
	   sudo ./test 16 19 20 21

If it does not work, you may need to edit 'motor-dshot-smi.c' and adjust
DSHOT_VERSION and/or DSHOT_SMI_TIMING macro.


About

Dshot for Raspberry Pi using SMI interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published