Go Down

Topic: Controlling lab equipment with Due and micro-USB to RS-232 DB9 adaptor (Read 77 times) previous topic - next topic

discwv

Hello all,

I'm a software person, and only a college student at that, so I'm a bit over my head with all this hardware stuff, so I apologize if my description is lacking.

One of my coworkers has gone on vacation for a couple weeks and I've been handed a project that he's been working on. I've been given a Due and a micro-USB to DB9 adaptor and I need the Due to be able to talk to a UC-2000 laser controller. As far as I know, what they hoped to do was just plug the adaptor into the native USB port on the Due and then just use SerialUSB to send commands to the laser controller. When I attempted this, however, it did not work. I've been looking around all day as to why this wouldn't work, and I believe it's because of how USB->RS-232 adaptors work. That is, you need drivers installed on the device plugged into the USB end for it to simulate a COM port, and you can't (as far as I know) put drivers on an Arduino.

So my question is, is it possible to connect these devices like this? Or will we have to make a different type of connector? My gut tells me it's not easily doable, but I might just be making a mistake somewhere else.

MorganS

The USB-to-Serial converter is definitely the wrong thing.

OK, do you understand that there are two different things that might both be called "RS-232"? The actual standard, which was originally named RS-232, specifies some pretty high voltages for the wires. (Plus and minus 12v.) Then there's "Serial TTL" or "TTL levels" which is exactly the same serial data except the voltages are low enough to be generated directly by a Due or other microcontroller.

For most devices with a DE9 connector, they are probably using the full voltage RS-232. You will need a level converter to step up to that voltage. There are some cheap ones around but the proper converter chip is so easy to use I don't know why you would bother with a cheap one. Maxim Integrated makes the best ones. Their line of chips that started with the MAX232 now has an enormous number of variations. For through-hole soldering and 3.3v compatibility, I like the MAX3222EPN+.

This is what's on my breadboard now (see photo.)

JWScotSat

Working on 2 assumptions here:

1 - The project isn't VITAL that you use the usb-rs232 converter

2 - The device you're communicating with doesn't require the extra RS232 signals above TX-RX (i.e. RTS etc for control).


With both of these assumptions true, you can easily use something like this  Serial-RS232 Converter which even comes with a nice DB9 connector.

This would really plug and play. Connect Serial 1, 2, or 3 to the RX-TX on the converter, as well as power, and you'll be flying.

However, if your application requires the control signals as part of the communication, then you're going to need to look at a more advanced converter. By the by, I think this is reasonably unlikely and that a cheap Serial - RS232 converter should work.

I haven't used the above linked converter before but I have used this one many many times and it's been great (once you get the TX-RX connected correctly).

Good Luck,

JW

discwv

With both of these assumptions true, you can easily use something like this  Serial-RS232 Converter which even comes with a nice DB9 connector.

This would really plug and play. Connect Serial 1, 2, or 3 to the RX-TX on the converter, as well as power, and you'll be flying.
I'm pretty sure I don't think I need the extra signals. Thank you!

robtillaart

here is another thread with related discussion - http://forum.arduino.cc/index.php?topic=221863.0 -
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

MorganS

With both of these assumptions true, you can easily use something like this  Serial-RS232 Converter which even comes with a nice DB9 connector.
1. That cheats by using the incoming signal to generate the required negative voltage for the outgoing signal. Depending on the data actually being transmitted, this may fail to work.
2. It can't generate output voltages higher than the 3.3v Vcc. Your equipment will probably accept this lower voltage but it may not.
3. It will also stress the Due TX pin to the 9mA limit of current it can sink, due to the LED. (TX on the Arduino goes to RX on this board.)

The Max3232 breakout from Sparkfun looks good and it's less than half the price of the other one, although you will have to do more work to attach a DE9 plug.

CrossRoads

Get one of these, let the Due talk 0/3.3V levels, with RS32 levels at the connector.
One has male connector, one has female.
http://www.nkcelectronics.com/rs232-to-ttl-converter-board-33v232335.html
http://www.nkcelectronics.com/RS232-to-TTL-converter-board-DTE-with-Male-DB9-33V-to-5V_p_369.html
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up