Quantcast
Viewing all articles
Browse latest Browse all 215

Interfacing 8x8 LED dot matrix with ARM Microcontroller

Image may be NSFW.
Clik here to view.
8x8-dot-matrix-led-interface-ARM-lpc2124-microcontroller
Dot matrix interface with LPC2124
LED's have a wide range of lighting applications in our daily life and surprisingly it also can be used as a display when interconnected together. LED dot matrix is nothing but collection of LED's interconnected together which can be lit by accessing through rows and columns. This dot matrix is used in banks, lifts, buses and much more where displaying of information is necessary.

8x8 DOT MATRIX:

Image may be NSFW.
Clik here to view.
common-anode-led-matrix-connection-diagarm
Common anode LED matrix
The above diagram shows the connection configuration of 8x8 LED dot matrix where each row and column consists of 8 LED's totally. The above figure shows the common Anode configuration where the LED's are sourced through the columns from the Microcontroller pins and sinked through the rows to the pins. The Switching of the LED's should be faster to form a pattern in the dot matrix display.

ULN2803:

The sinking current from the LED's can damage the pins of the Microcontroller since the current sinking capability of the controller is very less. So a IC ULN2803 was used here which is capable of sinking high currents from the rows of the dot matrix. Each pins of the ULN2803 can be switched by applying the high logic to the input pins of the ULN2803 from the pins of LPC2124. Read Complete working of ULN2803 for better understanding.

STEPS TO DISPLAY A CHARACTER IN DOT MATRIX:


  • Make the pins of each row high one by one, once high signal is applied to the ULN2803 input it will sink the currents of LED in that row.
  • Activate column pins for your pattern or character for each rows.
  • Use very small delay in the matter of milli seconds between each switching, this will make the dot matrix to display a your desired pattern or character.

TO DISPLAY A HEART SYMBOL IN DOT MATRIX:

Image may be NSFW.
Clik here to view.
Heart-symbol-display-dot-matrix
Heart Symbol display
This tutorial demonstrates displaying a heart symbol in the LED dot matrix. As you can see in the above diagram the dot matrix consists of 8 rows and columns with a heart drawn over it. The 1 represents the LED's which need to switched ON to display the pattern whereas  0 represents the LED in off state. The respective values for each column of each row activation was given, all you need to do is place the values in array and assign it to the pins of the Controller.


CODE:

This code was built using Keil uVision 4.

  1. #include<lpc21xx.h>
  2. unsigned char row_val[8]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
  3. unsigned char col_val[8]={0x00,0x66,0xff,0xff,0x7e,0x3c,0x18,0x00};
  4. void delay(void);
  5. int a;
  6. int main(void)
  7. {
  8.   PINSEL0=0;
  9.   PINSEL1=0;
  10.   IODIR0=0x0000ffff;
  11.   while(1)
  12.   {
  13. for(a=0;a<=7;a++)
  14. {
  15. IOSET0|=(row_val[a]<<0)|(col_val[a]<<8);
  16. delay();
  17. IOCLR0|=(row_val[a]<<0)|(col_val[a]<<8);
  18. }
  19. delay();
  20.   }
  21. }

  22. void delay(void)
  23. {
  24. unsigned int i;
  25. for(i=0;i<=2000;i++);
  26. }

Like this tutorial? Share this with others through social sites and do not forget to subscribe/follow us there for more of these tutorial right in to your timeline/inbox. Do not hesitate to hit the below comment box if you have any queries and opinion about this article.
Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 215

Trending Articles