| ??? 12/17/08 07:37 Read: times |
#160987 - Here's one way ... but you'll have to code it yourself Responding to: ???'s previous message |
Once you've looked at what a character generator ROM does in the classic text-on-a-CRT display, I think you will understand what has to be done on this configuration.
On a CRT, just for reference, the desired ascii code is stored in the appropriate location in a refresh RAM buffer. At the appropriate time, as determined by the counter chain to which I referred in an earlier post, a new character is addressed in the refresh RAM, and it then propagates to the character generator. A scan-line address, which is the horizontal position, in the case of a CRT display, is applied to the character generator, along with the ascii code from the refresh RAM. The ROM then produces a byte (or often fewer) of pixels that are sequentially driven to the CRT as timed by a shift register. That is pixel-by-pixel drive of the video combiner, or whatever is required. The LED matrix requires the same sort of process, but, rather than loading a shift register that converts, parallel-to-serial, the pixels of the current scan line in the current character, it simply drives those, in this case, eight pixels onto 8 data lines, each of which drives a single element on that column, more like what a dot-matrix printer does, assuming you're doing things in this way. Presumably, all the LED's, and let's for this discussion assume it's their anodes, in a given row (horizontal) are common, and the columns are driven by a single transistor or buffer, through the common cathodes of each column. That means that, if you have 8 columns, as you might in a single character, then you will require 8 cathode drivers, possibly transistors in an array, e.g. ULN2803. If you have 80 columns, you will then require ten such drivers. A byte driving the eight rows (anodes) and another byte driving the eight columns, via those buffers, will then either conduct or not conduct current through the LED's depending on the sense of the bits on the two ports that drive those bytes onto the LED array. Now ... assuming you've understood that, we can go on to the scrolling. Note that I've said nothing about the timing ... yet. Horizontal scrolling in such an array can be accomplished by performing the table-lookup/character-generator function as follows. This begins with the initial unscrolled position of the characters. Here's what you do to operate the display ...
select the first character to be displayed, and set offset 0 into the column offset address to
the character generator table in code memory.
retrieve the corresponding bit pattern for the first column of that character and drive the
anodes with that bit pattern, and select the corresponding column, initially zero, to drive the
cathodes corresponding to the first column.
.
.
.
increment the column however many times are required for a character, eight in your case, then
increment the character address to the refresh memory buffer and repeat until all the characters,
e.g. 80, if you have an 80x8 display. Note that you can display many more than 80 characters on
an 8x80 matrix, but you are limited to 80 of them at one time. Scrolling simply means that the
characters are displayed, column by column, traveling to left or right, whichever is appropriate
for the language you're using, and the columns are appended at the end of the display as they
"fall off" the leading end.
In order to scoll by one column, simply add 1 to the offset address, modulo 8, in the case of an 8x80 display, with timing appropriate for the proper display brightness and scroll rate, for each trip through the array of characters to be displayed. The effect will be that the leading columns are appended to the end of the entire string you are displaying. Timing has to be adjusted to make the display intensity sufficient, and to make the display slow enough to be readable, yet fast enough to maintain image persistence in the retina. A good place to start with the timing would be to use Erik's assumption of a maximal delay of 8 milliseconds per frame, i.e. you must cycle through all 80 of the characters, or 640 columns in 8 ms or less in order to minimize the risk of flicker, and you probably want to scroll at a rate somewhere between 1 and 2 columns per second. Your mileage may vary, of course. This can all be accomplished with a minimum of external timing/multiplexing hardware, though with 80 columns, some external multiplexing, perhaps by using some decoding logic together with 7445's, rather than simple cathode drivers such as the ULN2803, to drive the columns. ISTR that 7445 can sink 45 mA, which provides a maximum of slightly less than 6 mA per LED, which should be pretty bright if your LED's are pretty small. Some LED's require 20 mA each, so be prepared to increase the driver hardware. RE |



