0
\$\begingroup\$

I have the next situation:

I've got two microcontrollers that should drive 4 motors. It's either microcontroller1 or microcontroller2 that is driving the motors.And 4 motors means that each microcontroller has 4 outputs. So I'm searching for a system that could choose(depending on a extern variable) which microcontroller is driving the motors.

So basically it's something like a selective switch, but with 8 inputs (comming from microcontroller1 and microcontroller2, and 4 outputs that go to the motors)

Thanks in advance

\$\endgroup\$
  • \$\begingroup\$ Like a demultiplexer? \$\endgroup\$ – jippie Sep 15 '14 at 8:03
2
\$\begingroup\$

This is typical application for a digital multiplexer. In this case 8:4 multiplexer. For example the 74HC257 quad 2:1 MUX can do this.

Important thing is to keep its power on while either of the MCUs is on because input of inactive CMOS circuit is essentialy shorted to ground (via the protection diode to VCC).

\$\endgroup\$
  • \$\begingroup\$ I'll give it a try and compare it with the 74HC244 setup. Thanks \$\endgroup\$ – PlatonInc. Sep 15 '14 at 8:22
2
\$\begingroup\$

You can use a 74HC244.

1/OE and 2/OE must be different at all times (use an inverter for example) and every two outputs operating the same motor must be connected. I added a drawing to show what I mean.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ This is the first thing I'm going to try. Thanks for the idea! \$\endgroup\$ – PlatonInc. Sep 15 '14 at 8:19
0
\$\begingroup\$

How about a multiplexer? You feed the outputs of the microcontrollers in on one side and you use a binary selector to select one input which is routed to its output.

Multiplexers exist in several sizes, and to accomodate four outputs you can simply connect four of them in parallel (eg like in a 74HC157). There is a list of device types in the Wikipedia article, but a Google search is bound to give more results.

Another, maybe even more viable, method is using another microcontroller that you program as a multiplexer with all inputs and outputs in the same device. This would simplify wiring a lot.

\$\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.