Electronics > Projects, Designs, and Technical Stuff

RS485 using a multiplexer on A line

(1/1)

metRo_:
The project I'm working on require communication between a master and 20 nodes at 115200 baudrate, the nodes will be align (Node1 - Node2 - NodeN) and separated from each one 50cm.


--- Quote ---The way I've implemented auto addressing in the past is to arrange the serial bus connection to pass through the slave units on a gated pass through. Initially all slaves wake up with the pass through gated open. This causes just one slave to "see" the master. He gets the first address and then after a confirmation step with the master closes his pass through. The process repeats till the master realizes that no further devices respond on the serial chain. This works like a champ and is reliable.
--- End quote ---

This guy implemented auto addressing by controlling the RS485 lines.

Can I use a mux like this one to control the A line https://pt.mouser.com/datasheet/2/916/74LVC1G3157-1318329.pdf ? Should I apply a mux to both signals?

thank you

rstofer:
If you are designing the slaves, why not implement a proper protocol?

http://www.bdmicro.com/code/robin/


--- Quote ---The whole point of ROBIN is to define a standard packet format and a way of sharing the bus by multiple masters so that vendors can create devices that integrate with RS485 and end users can have a reasonable expectation that they can communicate with these devices to create something useful.

--- End quote ---

Without the multi-master approach things are even easier.  Each slave has an address and unless the master started a conversation with the address, it doesn't talk on the bus.  Both ends agree in advance to the length of the returned slave message.  The slave needs to know when to shut up.

This whole RS485 thing has already been worked out.  No hardware multiplexor is ever used.  Just a clean protocol describing the conversation between a master and an addressed slave.

ajb:

--- Quote from: rstofer on March 28, 2019, 02:31:16 pm ---
This whole RS485 thing has already been worked out.  No hardware multiplexor is ever used.  Just a clean protocol describing the conversation between a master and an addressed slave.


--- End quote ---

The OP is asking about a scheme to auto-assign station addresses to nodes on a bus, presumably such that the station addresses are mapped to the physical ordering of the bus.

I've used a similar scheme, and it can certainly work.  You should be able to use just about any analog switch, provided the cumulative resistance is not too high and the switch is sufficiently protected against harm.  Another option is to run a separate IO line out from one node and into the next, so once the first node in the line is addressed it asserts the signal to the second one which starts its address negotiation, etc.  I think mikeselectricstuff used this scheme on his massive wall of iPod LCD project.  This can be just a regular digital IO--in fact RS485 is probably overkill for your serial link.  For 115kbaud over 2m, you'd probably be just fine with regular TTL serial unless the environment is especially hostile. 

metRo_:

--- Quote from: ajb on March 28, 2019, 03:17:12 pm ---
--- Quote from: rstofer on March 28, 2019, 02:31:16 pm ---
This whole RS485 thing has already been worked out.  No hardware multiplexor is ever used.  Just a clean protocol describing the conversation between a master and an addressed slave.


--- End quote ---

The OP is asking about a scheme to auto-assign station addresses to nodes on a bus, presumably such that the station addresses are mapped to the physical ordering of the bus.

I've used a similar scheme, and it can certainly work.  You should be able to use just about any analog switch, provided the cumulative resistance is not too high and the switch is sufficiently protected against harm.  Another option is to run a separate IO line out from one node and into the next, so once the first node in the line is addressed it asserts the signal to the second one which starts its address negotiation, etc.  I think mikeselectricstuff used this scheme on his massive wall of iPod LCD project.  This can be just a regular digital IO--in fact RS485 is probably overkill for your serial link.  For 115kbaud over 2m, you'd probably be just fine with regular TTL serial unless the environment is especially hostile.

--- End quote ---

It's 10m but the main reason to use RS485 is to have a bus and been able talk with each node individually.  I thought on an IO line too but that will add another wire and if a node fails it could mess up the network. With a mux I'm thinking on have A and B normally connected and a device open the lines if doesn't have an address.

Do you recommend a analog switch for this purpose?

I found this app note  about the use of AQY282S but it is expensive.

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod