I have purchased a TB6612 in order to replace an LP298n to power one single motor. Bad surprise as it is waaaaaaay more complicated to connect when the LP298n is such a piece of cake with just some power and one single digital connection from the Arduino.
Has anyone found the way to connect this tiny TB6612 the same simple way ?
Read the datasheet. You will find a schematic of a microprocessor connected to a TB6612 with six pins of output.
The PWM connection must remain under microprocessor control, but if you tie the other four to appropriate logic levels, you will have a dumb PWM only motor controller.
If you don't want to change direction then you can hard wire all inputs except PWM.
Inverted inputs are widely used in RS-485 modules to change direction. One input enables reading while LOW, the other input enables writing while HIGH. Connecting both will change direction with a single signal. If both inputs (like AIN1/AIN2) have same polarity then an inverter has to be added for such a single signal control.
… we mean connect the four unused inputs each to an appropriate logic level.
Use a 4K7 resistor on every input that is to be held at a constant level, and wire the other end of each resistor either to Vcc to tie it high (true), or to GND to make it low (false).
Then as you have realized, the PWM pin can be used alone to control the speed of the motor.
Consult the datasheet and figure out what those four inputs should be for making the motors spin the one direction you are interested in.
Quote
Use a 4K7 resistor on every input that is to be held at a constant level, and wire the other end of each resistor either to Vcc to tie it high (true), or to GND to make it low (false).
UNQUOTE
1- That is very helpful ! My electronics knowledge is super basic and I had no idea I could do that
Thank you !
2- By default, for my education,
do I absolutely need a 4K7 when connecting unused inputs to the ground for LOW values ?
3- I am also reading that I need to put the standby value to High... Do I need also a 4k7 resistor ? Or can I just connect it to the VCC ?
Forum hardware heavies will weigh in, this is a bit above my pay grade:
With regard to the necessity of the resistors… it depends.
Often, no resistor is needed on inputs that are hard wired.
Studying the data sheets of the two devices would be a way to figure out if you need the resistors in your circumstances.
You could use four output pins, and just set them as outputs and to the value you want in setup().
No one wants to waste pins like that.
You could just wire them to Vcc or GND as needed and and hope for the best. I advise against that, because I don't want to see anything go wrong on my advices.
Or… you could use the resistors. The value is not critical. Anything from 1K to 47K should work fine. I picked 4K7 but often use 10K.
It's lazy of me, but rather than figure it out every time, I just use a resistor. Im not building 10000 of anything, so there's no reason to not.