Connect with us

why we use ports ?

Discussion in 'Microcontrollers, Programming and IoT' started by Jibin, Jul 23, 2015.

Scroll to continue with content
  1. Jibin


    Jul 20, 2015
    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) doubt is that why we need the use of ports?...can we connect the wires of devices directly to microcontrollers pins..
  2. BobK


    Jan 5, 2010
    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?

  3. Jibin


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

    davenn Moderator

    Sep 5, 2009
    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
  5. Minder


    Apr 24, 2015
    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.
  6. Martaine2005


    May 12, 2015
    Just to add to all of the above:
    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.

  7. Gryd3


    Jun 25, 2014
    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.
    chopnhack and CDRIVE like this.
  8. BobK


    Jan 5, 2010
    Why do we use ports to transport goods from China to the US? Shanghai - output port, San Francisco - input port. Of course both are actually bidirectional ports.

  9. Colin Mitchell

    Colin Mitchell

    Aug 31, 2014
    I also have a little port every night.
  10. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    May 8, 2012
    This was an EXCELLENT explanation. ;)
    This is funny but a good analogy too! :)

    This?? Well this is just funny. :p

    Gryd3 likes this.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day