Welcome! Log In Create A New Profile

Advanced

Two BV4112 Stepper Controllers on One Raspberry Pi

Posted by andrew 
Two BV4112 Stepper Controllers on One Raspberry Pi
February 24, 2013 10:35PM
Hi, I'm having some trouble getting two BV4112s to talk at the same time, I wonder if anyone can help!

I can get each board working in isolation without any trouble. I have set each board to a different address (101, 102) and specified the baud rate (38400) in the EEPROM hoping to avoid the handshake. No problems so far.

With both boards connected in parallel neither board responds. There is no evidence of anything coming back on the RX line of the Pi.

I have tried turning Multi mode on for one of the devices. I've confirmed that I can still talk to this device in isolation.

If I cut the 3.3v line to either board, both boards still do not work.

If I cut the RX & TX lines to either board, the other board will work.

A few questions:

1) Is it possible that I need to remove a pull-up resistor from one of the boards, and if so, is there a diagram somewhere that shows the exact location? The two boards are the only things connected to the UART. The datasheet suggests that with more than 3 devices the resistors should be removed - but the Pi is only supplying 3.3v.

2) With the baud rate set explicitly, I'm assuming that I don't need to "handshake" (sending a series CR's with various delays as in your Python example). It does seem to work in isolation, but am I correct? Can I send motor commands immediately after the UART is opened?

3) Should it be possible to isolate a board by cutting just the 3.3v supply or do I definitely need to cut the RX/TX lines as well?

4) Anything I've missed?!

Many thanks,
Andrew.



Edited 1 time(s). Last edit at 02/24/2013 10:47PM by andrew.
Re: Two BV4112 Stepper Controllers on One Raspberry Pi
February 25, 2013 03:24PM
They are designed to work together so here are some pointers:
1) no need to cut any tracks or remove resistors they should work up to 3 or more without.
2) both devices need to have multi set, this stops the '*' ACK when reset and enter so some software changes may be needed in the init to recognise this. - set EEPROM location 7 to 1 on both devices.
3) the Baud rate needs fixing on both devices as auto Baud rate will be unreliable when 2 or more devices are connected - set EEPROM location 4 on both devices to say 7 for 115200 Baud.
4) the address needs to be different for each device, so one of them will need changing - set EEPROM location 2 on one of the devices to say 98

To answer your questions:
2) With the Baud rate fixed the devices are ready at switch on, no need to send any CR
3) Cutting the 3.3V supply to the board should isolate the device. If you are going to use the TX/RX for something else the boards may have an impedance that could disrupt any other equipment connected to TX/RX
Sorry, only registered users may post in this forum.

Click here to login