Connecting logic pins between two microcontrollers

Discussion in 'General Electronics Chat' started by rjdekker, Dec 2, 2013.

  1. rjdekker

    Thread Starter New Member

    Dec 1, 2013
    4
    0
    I'm trying to figure out a way to connect the 5V logic out pin of some microcontroller board (HighlyLiquid MPA revB) to the logic input on a PIC16F688 (RA2). Can I directly connect them or should I put something in between?

    Both use 5V logic. The PIC is embedded in a device. Its RA2 pin is originally connected to +5V externally via a 10kOhm pull-up resistor. RA2 can be put at a low logic state using a button that connects it to ground. I aim to remove the button from the circuit and "push the button" using the other microcontroller's logic out.

    My knowledge of electronics is very limited as you might have guessed so I would be very happy if someone could help me out.

    Thanks in advance!

    Regards,

    Rob
     
    Last edited: Dec 2, 2013
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,547
    2,372
    Make sure the commons are the same if two supplies, as long as the initiating micro is active low, otherwise you would need to change the logic in one or the other.
    Max.
     
  3. adamclark

    Member

    Oct 4, 2013
    472
    6
    Really? compared to my knowledge, I would not have guessed that.:).
     
  4. JohnInTX

    Moderator

    Jun 26, 2012
    2,345
    1,028
    It wouldn't hurt to put a little series resistance between the two (220-330 ohms) so that if you foul up the IO programming (both set to be outputs for example) you wouldn't exceed Absolute Maximum Ratings on the parts. Correctly configured, the resistance shouldn't affect the IO.
     
    THE_RB likes this.
  5. rjdekker

    Thread Starter New Member

    Dec 1, 2013
    4
    0
    Thanks for your helpful responses!

    Both mcs are on the same psu.

    Just to be sure that I have everything clear:

    - originally the input (PIC) is externally connected to 5V via a pull up resistor
    - the to be connected mc that will "push the button" outputs 0/5V (by itself, not externally)

    So I remove the 5V+pull-up+button from the input and connect it to the other mcs output pin via a small resistor directly?

    OUTPUT PIN (0/5V) -----> RESISTOR -----> INPUT PIN

    I have absolutely no practical experience with this stuff. Everything I do know is basically the result of Googling around for an hour or so. ;)

    Thanks again!

    Rob
     
  6. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    What is the resistance value of the original pull up resistor?
    If it is 1kΩ or higher you can leave it in.

    Just connect the two mcu pins together - no additional resistor required.
     
  7. JohnInTX

    Moderator

    Jun 26, 2012
    2,345
    1,028
    Sounds about right. As MrChips said, it isn't a MUST to put a resistor between them, it just adds some protection from mis-programming the IO. I would leave the pullup in to keep the line initialized while the two uCs are coming up. If the 'switch reader' comes up before the 'switch pusher' initializes the line, the 'switch reader' could take the non-initialized input level as a button push when it shouldn't.
     
  8. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    763
    One outputting 0 and the other outputting 1. My very first mistake when starting with PIC micros (16C57).

    I firmly believed that one was set as input. It wasn't.
     
  9. TheComet

    Member

    Mar 11, 2013
    88
    12
    Good advice to eliminate the need of extra soldering.

    However, be aware that a series resistor might not be possible anymore if you don't take out the pull-up resistor.
     
  10. rjdekker

    Thread Starter New Member

    Dec 1, 2013
    4
    0
    Thanks for all the helpful advice. The last thing I want is to fry the PIC since the device it is in is quite expensive.

    Just to make sure I understand your suggestions correctly I put the situation in a scheme. So I could do both the red en blue option? (cut at RED and make RED connection or the same for blue)

    In all scenarios I remove the 5V? (blue or red cut) btw for both the PIC input and MPA output the max. source/sink current is 25 mA. Leaving the 10kOhm pull-up in between is okay?

    Thanks so much....
     
  11. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    No, no, no.
    Don't cut any traces. Simply connect a 100Ω resistor between the two pins.
     
  12. rjdekker

    Thread Starter New Member

    Dec 1, 2013
    4
    0
    Okay, thanks for the golden tip! I wrongly assumed all the time that I had to remove the external 5v from the pin...whoops!

    Thanks for helping out. Great forum!

    Regards,

    Rob
     
Loading...