ARTICLE UNDER CONSTRUCTION
This project is what you have been waiting for. Remember the scrolling signs you see in shops and on advertising billboards? Now you can program your own moving sign with all the effects you can think of. We have provided a blank canvas in the form of a scanning screen 15 LEDs by 7 LEDs and on this you can put anything you like. Of course this is not a two-day job. You have to learn how to program and how to get the effects. But when you get something on the screen, you will be able to classify yourself as a PROGRAMMER. Writing a program is a bit like writing a book. You have to think about a lot of things and actually invent many features. For instance, the design of each number and letter has to be determined. Then you have to decide how they are going to be stored and accessed. We have used one approach to displaying characters on the screen, but there are many ways to achieve the same result and you can start a-new or use our sub-routines. The switches can be re-assigned at any stage and they can have more than one function. It's all up to you. The first thing to do is go through the program and determine how each sub-routine operates. Then you can add your own ideas. But remember this important point: Only add a very small step at a time. Don't expect a complex routine to work the first time. Divide everything into small parts and make sure it works, before adding the next small step. This is the only way to avoid frustration. You will learn a lot more about how to go about this process in this article and you can come out a successful programmer. All the big signs are just an advancement on this project and once you have the concepts in place, you can tackle almost anything. A point to note: THE VOLTAGE The voltage on the PIC chip is critical and the author had some random faults develop on the screen when the voltage dropped below 4.5v. As soon as any unusual fault develops, the first thing to do is check (replace) the batteries. The author also had a problem with the PIC chip when the supply was above 5.6v (in another project). So, be warned! THE PC BOARD This project is provided as a "prototyping project" as no PC board has been produced. The photographs show the project built on a matrix board using surface-mount components and very fine wire. The final design will require a double-sided board with plate-through holes, especially for the matrix of LEDs, but for the moment you can refer to the photographs and construct the circuit yourself. Don't be put off by the appearance of the circuit. It is really just a duplication of a very simple circuit driving a LED that can be built on a matrix board with 0.1" spacing. Most of the surface-mount components can be positioned so the legs will reach a solder-land and you won't need a special surface-mount board. But you will need good eyesight and a fine tipped soldering iron. Simply follow the layout and use the photographs as reference. Let's start: THE CIRCUIT The circuit looks very complex but it consists of just two chips, 105 LEDs, a set of driver (buffer) transistors and 6 tactile switches. All the transistors and resistors seem to disappear when surface-mount components are used and the whole project can be constructed on matrix board or on a double-sided plate-through hole PC board. Here is the circuit: |
The 4017 is a
"decade counter" and this
means it has 10 outputs, starting with output pin 3, only one output
is HIGH at a time. The 10th output is pin 11 and then the counter
starts at pin 3.
Here are some updates of the project by S. Sandhu:
THE SUPPLY
The numbers and letters above have been
created by the author but if you want to change the appearance of any
of them, refer to the values in table 2 and change the appropriate byte.
(some of the
formats of the characters can be improved.) The two tables do not use the full
0FFh bytes of the first page of memory. There are twenty six bytes available for your own use.
SYNCHRONISING
The program now knows the 4017 has output 9 HIGH and one clock of the 4017 via the following sub-routine will make the 10th output HIGH:
The actual clocking of the 4017 is done via RA0, by taking it HIGH then
LOW and the 4017 is now clocked by the sub-routine SCAN, which scans the
7 rows. In fact it is the presence of data on line RA0 that clocks the
4017 and if line RA0 does not contain data (it will be LOW), the
sub-routine calls the clock routine above. When the project is turned on, the screen will be blank but it is actually being scanned at more than 100 frames per second but none of LEDs are activated. The scanning starts at the top of the screen and moves down, with each row being illuminated in turn. This scanning is the same as the production of the white screen on a TV or monitor and is produced by a separate sub-routine that we will not be concerned with. If the scan-rate is reduced, you will be able to see the rows being turned on in sequence. This can be done by increasing the length of the delay routine associated with the scan sub-routine and you should do this to see exactly what is happening on the screen. If we did not scan the screen like this, we would need 105 drive-lines to drive each LED individually. However LEDs are ideally suited to being turned on and off very quickly and their performance improves with this "pulse" approach. The concept is called POV (Persistence Of Vision) and is explained elsewhere in this article. When the project is turned on, the program moves the data in files 50h - 5Fh (called the GHOST files) to 70h - 7Fh (called the SCREEN files). If there is no data in the ghost files, the screen is blank. The reason why ghost files are needed is simple. Any of the information we want to put onto the display, must be contained a set of files. We now have to move the data from the files so it can be shown on the display. To show a complete screen of date requires 15 files. How do we take the information from the 15 files and show it on the screen? Of course you can take each bit for each file and individually load it into port A and B and display it, but this will take a lot of programming. The easiest way is to shift the bits in a file so that the end bit goes into a location called the "carry." When another file is shifted, the bit in the carry is loaded into the file. This is a very clever way to transfer a bit from one file to another. When this is done with 15 files, the data for the top row is available. Also the sub-routine for the 15 files can be used again for the second row etc and thus the lines of code can be kept to a minimum. This is how the end-bits of 8 files are loaded into a single temporary file and 7 bits are loaded into another temp file. These two files are then transferred to port A and Port B. Line RA5 (of port A) is an in-only pin and since it cannot output to the display, an extra shift is provided in the program to close the gap in the temporary file by the non-appearance of data from RA5. It is much easier to work on ghost files when animations are required, however it is not essential, and you can try manipulating the screen files, as a challenge. As you can see from the illustration below, the next letter (letter L) to be displayed is placed in a set of files that are outside the Ghost file area and it is very easy to shift the letter into position via a simple sub-routine. If you can think of a simpler way to carry out any of these tasks, you can produce the code and send it in for inclusion in the article. This is what this article is all about. After all, some of the smartest software in the world has been produced by very young, talented, programmers and I am not going to miss any opportunity to improve the project. In this world, the more you know, the more you realise you don't know.
BURNING THE CHIP The "effects" button is the pathway to the effects. By pushing this button you can re-name all the other buttons and produce any effect you like. All "effects" take the screen data and modify it in some way. We have already learnt, the data that will be shown on the screen is stored in a set of files 50h to 68h and these files are called GHOST FILES. You will appreciate the concept of storing data in this way, as the files are easy to manipulate. This has already been shown with the "running effect" where the letters are moved across the screen so words and sentences can be displayed. The sub-routine "shift" creates this effect. The next simplest effect is called COMPLIMENT. This effect reverses the color of the letters, similar to white writing on black background, in printing. The sub-routine "comp" changes all "1's" into "0's" and "0's" into "1's." In this sub-routine, all the illuminated LEDs are turned off and and the non-illuminated LEDs are turned on. We do this by taking each file in turn and complementing it. By calling the "run" sub-routine and adding the complement feature, we have produced a new effect. As each column of data is placed in file 5Fh, it is complemented and "shift" displays it on the screen as reverse lettering. USING THE PROJECT When the project is complete and tested, the first thing you will want to do is produce something on the screen. The 6 buttons on the project are labeled UP, DOWN, STORE, RUN, DELETE, and EFFECTS. These buttons are used to create and scroll a message of up to 7Fh characters. Any message is immediately saved in EEPROM and thus it is not lost when the project is turned off. To write a new message, the old message must be deleted by pressing the DELETE button as explained below. Here is the function of each button: UP - pressing this button will produce letters A - Z and numbers 1 - 9 then the number zero. The next character is a set of dots on the lower part of the screen to indicate a space. DOWN - pressing this button will produce letters in the reverse order. It can be used to go back to a missed letter or get to a character quickly without having to advance through the whole list. STORE - When the required letter appears on the right side of the screen, the STORE button is pressed. This will store the character in EEPROM and move the character to the left side of the screen and add a set of dots on the right side to indicate a place for the next character. If these dots are STORed, they will show when in the scroll mode. The space character is explained below. RUN - When the required number of characters has been stored, the RUN button is pressed and the message will scroll across the screen. You can store up to 7Fh characters. DELETE - pressing this button will remove the last character from the message when the message is scrolling across the screen. (To scroll the message, the RUN button is pressed). EFFECTS - This button will produce all type of effects as produced by you and other readers, as well as new effects, as they become available. WRITING A NEW MESSAGE To write a new message, the old message must be deleted by pressing the DELETE button until no character scrolls across the screen. Start by viewing the old message. Turn the project ON and press RUN. You will see characters scroll across the screen. Now press the DELETE button until no character scrolls across the screen. The project is now turned OFF then ON and is ready for you to create a new message. To store a BLANK, press UP to get the letter A, then DOWN to get the row of 5 dots. This character is then stored as a SPACE. The Space character (called a BLANK) is located after the numbers and after the number zero. The 5 dots will not appear in the scroll-mode - just a empty space.
WRITING YOUR OWN SUB-ROUTINES
Here is the 15x7 Display produced by one of our readers,
Emilo Konishi:
23/1/10 |