Low Cost PCB's Low Cost Components

Author Topic: DS2000 serial decode noob - doesn't read right  (Read 1169 times)

0 Members and 1 Guest are viewing this topic.

Offline Circlotron

  • Frequent Contributor
  • **
  • Posts: 844
  • Country: au
DS2000 serial decode noob - doesn't read right
« on: September 24, 2015, 02:54:02 PM »
Trying to decode a serial line with the DS2000. Total noob with this function. As per the attached screenshot the data after the start bit (cursor location) L>R is 10111111 but the decode bizzo shows it as 00111111.  Tried various settings. What's going on here?
 

Offline Circlotron

  • Frequent Contributor
  • **
  • Posts: 844
  • Country: au
Re: DS2000 serial decode noob - doesn't read right
« Reply #1 on: September 24, 2015, 03:09:30 PM »
Okay, this is with normal polarity and MSB Endian. Makes a bit more sense.
Previously was inverted and LSB Endian.
 

Offline Electro Fan

  • Super Contributor
  • ***
  • Posts: 1647
Re: DS2000 serial decode noob - doesn't read right
« Reply #2 on: September 24, 2015, 03:28:24 PM »
You are close - stick with normal polarity and go back to LSB.

Make sure you have this:

http://www.ascii-code.com/

Make a test text file in a simple text editor on your PC.

If the PC has a RS232 serial port use your scope probe to connect to the TX and GND pins on the port.

Use a terminal program on your PC to set up the parameters (speed, # bits, stop bit, parity, etc.).  Make sure to turn off (hardware) flow control.  Transfer/Send the text file (if you make the file long enough and send it at a low speed like 2400bps you will have plenty of time to twiddle with your scope settings).   

Set your scope for the same parameters, including normal polarity and LSB.  Start with ASCII on the decoder (vs. Binary or Hex or Decimal.  ASCII characters are easy to recognize/read).  Once the characters read properly (in ASCII) change to Binary and then you will have confidence that the Binary is correct (plus you can confirm it with the ASCII Table).

Have fun.

PS, notice on the individual Binary characters (such as the u and the m below) that the number patterns (1s and 0s) go the opposite direction of the waveform patterns.  The number (bit) on the right side of the Byte in the Binary sequence is depicted by the left side of the waveform (1s are open on the top of the waveform and 0s are closed on the top of the waveform).  It's probably easiest to see on the Binary m.
« Last Edit: September 24, 2015, 04:40:08 PM by Electro Fan »
 

Offline Circlotron

  • Frequent Contributor
  • **
  • Posts: 844
  • Country: au
Re: DS2000 serial decode noob - doesn't read right
« Reply #3 on: September 25, 2015, 07:27:27 AM »
Thanks for that Electro Fan.
Now also I see the length of the green strip shows where the actual data portion of the byte starts and ends.
 

Offline Circlotron

  • Frequent Contributor
  • **
  • Posts: 844
  • Country: au
Re: DS2000 serial decode noob - doesn't read right
« Reply #4 on: September 25, 2015, 03:35:05 PM »
Still struggling though.
Getting a piece of bit-banging code in assembly going on a micro.
What confuses me though is every example of RS232 serial I have looked up shows the line normally high, the start bit going low, and individual data bits going low for a "1". The only way I could get the scope to read sensibly though is to have the line normally LOW and the start bit goes HIGH even though the individual data bits going low for a "1" same as before. That does not make sense to me, that the start bit would be the opposite polarity to the data bits. Lots of examples show it to be the same polarity.

Here's the scope reading the right data even though the start bit goes high. Opposite polarity start bit and it reads way wrong.

Edit -> See linked timing pic that shows they are in fact different polarities...
http://www.ermicro.com/blog/wp-content/uploads/2008/12/rs232_01.jpg
Maybe I am just so wrong. It's nearly 4pm Friday. What do I expect?
« Last Edit: September 25, 2015, 03:53:14 PM by Circlotron »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf