Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:07 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : More than one connection to same pin

Author Message
Cyber

Senior Member

Joined: 13/01/2019
Location: Ukraine
Posts: 161
Posted: 06:48am 28 Sep 2019
Copy link to clipboard 
Print this post

Is it safe to connect more than one thing to same input (or output) pin of a microcontroller (for example Micromite or Maximite)?
What should I consider when doing this?

Some examples:
- connect more than one LED to same output pin, so they all light up on pin high
- connect more than one device (like other microcontroller) to same input pin, when I want to receive high or low from any of devices (I don't care from which one)
- connect more than one sender and receiver to serial Rx and Tx, so to be able to send commands from different inputs (for example keyboard and other microcontroller) and to get output on different devices (for example display and logger)
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 06:58am 28 Sep 2019
Copy link to clipboard 
Print this post

Connecting multiple devices to an output is only limited by the available output current. About 20mA.
Too much capacitance might cause some devices to not play happily together.

For multiple inputs you will have to provide some sort of AND gate to prevent two signals, one high and one low, from trying to compete.
It is much easier to use separate pins for input.

Jim
VK7JH
MMedit
 
Cyber

Senior Member

Joined: 13/01/2019
Location: Ukraine
Posts: 161
Posted: 07:10am 28 Sep 2019
Copy link to clipboard 
Print this post

  TassyJim said  Connecting multiple devices to an output is only limited by the available output current. About 20mA.
Too much capacitance might cause some devices to not play happily together.

So I need to check current in devices specs. And if it's not specified, is it safe to just try it out and see if my devices play happily together?
I'm fine if I see them not working properly.
What I'm aware of is will I fry somethig while experimenting?

  TassyJim said  For multiple inputs you will have to provide some sort of AND gate to prevent two signals, one high and one low, from trying to compete.
It is much easier to use separate pins for input.

Yeah, it is. But sometimes I just want to try some things. )
I get the point of competing high and low signals.
And will there be a problem if both devices send low?
Or both send high?
Again, I want to experiment, but I aware not fry my devices.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 07:14am 28 Sep 2019
Copy link to clipboard 
Print this post

If you connect two outputs together, I hope you have plenty of spares. You will need them unless they are designed with open collectors or similar.
VK7JH
MMedit
 
Cyber

Senior Member

Joined: 13/01/2019
Location: Ukraine
Posts: 161
Posted: 05:54am 30 Sep 2019
Copy link to clipboard 
Print this post

  TassyJim said  For multiple inputs you will have to provide some sort of AND gate to prevent two signals, one high and one low, from trying to compete.

  TassyJim said  If you connect two outputs together, I hope you have plenty of spares. You will need them unless they are designed with open collectors or similar.

I'm new to electronics, and now I see that I asked a dumb question in the first place. %)
Connecting two outputs together, when one goes high and another goes low, will result in short circuit, and eventually frying something...
But it's actually safe when using open collectors output with external pull-up (just read about it in wiki).
So it's safer to use different pins. And if I run out of pins, using additional microcontroller as a slave, providing additional pins, would be a safer and more controllable way out.
Yeah, I need to study more and be more careful.
Thank you, TassyJim, for helping out!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 06:07am 30 Sep 2019
Copy link to clipboard 
Print this post

Electronics is fun.
You get to recognise the different components based on the colour of the smoke you let out.

I have yet to find a way of getting the smoke back in.
VK7JH
MMedit
 
Cyber

Senior Member

Joined: 13/01/2019
Location: Ukraine
Posts: 161
Posted: 06:37am 30 Sep 2019
Copy link to clipboard 
Print this post

  TassyJim said  I have yet to find a way of getting the smoke back in.

Nice one! :D

Reminded me of Grogster's signature: Smoke makes things work. When the smoke gets out, it stops!
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 06:56am 30 Sep 2019
Copy link to clipboard 
Print this post

Cyber.
There is no such thing as a dumb question.
Peter
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 01:15pm 30 Sep 2019
Copy link to clipboard 
Print this post

  Cyber said  So it's safer to use different pins. And if I run out of pins, using additional microcontroller as a slave, providing additional pins, would be a safer and more controllable way out.


Master/slave can work, but "more controllable" might better be achieved by going to a bigger module capable of running MMBasic. For instance, the Armmite F4  STM32F407VET6 module here is only ~$10USD, with LCD available for another $15. This has lots of pins.

Info here and here

If you just want additional digital inputs and outputs, any MMBasic-capable device can use these $2 I2C modules to add 16 more I/Os (and they can be chained for even more).
Edited 2019-09-30 23:26 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Cyber

Senior Member

Joined: 13/01/2019
Location: Ukraine
Posts: 161
Posted: 02:07pm 30 Sep 2019
Copy link to clipboard 
Print this post

Thanx, lizby!

I read mentioning about Armmite F4, but didn't know what it is. That's massive!

Didn't know about I2C modules existence. Planned to solve this with additional 28-pin Micromite as slave. But this is more elegant solution.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025