Parallel Port Interfacing
Purpose: To design, build, and write software for a computer-controlled hardware-interface
Objective: To wire a circuit using buffers, and to program the parallel port so that:
Equipment:
Objective: To wire a circuit using buffers, and to program the parallel port so that:
- When any switch is ON, the corresponding LED is ON.
- If multiple switches are ON, corresponding multiple LEDs are ON.
- If all LEDs are ON, the Buzzer goes off.
Equipment:
- 4 red LED
- 4 x 220 Ω resistor
- 1 Buzzer
- 1 D-sub connector
- At least 10 male pins
- Breadboard
- Solid core wire
- 4 switches
- Power Supply
- 2 x 74LS245 Buffers
- 14 wire cable
Wiring:
Parallel port inputs to computer are S3, S4, S5, and S6 and they are connected to 4 switches using a 74LS245 buffer chip. Next is pin#18, connected to ground. Now, a second buffer is needed to carry the inputs from the interface back to the data input lines of the parallel port. Another buffer chip is used for this purpose. The outputs from the computer are connected to pins D0, D1, D2, and D3 on the parallel port respectively which are then connected to 4 LEDs. A 220Ω resistor is placed between each pin and LED to limit the electric current that passes through the circuit. Lastly, a buzzer is connected to D4 on the parallel port. |
Programming:
The coding is done in a way so that all the inputs are isolated from each other. It is achieved through div and mod functions as shown below:
The coding is done in a way so that all the inputs are isolated from each other. It is achieved through div and mod functions as shown below:
This allows specific instructions to be followed through and it is achieved by entering the required byte value for each and every condition that exists in the situation. For instance, if a value if 1 is given to be tested, only the LED connected to S3 lights up and if the value is changed to fifteen, all LEDs will turn on. All together, there are fifteen different possibilities to wire the circuit. Finally, the whole process is put in a loop so that it could be continued as many times as possible.
![](http://www.weebly.com/weebly/images/file_icons/file.png)
Turing Code | |
File Size: | 1 kb |
File Type: | t |