Thursday, June 12, 2014

Parallel Ports Basics

In this chapter we will discuss about the parallel ports.

Parallel ports are a set of pins used to interface external devices. The number of such ports are different for different micro controllers. Simply it can be defined as, we know that a micro controller is a programmed device which will perform as per the program. So in order to perform some actions the controller should be connected to some device/ circuit. As an example, in circuit we want to blink an LED for 5 seconds whens a key is pressed.Then we have to connect a switch and a LED to the controller. So we use the parallel ports to connect these components. The below picture shows the basic structure to connect an LED and switch to the controller.

We can choose any two pins( depends on the type of controller) and assign one pin(say pin-1) for the switch and the other(pin-2) for connecting the LED. And the a program is written in a manner that when the switch is pressed blink the LED for next five seconds.

Program logic: when the switch is closed the pin is actually connected to ground. That means a 'zero' is given as input. Then as per the program when a 'zero' is detected in pin-1, a loop/timer starts counting till 5 seconds, and an output is given to the pin-2 till the loop/timer ends. Out put means a 'one' is given to the pin-2 which is +5 volts causes the LED to blink.

Uses of parallel ports:

Usually micro controllers are not used in simple circuits as stated above. They are always used in much bigger circuits and devices that have lots of functions depending on the situations. Situations simply mean the conditions that are given by the user.

 As example suppose we want a device, when temperature in a room is becomes higher than a particular value, which will turn on the air conditioner  and if the temperature falls beyond a value then turn offs the air conditioner. Then we have got two conditions that are, two temperatures.  Using a digital thermometer we continuously  check the temperature and the readings are given to the micro controller through any one pin of the micro controllers parallel port. Then we wright the program to detect the condition ( both the values of temperature) and also what to do for that conditions.

Or in some other devices we have to detect several conditions and have to perform so many functions. Also these ports are used to interface other chips and external memory. That will be discussed in the following chapters.


Post a Comment