Computer Interfacing Sessional

Embed Size (px)

Citation preview

  • 8/3/2019 Computer Interfacing Sessional

    1/23

    www.digizoneku.com 1

    CSE 408N

    Computer Interfacing Sessional

    Configurable Moving Display

    Group No.: 2Group Members:

    #0105033#0105034#0105047#0105057#0105060

  • 8/3/2019 Computer Interfacing Sessional

    2/23

    www.digizoneku.com 2

    Table of Contents

    :: Introduction ::...............................................................................................................3:: Problem Description ::.................................................................................................4:: Design :: .......................................................................................................................5

    Block diagram with description : ...........................................................................5 :: Hardware description :: ...............................................................................................8:: Hardware and its Quantity :: .................................................................................... 12:: Software Description with Source code :: ............................................................... 13

    Core Component:................................................................................................... 13Architecture:........................................................................................................... 13

    :: User Manual ::........................................................................................................... 15Hardware Requirements: ..................................................................................... 15Hardware Setup: .................................................................................................... 15Software Requirements: ....................................................................................... 15Software Setup: ...................................................................................................... 15Software Description:............................................................................................ 16

    :: Problem faced and adopted Solution ::.................................................................... 20:: Future Direction ::..................................................................................................... 22:: Conclusion :: ............................................................................................................. 23

    Figures

    Fig.1: display procedure..4 Fig.2: Schematic block diagram of display board..5 Fig.3: detailed block diagram for configurable moving display board....6 Fig.4: 8x8 bicolor dot matrix..8 Fig.5 :- Interconnection between two 8x8 dot matrix....8 Fig.6 : Internal connection.9 Fig .7 : parallel port specifications9 Fig 8: detailed circuit diagram....11 Fig .9 : User manual : Home window....16 Fig .10 : User manual : Input window for text display.17 Fig .11 : User manual : Input window for animation display..18

    Fig .12 : User manual : Input window for graph plotting19 Fig .13 : User manual : how to close program.19

  • 8/3/2019 Computer Interfacing Sessional

    3/23

    www.digizoneku.com 3

    :: Introduction ::

    Overwhelming and tremendous aspects of computer science remainsobscure through mere theoretical reading. Interfacing projects not only reveal thecapabilities of Computers and its vast applications but also persuades us inthinking innovative ideas for advancing the technology one step more as well asmaking contemporary systems more cost effective and efficient.

    Havent you ever struck knowing that imported display boards using in localstadiums cost only a few crore taka? This motivates us in making a computerdriven configurable moving display board which will do much more than thoseboards with at least hundredth times less cost.

    In commercial display boards, the data to be display is written in a ROMwhich is much expensive because the when the amount of data is high it requires alot of memory in the ROM which ultimately increases the cost. The amount of dataincreases when there a lot of Functionalities to be performed by the board. Ourmotivation is to build such a board that interfaces with a computer which suppliesthe data to be displayed. In that case dataflow from computer must be fast enoughto show data without any flicker. This can reduce the price and overheadassociated with the ROM.

    In our Configurable Moving Display Board user can:

    1. Display any data (static )2. Move data in any of the four directions (up ,down ,left ,right)3. Plot a graph (by clicking mouse on any specified position in

    Graphic user interface)4. Display animation

  • 8/3/2019 Computer Interfacing Sessional

    4/23

    www.digizoneku.com 4

    :: Problem Description ::

    Displaying data on the display matrix is quite artful .Columns are displayedone at a time but at such speed so that, to human eye, these columns are appearto be lit all the time.

    For example, to show A, we have to go through the first 5 following stepsto get the final display.

    Fig.1: display procedure

    This is done continuously and frequently so that user can see A on the board.

    In this approach, Refresh Rate= 1*delay between adjacent column(Number of columns)

    If, number of column=64 andDelay between adjacent column=1ms

    Then, a column is displayed once in every 64 millisecond; that is, theRefresh Rate =15 which will cause flicker in human eye. Because the display willnot cause any flicker in human eyes when the Refresh rate is between 40 to 200.

    To increase this refresh rate, a new technique Segmented Approach isused. In this technique, the whole display is divided into several segments. And instead of illuminating just one column of the whole matrix, one column from eachsegment is displayed.

    In this display board we divide 64 columns into 4 segments, each contains16 columns. As a result of this segmentation, a column is displayed once in every16 ms, that is the Refresh rate=62(approx.) thus gives a static display, not causingany flicker in human eyes.

    We used buffers to save the data for displaying; otherwise data in onesegment can affect the data in other segments since all the data come from sameparallel port pin.

  • 8/3/2019 Computer Interfacing Sessional

    5/23

    www.digizoneku.com 5

    :: Design ::

    Block diagram with description :

    Main components of display board are:1. Display board2. Column selector3. Buffers for current data4. Buffers for next data

    Fig.2: Schematic block diagram of display board

    The figure above is the basic block diagram of the display board. Data from theParallel Port is loaded in the 4 segments and columns buffer. From this buffer the datais loaded into the display board. It should noted that we are performing timemultiplexing, that is data is continuously coming from port and to display a singlecharacter (let the character needs 5 column to display) we have to give the pattern ofthat character in the row buffer and the appropriate column selector is stored in thecolumn buffer. When we have saved all the data they are displayed simultaneously,thus we can lit only one column. After 1 msec of delay repeating this process more 4times we can lit the rest 4 columns. Repeating the whole process of displaying 5columns we can display the whole character.

  • 8/3/2019 Computer Interfacing Sessional

    6/23

    www.digizoneku.com 6

    The detailed block diagram is shown below:

    Fig.3: detailed block diagram for configurable moving display board

    In this block diagram all the next and current display data buffers and thecorresponding load signals are shown. All the segment buffers are used for saving rowdata and a single column buffer is used to store the column number of the column to

    light. This single column is given to all segments as shown by the same shorted linefrom column selector.

    1. Display board:

    In the figure 1 and 2, the display boards are represented as 8Segments. Display board consists of 64 columns and 14 rows (two lines) .Asmentioned earlier, columns are grouped into 4 segments, each containing 16 columns.At any particular time, nth column from each segment is illuminated. Then after 1 ms,(n+1)th column (from each segment ) is displayed ,then (n+2)th column is lit up , andso on. After displaying the last (16

    th) column, the 1

    stcolumn is selected again. This

    process goes on at such speed so that it appear as static to human eye.

  • 8/3/2019 Computer Interfacing Sessional

    7/23

    www.digizoneku.com 7

    2. Column selector:

    Column selector is used to select a column in a segment. If value of the columnselector is n, then the nth column from each segment will be selected .And only therow data for the selected columns will be displayed next .As each segment is 16columns wide ,column selectors value can be 1 to 16.

    3. Buffer for current data:

    At any specific time, nine sets of data are necessary to light a particular columnof each segment in both lines.

    `These are: Selected column Row data for selected column for each segments of line

    1 (four sets) Row data for selected column for each segments of line

    2 (four sets)

    These data are stored simultaneously in nine separate current data buffers fromcorresponding next display buffers.

    4. Buffer for next data:

    Data that will be displayed next are stored in next displaybuffers. These buffers are necessary as only one set (1 byte) of data can be outputted

    from computer, but to illuminate a single column of all segments we need nine sets ofdata. Because of this limitation, at first, each set of data is stored in next display bufferone after another .And then stored in current display buffer from where all data areshown at once. Loading of new data to these buffers are controlled by separate loadsignals.

  • 8/3/2019 Computer Interfacing Sessional

    8/23

    www.digizoneku.com 8

    :: Hardware description ::1. Display matrix:

    As display matrix, total sixteen 8x8 led dot matrix are used. Thismatrix needs active high voltage in row according to the data pattern and column tolight up any specific position. Each segment consists of 2 8x8 dot matrix. The rows ofthese both matrices are shorted as columns are selected from 1 to 16.The diagram isshown in the next page:

    Fig.5 :- interconnection between two 8x8 dot matrix.

    Fig.4: 8x8 bicolor dot matrix

  • 8/3/2019 Computer Interfacing Sessional

    9/23

    www.digizoneku.com 9

    Fig.6 : Internal connection

    2.Column selector :

    As each segment consists of 16 columns and only one column from eachsegment is selected, 4 to 16 decoder (74154) is used for column selection. Thisdecoder provides active low output, so this output can be directly used to select acolumn of the 8x8 dot matrix.

    3.Parallel Port :

    In order to interface with the computer, the parallel port LPT1 is used to supplythe data to be displayed and also the necessary control signals for the signals for thebasic operation of the circuit. Specification for computers parallel port are given below :

    Fig .7 : parallel port specifications

  • 8/3/2019 Computer Interfacing Sessional

    10/23

    www.digizoneku.com 10

    Here,

    Pin 2-8 are used for data output

    Pin 9 is used as clock signal for buffers Pin 1,14,16,17 are used as load signals Pin 10-13 are used for taking input from hardware

    3.Load generator:

    As all the data for displaying are coming from the same data pin of the parallelport, we need buffers to store the data for the corresponding segments. We used d-flip-flops as buffer. To store data in this flip-flop we need a clock signal to load the datafrom its input pin to its output pin. For this purpose we needed the Load Generator.

    As described earlier, nine (for current display) buffers are required for readydata to illuminate one column of each segment. So we needed a total of 10 loadsignals. Nine of these load signals are needed to store the ready data for display and

    an additional load signal is required to display those data simultaneously.Control pins available in the parallel port can be use for this purpose. But to

    generate 10 control signals out of 4 control pins, a 4 to 16 decoder is used as loadgenerator.

    Inverted outputs (as 4 to 16 decoder has active low output) of load generatortogether with data of 9

    th(used as clock input) pin of the parallel port is used as clock

    signal for buffers.The Load Signals are described below (Figure: 2)Load 0: Load next display buffer for line:2 segment:4Load 1: Load next display buffer for line:2 segment:3Load 2: Load next display buffer for line:2 segment:2Load 3: Load next display buffer for line:2 segment:1

    Load 4: Load next display buffer for line:1 segment:4Load 5: Load next display buffer for line:1 segment:3Load 6: Load next display buffer for line:1 segment:2Load 7: Load next display buffer for line:1 segment:1Load 8: Load data for Column(Next Column buffer)Load 9: Load all current display buffer and Column Selector to the display

    board

  • 8/3/2019 Computer Interfacing Sessional

    11/23

    www.digizoneku.com 11

    Fig 8: detailed circuit diagram

  • 8/3/2019 Computer Interfacing Sessional

    12/23

    www.digizoneku.com 12

    :: Hardware and its Quantity ::

    1. Display matrix:a. For 64 column 14 row (2 lines) display , 16 8x8 dot matrix are used.b. Row data can not be directly connected to the matrix. So,14(row)*4(segment) 33 resisters are used.

    2. Column selector:4 to 16 decoder (74154) = 1To store column data ,

    Current column buffer (74273) =1

    Next column buffer (74273) =1

    3. Load generator:

    4 to 16 decoder (74154) =1Inverter (7404) =2And (7408) =3

    4. Buffer for current data :

    1 buffer for each segment for 2 lines(74273) =8

    5. Buffer for next data:

    1 buffer for each segment for 2 lines(74273) =8

  • 8/3/2019 Computer Interfacing Sessional

    13/23

    www.digizoneku.com 13

    :: Software Description with Source code ::

    Core Component:

    Our Software consists of 3 main components: A package calledparport A special Application UserPort DisplayMatrix_HW.java written in Java programming

    language

    Package parport and UserPort is easily available in the Internet. There is a

    dll (Dynamic Link Library) file calledparport.dll which should be copied tothe jdk bin directory and the package parport should be set as class path inthe used IDE(covered in details in User Manual Section).UserPort is needto access the parallel port which is not permitted in Windows XP(covered indetails in User Manual Section).

    Architecture:

    Since Java is an object oriented programming language we have usedclasses and objects. We have total 8 threads (5 for display text(static, left, right, up,down) and 3 for animation),but these threads will not be activated at the same time.We have activated the thread corresponding to the given input. Such as: when theuser has given the input to display data to move leftward only the threadcorresponding to writing data leftward is started, others are suspended.

    We have currently total of 14 classes. They are given below: DisplayMatrix_HW class is the main class for initiating the program Moving class for taking the input for display text module Common class for writing the port with data for static text and graph

    plotting Left class consists of the thread writing the port with data for

    moving the input text leftwards Right class consists of the thread writing the port with data for

    moving the input text rightwards Up class consists of the thread writing the port with data for moving

    the input text upwards Down class consists of the thread writing the port with data for

    moving the input text downwards Animation class for taking the input for showing the selected

    animation Clock class consists of the thread writing the port with data for

    animated sand clock

  • 8/3/2019 Computer Interfacing Sessional

    14/23

    www.digizoneku.com 14

    Kite class consists of the thread writing the port with data for flyingkite

    Smile class consists of the thread writing the port with data for

    smiling face Plot class for graph plotting Database class for initialization of the bit patterns for the letters and

    numbers Init class for saving the bit patterns for the letters and numbers

    The commented source code is attached with report.

  • 8/3/2019 Computer Interfacing Sessional

    15/23

    www.digizoneku.com 15

    :: User Manual ::

    Hardware Requirements:

    5 V Source and Ground (Possibly Trainer Board or 5V Adapter) Parallel Port Connector Pentium 3 or Pentium 4 Micro-Processor Personal Computer

    Hardware Setup:

    1. The 5V Source and Ground should be connected to the circuit.

    2. Then the Parallel Port Connector should be connected to the ParallelPort of the Computer and to the circuits parallel port bread board.

    3. To give the hardware input:a. The number 10 pin of the parallel interface of the breadboard

    should be connected to an input switch of the trainer board for left direction.b. The number 12 pin of the parallel interface of the breadboard

    should be connected to an input switch of the trainer board next to theprevious for right direction.

    c. The number 13 pin of the parallel interface of the breadboardshould be connected to an input switch of the trainer board next to theprevious for up direction.

    d. The number 15 pin of the parallel interface of the breadboardshould be connected to an input switch of the trainer board for the downdirection.

    Software Requirements:

    Windows 98/ME/2000/XP If the Operating System is Windows 2000/XP then Administrator

    privilege is required.

    Software Setup:

    1. First Java supported IDE (Kawa/JCreator/JBuilder) and at leastJDK1.4.0_03 should be installed in the Computer which will be used to interfacethe circuit.

    2. We are using a special package calledparport which is easily availablein the Internet. To use that package we have to first set the class path for thatpackage in the IDE(Kawa/JCreator/JBuilder) that is being used.

  • 8/3/2019 Computer Interfacing Sessional

    16/23

    www.digizoneku.com 16

    3. Normally accessing the parallel port is not permitted in Windows NT/XP,

    so we are using another type of Application called UserPort which is also

    available in the Internet. To use UserPort, there is a sys file called UserPort.sys inthe UserPort folder which should be copied toC:\WINDOWS/SYSTEM32/DRIVERS.Then UserPort.exe in the UserPort foldershould be executed and the address 03bc-03bf should be selected and start buttonshould be clicked. If the Operating System is Windows 98/ME this step no.3 can beignored.

    4. Next the source file DisplayMatrix_HW.java should be loaded in thedesired IDE and compiled and then executed.

    Software Description:

    There are currently three modules in our software for Configurable MovingDisplay. They are:

    Display Text Animation Graph Plotting

    When the program is executed, a Graphics User Interface appears asfollows :

    Fig .9 : User manual : Home window

    This window is called Home window. To perform any of these functionality,simply the corresponding button should be pressed.

    Module 1: Display Text

    After pressing the Display Text button the following window will appear onthe sceen:

  • 8/3/2019 Computer Interfacing Sessional

    17/23

    www.digizoneku.com 17

    Fig .10 : User manual : Input window for text display

    Any desired input (any numbers and alphabets) can be given in the text boxshown.

    The Display board can output the given text input in 5 ways:

    1. Given text input can be displayed in static mode (non-moving) by clicking theStatic button or by giving hardware switch input to all zero.

    2. Given text input can be displayed in moving mode in right to left direction byclicking the Left button or by giving hardware switch: 1(most left) input to one andall other switches to 0.

    3. Given text input can be displayed in moving mode in left to right direction byclicking the Right button or by giving hardware switch: 2 (next to the switch forleft input) input to one and all other switches to 0.

    4. Given text input can be displayed in moving mode in down to up direction byclicking the Up button or by giving hardware switch: 3 (next to the switch for rightinput) input to one and all other switches to 0.

    5. Given text input can be displayed in moving mode in up to down direction byclicking the Down button or by giving hardware switch: 4 (right most ) input toone and all other switches to 0.

    Module 2: Animation

    In this module we have currently 3 animation displays. After clickingthe Animation button in the Home, the following window will appear:

  • 8/3/2019 Computer Interfacing Sessional

    18/23

    www.digizoneku.com 18

    Fig .11 : User manual : Input window for animation display

    By clicking the corresponding button, the desired animation can bedisplayed in the display board.

    The Clock provides animation of falling sand of a sand clock, the Kiteprovides animation of a flying kite and Smily gives the animation of a smiling faceon the display board.

    Module 3: Graph Plotting

    After clicking the Graph Plotting button the followingwindow will appear:

  • 8/3/2019 Computer Interfacing Sessional

    19/23

    www.digizoneku.com 19

    Fig .12 : User manual : Input window for graph ploting

    By clicking the mouse or by dragging the mouse over the proper co-ordinate the desired graph can be plotted and displayed on the display board byclicking the Show button. The graph plotted is displayed on the User Interface byhighlighting the co-ordinate by red color (as in the picture above the L shape).

    To go back to the Home window simply the Current window should becrossed. It is applicable in all the three modules. To terminate the program thecross in the Home window should be pressed by the mouse as shown below.

    Fig .13 : User manual : how to close program

  • 8/3/2019 Computer Interfacing Sessional

    20/23

    www.digizoneku.com 20

    :: Problem f aced and adopted Solution ::

    Implementation of theoretical circuit into reality had confronted us with manypractical problems. Some of those problems along with our adopted solutions areprovided below.

    Voltage Source value:

    We gave the main power connection (vcc) by cascading from the firstbread board to all the other bread boards. This cascading made the secondline appear so dimly that we could hardly see the displayed letters.Measuring voltage we found out that may be due to wire resistances vccdeteriorated to almost 4V instead of 5V which causes this dimness.

    To resolve this problem we used separate voltage sources for both lines .

    But output voltages from various pins of 74273 buffer are not same. So lightintensity of all led were not always the same.

    Load Signals:

    According to our design, data is continuously written in the parallel portfrom the computer and arriving at all the segments buffers but only the

    appropriate buffer is loaded with necessary data .Appropriate buffer ischosen by load signals. We used the control register of the parallel port forgiving the clock pulse or the load signals for the corresponding buffer.

    But when two or more load signals are too closely spaced (differing in onlyLSB position ) they get load signals almost at the same time ,thusdisplaying same data.

    Such as: segment 1 and segment 2 were displaying same data if loadsignal patterns from Control register were 1100 and 1101.

    To solve this problem we changed the second segments load signal to

    1000,where there was much difference in the binary bit pattern.

    Threads:

    We have faced serious problem in managing threads. When we first wrotethe code for the display we created a function that will write data in displayinfinite times. Because of that infinite loop our Graphics User Interfaceallowed only one input. We had to stop the program each time to changeinput or display mode.

    To solve this problem we kept two threads one for input and another forwriting in the port. That caused another problem. Display must be shown

    for a pre-specified duration and at a specific interval to maintain correct

  • 8/3/2019 Computer Interfacing Sessional

    21/23

    www.digizoneku.com 21

    refresh rate .But in the time of thread switching ,maintaining refresh rate isnot possible, thus at those times display was perturbed and showed blank.

    To solve this problem we kept one thread only for taking input and separatethreads for each separate functions .When the user gives any input fordisplay we simply started the corresponding thread and suspend any otherrunning thread. In this way the input User Interface was not impeding thecontinuous writing in the port and correct refresh rate was maintained.

    Determining refresh rate:

    Refresh rate is calculated in trial and error method .Each buffer and otherhardware has settling time and propagation delay. Refresh rate must be

    greater than sum of settling time of 18 buffers that are used for displayingone column and it must be greater than time that the 8x8 dot matrixrequired to go off.In our design refresh rate is 62.5 per second.

    Resistance value:

    In the specification of 8x8 led dot matrix, resistance connected in serieswith the row connection was 470 ohm. But this resistance made certain ledto lit very indistinctly. For better and brighter display, the resistance value

    was reduced to 33 ohm.

    Wiring:

    According to our design ,displaying 8 segments we had to usetotal 18 buffers (74273) to keep the provided data safe and saved. Thismade our circuit pretty complicated and entangled. To keep track of theselarge number of wiring we used specific colored wires for specificconnections, such as : for line 1 data we used yellow wire and for line 2used green wires.

  • 8/3/2019 Computer Interfacing Sessional

    22/23

    www.digizoneku.com 22

    :: Future Direction ::

    The IC used for our display is fitted on the bread board and all thewires for selecting the columns are shorted to the first segment. Theamount of wires for selecting the columns for both lines was morethan hundred. Without shorting these connections by wires thisdisplay board can be made on the PCB (Printed Circuit Board) toavoid this excessive wiring and interconnections.

    Although our 8x8 dot matrix IC could light both red and green colorand we designed the circuit for both colors, but due to the lack of

    breadboard and excessive wiring we displayed everything in the redcolor. If we could get a large bread board or could make PCB wecould show 2 colors. So these improvements can be done in thefuture.

    We have shown alphanumeric display. It could be modified to addother characters too, such as: punctuation symbols, specialcharacters etc. It can be added to the software by giving the bitpattern for those symbols.

    We have currently shown only the capital letters fro the display. Itcan be modified by associating small letters too.

    We have shown only three animations. It can be further modified byadding more animations.

    We have designed the circuit for displaying a total of 16 rows(2lines) and 64 columns. It can be made larger by adding moresegments. But in that case the delay time for loading the data andsignals should be considered carefully.

    Functionalities can be added to display data from files.

  • 8/3/2019 Computer Interfacing Sessional

    23/23

    www.digizoneku.com 23

    :: Conclusion ::

    We are cordially grateful to our advisor Mostofa Ali Patowary sir. Inspite of his busy schedule, he guided us in designing ,specifying problems andmost importantly, elucidating effective ways of thinking to solve designingproblems . We also thank our friend Asif Islam Khan (EEE) for assisting us infinding 8X8 dot matrix IC. This project would have been impossible without theirhelp.

    We are also indebted to all lab attendants, because of their patience andcontinuous assistance weve been able to finish this project on time.

    Display Boards are being used in Markets, Hospitals, Lifts, Streets(for giving directions)in huge quantity. Since our display board can be configured

    so it can be used anywhere to display any message to give. Our display board iscost effective for any use. It can be further modified to have more functionalities aswe discussed in the previous section. We are looking forward for thoseimprovements to be done.