Disable diode on serial Rx/Tx for flashing

Hi all,

I have a project that uses the serial port for input, processes the incoming data and sends it to the next device. Since the input side is a single wire port, there is the need for a diode between the Rx und Tx serial pin. This all works flawlessly.

Now I'd make the device available to others and leave the USB port accessible for updates. Obviously the diode would need to be "removed" for flashing, so one way would be to put the diode on the wire harness that could be unplugged but I don't like that solution and would like to have the diode wired within my device. I thought of a capacitative sensor that triggers the "breaking" of the line with the diode between Rx and Tx so the user could just place his finger on the sensor during flashing. Due to possible vibration I don't want to use a mechanical switch. I can write the code, but I need help on how to make such a circuit.

Thanks a lot for your support!

rflt:
Obviously the diode would need to be "removed" for flashing

It's not obvious to me. Read the forum sticky and post a schematic.

Have a look here: Arduino Forum

AJLElectronics:
Have a look here: Arduino Forum

Thank you very much, looks like that's exactly what I need!

arduarn:
It's not obvious to me. Read the forum sticky and post a schematic.

Will do if I am not successful using the approach AJElectronics posted above.

Since the input side is a single wire port, there is the need for a diode between the Rx und Tx serial pin.

Sorry but that makes no sense at all. What does 'the input side is a single wire' mean? Does it mean that you don't have the ground connected? Or something else? No ground will never work however many diodes you have. Ground or no ground I can't imagine what the diode is for, please explain.

Thank you.

The device connected to the Arduino has a signal line and ground for bi-directional communication. Arduino sends a request to the device, the device answers accordingly.

Wiring:
Device GND is connected to GND on the Arduino serial port. Device bi-directional signal line is connected to Rx port on the Arduino. The same line is also connected to the Tx port with the diode in between. Afaik this is pretty standard way for enabling one-wire communication over UART. See 2nd schematic on the following page as example: GitHub - dword1511/onewire-over-uart: Access Dallas 1-Wire bus on your PC via low-cost USB to UART bridge.

As far as I understand I cannot flash the Arduino with the diode between Rx/Tx? (The setup at runtime works flawlessly, requests are sent, the device answers, no problem. I am just trying to find a way how to enable the user to flash the Arduino via USB without having to tamper with the diode.)

I apologize for initially not being clear enough, as said my knowledge in electronic circuits is very limited, but I know how to code.

Hello rflt,
OK, makes sense now. I have never heard of that setup so I guess I learned something today. I don't know if it works but it is certainly not common.

I can't think of a simple way to do what you want, if not a mechanical switch. I don't understand your objection to a switch. Another possibility is software serial so you are not sharing the port or a different board with a spare serial port.

Please follow the instructions given to you in reply #1 and post your schematic here, not a link to another web site.

Thank you.

PerryBebbington:
Hello rflt,
OK, makes sense now. I have never heard of that setup so I guess I learned something today. I don’t know if it works but it is certainly not common.

Thank you.

Perry, the Burroughs Corp used something like that in the 1960-70’s called a TDI, or two-wire direct interface. I never investigate how they did it. Since their terminals were addressable, you could daisy-chain terminals in parallel using TDI.

Paul

I may be misunderstanding the issue, but from the schematic you referenced on GitHub (which may differ from your actual schematic) perhaps a resistor in series connected to the Arduino's RX pin would be sufficient. Maybe something like 560R, though if it works I doubt the exact value would be too critical.
Other opinions on this welcome.

++ Karma; // rflt for teaching me something new
++ Karma; // Paul_KD7HB for teaching me something new

arduarn:
I may be misunderstanding the issue, but from the schematic you referenced on GitHub (which may differ from your actual schematic) perhaps a resistor in series connected to the Arduino’s RX pin would be sufficient. Maybe something like 560R, though if it works I doubt the exact value would be too critical.

No, resistors as such will just form a voltage divider.

What is described appears to be a “wired-OR” (or “wired-NOR”) arrangement emulating an open-collector bus like I2C. Any transmitter on the wire can pull down via the diode and send data as long as the others are quiescent.

Note: you need at least one pull-up resistor somewhere, perhaps one at each end of the bus,

Paul__B:
No, resistors as such will just form a voltage divider.

Ta. Upon reviewing the schematic of the Uno and Mega, I see that the RX/TX lines already have 1k resistors built into them, so the value of the added external resistor would have to be much higher. But it won’t work since the USB IC would be driving its TX line high when idle, so the RX pin on the main MCU won’t get pulled down properly by the OneWire device.
Anyway, for some reason I imagined that the OneWire device was going to be disconnected during flashing, but the OP didn’t state that anywhere. I get some funny ideas sometimes.
Interesting thought experiment for me, but it won’t work properly.