Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

8x8 LED Matrix using 8051

Status
Not open for further replies.

skydemon

Newbie level 2
Joined
Mar 7, 2008
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,295
8x8 led matrix

Hi guys.. i'm planning on displaying words through two 8x8 LED Matrix using 8051 microcontroller and C programming. i would like to make the words to move as well.
My problem is for the coding part, what type of statement that i should use in writing the code? or do anyone has the related sample C language code that can share with me?
Thanks..
 

8051 led matrix

are using kiel ?
 

led matrix 8051

you mean keil microvision? i'm using keil microvision 3..
 

led matrix display controlled by 8051

You will need to create font lookup tables for all the characters you wish to display. You then use the ASCII code representing each letter of words you wish to display as a lookup in the font table. The best is to break your code into sections such as getting fonts, sending to display, and the scrolling part which is the easiest ... simply move the index into your string to the next character. This will then look like this.

//this routine will most likely be called from an interrupt
// just a rough guide to get you thinking - will need some extra stuff :)

FontIndex = StartOfFontTable[(STringToDisplay[ScrollingIndex])];
FontStart = FontIndex;
while(FontIndex < FontStart + NumberOfLinesInCharacter)
{
OutPut(FonTable[FontIndex ]);
FontIndex++;

}
 

Re: 8x8 led matrix

// Amir Rasheed
// 0345-5917219
//******************************************************************************

#include <reg51.h>
#include "table.h" //defined lookup table for MMD LED patern
#define set 1
#define reset 0
unsigned char bdata temp; // bit addressable memory location variable
sfr port2 = 0xA0; // port2 is used for row scanning attached with 74LS145
sbit MSB=temp^7; // MSB bit of temp variable to make data serialized
sbit clk = P3^2; // Clock Pin 3/12 ----> MBI5026/8051 P3^2 PIN_12
sbit sdata = P3^3; // port pin for data Serialization P3^3 PIN_13


unsigned char scan[8]={0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7}; //Row selection
unsigned char ser_copy[]={"AMIR"}; // store incomming 5 characters

void main()
{
unsigned char row,col,count,i;

while (1)
{
for (col=0; col<8; col++) // loop for selecting columns
{
for (i=0; i<4; i++) // loop for INSERTING WORDS
{
row = ser_copy;
row = row-0x0D; //staring hex code of lookup table is 0x0d
{
temp = matrix_arr[row][col];
for (count=0; count<8; count++) //SERIALIZATION
{
clk=0; // low to high transition
sdata = MSB; // (serial data to MMd) sdata = P3^1
clk = 1; // (for MMD) clk = P3^2
temp = temp << 1; // bit addressable memory location
}
}
}
port2 = scan[col]; // connected to 4 to 10 decoder/driver
delay_ms(2); // For low or high intensity of LEDs
port2 = 0xff;
}
}
}

---------- Post added at 15:28 ---------- Previous post was at 15:26 ----------

The code i have given to you is not based on INTERRUPTS ... its just to provide you an idea of coding it but for better control and brightness you must use interrupts.

Make a lookup table for your desired font.

Regards

Amir Rashid
Engr. Electronics
NADRA HQs, Islamabad
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top