Main Site Documentation

Half Duplex UART type support


#1

Hi,

I have the FEZ Mini starter kit and I want to use it to control a Robotis Dynamixel AX-12 servo. The manual for the AX-12 says the UART has to be of the “half duplex” type which is described on pages 7/8 of the AX-12 manual with a circuit diagram:

http://forums.trossenrobotics.com/datacenter/robotis-19/ax-12-manualenglish-75/

I don’t expect to supply power from the FEZ board (although that would be nice if it were easily posssible), just the signal - can I do this?


#2

Yes, you can do this…

Half duplex means that transmision can only occur in one direction at a time. But, what I think they mean is that you can only send data to the servo, it does not send any data to you.

You can power the servo off an external power supply as long as you tie the ground of the mini to the ground of the external power supply.


#3

Hi Mike,

Yep - half duplex does mean you can only communicate in one direction at a time - AND the servo actually DOES send messages back (well, you request them) and for the application I am intending to build, I do need that!
There is a circuit diagram in the link to the document I supplied and a (short) description.
You say I can do this, but you don’t say how - connect the wiring as described in the FEZ manual for UART, open the COM port as per normal for UART Tx/Rx and that’s it - or do I have to do anything else?
So in this case GND (FEZ pin1) would connect to GND (AX pin1), Signal (FEZ pin2) to DATA (AX pin 3) and VCC (FEZ pin3) would connect to VDD (AX pin2) AND (presumably) I could supply power to the AX via the FEZ board by supplying 9v input to the FEZ board?

I am just being cautious in my questioning because I have managed to fry one bit of hardware, not from GHI :slight_smile: this week by wiring it incorrectly!


#4

Hmmmm.

I looked at the manual for the servo…

It looks like you are trying to connect directly to the servo bypassing a controller board.

If you want to do that, you will have to implement the circuit shown in the manual to convert a two pin UART into a single data path, or write software to emulate a UART and change between being an input and output port. Both solutions are more complicated than just connecting pins together.


#5

Hi Mike!

I was hoping you’d do that! :slight_smile:

Yes !

I thought you’d say something like that!
With my background in software, I am (much) happier attempting the latter. I am assuming that I will have to:

(a) power the servo separately and not from the board
(b) as per your instruction earlier ensure the GND is tied to the GND of the FEZ board
© Implement a Half Duplex UART emulator (and hope I can do all this in managed code - C#)

Does that sound about right? And if so could you give me a short pointer on © above - i.e. for starters what I might have to do? I promise I won’t bother you any more after that! :slight_smile:


#6

Hi Mike,

OK, quick search on the web and I think I can answer my own question - too complicated to do in software - seen some examples for various chips - all written in assembler and I turned around to run away with my tail between my legs… :frowning:
I really want to bypass the controller - as it is too much for my purposes - how do I go about the hardware option? I am assuming there must be some hardware off-the-shelf full->half duplex boards?


#7

One issue to check… are the voltages between the min and the servo compatible. The min is 3.3V, but is 5V compatible. That is, the mini can connect to 5V logic. Hopefully, the servo data signal is 3.3 or 5 volts.

Assuming there are no voltage issues…

Something to try…

Open a UART with the data pin as TX. Send a command. Close the UART and reopen with the data pin as RX.

The turn around delay to do this may be too long and you will lose data. But, you might get lucky

There might be easier hardware solutions but it would take me a bit of time to work one out. I am a software guy also.


#8

Hi Mike,

Yes the servo data signal is 5v.

I will try as directed but I was hoping you’d say something else - in that I could connect two UARTs to the servo one Tx and the other Rx and use separate threads to monitor them - that way I absolve myself of guilt for losing data - maybe. Is that possible?

In the mean time if you could also locate some possible hardware solutions (other than the obvious one of getting the dedicated controller :slight_smile: ) that would be nice too - thanks for your help!


#9

Let me jump in here…Mike did a good job but I want to cover it a bit more.

What they did on the servo you pointed out is use one wire for incoming and outgoing data. This works great but then you can only send or receive (half duplex).
All that is easy with the exception of one problem…how would you connect 2 wires from FEZ to one wire on servo? (you should make a wiki page on our project website once this is working)

Option1:
You can implement the circuit they pointed out, which uses 2 different logic gates. You can actually do this with only 74HC126 but then you need 2 pins from FEZ, one to enable TX and one to enable RX.

Option2:
Use a general purpose transistor to reconfigure the TX pin for UART as open drain. Leave RX always connected. I do not recommend this if you do not know what I am talking about.

Option3:
This can be done in software I think but it requires you to use register access to control the processor directly. This is not easy for beginners. I personally do not mind making code driver for it if you send me one of those servos as a gift :wink:


#10

[quote]Option1:
You can implement the circuit they pointed out, which uses 2 different logic gates. You can actually do this with only 74HC126 but then you need 2 pins from FEZ, one to enable TX and one to enable RX.[/quote]
I know what you’re talking about, but frankly, I couldn’t do it :frowning:

[quote]Option2:
Use a general purpose transistor to reconfigure the TX pin for UART as open drain. Leave RX always connected. I do not recommend this if you do not know what I am talking about.[/quote]
Eh? :confused: I don’t have the foggiest what you are talking about!

[quote]Option3:
This can be done in software I think but it requires you to use register access to control the processor directly. This is not easy for beginners. I personally do not mind making code driver for it if you send me one of those servos as a gift [/quote]
Give me your delivery address NOW!!! :smiley: (Those servos are fun to play with) :smiley:


#11

omg those would be nice on a biped


#12

Ship it to GHI and put Attn: Chimp

I should be able to make you a driver in the same day. Where do you order these if I want to buy few in future?


#13

Hi Chimp,

Ordered from Trossen Robotics right now:

http://www.trossenrobotics.com/dynamixel-ax-12-robot-actuator.aspx

I chose next day UPS air but I believe I have missed the 14:30CST shipping deadline so it will get sent out tomorrow for you to receive it Wednesday.

I live in the UK and I normally order them from UK/Europe based distributors, but I chose Trossen because they are based in the states.

Larger quantities can be ordered from the manufacturer direct - www.robotis.com - but I believe they are Korea-based and it is not economical for smaller numbers!

Good luck! And thank you (very much). :smiley:


#14

I have done some searching and I think the easiest way to order these in USA is through http://www.robotshop.com

…will be waiting to try the servo you sent :slight_smile:


#15

A little dickie bird tells me you have received your new toy! Enjoy!

BTW there is a C# Dynamixel API you can download from here:
http://www.agaverobotics.com/services/dotnet/Dynamixel/default.aspx


#16

Yes we have it now and can’t wait to try it out


#17

Do you know if these are 5V or 3.3V…or what voltage is needed?! I am not finding this info in the servo manual


#18

Hi Chimp,

The voltage is 7v - 10v, recommended voltage is 9.6v, you will find that information in the manual, perhaps you have the wrong one. I am going to find some links for you. Give me a minute.


#19

OK, you can get the manual from here:

And this document is the best document which gives you a step-by-step description of how to wire the power to it. I recommend rather than use a 9v battery as in the pictures that you use a mains adapter as the servo will drain the battery rather quickly!

http://www.crustcrawler.com/electronics/USB2Dynamixel/docs/ConnectingAX12toUSB2Dynamixel_Rev0.1.pdf


#20

The adapter you pointed out in last post can be used with FEZ. In worst case, if we can’t make it work directly then we defiantly can connect then USB adapter…you need FEZ Domino ad Mini doesn’t have USB host. Did you know the default baud rate is 1000000!!! Who uses this strange baud rate! Anyway, good thing FEZ supports it.

I have it wired and sending ping command to it but it it is not responding! I am still trying to see why…all looks good on scope :confused: