Skip to main content
added 562 characters in body
Source Link
jonathanjo
  • 16.2k
  • 3
  • 36
  • 74

If you specifically want to know what the sender is doing: as opposed to making communications work ...

Background

enter image description here

Case 1 is a sender sending back-to-back 8N1 (ASCII 'J' = 0x4a). If the sender is a little slow, we get a short delay (case 2), a whole bit delay (case 3) or more (case 4).

Case 5 is back-to-back 8N2, with a little delay (case 6).

Note that 8N2 is indistinguishable from 8N1 with a 1-bit delay (cases 3 and 5), and so 8N2-with-small-delay is indistinguishable from 8N1-with-longer-delay (cases 4 and 6). Exact 1-bit delay is extremely uncommon.

However, if the baud rate is slow enough or the computer is fast enough, you will have case 1 or 5.

Method 1: Timing

You can tell 8N1 vs 8N2 by timing. If you can get the timing accurate enough, either blocks of data with stopwatch, special program to time incoming bytes (might be tricky in Windows), or oscilloscope.

Method 2: Parity

If your sender is sending back-to-back data, you can use the receiver's parity detection to look at the position of the second stop bit. This extends the byte frame by one bit, and now the receiver will check the bit where the second stop bit would be.

Ideally use "Mark" parity (8M1) which sends a 1 for every parity bit, and in fact sends the identical signal to 8N2. But you can do it with even or odd parity (8E1 or 8O1) if you understand that many incoming bytes will have parity errors. (Very briefly: even parity ensures there an even number of 1s in the data+parity bits; odd gives an odd number.)

If you set the receiver to have parity (eitherbest is 8M1 where parity is always "Mark", if your receiver will do it, but 8E1 or 8O1 will also work), then you will have either:

  • Case A (red sender sending 8N1 followed by the next byte's start bit, blue what the receiver interprets), which will be a parity error on half the byte values andgive a framing error on every byte.   (Becauseand potentially parity errors). Because the receiver will always see the stop bit as a 1, which will be often(which might be an error depending on what parity is set), and the new start bit where the stop bit should be, which makes the framing error.)
  • Case B (sender sending 8N2), which will be a parity error on half the byte values and nonot make framing errors. (Because Because the receiver will always see the stop bit as a 1, which will be oftenparity=1 (which might be an error), and the second stop bit where a stop bit should be.)

enter image description here

If you specifically want to know what the sender is doing: as opposed to making communications work ...

Background

enter image description here

Case 1 is a sender sending back-to-back 8N1 (ASCII 'J' = 0x4a). If the sender is a little slow, we get a short delay (case 2), a whole bit delay (case 3) or more (case 4).

Case 5 is back-to-back 8N2, with a little delay (case 6).

Note that 8N2 is indistinguishable from 8N1 with a 1-bit delay (cases 3 and 5), and so 8N2-with-small-delay is indistinguishable from 8N1-with-longer-delay (cases 4 and 6). Exact 1-bit delay is extremely uncommon.

However, if the baud rate is slow enough or the computer is fast enough, you will have case 1 or 5.

Method 1: Timing

You can tell 8N1 vs 8N2 by timing. If you can get the timing accurate enough, either blocks of data with stopwatch, special program to time incoming bytes (might be tricky in Windows), or oscilloscope.

Method 2: Parity

If your sender is sending back-to-back data, you can use the receiver's parity detection to look at the position of the second stop bit:

If you set the receiver to have parity (either 8E1 or 8O1), then you will have either:

  • Case A (red sender sending 8N1 followed by the next byte's start bit, blue what the receiver interprets), which will be a parity error on half the byte values and a framing error on every byte. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the new start bit where the stop bit should be.)
  • Case B (sender sending 8N2), which will be a parity error on half the byte values and no framing errors. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the second stop bit where a stop bit should be.)

enter image description here

If you specifically want to know what the sender is doing: as opposed to making communications work ...

Background

enter image description here

Case 1 is a sender sending back-to-back 8N1 (ASCII 'J' = 0x4a). If the sender is a little slow, we get a short delay (case 2), a whole bit delay (case 3) or more (case 4).

Case 5 is back-to-back 8N2, with a little delay (case 6).

Note that 8N2 is indistinguishable from 8N1 with a 1-bit delay (cases 3 and 5), and so 8N2-with-small-delay is indistinguishable from 8N1-with-longer-delay (cases 4 and 6). Exact 1-bit delay is extremely uncommon.

However, if the baud rate is slow enough or the computer is fast enough, you will have case 1 or 5.

Method 1: Timing

You can tell 8N1 vs 8N2 by timing. If you can get the timing accurate enough, either blocks of data with stopwatch, special program to time incoming bytes (might be tricky in Windows), or oscilloscope.

Method 2: Parity

If your sender is sending back-to-back data, you can use the receiver's parity detection to look at the position of the second stop bit. This extends the byte frame by one bit, and now the receiver will check the bit where the second stop bit would be.

Ideally use "Mark" parity (8M1) which sends a 1 for every parity bit, and in fact sends the identical signal to 8N2. But you can do it with even or odd parity (8E1 or 8O1) if you understand that many incoming bytes will have parity errors. (Very briefly: even parity ensures there an even number of 1s in the data+parity bits; odd gives an odd number.)

If you set the receiver to have parity (best is 8M1 where parity is always "Mark", if your receiver will do it, but 8E1 or 8O1 will also work), then you will have either:

  • Case A (red sender sending 8N1 followed by the next byte's start bit, blue what the receiver interprets), which will give a framing error on every byte  (and potentially parity errors). Because the receiver will always see the stop bit as a 1, (which might be an error depending on what parity is set), and the new start bit where the stop bit should be, which makes the framing error.
  • Case B (sender sending 8N2), which will not make framing errors. Because the receiver will always see the stop bit as parity=1 (which might be an error), and the second stop bit where a stop bit should be.)

enter image description here

minor typo
Source Link
brhans
  • 14.8k
  • 3
  • 36
  • 51

If you specifically want to know what the sender is doing: as opposed to making communications work ...

Background

enter image description here

Case 1 is a sender sending back-to-back 8N1 (ASCII 'J' = 0x4a). If the sender is a little slow, we get a short delay (case 2), a whole bit delay (case 3) or more (case 4).

Case 5 is back-to-back 8N2, with a little delay (case 76).

Note that 8N2 is indistinguishable from 8N1 with a 1-bit delay (cases 3 and 5), and so 8N2-with-small-delay is indistinguishable from 8N1-with-longer-delay (cases 4 and 6). Exact 1-bit delay is extremely uncommon.

However, if the baud rate is slow enough or the computer is fast enough, you will have case 1 or 5.

Method 1: Timing

You can tell 8N1 vs 8N2 by timing. If you can get the timing accurate enough, either blocks of data with stopwatch, special program to time incoming bytes (might be tricky in Windows), or oscilloscope.

Method 2: Parity

If your sender is sending back-to-back data, you can use the receiver's parity detection to look at the position of the second stop bit:

If you set the receiver to have parity (either 8E1 or 8O1), then you will have either:

  • Case A (red sender sending 8N1 followed by the next byte's start bit, blue what the receiver interprets), which will be a parity error on half the byte values and a framing error on every byte. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the new start bit where the stop bit should be.)
  • Case B (sender sending 8N2), which will be a parity error on half the byte values and no framing errors. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the second stop bit where a stop bit should be.)

enter image description here

If you specifically want to know what the sender is doing: as opposed to making communications work ...

Background

enter image description here

Case 1 is a sender sending back-to-back 8N1 (ASCII 'J' = 0x4a). If the sender is a little slow, we get a short delay (case 2), a whole bit delay (case 3) or more (case 4).

Case 5 is back-to-back 8N2, with a little delay (case 7).

Note that 8N2 is indistinguishable from 8N1 with a 1-bit delay (cases 3 and 5), and so 8N2-with-small-delay is indistinguishable from 8N1-with-longer-delay (cases 4 and 6). Exact 1-bit delay is extremely uncommon.

However, if the baud rate is slow enough or the computer is fast enough, you will have case 1 or 5.

Method 1: Timing

You can tell 8N1 vs 8N2 by timing. If you can get the timing accurate enough, either blocks of data with stopwatch, special program to time incoming bytes (might be tricky in Windows), or oscilloscope.

Method 2: Parity

If your sender is sending back-to-back data, you can use the receiver's parity detection to look at the position of the second stop bit:

If you set the receiver to have parity (either 8E1 or 8O1), then you will have either:

  • Case A (red sender sending 8N1 followed by the next byte's start bit, blue what the receiver interprets), which will be a parity error on half the byte values and a framing error on every byte. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the new start bit where the stop bit should be.)
  • Case B (sender sending 8N2), which will be a parity error on half the byte values and no framing errors. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the second stop bit where a stop bit should be.)

enter image description here

If you specifically want to know what the sender is doing: as opposed to making communications work ...

Background

enter image description here

Case 1 is a sender sending back-to-back 8N1 (ASCII 'J' = 0x4a). If the sender is a little slow, we get a short delay (case 2), a whole bit delay (case 3) or more (case 4).

Case 5 is back-to-back 8N2, with a little delay (case 6).

Note that 8N2 is indistinguishable from 8N1 with a 1-bit delay (cases 3 and 5), and so 8N2-with-small-delay is indistinguishable from 8N1-with-longer-delay (cases 4 and 6). Exact 1-bit delay is extremely uncommon.

However, if the baud rate is slow enough or the computer is fast enough, you will have case 1 or 5.

Method 1: Timing

You can tell 8N1 vs 8N2 by timing. If you can get the timing accurate enough, either blocks of data with stopwatch, special program to time incoming bytes (might be tricky in Windows), or oscilloscope.

Method 2: Parity

If your sender is sending back-to-back data, you can use the receiver's parity detection to look at the position of the second stop bit:

If you set the receiver to have parity (either 8E1 or 8O1), then you will have either:

  • Case A (red sender sending 8N1 followed by the next byte's start bit, blue what the receiver interprets), which will be a parity error on half the byte values and a framing error on every byte. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the new start bit where the stop bit should be.)
  • Case B (sender sending 8N2), which will be a parity error on half the byte values and no framing errors. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the second stop bit where a stop bit should be.)

enter image description here

added 39 characters in body
Source Link
jonathanjo
  • 16.2k
  • 3
  • 36
  • 74

If you specifically want to know what the sender is doing: as opposed to making communications work ...

Background

enter image description here

Case 1 is a sender sending back-to-back 8N1 (ASCII 'J' = 0x4a). If the sender is a little slow, we get a short delay (case 2), a whole bit delay (case 3) or more (case 4).

Case 5 is back-to-back 8N2, with a little delay (case 7).

Note that 8N2 is indistinguishable from 8N1 with a 1-bit delay (cases 3 and 5), and so 8N2-with-small-delay is indistinguishable from 8N1-with-longer-delay (cases 4 and 6). Exact 1-bit delay is extremely uncommon.

However, if the baud rate is slow enough or the computer is fast enough, you will have case 1 or 5.

Method 1: Timing

You can tell 8N1 vs 8N2 by timing. If you can get the timing accurate enough, either blocks of data with stopwatch, special program to time incoming bytes (might be tricky in Windows), or oscilloscope.

Method 2: Parity

If your sender is sending back-to-back data, you can use the receiver's parity detection to look at the position of the second stop bit:

If you set the receiver to have parity (either 8E1 or 8O1), then you will have either:

  • Case A (senderred sender sending 8N1 followed by the next byte's start bit, blue what the receiver interprets), which will be a parity error on half the byte values and a framing error on every byte. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the new start bit where the stop bit should be.)
  • Case B (sender sending 8N2), which will be a parity error on half the byte values and no framing errors. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the second stop bit where a stop bit should be.)

enter image description here

If you specifically want to know what the sender is doing: as opposed to making communications work ...

Background

enter image description here

Case 1 is a sender sending back-to-back 8N1 (ASCII 'J' = 0x4a). If the sender is a little slow, we get a short delay (case 2), a whole bit delay (case 3) or more (case 4).

Case 5 is back-to-back 8N2, with a little delay (case 7).

Note that 8N2 is indistinguishable from 8N1 with a 1-bit delay (cases 3 and 5), and so 8N2-with-small-delay is indistinguishable from 8N1-with-longer-delay (cases 4 and 6). Exact 1-bit delay is extremely uncommon.

However, if the baud rate is slow enough or the computer is fast enough, you will have case 1 or 5.

Method 1: Timing

You can tell 8N1 vs 8N2 by timing. If you can get the timing accurate enough, either blocks of data with stopwatch, special program to time incoming bytes (might be tricky in Windows), or oscilloscope.

Method 2: Parity

If your sender is sending back-to-back data, you can use the receiver's parity detection to look at the position of the second stop bit:

If you set the receiver to have parity (either 8E1 or 8O1), then you will have either:

  • Case A (sender sending 8N1 followed by the next byte's start bit), which will be a parity error on half the byte values and a framing error on every byte. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the new start bit where the stop bit should be.)
  • Case B (sender sending 8N2), which will be a parity error on half the byte values and no framing errors. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the second stop bit where a stop bit should be.)

enter image description here

If you specifically want to know what the sender is doing: as opposed to making communications work ...

Background

enter image description here

Case 1 is a sender sending back-to-back 8N1 (ASCII 'J' = 0x4a). If the sender is a little slow, we get a short delay (case 2), a whole bit delay (case 3) or more (case 4).

Case 5 is back-to-back 8N2, with a little delay (case 7).

Note that 8N2 is indistinguishable from 8N1 with a 1-bit delay (cases 3 and 5), and so 8N2-with-small-delay is indistinguishable from 8N1-with-longer-delay (cases 4 and 6). Exact 1-bit delay is extremely uncommon.

However, if the baud rate is slow enough or the computer is fast enough, you will have case 1 or 5.

Method 1: Timing

You can tell 8N1 vs 8N2 by timing. If you can get the timing accurate enough, either blocks of data with stopwatch, special program to time incoming bytes (might be tricky in Windows), or oscilloscope.

Method 2: Parity

If your sender is sending back-to-back data, you can use the receiver's parity detection to look at the position of the second stop bit:

If you set the receiver to have parity (either 8E1 or 8O1), then you will have either:

  • Case A (red sender sending 8N1 followed by the next byte's start bit, blue what the receiver interprets), which will be a parity error on half the byte values and a framing error on every byte. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the new start bit where the stop bit should be.)
  • Case B (sender sending 8N2), which will be a parity error on half the byte values and no framing errors. (Because the receiver will always see the stop bit as a 1, which will be often be an error, and the second stop bit where a stop bit should be.)

enter image description here

Source Link
jonathanjo
  • 16.2k
  • 3
  • 36
  • 74
Loading