Adafruit DRV8871 Motor control module

For general Flowcode discussion that does not belong in the other sections.
Post Reply
TWPC
Posts: 20
http://meble-kuchenne.info.pl
Joined: Thu Mar 30, 2023 1:51 pm
Has thanked: 3 times

Flowcode v10 Adafruit DRV8871 Motor control module

Post by TWPC »

Hi all,

Was wondering if anyone could shed some light on what i am missing.

I have a Adafruit DRV8871 Motor control module, which as i understand uses two pins on a microcontroller giving alternating PWM depending on direction. for example (not accurate to pins on an Arduino R3 of which i am using),Forward (max speed), pin 1 = low, pin2 = 255 and backwards (max speed), pin 1 = 255, pin 2 = low.

I am using the dc motor component and am clearly missing how to set up the properties for this board. if anyone has used this board or know the property config, minus the pins as that will be unique to what i am using - i would greatly appreciate it.

Thanks all,

Here are some links to the board if it helps.

https://learn.adafruit.com/adafruit-drv ... r-breakout
https://learn.adafruit.com/adafruit-drv ... kout/usage

chipfryer27
Valued Contributor
Posts: 1149
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Adafruit DRV8871 Motor control module

Post by chipfryer27 »

Hi

The module can either run a motor forwards or backwards (at full speed) depending on logic levels on Pin 1 / Pin 2 as you describe above. To adjust the speed you need to use PWM on a pin.

Using forward direction (and your pins) as an example, You would set Pin 1 Low then enable PWM on Pin 2.

Pulse Width Modulation varies the duty cycle of a pulse. 0% would give a constant Low, 100% a constant High with 50% a perfect square wave. The WiKi has many examples of how to use PWM.

I'm not over familiar with your chip but I know it has many PWM channels and it would probably be easier to use the PWM (Internal) components on each pin, and set according to desired direction and speed.

Regards

TWPC
Posts: 20
Joined: Thu Mar 30, 2023 1:51 pm
Has thanked: 3 times

Re: Adafruit DRV8871 Motor control module

Post by TWPC »

Hi Chipfryer27,

Thank you for your help. My gut feeling was to use the PWM (internal) component, however i was just hoping it might be possible with the dc motor component and i was just missing something. all working.
thanks again :)
Kind regards,
Leon

Post Reply