Connecting logic pins between two microcontrollers

Thread Starter

rjdekker

Joined Dec 1, 2013
4
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:

MaxHeadRoom

Joined Jul 18, 2013
28,619
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.
 

JohnInTX

Joined Jun 26, 2012
4,787
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.
 

Thread Starter

rjdekker

Joined Dec 1, 2013
4
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
 

MrChips

Joined Oct 2, 2009
30,714
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.
 

JohnInTX

Joined Jun 26, 2012
4,787
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
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.
 

TheComet

Joined Mar 11, 2013
88
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.
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.
 

Thread Starter

rjdekker

Joined Dec 1, 2013
4
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....
 

Attachments

Thread Starter

rjdekker

Joined Dec 1, 2013
4
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
 
Top