DRV8876 + Arduino/Attiny85

Hello, I am looking for help to wire a drv8876 to an Arduino or to an attiny85 and to a motor

I would be interested to get a code example. Thanks a lot.


The DRV8876 has three different control modes that would need to be programmed differently. I suggest you use it in phase/enable mode (which is achieved by wiring it as shown in the diagram you posted). We do not have a specific example program for doing that with the DRV8876, but the phase/enable interface is very common, so you should be able to find several examples with a quick Google search. (Ideally, I suggest finding a library that sends PWM signals with a 20 kHz frequency for quieter operation.)

If you just want to make something basic yourself though and are using the Arduino IDE to program your boards, you could just use analogWrite() commands for the pin connected to EN to set the speed and digitalWrite() commands on the pin connected to PH to set the motor direction.

- Patrick

Thanks Patrick! I will!
Have a nice day