Maker Pro
Maker Pro

why we use ports ?

Jibin

Jul 20, 2015
9
Joined
Jul 20, 2015
Messages
9
In microcontrollers, we says that we connect devices to and from microcontroller's input/output port pins(for eg: take 8051 mc, it has 4 I/O ports)..my doubt is that why we need the use of ports?...can we connect the wires of devices directly to microcontrollers pins..
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
You apparently misunderstand what ports are. They are pins that you can either control or read from the microcontroller. Of course you connect external signals to a microprocessor pin. That pin is either an input or an output pin to the microcontroller. What else would you connect it to, a power pin?

Bob
 

Jibin

Jul 20, 2015
9
Joined
Jul 20, 2015
Messages
9
Okey with that..
But can you tell me why we use ports for connecting devices (generally in computers)
 

davenn

Moderator
Sep 5, 2009
14,260
Joined
Sep 5, 2009
Messages
14,260
Okey with that..
But can you tell me why we use ports for connecting devices (generally in computers)

read AGAIN what Bob wrote
The word port is just the term for the in/out connection to the processor chip or other controller/memory chip
 

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
But can you tell me why we use ports for connecting devices (generally in computers)

In computers there are also physical connection ports to the outside world COM port,Parallel Port, USB port etc.
These are not to be confused with the ones already stated, physical pins on the processor.
M.
 

Martaine2005

May 12, 2015
4,949
Joined
May 12, 2015
Messages
4,949
Just to add to all of the above:
But can you tell me why we use ports for connecting devices (generally in computers)
GENERALLY, it is because of the amount of wires that need connecting.
Why would you want to connect 13 pins individually, when you can just plug in 'port' a connector?

Also 'ports' are used to identify a protocol to certain devices or url's.

Martin
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Okey with that..
But can you tell me why we use ports for connecting devices (generally in computers)
Let's try to clear it all up at the same time.

When talking about 'physical' items like microcontrollers, computers, cars, etc...
A 'PORT' is a collection of pins.
-This collection of pins is a logical group. ie, pins 14-19 belong to 'Port B'.
-Or can be a physical group. is, the collection of pins in a DB9 connector is the 'Serial' port.

Using Ports to deal with a set of pins is much easier than connecting to each pin by itself, or controlling each pin by itself. It's like handing someone paperwork for a job you need to do, but giving them all loose papers... Staple it together and call it a 'package' .. same kind of thing.


There is a confusing use for 'PORT' for computers though... and this refers to networking.
I will not go into extensive details, but every networked device has an address. On the internet, in order to communicate, computers need an 'ip address' and 'port' number to communicate over. In this situation, a port number can be compared to a 'channel' like in a radio. If you send the information on the wrong channel, it won't reach it's destination even if it's address is correct.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Top