0
\$\begingroup\$

In the current network, there's 1 master device, which gathers data from over 20 devices. Nameplate says the baud rate is 2400. In the bus cable there's one data wire, 12V and GND. A friend of mine connected oscilloscope to Data-GND and checked there's 0-12V voltage level.

I want to reverse engineer the protocol used, so I'd like to connect my PC to check byte frames. Is it safe to connect Data to RxD and GND to GND of COM port, or will I damage the ports by connecting it that way?

EDIT: Today I had a chance to connect device to logic analyzer. Here's the screenshot of sigrok:enter image description here

I used UART and inverted Rx cause it looked somewhat reasonable. Afterwards I connected Data and GND to usb/TTL converter to hopefully get some data to work on, but sadly serial port monitors show nothing... Any idea how can I capture the signal?

\$\endgroup\$
1
\$\begingroup\$

One key piece of information missing is the bandwidth of the signal, but it's likely not extreme.

A PC "com" (asynchronous serial) port is not suitable, because it won't match a "one-wire" type data format. Of course it is possible that what you are looking at actually is serial, (even RS232), but in that case you have not accurately described the signal or it is not entirely proper - proper RS232 signals swing both above and below ground, and they aren't the same as what are typically referred to as one-wire protocols.

For the generic case of moderate rate protocols with one more more wires, you can build a resistive voltage divider to reduce the level (also add a diode clamp if the signal may swing negative), and then feed it into something like a cheap logic analyzer based on a CY7C68013A USB chip. Then you can use sigrok to operte this as a logic analyzer followed by either pulseview for visualization, or custom python decoders (original or based on existing models that ship with sigrok) once you start to get an idea of what you are looking at.

It will be a lot easier to set this up if you have a scope to look at the divided signal while you are trying to verify the logic analyzer setup - scope to look at the fidelity of input translation, analyzer to pipe data to where you can start to interpret it.

\$\endgroup\$
  • \$\begingroup\$ The signal is 0V and +12V DC. I'm sure there's no negative voltage. I thought it'll be as easy as converting signals to 0-5V and monitoring hex data on some terminal software. But seems it's more to that. Will buy some analyzer and see if I can read something. \$\endgroup\$ – imperf Apr 8 at 20:56
  • 1
    \$\begingroup\$ It is possible that the data matches an asynchronous serial port, but without specifics impossible to tell. The logic analyzer is a universal tool for about $12 and a very useful thing to have around. If your friend can take a screen shot of the signal on the scope, it may be possible to identify it as something that is logically compatible with RS232. \$\endgroup\$ – Chris Stratton Apr 8 at 21:50
  • 1
    \$\begingroup\$ Another thing that may actually work, if crudely, is to feed the signal into a sound card through a very small series capacitor and plot it with audio software like Audacity. You'll lose any steady DC level, but if it is toggles often enough you may be able to see enough despite the AC coupled distortion to at least rule out some possibilities. \$\endgroup\$ – Chris Stratton Apr 8 at 21:52
  • \$\begingroup\$ I spent last hour to check up on the logic analyzers and they really are good to have around. Will get one and hopefully see something useful. I will see my friend tomorrow in work, so will ask if he made some screenshots from the scope. Sound card solution looks nice, but I work on my employer's laptop, and I don't wanna fry the card so I think I just stick to logic analyzer for now. (very curious how it would work, though) \$\endgroup\$ – imperf Apr 8 at 22:14
  • \$\begingroup\$ Updated my post with screenshot of Pulseview. I failed at gathering data through serial port monitor, though. Could it be caused by too high resistance used in voltage divider? \$\endgroup\$ – imperf Apr 23 at 4:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.