0
\$\begingroup\$

I am looking for a solution where I can use RS485 along with the 2 (two) digital input port on the same line but both will be used one at a time. When there is RS485 communication (selected through software) then that port will act as a RS485 communication to the outside of the device. When used as a digital input same 2 pin port will be used as a digital input port. Let me know what could be the solution

Thanks

\$\endgroup\$
  • \$\begingroup\$ Tri statable gates. \$\endgroup\$ – Andy aka Oct 29 '18 at 12:52
1
\$\begingroup\$

This should be straightforward:

schematic

simulate this circuit – Schematic created using CircuitLab

When the RS-485 driver is disabled, you can read the pins directly. I would add some buffers to protect the MCU inputs from direct connection to the outside world.

There is the small matter of RS-485 bus termination, if used. You can get driver/receiver chips that include switchable termination.

\$\endgroup\$
  • \$\begingroup\$ This schematics assumes digital signals can be connected directly to RS485 bus lines, which I doubt is the case. There are other nodes on the line after all, that have no idea about digital input being in use. \$\endgroup\$ – Maple Oct 30 '18 at 1:06
  • \$\begingroup\$ Usually what I found is enable pin for both the driver and receiver are separate . I mean there are 2 pins so we need 2 (two) pins to enable & disable the RS485 driver. Is there any solution so that I control RS485 transceiver from single pin so that I can save 1 pin of microcontroller. I dont have much spare GPIo on microcontroller side. \$\endgroup\$ – techsavvy2 Oct 30 '18 at 6:13
  • \$\begingroup\$ @Maple: RS-485 lines swing between 0V and 5V, perfectly compatible with TTL I/O. \$\endgroup\$ – Dave Tweed Oct 30 '18 at 11:19
  • \$\begingroup\$ @techsavvy2: There's no need to manipulate the receiver enable at all, unless there's something special going on in your application. Just keep it enabled all the time. \$\endgroup\$ – Dave Tweed Oct 30 '18 at 11:21
  • \$\begingroup\$ Further to above requirement there is addition in requirement. Digital input voltage level is maximum 24V. So what could be the updated solution to switch between the RS485 and Digital input port (24V max.). My power supply level is 15V \$\endgroup\$ – techsavvy2 Dec 5 '18 at 5:04
0
\$\begingroup\$

This calls for something like DPDT analog switch, actually. Or dual SPDT. Something like TS3A24159.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.