View Full Version: 7-segment display interfacing with parallel port

booksbybibin >>Computer interfacing >>7-segment display interfacing with parallel port


yogi- 07-03-2006
7-segment display interfacing with parallel port
This tutorial is taken from the book MY EXPERIENCE IN PARALLEL PORT INTERFACING. you can download it free from the files section(file:-parallelport(3 files) of yahoo group-booksbybibin http://groups.yahoo.com/group/booksbybibin/ comments about this book on www.booksbybibin.blogspot.com DISPLAYS 7-segment display The above circuit shows how to connect multiple displays with a single decoder. You can do it without a decoder and some transistors. But here I am using 74126 a tri-state buffer and a 7segment decoder. Corresponding pins of displays are short ciruited together. i.e, 'a' of all displays are short circuited, same as b'. #include"bparlib.c" void main() { int a,i,j=0,b,h; printf("\nenter the number"); scanf("%d",&a); Clear_ControlPort_bit(0); Clear_ControlPort_bit(1); Clear_ControlPort_bit(2); Clear_ControlPort_bit(3); do { b=a; for(i=1;i<5;i++) { h=b%10; b=b/10; printf("%d",h); Write_DataPort(h); Set_ControlPort_bit(4-i); delay(7); Clear_ControlPort_bit(4-i); } j++; } while(j<1000); } Algoritham Clear_ControlPort_bit(0); Clear_ControlPort_bit(1); Clear_ControlPort_bit(2); Clear_ControlPort_bit(3); This is used to remove the Vcc to all displays so that nothing can be seen on display. Here we use the technique of persistance of vision. i.e, our eye cannot detect what is happening within 1/16 of a second. Delay(7); This command gives a delay of 7ms and the digits to be displayed on LED are given to the data port and the corresponding control bit is taken. Suppose if the input number is 1234 So 4 should be displayed on the last 7 segment. So we first get digit 4 from the input and send it to the data port and Set C3 to HIGH. Thus we get 4 on last display and it last for 7ms, while in the mean time the power supply for other displays are OFF and nothing will be displayed on them. After 7ms we make C3=LOW to OFF the display and we send '3' to the data port and enable the C2 = HIGH. So the second last 7 segment will display for 7ms and after that it will become OFF, while all other displays are OFF. This will continue for (j<1000, an arbitary time). When one cycle is over, the same process will repeat. See all these events are happening in milliseconds and for one cycle it will take at max.50ms(let's say by calculating all other time). This time of 50ms is too small for our eye to detect and our eye will perceive as displays are ON all the time. Troubleshooting: 1. Check the connections like 'a' of all are short circuited. 2. Check whether all the segments of the display are working by connecting Vcc of all to Power supply and LT'=GND. In that case all displays should glow. 3. See whether your breadboard has any problems and the connections are interchanged or not 4. The pin3 and pin8 can be used for VCC but only one at a time. 5. Here i have not used resistor, it is better to insert a series resistance of 100 ohm according to the intensity of the display.


Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.