![]() |
Forum Index : Microcontroller and PC projects : More than one connection to same pin
Author | Message | ||||
Cyber![]() Senior Member ![]() Joined: 13/01/2019 Location: UkrainePosts: 161 |
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: AustraliaPosts: 6283 |
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: UkrainePosts: 161 |
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? 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: AustraliaPosts: 6283 |
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: UkrainePosts: 161 |
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: AustraliaPosts: 6283 |
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: UkrainePosts: 161 |
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: AustraliaPosts: 655 |
Cyber. There is no such thing as a dumb question. Peter |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
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: UkrainePosts: 161 |
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. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |