# RCM6760 serial D,E,F 9600bps 8N2 ... first byte not generate 2 stop bit

**URL:** <https://forums.digi.com/t/rcm6760-serial-d-e-f-9600bps-8n2-first-byte-not-generate-2-stop-bit/17325>\
**Category:** Rabbit Software\
**Tags:** bit, rcm6760, e, rabbit, 1\
**Created:** [August 31, 2016, 8:50pm UTC](https://forums.digi.com/t/rcm6760-serial-d-e-f-9600bps-8n2-first-byte-not-generate-2-stop-bit/17325 "2016-08-31T20:50:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcosterada](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@marcosterada](https://forums.digi.com/u/marcosterada)\
**Post date:** [August 31, 2016, 8:50pm UTC](https://forums.digi.com/t/rcm6760-serial-d-e-f-9600bps-8n2-first-byte-not-generate-2-stop-bit/17325/1 "2016-08-31T20:50:16Z")

</div>

RCM6760 UART bug: serial D E F : 9600bps 8N2  
baud rate is ok.  
first byte generate ONLY 1 stop bit.  
after second byte generate 2 stop bit.

---

<div class="post-metadata">

**Author:** ![TomCollins](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/tomcollins/32/37_2.png) [@TomCollins](https://forums.digi.com/u/TomCollins)\
**Post date:** [September 2, 2016, 5:19pm UTC](https://forums.digi.com/t/rcm6760-serial-d-e-f-9600bps-8n2-first-byte-not-generate-2-stop-bit/17325/2 "2016-09-02T17:19:07Z")

</div>

I think I see the error in RS232.LIB that causes this problem.

In spx\_starttx(), it isn’t checking for the 2-stop-bits flag before loading the byte to send. Later, in spx\_isr(), it checks that flag and correctly uses SxLR\_OFS instead of SxDR\_OFS.

I don’t have a system set up where I can test this code, but it _should_ work. Just replace everything between .send and .exit in spx\_starttx() of RS232.LIB with the following:

```auto

.send:
      _READ_BIT_(SER_BIT_TWOSTOP)
      jr z, .normal_stop
ioi ld (iy+SxLR_OFS), L ; send with an extra stop bit
      jr .load_done

.normal_stop:
ioi ld (iy+SxDR_OFS), L ; normal send

.load_done:

.exit:

```

Please let me know if that works for you.

---

<div class="post-metadata">

**Author:** ![TomCollins](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/tomcollins/32/37_2.png) [@TomCollins](https://forums.digi.com/u/TomCollins)\
**Post date:** [September 23, 2016, 5:48pm UTC](https://forums.digi.com/t/rcm6760-serial-d-e-f-9600bps-8n2-first-byte-not-generate-2-stop-bit/17325/3 "2016-09-23T17:48:05Z")

</div>

Tested and released on GitHub. [https://github.com/digidotcom/DCRabbit\_10/commit/c7d6a7ded4a3d78c6d38e77c08a8e55e52c5ed4c](https://github.com/digidotcom/DCRabbit_10/commit/c7d6a7ded4a3d78c6d38e77c08a8e55e52c5ed4c)

---

<div class="post-metadata">

**Author:** ![marcosterada](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@marcosterada](https://forums.digi.com/u/marcosterada)\
**Post date:** [October 5, 2016, 9:28pm UTC](https://forums.digi.com/t/rcm6760-serial-d-e-f-9600bps-8n2-first-byte-not-generate-2-stop-bit/17325/4 "2016-10-05T21:28:47Z")

</div>

hi tom,

I replace your code as you described…  
your code fix the bug… 🙂  
the serial working 8N2 correctly.

thank you!

---

<div class="post-metadata">

**Author:** ![Eduardo\_RS](https://avatars.discourse-cdn.com/v4/letter/e/f9ae1b/32.png) [@Eduardo\_RS](https://forums.digi.com/u/Eduardo_RS)\
**Post date:** [November 1, 2016, 10:28am UTC](https://forums.digi.com/t/rcm6760-serial-d-e-f-9600bps-8n2-first-byte-not-generate-2-stop-bit/17325/5 "2016-11-01T10:28:53Z")

</div>

Hello, im trying to get rid of the start bit, anyone knows how to?

---

<div class="post-metadata">

**Author:** ![TomCollins](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/tomcollins/32/37_2.png) [@TomCollins](https://forums.digi.com/u/TomCollins)\
**Post date:** [November 1, 2016, 1:11pm UTC](https://forums.digi.com/t/rcm6760-serial-d-e-f-9600bps-8n2-first-byte-not-generate-2-stop-bit/17325/6 "2016-11-01T13:11:15Z")

</div>

Please ask this as a new question in the forum, and include additional background information on what you’re trying to accomplish, and what you’ve already tried.
