Serial Tx / Rx over one wire?

Post here first, or if you can't find a relevant section!
Post Reply
moelski
Posts: 7
Joined: Mon Jan 18, 2021 5:15 am

Serial Tx / Rx over one wire?

Post 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
User avatar
fpiSTM
Posts: 1746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Serial Tx / Rx over one wire?

Post 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
moelski
Posts: 7
Joined: Mon Jan 18, 2021 5:15 am

Re: Serial Tx / Rx over one wire?

Post by moelski »

Thx alot.
That is a good starting point.

Dominik
roskonedelchev1
Posts: 2
Joined: Thu Jun 23, 2022 1:00 pm

Re: Serial Tx / Rx over one wire?

Post 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
Attachments
Screenshot 2022-07-28 120218.png
Screenshot 2022-07-28 120218.png (4.07 KiB) Viewed 2238 times
MoDu
Posts: 16
Joined: Mon Jul 20, 2020 10:43 pm

Re: Serial Tx / Rx over one wire?

Post 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
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: Serial Tx / Rx over one wire?

Post by dannyf »

or SPI to 1wire.
Post Reply

Return to “General discussion”