user87406: I am trying to troubleshoot a Software Uart Connection from my Arduino Nano, and I do not understand this output. The setup is simple, I have a Software Serial connection on pins 2 and 3. I send 170, which I expect to be 10101010 of course with a low start bit and high stop bit.
I hook up to the TX line with my Oscope and check the waveform, but its not as I expect.... I only see 101010
#include <Arduino.h>
#include <SoftwareSerial.h>

#define SW_RX 2
#define SW_TX 3
#define SW_BAUD 9600

SoftwareSerial Serial2(SW_RX,SW_TX);

void setup(){
  Serial2.begin(SW_BAUD);
  delay(1000);
}

void loop(){
  Serial2.write(170);
  delay(100);
}

Can someone help me to understand this output?



user7508: It is working exactly as expected. The scope trace shows 10010101011:

1: idle state of the serial port
0: start bit
0: first data bit
1010101: other data bits
1: stop bit.

Keep in mind that the data bits are sent least-significant first.

87406: <p>I am trying to troubleshoot a Software Uart Connection from my Arduino Nano, and I do not understand this output. The setup is simple, I have a Software Serial connection on pins 2 and 3. I send 170, which I expect to be 10101010 of course with a low start bit and high stop bit.</p>
<p>I hook up to the TX line with my Oscope and check the waveform, but its not as I expect.... I only see 101010</p>
<pre><code>#include &lt;Arduino.h&gt;
#include &lt;SoftwareSerial.h&gt;

#define SW_RX 2
#define SW_TX 3
#define SW_BAUD 9600

SoftwareSerial Serial2(SW_RX,SW_TX);

void setup(){
  Serial2.begin(SW_BAUD);
  delay(1000);
}

void loop(){
  Serial2.write(170);
  delay(100);
}
</code></pre>
<p>Can someone help me to understand this output?</p>
<p><a href="https://i.stack.imgur.com/JkZbe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JkZbe.png" alt="Oscope Image" /></a></p>
<p><a href="https://i.stack.imgur.com/vteI1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vteI1.png" alt="Schematic" /></a></p>
 7508: <p>It is working exactly as expected. The scope trace shows 10010101011:</p>
<ul>
<li>1: idle state of the serial port</li>
<li>0: start bit</li>
<li>0: first data bit</li>
<li>1010101: other data bits</li>
<li>1: stop bit.</li>
</ul>
<p>Keep in mind that the data bits are sent least-significant first.</p>
