Can single UART send data to multiple device

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

 

I have question Can single UART send data to multiple devices?. I don't think because Uart can't identify the device 

 

This topic has a solution.
Last Edited: Thu. Apr 9, 2020 - 12:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1


 

 

Last Edited: Thu. Apr 9, 2020 - 08:10 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

ansh11 wrote:
Can single UART send data to multiple devices?.

Yes, of course it can - as your diagram shows!

 

I don't think because Uart can't identify the device 

The limitation, of course, is that every single device will receive exactly the same stuff!

 

If that's not what you want, then you will need to add some scheme so that the PC can tell what's intended for it - and ignore other stuff.

 

ie, you devise some sort of protocol which has some provision for addressing the receivers.

 

EDIT

 

The addressing can be done without requiring any extra or special hardware at all - it can be all purely in "software" using the standard UART comms

 

The bigger problem is when you want all the PCs to be able to send stuff to one UART on the microcontroller - because you must not just short multiple transmitters (ie, outputs) together!

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Apr 9, 2020 - 09:20 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
every single device will receive exactly the same stuff

An example of where that is very useful:  https://www.avrfreaks.net/comment/2306116#comment-2306116

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
The limitation, of course, is that every single device will receive exactly the same stuff!
But that's what MPCM and the 9th bit is all about ?!? The result is not entirely dissimilar to what is achieved in I2C addressing, though rather than a separate TWAR the slaves simply have to read the other 8 bits when bit 9 is set and compare against their assigned address to decide whether to filter.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
But that's what MPCM and the 9th bit is all about ?!?

Yes, it is.

 

Specifically, it is one way to address:

I wrote:
some scheme so that the PC can tell what's intended for it 

although PC's don't (directly) support it - so probably not the best choice where PCs are specifically targetted.

The result is not entirely dissimilar to what is achieved in I2C addressing

Indeed

 

EDIT

 

Recent thread on the MPCM stuff:  https://www.avrfreaks.net/forum/mpcm-mode-send-data-slave-master

 

EDIT 2

 

that thread also has a reference to a protocol - "SNAP" -  which gives you addressing without requiring MPCM: https://www.avrfreaks.net/commen...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Apr 9, 2020 - 11:43 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

As I pointed out in another thread, S.N.A.P is a protocol designed for just such a case, here are the links: https://www.avrfreaks.net/commen...

Jim

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
 I pointed out in another thread

Indeed - that was my reference in EDIT 2 of #3

 

laugh

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just encode an identifier in all of the commands you send out:

 

U5RPM100    ... unit 5 set RPM to 100

U9RPM100    ... unit 9 set RPM to 234

U8LEDA1      ... unit 8 turn LED A ON

U8LEDE0      ... unit 8 turn LED E OFF

 

You can then use a terminal to send them.  As mentioned, the response is limited to 1 unit at a time.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
  As mentioned, the response is limited to 1 unit at a time.

You're thinking of the other thread?

 

Standard PC COM ports don't (generally) have "bussable" outputs

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Standard PC COM ports don't (generally) have "bussable" outputs

I'm assuming the hardware for the slaves will support tristating of their tx lines.  If the slaves are truly PC's (the op shows that, though it may be generic), the PC needs some hardware anyhow, since it prob doesn't have a serial port in the first place.

Or perhaps, the comm is only one-way only, from the master unit.  I wish PC's still had serial ports...quite often add a lot of malarky to get them back...why not just include in the first place... a money $$$ maker fro the adapter guys.

 

Soon PC's will get rid of USB ports and instead have XVG3 (eXtended Virtual/Generation 3) ports.  You'll be able to buy adapter hubs & cables to convert from XVG3 to USB.

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

IF that bus-connection is at the RS232 level rather than raw UART level, then you have to be aware that every (conforming to standard) RS232 receiver has a several KOhm resistance to ground. That makes it really hard to parallel inputs. There is no problem if the outputs and inputs are "raw UART" (also known as "TTL"). 

 

JIm

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net