____________________________________________________________________________________________________
Introduction An LED dot matrix display multiplexing consists of a matrix of LED’s arranged in a rectangular fashion. The desired character or graphics can be displayed by switching ON /OFF a desired fashion of LED’s. Common display fashion available are 7×5, 8×8, 7×15, etc. LED dot matrix can be used in simple display applications where the resolution is not a big concern. The figure below shows the arrangement of LEDs in a typical 8×8 dot matrix display.
WORKING OF A SINGLE LED We all know that led only glow when it is in forward bias. In the above fig we provide different voltage combination on the terminals of led, notice that led glow only when a=1 and b=0, because in this case led is in forward bias. We use this concept in case of multiplexing of led. Here you can find out how to drive an led dot matrix with 64 LEDs (8 rows by 8 columns – 8×8 display) or less e.g. 35 LEDs (7 rows by 5 columns – 5×7 dot matrix). However, the principle remains the same for larger displays, you may need more processing power and driver circuitry though. Multiplexing Displaying single character “R” Figure shows the working of led matrix. During multiplexing of led we only glow one row at a time but time delay is in micro-second. Our eyes doesn’t able to distinguish images until the time delay between images is greater than about 50 millisecond or one-twentieth of a second. This is known as persistence of vision. Due to persistence of vision we can see the combined image. For the Display any character we have to assign rows & columns to the microcontroller pins. As you see in above first figure we assign eight rows (i.e. R1 to R8) and eight column (i.e. C1 to C8). Step by step programming of led matrix If we put the entire 7 step in a proper order with very small delay in a while loop, then we can see the R on LED Matrix. Here is the logic of code…………. 1. Program of Multiplexing of LED with ARM7 ( LPC2148 )
while(1)
{
C=0X0F;
R=0X80;
Delay();
C=0X77;
R=0X40;
Delay();
C=0X77;
R=0X20;
Delay();
C=0X0F;
R=0X10;
Delay();
C=0X1F;
R=0X08;
Delay();
C=0X6F;
R=0X04;
Delay();
C=0X77;
R=0X02;
Delay();
};
/******************************************************
www.firmcodes.com
DEVELOPED BY:- FIRMWARE DEVELOPER
WHAT PROGRAM DO:- This program display FIRMCODES on LED matrix
******************************************************/
#include<lpc21xx.h> // arm header file
/* codes to display on lcd */
int ar[10][8]={
{0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80},
{0x81,0x81,0x9d,0x87,0x87,0x9f,0x9f,0x9f}, //F
{0X81,0X81,0XE7,0XE7,0XE7,0XE7,0X81,0X81}, //I
{0X83,0X81,0X99,0X81,0X83,0X87,0X93,0X99}, //R
{0X18,0X00,0X00,0X24,0X3C,0X3C,0X3C,0X3C}, //M
{0X81,0X81,0X99,0X9F,0X9F,0X99,0X81,0X81}, //C
{0XC3,0X81,0X99,0X99,0X99,0X99,0X81,0XC3}, //0
{0X07,0X03,0X31,0X39,0X39,0X31,0X03,0X07}, //D
{0X81,0X81,0X9F,0X87,0X87,0X9F,0X81,0X81}, //E
{0X81,0X81,0X9D,0X87,0XE1,0XD9,0X81,0X81} //S
};
void delay(unsigned int x,int y)
{
unsigned int i,j;
for(i=0;i<x;i++)
for(j=0;j<y;j++);
}
void main()
{
unsigned int select_word,display,repeat;
PINSEL0 =0X00000000; // select the GPIO mode of PORT0
IO0DIR=0XFFFFFFFF; //direction of PORT0 is selected as output
while(1)
{
delay(1000,100); // halt some time
for(select_word=1;select_word<10;select_word++) // select the word to display
{
for(repeat=0;repeat<150;repeat++) // repeat display upto 150 times so that the display is visible to us
{
for(display=0;display<8;display++) //display the codes of each letter
{
IO0SET |=(ar[0][display]<<0);
IO0SET |=(ar[select_word][display]<<8);
delay(10,10);
IO0CLR |=(ar[0][display]<<0);
IO0CLR |=(ar[select_word][display]<<8);
}
}
}
}
}
Suggested Reading
- Scrolling text Message Display Led Matrix using ARM(LPC2148)
- Interfacing of Graphical LCD with ARM7 ( LPC2148 )
- Custom character generation on LCD With ARM(LPC2148)