Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open Collector TX #17

Open
muebau opened this issue May 21, 2023 · 2 comments
Open

Open Collector TX #17

muebau opened this issue May 21, 2023 · 2 comments

Comments

@muebau
Copy link

muebau commented May 21, 2023

What would be needed to (if possible) to change the TX to an open collector like output.

I TX is LOW the output pin would be GND and if TX would be HIGH the pin would be floating (eg. high impedance, Z) but not VCC.

I thought one way to implement this could be a simple 'copy' PIO code which simply mirrors the TX state but gets 'Z' instead of HIGH (VCC).

Is there a simple way to implement this?

@laf0rge
Copy link

laf0rge commented Nov 29, 2023

AFAICT the rp2040 doesn't do open-collector/open-drain. So you have to emulate it by switching the TX pin to an input whenever you're not transmitting. That would have to be done at a very low level (inside the driver) as it has to reflect the actual UART hardware IP cores "transmit idle" state, and not just some higher-level state at which point the application code has told the UART driver to write something.

In the end, this might be easier by using a modified PIO soft-uart instead of the hardware UART IP core.

@xxxajk
Copy link

xxxajk commented Apr 15, 2024

...or just add a diode and a pullup resistor of about 1k, which emulates an open collector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants