Using SoftwareSerial withOneWire (RX=TX Pin) option do work

I am using the softwareserial library with RX=TX for Pin 0 but I get no output signal. When I am spliting the RX / TX on PIN 0 and PIN 2 e.g. it works as expected.

//RX=TX
#include <SoftwareSerial.h>

SoftwareSerial mySerial(0, 0, true); // RX, TX, true =inverted

I don’t quite understand what you mean by this. SoftwareSerial and OneWire are different buses. @arno.waldmann

Hi,

For clarification: SoftwareSerial is a software library to create a serial port from the SeeedStudio environment in the Arduino IDE. A special configuration of such a serial port, namely when sending and receiving on one line only, is called OneWire.

The following configuration of a serial port with this library defines a serial port with only one line (rxPin = txPin=0 -> One Wire) and inverted signal. Once the option inverted (true) is used, the serial port will not work.

#include <SoftwareSerial.h>

const byte rxPin = 0;
const byte txPin = 0;
SoftwareSerial mySerial (rxPin, txPin, true);


If you want to use OneWire, you should use this library. @arno.waldmann

If I want to use 1wire then I would also use the corresponding 1wire library. This is a half-duplex serial transmission over a serial interface. The SoftwareSerial library included in the Seeeduino SAMD21 IDE has a bug. Now an expert is needed to correct this bug. This library was written by Chiara Ruggeri (chiara@arduino.org). Unfortunately this eMail address does not work anymore.

Github space at: https://github.com/chiararuggeri

Unfortunately the developer who wrote this library SoftwareSerial no longer works for Arduino. But she gave me a hint via email about what needs to be adapted.

In order to achieve the desired behaviour we should modify the SoftwareSerial library in order to change pin configuration every time is required (e.g. you always set the pin as input, then when you need to write, we can set the pin as output and revert back the input mode as soon as the write is over).

Does anyone have an idea how to implement this?

Many thanks for the technical contributions. I have adapted the library of SoftwareSerial (halfduplex inverted)) and it works.