Pic Multiple inputs interfacing

Discussion in 'Embedded Systems and Microcontrollers' started by saneeshforu, Jan 23, 2016.

  1. saneeshforu

    Thread Starter New Member

    Feb 22, 2014
    6
    0
    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 .
     
  2. nerdegutta

    Moderator

    Dec 15, 2009
    2,515
    785
    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.
     
  3. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,789
    Inputs you can connect together. Outputs can be connected together, but all except one must be in a high impedance state.
     
  4. DNA Robotics

    Member

    Jun 13, 2014
    123
    26
    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.
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    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.
     
  6. NorthGuy

    Active Member

    Jun 28, 2014
    603
    121
    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.
     
  7. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    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.
     
Loading...