RS-485 connection question

signal15

Senior Member
I have a Hexin USB->RS485 interface. It has 6 terminals on it:
- A/T-
- B/T+
- R+
- R-
- GND
- +12v

I'm trying to hook it up to my M1, which has ground, power, a, and b. I wired it up to the A and B terminals on the converter and plugged it into the data bus. I correctly put the return pairs on there, it's wired just like I would wire a keypad. However, when I plug it into the data bus, none of my ELK devices after the converter are visible anymore to the M1. I get alerts that it lost communication with expander boards.

Any ideas? Could this be internal termination on the converter? Even if it was, it shouldn't matter since I still have the return lines, should it?

The manufacturer data sheet is no help, and emails to them have gone unanswered.
 
The manufacturer data sheet is no help, and emails to them have gone unanswered.

What are you trying to do exactly? Elk doesnt document or support connecting to it's databus via RS485. If you really want to talk to the control, you should use the RS232 interface. That's documented and how Elk expects you to interact with the control.

Now if you are trying to reverse engineer their databus protocol, that sounds like a lot of fun and I hope you'll post your findings!
 
I looked at their web site. Their "manual" is a joke and basically just tells you to install the drivers. That's about it. Since you haven't had much luck getting info from them I suspect they are just reselling some foreign made device and CAN'T support it but that's just my guess. At work I have used B & B converters and have had good luck with them and with support. And the manuals have much more information in them so support is not usually needed. (no connection with them other than buying and using a few of their products.) They probably cost a bit more but consider the hassle factor...

There are a few things that can be implied from the names on the device you are trying to use.

- A/T- This appears to be a transmit (T-) or transmit/receive (A-) pin. Don't know how this is selected. RS-485 is usually bidirectional so I would expect A/B to be used for that. RS-422 is single transmitter and single receiver (As I recall...) so would use either T or R signals, one for each end. For monitoring you could use either since signal levels are the same.
- B/T+ Same as above but the + signal
- R+ Appears to be the receive pin for the + line
- R- Same as above but - line
- GND Ground. Need to hook this up and not sure if you did.
- +12v This is a bit of a mystery. RS485 is a 5 volt signal and I would expect it to get power from the USB. Why this is 12V and if it is an input or output is what I am wondering. You could take a meter from here to the ground pin with it plugged into the USB but no other connections and see if you get voltage. In most cases a terminal like this will not need to be connected to the system you are communication with as they both have their own power supplies.

If you have an Oscilloscope you can learn a lot but you may not have that.

It could be termination on the USB serial converter is overloading the lines. With it connected but with no comms happening one data line should be near 5V and the other near 0 (measured to ground). Just hooking up another RS485 node should not disrupt the system communications. Try the R+/R- lines as they should not be able to transmit and block other comms.
 
The device might not be capable of meeting the 3 state, 2 wire, RS485 spec. It looks more like a 4 wire 485/422 device.

For converters B&B is definitely the way to go. I have also used some BlackBox devices but they are much more expensive.
 
The device might not be capable of meeting the 3 state, 2 wire, RS485 spec. It looks more like a 4 wire 485/422 device.

For converters B&B is definitely the way to go. I have also used some BlackBox devices but they are much more expensive.

ELK's RS-485 bus measures 13.2 volts for the power with my multimeter. From what I can gather, RS-485 has both full and half duplex modes. ELK uses half duplex, if they were using full duplex, there would be two more wires. The converter I have should support both half and full duplex operation. A full duplex only interface can be made to work with a half duplex one by bridging the T+ and R+ together, and doing the same for the negatives. However, you need to find a way to turn off echo on the device or it will echo commands back onto the bus, potentially causing a storm of messages that takes it down. Being that my device has labels for just A and B, it should be a dual mode converter.

I have an idea that would require me to talk/interact directly on the RS-485 data bus, so this is why I'm trying to get it working. An XSP won't work for what I want to do.
 
ELK's RS-485 bus measures 13.2 volts for the power with my multimeter. From what I can gather, RS-485 has both full and half duplex modes. ELK uses half duplex, if they were using full duplex, there would be two more wires. The converter I have should support both half and full duplex operation. A full duplex only interface can be made to work with a half duplex one by bridging the T+ and R+ together, and doing the same for the negatives. However, you need to find a way to turn off echo on the device or it will echo commands back onto the bus, potentially causing a storm of messages that takes it down. Being that my device has labels for just A and B, it should be a dual mode converter.

I have an idea that would require me to talk/interact directly on the RS-485 data bus, so this is why I'm trying to get it working. An XSP won't work for what I want to do.

For the device you are using (without digging into the manual):
- You shouldn't need the Gnd/+12, only the A/B since it is a differential signal;
- Drivers probably need to be loaded to set it into 485 mode others the transmit lines are enabled, which will kill the bus.

If you want this converted to 232, just get the Elk MB485 and your all set (yes, they sell the adapter if you look closely)

Some input on what you are digging into ...

I did a lot of reverse engineering about 2 years ago using an Ethernut v2 development board because it needs true 9-bit data words to work. Most microcontrollers support 9-bit with a special interrupt tied to the 9th bit because it is used for addressing. Just using a PC, you need to set it for 8 bit, space parity and look for parity errors. Generating them is hard because of character timing vs parity shifting combined with some strict timing on the bus.

I got to the point that:
- Full ASCII dump of packet hex data, both Elk transmitted and responses (identified);
- Discoverable on the network (it responded to the discovery and poll messages) and could represent multiple modules;
- Decoded discovery, poll, time, relay, lighting, tstat.
- Decoded firmware download
- Respond to module-global poll with "have data" and the module-device poll with the data

Stopped just before creating a real interface for ALC with custom mapping since ALC started to go away. I have a "c" header file with comments, an example:
Code:
typedef struct {
   unsigned char     module;
   unsigned char     address;
   unsigned char     command;
} ELK_COMM_HEADER;

/**
 * Comm Format ef - Set Outputs
 * 
 * Type        Panel Request, Broadcast
 * Command     ef
 * Module      00 (All)
 * Address     00 (All)
 * 
 * Length      11
 * 
 * Response/Notify: No
 * 
 * 00 00 ef 01 02 00 02 00 6f 60 a5
 * 00 00 ef 01 00 00 02 00 82 08 a5
 * 
 **/

typedef struct {

   ELK_COMM_HEADER   hdr;

   unsigned char     baseoutput;    // Base output # for command
                                    // 1-based, multiples of 16

   unsigned char     status_hi;     // Status of 9..15 (bits, from baseoutput)
   unsigned char     status_lo;     // Status of 0..7  (bits, from baseoutput)

   unsigned char     mask_hi;       // Status change mask of 9..15
   unsigned char     mask_lo;       // Status change mask of 0..7

   unsigned short    cksum;
   unsigned short    a5;

} ELK_COMM_FMT_EF_REQ;
On this message, the module and a5 will have the 9th bit set so you have interrupts at both address and end-of-packet.

I want to get this Linux-based because there is much more detail within this bus than the 232 bus (and you know if it is a command or status!) but not sure I can because of timing and the 9th bit issues.

Drop me a line directly if you would like what I have as a starting point. The code is not anywhere near as clean as I like it, but this is an in-progress reverse engineering project that has been hacked at quite a few times as I learned things.

Jay
 
It's been 10 years since the last message on this post.
 
Jay... I am trying to emulate an M1X-IN module for a personal project, so that my own system can interact with the ELK-M1 through zones. I've been able to get a 9-bit capable serial adapter and have got as far as to be able to read packets on the bus. While I have reverse engineered other RS-485 protocols in the past, this one seems harder or maybe I am losing my edge. Is there any chance you can point me to the right direction? I've picked some ideas from your post but it does not seem to be enough. I've tried to send you a PM but the site won't let me (I don't seem to have the privileges for that).
 
If there is any chance you can e-mail me to cris at losadamo dot com, I would greatly appreciate it.
 
Thank you,
 
Cris Adamo.-
 
 
Back
Top