Author Topic: Trying to find out how device communicates over serial  (Read 1716 times)

0 Members and 1 Guest are viewing this topic.

Offline pbgbenTopic starter

  • Contributor
  • Posts: 22
Trying to find out how device communicates over serial
« on: February 15, 2016, 09:19:55 pm »
Hello,

I have a device that is controlled over serial, I want to be able to replace the controller with my own unit and need to work out what commands are being sent over the serial connection. The problem Im having is that the data is garbled. I have tried a bunch of different Baud rates and found numbers counting down at 1200, but their followed by gibberish.

I don't have access to an oscilloscope so am unable to use that route.

Code: [Select]
?????   ????????        ????????        ????????        ????????        ????????????????        ????????        ????????        ????????        ????????       ????????
        ????????        ;       ????????        :       ????????        9      ???????? 8       ????????        7       ????????        6       ????????       5????????        4       ????????        3       ????????        2       ????????1       ???





 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Trying to find out how device communicates over serial
« Reply #1 on: February 15, 2016, 09:35:49 pm »
Hello,

I have a device that is controlled over serial, I want to be able to replace the controller with my own unit and need to work out what commands are being sent over the serial connection. The problem Im having is that the data is garbled. I have tried a bunch of different Baud rates and found numbers counting down at 1200, but their followed by gibberish.

I don't have access to an oscilloscope so am unable to use that route.

Code: [Select]
?????   ????????        ????????        ????????        ????????        ????????????????        ????????        ????????        ????????        ????????       ????????
        ????????        ;       ????????        :       ????????        9      ???????? 8       ????????        7       ????????        6       ????????       5????????        4       ????????        3       ????????        2       ????????1       ???






Hi

Ok, here is the matrix:

Baud rates from 300 to 115.2K
Data size from 5 to 10 bits
One start bit
Zero or one parity bit (odd or even if present)
One or two stop bits.
Signal inverted or not

There are a *lot* of things to search out in that.

Since standard baud rates are related to each other, you can find multiple baud rates that give you some correct characters. Auto baud routines use this fact to figure out what the baud rate is. You need to search all the baud rates to be sure you have the right one. There are some that are above and below what I listed above.

Start with signal  un-inverted and do a search at 8 data, no parity,one stop bit. See what you find. Go back, invert the signal and repeat the process. That should get you somewhere. If it does not, find a friend with a scope.

Also consider -- there is no reason why a controller would talk ASCII text. It may be talking binary ...what you have may be the right baud rate already.

Bob
 

Offline pbgbenTopic starter

  • Contributor
  • Posts: 22
Re: Trying to find out how device communicates over serial
« Reply #2 on: February 15, 2016, 10:06:29 pm »
Thanks Bob,

I think it might be binary.

I used realterm to capture the data sent from the controller at 1200 Baud, no parity, 8Data and 1Stop. then I could replay that capture to the device and it would perform the action.

I guess I can work with this, just record the data sent from the controller and replay via Arduino.
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Trying to find out how device communicates over serial
« Reply #3 on: February 15, 2016, 10:32:08 pm »
Hi

If it works it works.

Bob
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: Trying to find out how device communicates over serial
« Reply #4 on: February 15, 2016, 11:33:34 pm »
get a sigrok compatible logic analyzer, some are as cheap as $10.
"What the large print giveth, the small print taketh away."
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf