Welcome! Log In Create A New Profile

Advanced

BV4213

Posted by ugine 
BV4213
July 24, 2012 12:11PM
Does the BV4213 motor driver work with 3v3 Vcc and with 3v3 i2c bus?
Re: BV4213
July 24, 2012 12:14PM
The logic IC will work down to 3V but the L293 data sheet specifies the minimum voltage of 4.5 so the answer is probably no.
Re: BV4213
January 01, 2013 04:42PM
Hi, I'm really stuck on this and could definitely use a little help!

I'm trying to use a BV4213 motor controller board with a revision 2 Raspberry Pi. I have the board connected to an AB Electronics ADC Pi V2 - this happens to have a buffered 5v I2C port which allows me to connect at the right logic voltage (the Pi is normally 3.3v).

I have a DC motor connected between pins 1 & 2, and another between pins 3 & 4 on the DC output connector. I also have 12v coming in to the same connector. The Pi itself actually has the required pull-up resistors, or so I have read. I also understand that the board defaults to I2C mode, so I have nothing else connected.

If I run i2cdetect, I can see the BV4213 at 0x21 (7-bit), and also the ADC at 0x68/0x69 (which we'll now ignore).


> i2cdetect -y 1

0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- 21 -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 69 -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Note: I'm using I2C bus 1 rather than 0 as this is a revision 2 Raspberry Pi and they switched things around.

I can run the test command on the BV4213 using i2cget and receive the incrementing number returned as I should:

> i2cget -y 1 0x21 0x55

0x01
0x02
... etc

Now, here's where I run into problems. Using i2cset, I should (I think) be able to start the motors running with a few commands, as follows:

> i2cset -y 1 0x21 0x01 0x01
> i2cset -y 1 0x21 0x04 0x01
> i2cset -y 1 0x21 0x15 0x80

As per the datasheet, that should:

1) enable Y1,Y2
2) set differential control of Channel A (Y1,Y2) so that the connected motor runs in one direction
3) set PWM channel A to 50%

I have tried sending various formats for the last argument (e.g. 0x01 / 1, 0xFF / 255) but nothing seems to work. There is no voltage showing on any of the output pins.

The BV4213 is not listed as requiring the clock stretching "fix", though I did compile and run bcmdel as per instructions on this site

> sudo ./bcmdel

This didn't seem to make any difference.

I'm obviously missing something (I'm very new to this). Any ideas?
Re: BV4213
January 03, 2013 07:27AM
hello,
you have done everything correctly but this device needs a very small delay between sending the command and sending the data for that command thus:
1) send start condition with address S 0x21
2) send command (0x1)
3) delay about 50 to 100uS
4) send data for command (0x1)
5) send stop condition P
I don't think that you can do this on the PRi as you only have partial control over the I2C bus. The options are:

1) Use Option 2 that will give you full control over the I2C bus and does have the advantage that any pins can be used for the SDA and SLK
2) There is an alternative device that will work with the RPi on the serial bus and it uses the more powerful L298. As you have got the BV4213 for the RPI then contact me here to do a swap or your money back as I operate a full money back policy if you are not happy with the device for any reason.
3) There may be an alternative way to get full control over the I2Cbus that I don't know about.

Jim
Sorry, only registered users may post in this forum.

Click here to login