Page 1 of 1

Serial Tx / Rx over one wire?

Posted: Mon Jan 18, 2021 6:17 am
by moelski
Hi @all,

I´m new to the STM32 - so please be patient with me :roll:

We like to build some Sensors for a RC radio controll from FrSky. You can attach sensors which communicate serial over one line. So Tx and Rx are shared. There are also some great libs to get use of the smartport functionality:
https://www.rcgroups.com/forums/showthr ... nfigurable

But most projects are build on top of Arduino or Teensy. And they all have special implementations to make use of a single wire serial bus.

Can anyone give some adivce how I can send and receive data over one combined TX/RX line?
And btw ... I know that some STM32 have build in serial inversion. Can I activate this function from my Arduino code?

Thx for your help
Dominik

Re: Serial Tx / Rx over one wire?

Posted: Mon Jan 18, 2021 8:06 am
by fpiSTM
Hi

with STM32 core you can use Serial in half duplex. It uses only the TX pin.
https://github.com/stm32duino/wiki/wiki ... uplex-mode

For inversion, it is currently not implemented.
There is a request for this: https://github.com/stm32duino/Arduino_C ... ssues/1160

Re: Serial Tx / Rx over one wire?

Posted: Mon Jan 18, 2021 11:35 am
by moelski
Thx alot.
That is a good starting point.

Dominik

Re: Serial Tx / Rx over one wire?

Posted: Thu Jul 28, 2022 9:00 am
by roskonedelchev1
HI Moelski,

I faced the same problem. I am trying to implement this scheme but I am not able to configure the communication to work. Would you share how you defined Half Duplex communication?
https://github.com/betaflight/betafligh ... -telemetry

Re: Serial Tx / Rx over one wire?

Posted: Tue Aug 30, 2022 2:08 pm
by MoDu
You should be able to replicate the Serial-to-OneWire method, maybe?
Both sides can pull the line down or "leave it" at high.

Image

https://github.com/dword1511/onewire-over-uart

Re: Serial Tx / Rx over one wire?

Posted: Wed Aug 31, 2022 7:42 pm
by dannyf
or SPI to 1wire.