Pic Multiple inputs interfacing

Thread Starter

saneeshforu

Joined Feb 22, 2014
8
Haii all i am new in pic programming.i am doing a project on which one push button out put (5V) should connect 4 micro controllers input pin simultaneously.
Can i tie 4 inputs together and connect to push button,? it will affect PIC. or any other ways to connect these things?. Also i have to connect out puts of 4 micro controllers to a single LED. Help me to design this Section of circuitry .
 

nerdegutta

Joined Dec 15, 2009
2,684
Hi.
Make a schematic diagram of what you think will work, and post it here.

It would also benefit your question, if you elaborated what you are building/ doing, or if this is a homework assignment.
 

Papabravo

Joined Feb 24, 2006
21,226
Inputs you can connect together. Outputs can be connected together, but all except one must be in a high impedance state.
 

DNA Robotics

Joined Jun 13, 2014
649
A 74LS244 buffer will pass 4 outputs with your push button switch on the enable pin.

For 4 outputs to 1 LED I would use opto-isolators to make sure nothing gets shorted.
 

ErnieM

Joined Apr 24, 2011
8,377
If I read your question correctly you have 4 micro controllers, one button, and one LED, correct?

Inputs are fine to tie together to 4 devices.

Outputs are a bit trickier. To get any one or all micros to turn on the LED you can use a series diode on each micros output, then one resistor and one LED. Sketch this out, post it and we will check it.
 

NorthGuy

Joined Jun 28, 2014
611
So, you have 4 MCUs, but 1 button and 1 LED.

It is ok to connect inputs of 4 MCUs to the single button. It's not different than connecting one button to one MCU. You only will need a single pull-up for the button, not four, but each MCU will have to do its own debouncing, so the MCUs may not agree on when the button is pressed.

On the output, program each MCUs to drive low when you want the light lit or to go tri-state (high impedance) when you want the light to turn off. Connect all the outputs together and connect the LED between the inputs and VDD (through current-limiting resistor of course). Make sure you never drive any of the outputs high! In this arrangement, LED will be lit any time any of the MCUs drives its output low.

Better yet, use a single MCU to do all the job.
 

John P

Joined Oct 14, 2008
2,026
Nobody else has said it, but it needs to be said: if you want to connect multiple processors together electrically, they must have a common ground. If you can arrange it, it's also best if they have a common power bus, but that's not quite so important.

For inputs, you can just tie them together. For outputs, I would suggest tying them together but set the port pins all to the same state (0 or 1) and use the TRIS register bits for control. That way, each processor pin will either have the same level as any others that are "on", or it'll be "off" and in the high impedance state, so it won't care what any other pins are doing. What you need to avoid would be a situation where multiple pins with different output levels are connected together.
 
Top