# RCM6700  need to share serial B between RS232  and writeUserBlock

**URL:** <https://forums.digi.com/t/rcm6700-need-to-share-serial-b-between-rs232-and-writeuserblock/16765>\
**Category:** Rabbit Software\
**Tags:** rcm6700-writeuserblo\
**Created:** [May 13, 2016, 12:28am UTC](https://forums.digi.com/t/rcm6700-need-to-share-serial-b-between-rs232-and-writeuserblock/16765 "2016-05-13T00:28:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![equinoxsoftware](https://avatars.discourse-cdn.com/v4/letter/e/ac91a4/32.png) [@equinoxsoftware](https://forums.digi.com/u/equinoxsoftware)\
**Post date:** [May 13, 2016, 12:28am UTC](https://forums.digi.com/t/rcm6700-need-to-share-serial-b-between-rs232-and-writeuserblock/16765/1 "2016-05-13T00:28:50Z")

</div>

writeUserBlock makes use of serial port B. Application uses all serial ports .Have not been successful in finding a way of serBopen(9600) … serBclose … writeUserBlock … serBopen(9600) . RS232 on SerB does not work again after writeUserBlock. (and writeUserBlock behaves oddly if serB has ever been opened.)

---

<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:** [May 25, 2016, 5:33pm UTC](https://forums.digi.com/t/rcm6700-need-to-share-serial-b-between-rs232-and-writeuserblock/16765/2 "2016-05-25T17:33:59Z")

</div>

The RCM6700 uses a semaphore on the shared SPI lines of serial port B. You need to use SPIgetSemaphore() and SPIfreeSemaphore() to ensure that only one device accesses the port at a time.

And your serial device needs some sort of chip select so it doesn’t freak out at the data on TxB and RxB from other devices on the shared lines.

Don’t forget that when the RCM6700 starts up, it loads the firmware from serial flash.

Take a look at SPI\_PORTB\_UCOS.c or SPI\_PORTB\_COSTATE.c in Samples/RCM6700/Shared\_SPI/ for an example of how to share SerB from an application using uC/OS-II or costates.
