Sunday, May 11, 2008

Checking Your Parallel Port

Parallel Port Description




For blinking LED you have to write a code. i.e. first you have to make the data pin high(pin no:2-9)
we will be writing a C code:


1. #include"stdio.h"
2. #include"sys/io.h" /*Header file for iopl(),outb()*/
3. main()
4. {
5. iopl(3);

6. while(1)
7. {
8. outb(0xff,0x378); /* it will make the pin 2-9 high(0xff eight 1's) & 0x378 is the port address*/
9. sleep(1);
10. outb(0x00,0x378);/*it will make the pin 2-9 low */
11. sleep(1);
12. }
13. }




Now comes your circuit. Here we have connected only 1 LED to pin2 and pin 19 is the ground.

You can connect LED to pin 2-9 with a resistor(1k) & control these pins in different way

















comments to:
Ranjeeth PT
Govt Engg College
Sreekrishnapuram,Palakkad.

No comments: