![]()
SUMBER : INTERNET
By : Mr. Widodo
Pada contoh dibawah
ini, selain mikro 2051 anda juga dapat menggunakan
89s51 atau lainnya, yang penting gunakan 2 port.

#include
unsigned char pat[5] = {0x3f,0x02,0x04,0x02,0x3f} ;
void main () {
unsigned char cnt, col ;
P1 = 0 ; /* Initialize all P1 outputs to be
zero */
P3 = 0;
while(1) {
col
= 1 ;
for (cnt = 0 ; cnt < 5 ; cnt ++ ) {
for (col = 1 ; col < 32 ; col <<= 1) {
P3 = col ;
P1 = pat[cnt] ;
delay_ms(1) ; // delay of 1 ms
}
}
}
}
Harga kit belum
disolder Rp 450.00 (menggunakan 89S51), harga kit sudah jadi (89S51) RP 900.000, disertai contoh program (PESANN SEGERAAA)
The circuit, illustrated below, is so simple that it needs little
explanation:

To drive the display, the PIC brings one of the row select lines (RB4 thru
RB7) low, and places the data for that row on the column lines, RB0 thru RB3.
This configuration is held for a short interval, then the next row is selected
and the new data is placed on the column lines, and so on. A variety of
patterns are programmed into the sample firmware, including a "comet"
racing around the edge of the screen, a rotating propeller, twinkling stars,
and a firework which spirals in to the center of the screen and explodes. What
you display onscreen is limited only by your imagination... and the fact that
with 16 LEDs, there are only 65,536 possible
"pictures" :-)
When you power up the device, it will run a quick test to prove that all
wiring is correct - first, all LEDs will come on for
a moment, then a black spot will walk along the screen from left to right,
going down a line each time it reaches the rightmost edge of the display, until
the bottom right corner is reached. This process is then repeated with a
lighted dot on a black background, and then after a short pause on a blank
screen, the main animation loop will start.
Note: There are five unused I/O lines which could be used to expand the
device to a 9x4, 8x5 or 7x6 pixel display with no extra external logic. The
reason I left it at 4x4 was mainly because it's an easy number to work with,
and makes it possible to store longer animations (since each frame requires
less memory to store). Experiment, expand and comment! With two additional
8-bit latch ICs, you could make an 8x8 display, and with four of these latches
you could build a 16x16 display which will allow you to create some quite
complex animations; it's a
Your prototype could look something like the picture below. Note that I used
square LEDs. It's of no importance to the circuit,
but if you use fairly tall square LEDs, the difficult
task of lining them all up is slightly easier - poke them all through the
board, flip the whole thing upside down onto a flat surface, and solder down
all the legs.
|
|
|
|
Click to view the
horrible backside.
Those surplus green 5x7 LED modules went sale again at the local electronics
store, so I bought a few and decided to build a bigger and better display. The previous
one was too small, dim and had a crappy interface. This new one would
have a much more powerful microcontroller, an AT keyboard interface, a serial
interface for connecting to a PC, a builtin font, and
an EEPROM for storing text entered from the keyboard or PC. All these features
and more are now packed in the new display, and it
looks awesome. 840 LEDs! This is the biggest circuit
board I have ever built. 24 LED modules, 58 MOSFETs,
16 ICs and other components are all soldered onto a big board that is made from
6 smaller boards. Connections are made with wire-wrap wire. The microcontroller
software is written in C, and almost fills the entire 8KB flash of the
microcontroller.
View closeups of the CPU & power supply, the other end, and the long line of MOSFETs.
|


Here is the editor in
action. The arrow indicates "end of line".
Implemented editor control keys are: alt+alt gr, caps lock, shift, F1-F12, insert/overtype, delete,
home, end, backspace. The cursor blinks and changes
shape with the insert key too!
The software in the
microcontroller is written in C with a few tiny asm
snippets. The compiler used is SDCC. The software does the following:
|
The software barely fits in the 8K flash memory. I originally intended to
include more effects, such as vertical scrolling and fade in & fade out
effects. I had to shave 1KB off the font (chars 192-255) to make even this fit
in there! If I had written this in assembler, everything would have fit. SDCC
generates quite fast code, but not small code.
Get the firmware
sources in tar.gz format (TODO) or
browse online with syntax highlighting: (TODO)
Ever wanted cool visualization
while playing music? This is the ultimate in visualization plugins!
Compile and install this plugin to get three
visualization modes: Spectrum analyzer, Oscilloscope and Stereo VU Meter.
Refresh rate is about 47 FPS. It's very smooth.

Get matrixplugin-1.0.tar.gz.
(TODO: package it) Coooooool!!! Linux
only.

Spectrum
analyzer.

Oscilloscope. The long exposure time messed the
picture up a bit.