Probably impossible: Position Controller 29319 with two-wire serial connection
This is probably impossible:
I have a Motor Mount (27971) with the integral Position Controller 29319. They work well under the basic stamp control.
The position controller uses a single-wire serial connection: the DATA communications line is used to send and receive daa, and connects to a single-wire UART bus.
I'm trying to connect the position controller to a system that has a TWO-wire serial communications.
That is, the microprocessor has one wire for transmit data, and a different wire for receive data. (all TTL levels)
I'll bet that this is impossible. Ideas? Suggestions?
I have a Motor Mount (27971) with the integral Position Controller 29319. They work well under the basic stamp control.
The position controller uses a single-wire serial connection: the DATA communications line is used to send and receive daa, and connects to a single-wire UART bus.
I'm trying to connect the position controller to a system that has a TWO-wire serial communications.
That is, the microprocessor has one wire for transmit data, and a different wire for receive data. (all TTL levels)
I'll bet that this is impossible. Ideas? Suggestions?
Comments
I just googled "open collector non-inverting driver" and found a TI SN5407 Integrated Circuit.
So far, so good.
I buy this chip.
Then I connect the input of this to the microprocessor's UART transmit pin. OK, so the microprocessor's output goes to the chip.
Then I connect the output of the chip-driver to the position controller. This will cause the microprocessor's output to go to the position controller. So far, OK.
Then I connect the output of the chip-driver also to the UART Receive pin. This step is baffling to me:
This means that the output of the chip-driver goes to both the position controller and the uart receiver.
Will the Position Controller's output *also* go to the UART receiver?
(is there magic inside the SN5407 chip that sends its input messages to its output but does not bother other signals that appear on its output?)
Youth wants to know...
I have this working using a standard UART on a PIC32 using a simply diode to interface the tx and rx pins on the PIC to the communication bus.· I was having some problems, but this is not related to communication. Right now my post is immediately below yours!·
http://forums.parallax.com/showthread.php?p=921994
Scott
http://forums.parallax.com/showthread.php?p=907856
Scott
Yes, I am facing the exact same problem that you are. *sigh*
I will try your 10K resistor & diode trick.
MANY THANKS!
-Cliff
These programming problems grow out of using the same line for both transmit and receive.
Tomorrow, I'm tacking together a 10K resisitor / diode to connect the two-wire microprocessor to the one-wire Parallax encoder. I'll let you know how (if?) it works...
Cheers all around,
-Cliff
I built the Arduino to Parallax Motor/Encoder interface (just a diode & 10K resistor to convert from the 2-data wires used by the Arduino serial port
to the 1-wire system used by the Parallax motor/encoders.)
I've also written a set of functions to drive the Parallax Encoder/Motor system from the Arduino Mega.
I've attached the sample program and code to this note (I hope!). Enjoy!
Best wishes to all,
-Cliff Stoll
Oakland, California 2010/July/25
I would like to thank you because your work on those position controllers helped me so much.
I took a look at your code and it's very rigorous and so well commented.
I have the exact same configurationn and your "firmware" is very effective and so much things are so simple now...
Thank you.
Sincerely,
Steve
I have a version of the above code (Cliff_Stoll_Parallax_Motor_Control_Functions_for_Aduino.pde) which I am running on an Arduino making use of the diode and resistor documented at the top of this file to do the conversion from 2 wire to 1 wire UART. The arduino is wired to the position controllers as follows:
UART_wiring.jpg
I have the right motor set as reversed. When the TRVL command is issued with positive counts, the motor mount kit (36 count encoders) behaves as expected. However, when passed a negative number of counts the motors do not reverse, instead they rotate in the positive direction for greater than the (absolute value of) issued counts. Any ideas as to why this would happen? Note that my code 9 (attached) is the same as the above appart from the line that writes to the serial port - I use serial.write(x) instead of serial.print(x,BYTE) since the latter has become deprecated. Would this cause a problem?
Cheers