Scrolling text in LED dot-matrix display
Introduction:
Multiplexed displays are electronic displays where the entire display is not driven at one time. Instead, sub-units of the display (typically, rows or columns for a dot matrix display or individual characters for a character orientated display, occasionally individual display elements) are multiplexed, that is, driven one at a time, but the electronics and the persistence of vision combine to make the viewer believe the entire display is continuously active.
10x8 LED dot matrix display:
Below figure illustrates the construction of a 10x8 LED dot matrix display.
Multiplexed displays are electronic displays where the entire display is not driven at one time. Instead, sub-units of the display (typically, rows or columns for a dot matrix display or individual characters for a character orientated display, occasionally individual display elements) are multiplexed, that is, driven one at a time, but the electronics and the persistence of vision combine to make the viewer believe the entire display is continuously active.
10x8 LED dot matrix display:
Below figure illustrates the construction of a 10x8 LED dot matrix display.
Working:
In the above figure, the rows are negative and columns are positive. Now, if I connect a single column to positive 3V and a single row to negative (0v), then the LED in place of the intersection of the corresponding row and column will glow. Now , if we select a single column(means a + volt at selected column) , say column 1 and multiple rows (means connect 0V to few selected rows), say row 1,2 & 8, then the selected 1,2 and 8 LEDs in column 1 will glow. Now if i shift the column(means shifting the positive voltage from column 1 to column 2), and if i change the row data ,then the new data will be displayed in column 2.
Now, if i continuously shift the column and provide row data corresponding to each column, then i can display the different row data (8 bit) in different columns...
. So, if one frame(10 column shift) is completed within 1/16 th of a second, then due to the persistence of vision of our eye, we will feel the entire columns are activated at a time, and thus we will see all the ten -8 bit data corresponding to the 10 columns , at a time.........
Now, if a set of 8 bit data (say 5x8 ) represents a letter, say , 'F' then we will see letter 'F' in the display.
In the above circuit, the PIC16F877A provides the 8 bit row data. CD4017 is used to select the column one by one. Now, for shifting the column position, a clock is provided by the PIC to the CD4017. On every clock, the column is shifted .(from right to left in this case).
Note:
Here, I used a PIC16F877A microcontroller and a CD4017 johnson counter. But the 40 pin PIC16F877A is having more number of PORT pins, and thus there is no need of the CD4017 for this small display, and i could use some other port pins of the PIC to work as a johnson counter. But any way, i used a CD4017 just because, in the same circuit board, i could use other free PORT pins for some other purpose like LCD interfacing, USRT, SPI, PWM etc later...
Programming:
I am using Hi-Tech C compiler with MPLAB IDE for compiling the embedded C program and thereby generating the hex file which is to be loaded/burned to the PIC. There are many other C compilers, but i started with Hi-Tech C and I like it. So I am continuing with it....
Before doing a scrolling text,what i did is a still letter display.
Program to display a still letter 'F' in the display (example)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
| /* To display a still letter 'F' in the display */#include<pic.h>#define _XTAL_FREQ 20e6__CONFIG(0x3F3A);unsigned char i;void clock(){ RB6=1; RB6=0;}void reset(){ RB7=1; RB7=0;}void display(unsigned char c){ PORTD=c; /* to display 1/5th of letter */ __delay_ms(1); /* to display the data in a column for 1ms */ PORTD=255; /* to blank the display */ clock(); /* to give a clock to CD4017 for column multiplexing */}void pic_init(){ TRISD=0; TRISB6=0; TRISB7=0;}/* MAIN FUNCTION */void main(){ __delay_ms(100); pic_init(); /* to set out ports */ while(1) { reset(); /* to jump to first column from right */ display(0x7f); /* 1/5 portion of letter F */ display(0x6f); /* 1/5 portion of letter F */ display(0x6f); /* 1/5 portion of letter F */ display(0x6f); /* 1/5 portion of letter F */ display(0x01); /* 1/5 portion of letter F */ reset(); /* to jump to first column from right */ }}/*program end */ |