|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The LED DisplayThe LED display could be made up of separate LEDs, but this would make producing a PCB difficult. Instead, I have used ready-made modules available from Rapid Electronics Ltd. These have 35 red LEDs arranged in a 5x7 matrix with the cathodes of each column and the anodes of each row commoned together, as shown in figure 2. This results in there being 12 connections to each module, which makes producing a PCB easier. The number of modules required to give a good effect was decided by using the computer program in Appendix 1 which simulates on screen a message scrolling across a display. Using this, I decided 16 modules would give a good display, allowing 13 characters to be shown on the display at any instant.
Printed Circuit BoardRather than draw the copper pattern for the PCB by hand, since it is repetitive, I used a computer drawing package and a laser printer to produce an image on acetate film. Unfortunately, the number of display modules had to be reduced to 12 due to the size of the screen drawing area and the size of the UV light box used to produce the PCB. With the PCB of figure 3, the first seven connections (marked in red) are the LED anodes, and the other 60 are the LED cathodes.
The EPROMThe characters in each message are stored in an EPROM with one byte corresponding to one column of dots. Storing the characters in this way rather than as their ASCII codes has the advantage that, apart from being simpler to decode with the electronics, any character or graphic needed can be easily formed. The character definitions used in the system are those used in my NC200 computer, which uses a 5x8 matrix to display each character. Since the LED display modules are 5x7, only upper-case letters can be shown properly, since the letters 'g', 'j', 'p', 'q' and 'y' will lose their 'tails' (see figure 4). An extra column is added between each character for spacing, meaning that each character is therefore 6x7. The EPROM used in the system is the 2764, which has a storage capacity of 64K bits organized into 8,192 bytes. There are therefore thirteen address lines, which are split up, the first eleven (A0-A10) being set by the address counter block. The number of address lines set by the address counter block determines the length of the message, meaning there are 2,048 (2 to the power of 11) columns available for a message. This means that the maximum length of each message is 341 characters (2,048 divided by 6), which satisfies the requirement of the specification.
Adding Extra MessagesThe two extra address lines A11 and A12 are used to select one of four messages stored in the EPROM. Switches 'A' and 'B' select a message when set as shown below:
Switches 'A' and 'B' are SPDT types connected as shown in figure 5 so that each address line is either connected to +5V or 0V.
Address CountersThe address counters form the heart of the system as it is these that enable the scrolling of a message to take place. There are two counters which work together: The Base Address CounterThe 'Base' counter is a 12-bit (only 11-bits are used) ripple counter IC (4040) which is reset to zero by bit D7 of the EPROM at the end of a message so that the first byte of data in a message is at the first EPROM address, 00000000000. The counter then increments every time the Cathode Multiplex block finishes a scan, so that the display appears to scroll. The Main Address CounterAfter the 'Base' address counter is clocked at the beginning of a scan, a LOAD signal inputs the new address into the 'Main' address counter. The 'Main' address counter then advances from this address once each time the Cathode Multiplex block moves on to the next column. The Main address counter needs to be 11 bits long and has to be programmable. Since this length of counter cannot be found in one IC package, three identical 4-bit programmable synchronous counters are used (74C161). These have common clock and common load lines, plus carry-in and carry-out pins which are connected as shown in figure 6. The whole block was tested when built using two Logi-boxes to monitor the outputs and provide CK and LOAD inputs.
Cathode Multiplex BlockThe function of this block is to pull one of sixty outputs low in order each time a clock pulse is received, i.e., a 1-of-60 decoder. Each of the sixty outputs is connected to one column of LEDs on the display so that only one column can ever be on at any one time. Since a 1-of-60 decoder is not available in one IC package, four 1-of-16 decoders (originally 4515) were used instead. However, this meant two extra counters and a 1-of-4 decoder were also needed. The circuit is shown in figure 7. 'Select' CounterEach of the 1-of-16 decoders has 4 address lines, A to D. Connecting the Q0-Q3 outputs from a 4-bit counter (4520b) to each of the decoder address lines makes each decoder pull each of its outputs low in turn when the counter is clocked. Now, all that is needed is a method to making only one decoder do this at a time. 'Enable' Counter and DecoderThe 1-of-16 decoders have an enable input, which, when brought low holds all their outputs high, thus preventing any display column to be on. One output from a 1-of-4 decoder (4556a) is connected to each enable input so that only one 1-of-16 decoder is active at any one time. The 1-of-4 decoder needs a 2-bit counter (4520a) to supply its address and this is clocked every time the D3 output of the 'Select' counter returns to zero (i.e., when a count of 16 has been reached and the 'Select' counter returns to 0000). Because the 4520 is positive clocked, a NOT gate is required to invert the D3 output before it clocks the 'Enable' counter. The block was then tested using a Logi-box to show the 4556 outputs changing and then applying the fast system clock and using 4 LED displays to check that scanning worked at high speed. To do this the anodes of each row of LEDs were tied high. However, as more rows of LEDs were switched on, the LEDs became progressively dimmer due to the 4515 IC not being able to sink enough current. In order for the LEDs to all be the same brightness I decided that the Anode Multiplex block was needed.
Anode Multiplex BlockThe Anode Multiplex block was designed to overcome the problem of the LEDs becoming dimmer by ensuring only one LED is on at any one time. (Note that this block was eventually taken out once transistor display drivers were added.) The Anode Multiplex block scans each of the seven LEDs in a column in turn and either turns each one on or off depending on the data in the EPROM. To do this, two 4051 8-input analogue multiplexers were used as shown in figure 8, with only 7 inputs/outputs being needed. Using analogue multiplexers means that data can flow to or from the switch 'wiper'. For example, if address 010 is present on both multiplexer address lines, then data input to input 2 through the first multiplexer will be available on output 2 of the second multiplexer.
'Select' CounterThe 'Select' counter is a 3-bit counter (4520) that provides the address inputs for the 4051 analogue multiplexers. The counter needs to count up to six, then reset on seven since there are seven LEDs in each column. This was achieved at first by using two AND gates wired as a three input AND as shown in figure 9[a]. However, when tested using a Logi-box, the counter reset on a count of four, rather than seven. This is because the signal is delayed in the first gate so that a glitch occurs when the output changes from 3 to 4, causing a brief reset signal to the counter, as shown in figure 10. To stop this, the inputs to the AND gates were swapped around as shown in figure 9[b].
System ClockThe system clock is produced by a NE555 astable circuit as shown in figure 11. The frequency of the astable was at first based on the scan rate of a TV screen, 25Hz, because at this frequency the screen cannot be seen to flicker. The clock frequency of the display system was therefore chosen to be 1.5kHz (25Hz x 60), since there are 60 LEDs in the display. The formula for the frequency of an NE555 astable is:
Therefore:
If Ra is chosen to be 1kΩ and C is chosen to 0.1μF, then:
With this value, the scanning of the display could still be seen (possibly because LEDs have a lower persistence than the phosphor in a TV screen), and the value was finally changed to 1.6kΩ giving:
Connecting the Blocks TogetherWhen the system was first connected up as shown in figure 12, a slower system clock was used for testing, and the Cathode and Anode Multiplex blocks were seen to function together correctly. However, the 'Main' address counter did not count due to the length of the Anode Multiplex block 'Select' counter reset pulse not being enough to clock the counter. This problem was solved by placing two spare NOT gates at the reset input of the 'Select' counter and connecting their output to the clock input of the 'Main' address counter, as shown in figure 13. Another problem to be sorted out was that the the 'Main' address counter did not load in it's new value from the 'Base' address counter at the end of each scan. Again, this was due to the short length of the Cathode Multiplex block reset pulse. Using the Spare OutputsThe problem was solved by re-designing the resetting of the system. Since there are 60 columns of LEDs used in the system, there are 4 spare outputs from one of the 1-of-16 decoders, each one being taken high when it is selected, and they are selected one at a time by the Cathode Multiplex block. I decided to use three of these to do the following tasks:
When tried, it was found that the 'Base' address counter was being clocked twice each time output 61 went high due to a glitch. When a logic probe or an oscilloscope was connected to output 61 to try to observe the glitch, it disappeared. This must have been because of the load placed on the output by the test instruments, so I placed a variety of resistances between the output and +5V to try to stop the glitch. When this failed, I tried a 0.2nF capacitor (equal to the capacitance of the oscilloscope) instead cured the problem. After this, the design worked perfectly because the clock and load pulses are now longer, guaranteeing that the 'Base' counter will be clocked and the 'Main' counter will load in the new value from the 'Base' counter.
De-coupling CapacitorsSix 0.1μF capacitors were placed near to many of the ICs to avoid problems with glitches causing unwanted clocking, etc. (The circuit behaved erratically when capacitors near the 555 IC were removed.) Larger 100μF capacitors were also placed on each breadboard to smooth the power supply. Display DriversThe brightness of the LED display was not adequate due to the small amount of current (25mA) that could be sourced from the 4051 and sunk into the 4515 ICs. At a high scan rate, the LEDs appear dimmer even with 25mA through them. So that higher currents could be supplied to the LEDs, two types of transistor drivers were used, placed as shown in figure 14.
Darlington PairsNine ULN2004 ICs were used at the LED cathodes to sink the higher current. Each IC has seven identical Darlington Pair drivers as shown in figure 15. These can sink a maximum of 550mA, so are perfect for this application. However, the Darlington Pairs are inverting, meaning that the 4515 ICs needed to be swapped for 4514 ICs (They both have the same pin-out!) so that bringing an output high allows a column of LEDs to be switched on, since the output of the corresponding Darlington Pair will become low.
Transistor DriversFor the LED anodes, the ULN2004 could not be used since current needs to be sourced from the driver circuit rather than sunk. Therefore, the transistor switch circuit shown in figure 16 was used. When the base voltage is 5V, the transistor is fully switched on, allowing a larger current to flow through the transistor into the LED.
LED ResistorsBecause of the transistor driver, 0.7V is lost from the 5V supply, meaning that there is 4.3V across the LED and resistor. Because the display is being scanned at high speed, the LEDs are only on for a brief period, meaning that they will appear dim unless a higher current than they would normally use is pushed through them. The low resistance of 47Ω gave a bright display, meaning that the current through the LEDs is 90mA. Because the brightness of the display does not now depend on the amount of current the ICs can sink and source, the Anode Multiplex block was removed, cutting down the number of ICs in the system from 27 to 23. Scan CounterThe scan counter was added so that the speed of scrolling could be altered. The counter is a 4-bit 4520 counter that simply divides it's clock input down by 2,4,8 or 16 depending on which Q output is used. Therefore, if output Q3 is connected, the display will be scanned eight times before the 'Base' address counter is incremented.
Programming by ComputerA requirement of the specification was that the system could be programmed by computer. Unfortunately, I did not have time to build and test the additions to the existing circuit described below. The simplified block diagram of figure 18 shows how the computer interface could have been added. The EPROM would be exchanged for a Random Access Memory of the same memory capacity. Using the parallel port of a computer such as the BBC Micro, each byte of data would be downloaded in order, the STROBE output acting as a clock for the 'Main' address counter. A tri-state device such as the 74254 would allow the data to be entered into the RAM. Before commencing downloading, a switch S3 in the circuit would need to be moved to get the system ready to accept the new data by ensuring the following:
Handshaking with the computer could be done by mimicking a printer's response to the new data using two monostable timers to provide the ACK and BUSY outputs (As in 'Parallel Interface Relay Card' article; see References).
Full Circuit Diagram (version 5)Parts List (version 5)
ConclusionApart from not having a computer interface, the system satisfies the specification. It has a display which is 60 columns wide, enabling 10 characters to be shown at any one time. The maximum length of each message is 628 characters because the 12-bit counter gives a maximum count of 4,096. By adding extra counters a message length of 1,365 could be achieved using the 2764 EPROM. The Message Select switches were added to enable up to four individual messages to be stored on the same EPROM. This is a feature which could be excluded should a computer interface be added. An extra counter, the Scan Counter, was added to enable the scrolling rate of the message to be changed from a slow crawl to a smooth 'glide' across the display. The circuit runs from a 5V DC regulated supply and consumes around 300mA peak when at LEDs are lit. Although it does not have some of the special effects that commercial display systems do, this system is considerably cheaper to produce, costing about £45, compared to a typical commercial system costing around £200. One problem with the system is that the display brightness needs increasing further so it can be seen in bright artificial light and sun light.
Suggested Additions to the Circuit
Version 6: Additions to the CircuitAfter my A-Levels were finished, I did some more work on the MMDS, as briefly summarised below: The Display Module PCBsUsing Microsoft Paint I designed a PCB that could accommodate a matrix of 16 x 7 standard 5mm LEDs spaced 1cm apart. This PCB includes two ULN2803 Darlington Pair ICs and one 4514 1-of-16 decoder IC. The PCBs can be aligned in a row (up to 4) to create a large display. Programming by ComputerIn order to program messages into the system, the EPROM was replaced with a RAM and tri-state buffers to control the data flow. The RAM has a rechargeable backup battery. A 'run/program' switch sets up the system to either run the selected message or wait for bytes received on the parallel port. A circuit from Electronics - the Maplin Magazine was used to simulate the responses a printer would make to a PC on the parallel port. Message design is acheived using the MMDS Editor software written for the Amstrad NC200 Notebook computer. This program can be downloaded from Tim's Amstrad NC Users' Site at www.ncus.org.uk/oande.htm#mmds_editor. Full Circuit Diagram (version 6)Parts List (version 6)
AppendicesAppendix 1: Moving Message Display Simulator ProgramThe following program was written in BBC BASIC on my computer (Amstrad Notebook NC200) so as to judge the size of display needed to give a good effect: This program is also available to download from Tim's Amstrad NC Users' Site at www.ncus.org.uk/oande.htm#mmds_editor. 10 REM MMDS Simulator program Note that the real display system scrolls column by column, not character by character. Appendix 2: EPROM Data ProgramThis program written for the BBC Micro by John Hewes allows the message stored in 'M$' to be viewed on the screen and printed as it will appear on the LED display. This program is also available to download from Tim's Amstrad NC Users' Site at www.ncus.org.uk/oande.htm#mmds_editor. The resulting list of bytes can then be dumped to the EPROM programmer. 10 REM EPROM data program (Note : Character definitions are given for Test Message 1 only) Appendix 3: Test MessagesThe four test messages are available to download from Tim's Amstrad NC Users' Site at www.ncus.org.uk/oande.htm#mmds_editor and can be read by the MMDS Editor software, also downloadable at this location. Photographs of the Completed Project
References
Thank you to John Hewes for programming the EPROM for me and writing the computer program in Appendix 2.
|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||