Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Controlling a microcontroller from multiple computers
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Controlling a microcontroller from multiple computers

by SimplicityGuy on Mon Nov 14, 2011 2:25 am

I'm looking into an application where I need to control a microcontroller over USB from say 4 computers and be able to query the status of the microcontroller from the same machines.

Is this even possible or am I in a pipe dream?

Thanks,

Robert.
Last edited by SimplicityGuy on Tue Nov 15, 2011 12:48 am, edited 2 times in total.
SimplicityGuy
 
Posts: 3
Joined: Fri Jul 30, 2010 10:04 am

Re: Controlling a microcontroller from multiple computers

by meseta on Mon Nov 14, 2011 8:24 am

You would most likely need four separate microcontrollers.

OR if you're ok with manually pushing buttons to switch devices, then you can get yourself a cheap USB switch which shares USB devices between several computers. (Although not at the same time, you have to push a button to switch computers).
meseta
 
Posts: 82
Joined: Tue Aug 02, 2011 7:57 pm

Re: Controlling a microcontroller from multiple computers

by cstratton on Mon Nov 14, 2011 12:25 pm

SimplicityGuy wrote:I'm looking into an application where I need to control a microcontroller over USB from multiple computers and be able to query the status of the microcontroller from the same machines.


You basically need to switch from a master/slave paradigm to a network one. You could do that with Ethernet - if the computers are already on a network (likely) you just need a micro controller with an Ethernet interface and software on the micro that can accept multiple TCP connections, discard an old connection when a new one is made, or implement its own reliability assurance over connectionless UDP. There are many microcontroller options out there which have built in Ethernet support and corresponding boards for sale, and there is also an Ethernet shield for grafting it on to Arduino-type systems. You can of course get USB-Ethernet adapters if there are machines where USB is your only option for connecting.

A more traditional solution to this problem is a UART-type serial network, traditionally built on RS422 or RS485 differential standards which are better for long distance runs and in noisy industrial environments, but it can also be done single-ended RS232 style. The only real requirements are that you have a circuit which can tri-state the transmitter when not in use to allow the other machines to talk (or sometimes even to hear the reply from the device - as some versions use the same wires for transmit and receive), and software that understands the protocol and knows when to talk and when to be quiet and let others talk. Usually each node is given an address and information is sent in packets with the destination address and a checksum. I'm sure you can buy USB to RS422/RS485 adapaters, but you could also fairly easily make them from ordinary (RS232 or logic level) USB-serial converters and an outboard circuit. One approach uses the RTS control signal to enable the transmitter output, another simply transmits when the transmit pin first toggles and then stays enabled for a brief time delay before relinquishing the bus.

cstratton
 
Posts: 294
Joined: Wed Sep 29, 2010 3:52 pm

Re: Controlling a microcontroller from multiple computers

by SimplicityGuy on Mon Nov 14, 2011 11:07 pm

Very true. Thanks for the suggestions. I'll go with the network approach.
SimplicityGuy
 
Posts: 3
Joined: Fri Jul 30, 2010 10:04 am

Please be positive and constructive with your questions and comments.