views:

1424

answers:

7

Hi,

I'm currently working on a serial interfacing project based upon connecting to the rs232 port. However, seeing as a decent number of laptops and/or PC's seem like they might have their rs232 ports disappear within the next 5 years, I was considering using the RJ45 modular port for my project (EIA/TIA 568). However, I'm not quite sure how to denominate it when accessing the port through the Win32API (I'm programming in C++). It's currently programmed to "COM1". Does anyone know how I can find out what this port is called or how to configure it so it can be used in this manner?

Thank you,

Nick Sullivan

+8  A: 

I'm really confused... RJ45 ports on laptops/PCs are for Ethernet connections, aren't they? I don't understand how you could utilize one as a COM port.

If you need a serial port, and don't need ultra-low latency*, pick up a USB <-> RS232 converter, they run about $20-$30 and work just fine: from the PC software's point of view it looks like a regular old COM port.

*RS232 itself has low latency, but if you use USB as part of the serial connection, you're limited by the timing of its frames and how the USB serial converter uses them... I seem to remember USB has 1msec and 16msec frame timing; USB 2.0 appears to have 125usec microframes but I don't know if any of the serial converters manage to use them. You'd run into latency issues if you're using a command-response protocol in RS232 with lots of back-and-forth traffic.

Jason S
+1 for USB<->RS232 converter.If you need to support devices which attach only via RS-232.If you are building devices, then you should probably choose a different interface.
maxwellb
In the embedded device world, RS232 by far is the most common interface that easily communicates w/ PCs. SPI and I2C are also common but you don't see PCs that support these (especially slave mode); FTDI's USB <-> serial chips now have SPI / I2C features as well as regular UART. Ethernet and USB are available on some microcontrollers but are much less common unless you are using higher-end processors (e.g. for digital cameras + the like)
Jason S
Correct me if I'm wrong, but does the Yost wiring standard not allow one to connect to an RJ45 port in order to do serial communications?http://www.lammertbies.nl/comm/cable/yost-serial-rj45.htmlhttp://yost.com/computers/RJ45-serial/All I'm wondering is how to actually access the port from the win32 API. Am I terribly off base here?
The RJ45 is going to be part of an ethernet card (whether integrated or standalone), so you may very well not have any direct access to the port's pins, even if you were planning to do a software UART. I can't say that no ethernet card would let you do that, but I can't imagine that it's common.
Tyler McHenry
That looks like a cabling standard, not a way to bridge ethernet and RS_232. An ethernet port will probably not allow you enough control to be able to output the correct electrical signals since it is designed for ethernet rather than RS-232.
Amuck
+1  A: 

The RJ45 port you are referring to is an Ethernet port, not a serial port.

If you are looking for a more current technology, you should investigate the USB interface. If you really want Ethernet, you might be interested in the XPort from Lantronix.

-- Edit --

What type of device are you looking to use as a host?

You're worried about an aging but common standard (RS-232) going away, but you're going to use a non-standard, that never was?

The documents you refer to appear to be an alternate wiring method for a typical RS-232 port.

By the way what you're referring to as RJ-45 is a wiring standard not an interface. RS-232 can be connected via DB-9, DB-25, RJ-45 or screw terminals. The voltages and signaling are part of the protocol. The connector type is determined more by convenience.

Most computers use an RJ-45 for ethernet. The only time I've seen RJ-45 connections for serial connections was on networking equipment or terminal servers.

Brad Bruce
http://yost.com/computers/RJ45-serial/http://www.lammertbies.nl/comm/cable/yost-serial-rj45.htmlAgain, any idea how to access the port through the SetComm function?
+1  A: 

The USB port has been starting to take over the duties of RS-232 for the last few years.

You should seriously consider USB as an interface for your project.


Oh, yes; that might seem like a ludicrously obvious statement -- "duh! nobody's been using Serial for a decade now".

Not so easy: there is a lot more than mice and printers out there.

RS-232 has been the preferred interface for custom-build devices, scientific instruments, and low-production devices far long after everybody started using USB for mice and high volume consumer devices.

My most direct experience comes from amateur astronomy and accessibility computer accessories for the visually-impaired. Until not too long ago, all of the above were still mainly RS232 devices, and a common headache has been finding a way to plug those in a modern laptop. RS232-to-USB consumer adapted will sometimes work, sometimes not. At least one manufacturer of accessibility devices (a braille embosser) has stated to us that they don't recommend RS232-to-USB adapters because they have had (unspecified) problems with them.

I don't know the cause. Maybe USB components are more expensive, maybe it's the need to interface with legacy devices that would be expensive to redesign; maybe it's what the engineers know. Maybe it's just "ain't broken, don't fix it" or simple inertia.

It's only been in the last couple of years, but I've finally seen a number of these devices offered with USB ports instead of serial RS232; in some cases, RS-232 versions have been discontinued. It's just taking a little longer.

Euro Micelli
Jason S
One problem that can arise is that some adapters don't enumerate as the *same* COM port name every time they are plugged in. This is really annoying with a laptop where the cables get unplugged and put away from time to time. The better adapters all have unique serial numbers (FTDI's chips are unique at the factory, for instance) and the Windows drivers will use that to preserve the specific COM port name assignment where possible.
RBerteig
@RBerteig: good point. The flip side of this, is you start plugging in a bunch of devices and you start seeing COM8, COM9, COM10, etc. because at some point you used one particular adapter that you may never connect to your computer again.
Jason S
A: 

Correct me if I'm wrong, but does the Yost wiring standard not allow one to connect to an RJ45 port in order to do serial communications?

http://yost.com/computers/RJ45-serial/

http://www.lammertbies.nl/comm/cable/yost-serial-rj45.html

All I'm wondering is how to actually access the port from the win32 API. Am I terribly off base here?

– Nicholas Sullivan

RJ45 is just a standard for the physical connector. You can transfer serial communication or ethernet traffic over that connector, but you cannot use ethernet hardware for RS232 communication.
Harriv
The RJ45 connector used in PCs is used for ethernet (networking). It is physically wired to ethernet hardware inside your PC. If you put RS232 signals onto that connector, the ethernet hardware won't be able to understand them, and it might break the hardware (because the voltages and currents aren't compatible between ethernet and RS232). This Yost guy is using a commonly available connector (RJ45) for a protocol that it isn't commonly used with. That's okay if you develop all the hardware yourself, and only hook up your hardware to other instances of your hardware.
KeyserSoze
I can, however, access it from the win32 api, right? do you know how? Thanks for the answer, by the way.
Alright, keysersoze. That makes much more sense. Thank you.
+2  A: 

On the meta level, what you want to do is a bad idea. You're inventing your own standard for hardware, in a manner which is wholly inconsistent with established protocols.

You are much better directly using either USB or a DB-9 connector with RS-232. RS-232 is really quite good, but it's getting outdated(unfortunately, it's much simpler than usb). For salable products, you'd want to have both. For researchy/geek products, USB is much better.

You should be able to enumerate your com ports from Windows and open a given com port as a file(I've done it).

Paul Nathan
A: 

Maybe you are thinking about something like this...

http://www.comtrol.com/products/specifications/30130-1

Julianno Jungle

A: 

http://site.gridconnect.com/docs/PDF/xportmanual.pdf you mite get some ideas from reading this manual.

the way this manufacturer communicates with the product is by the rs-232 port on the camera and the Ethernet connection. the plug combines both the software to connect and the plug with samples.

Although I would like to have this setup , I am trying to make it myself rather than buying it. You may just consider buying the product and just shairing back to this thread the way they comuncate and the wireing of the plug or at least the fact that the conversion from serial to lan a valid solution.

I am also with a laptop that I want to talk to a CNC machine by way of rs-232 (25 Pin serial) and the LAN connection on the laptop.

It is not about keeping the past alive or saying whitch standard is better or worse than another.

It's about being able to run the CNC machine with the laptop and How to wire the RS-232 to the LAN 45rj - nine pin connector on the laptop and what software to use to make it happen.

::::::NOTE:::::: Also I wish to have the ability to use a Microsoft sidewinder joy stick that uses another connection ; a """" A Game Port """"" another failed attempt to make things easier. Run the CNC for use as a CMM or Computer Measuring Machine.

A little known fact is that people should only give information , if they know what they are talking about.