13.07.2015 Views

PC-Based 7-segment Rolling disPlay

PC-Based 7-segment Rolling disPlay

PC-Based 7-segment Rolling disPlay

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PC</strong>-<strong>Based</strong> 7-Segment<strong>Rolling</strong> DisplayItis very interesting and convenient to be able to controleverything while sitting atyour <strong>PC</strong> terminal. Here, a simplehardware circuit and software isused to interface a 7-<strong>segment</strong> basedrolling display.The printer port of a <strong>PC</strong> providesa set of points with some actingas input lines and some othersas output lines. Some lines are opencollector type which can be used asinput lines. The circuit given herecan be used for interfacing with anytype of <strong>PC</strong>’s printer port.The 25-pin parallel port connectorat the back of a <strong>PC</strong> is a combinationof three ports. The addressvaries from 378H-37AH. The 7 linesof port 378H (pins 2 through 8) areused in this circuit to output thecode for <strong>segment</strong> display throughIC1. The remaining one line of port378H (pin 9) and four lines of port37AH (pins 1, 14, 16, 17) are usedto enable the display digits (one atime) through IC2.The bits D0, D1 and D3 of port37AH connected to pins 1, 14 and 17of ‘D’ connector are inverted by thecomputer before application to the pinswhile data bit D2 is not inverted. Thereforeto get a logic high at any of formerthree pins, we must send logic 0 output tothe corresponding pin of port 37AH.Another important concept illustratedby the project is the time division multiplexing.Note that all the five 7-<strong>segment</strong>displays share a common data bus. The/*DISP.C*** <strong>PC</strong> BASED ROLLINGDISPLAY *//* P.R.DESHMUKH*/#include#include#include#define PORTA 0x378#define PORTB 0x37avoid main(){int dno[6]={0x0a,0x09,0x0f,0x03,0x80};/* code for “hallo”*/int m[5]={0x76,0x77,0x38,0x38,0x3f};/*code for the selection of display*/int f,j;<strong>PC</strong> places the 7-<strong>segment</strong> code for the firstdigit/character on the data bus and enablesonly the first 7-<strong>segment</strong> display. Afterdelay of a few milliseconds, the 7-<strong>segment</strong>code for the digit/character is replaced bythat of the next charter/digit, but this timeonly second display digit is enabled.After the display of all characters/digits in this way, the cycle repeats itselfP r o g r a mclrscr();for(f=200;f


ers with non-inverted tri-state outputs.The buffer is controlled by two activelow enable lines. IC2 (75492) can drivea maximum of six 7-<strong>segment</strong> displays.(For driving up to seven common-cathodedisplays one may use ULN2003 describedin the previous circuit idea.)The program for rolling displayis given in the listing DISP.C above.Whatever the message/characters tobe displayed (here five characters havebeen displayed), these are separatedand stored in an array. Then these aredecoded.Decoding software is very simple.Just replace the desired character withthe binary equivalent of the displaycode. The display code is a byte thathas the appropriate bits turned on. Forexample, to display character ‘L’, the<strong>segment</strong>s to be turned on are f, e andd. This is equivalent to 111000 binaryor 38 hex.Please note that only limited characterscan be formed using 7-<strong>segment</strong>display. Characters such as M, N and Kcannot be formed properly.ELECTRONICS PROJECTS Vol. 20

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!