Implementing F.PORT on BeagleBone Blue PRU

Hello,

Recently I have implemented SBUS protocol on BeagleBone Blue PRU (naminukas-brain/sbus.pru0.c at main · kikaitachi/naminukas-brain · GitHub). Now I want to move one level up and implement F.PORT protocol which is essentially UART using single wire. Currently I use E4 pin (signal B in 4th quadrature encoder connector) by reading 15th bit of R31 register. A lot of Googling convinced me that PRUs don’t allow bidirectional use of the same pin so I need to use OCP.

Maybe someone could answer the following questions:

  1. Is E4 capable of UART on single wire?
  2. How pins documented here cloud9-examples/prugpio.h at master · jadonk/cloud9-examples · GitHub map to physical pins https://inst.eecs.berkeley.edu/~ee192/sp19/images/cp1/Pinos.jpg? For example there is a physical pin labelled as GPIO3_17 but the is no such constant in prugpio.h.
  3. I assume I might need to switch pin from input to output mode during read/write phases. How can I do that in PRU?

Best regards,
Mykolas

I have a same need - to read pru data - for a dshot esc with telemetry, and I couldn’t find something about it.

You can use PRU GPIOs if you control an external tri-state buffer (e.g. SN74AHC125). I would suggest to dedicate 3 PRU GPIOs :

  • Input GPIO to read current line state.
  • Output GPIO to control the line state (connect to A input of SN74AHC125).
  • Output GPIO to enable/disable the output buffer (connect to OE input of SN74AHC125).

Regards,
Dimitar

Thanks @dinux. Of course adding additional hardware is always an option. There are some 1-wire protocol examples like GitHub - DTJF/libpruw1: One-wire driver for BeagleBone [Black|Green|White] hardware I so it seems bidirectional IO on single pin is possible unless 1-wire communication is somehow fundamentally different from half-duplex UART on single wire.