• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help me about led matrix

Status
Not open for further replies.

hoangson

New Member
hi ! I make a project about dot matrix .. but there are some problem ...please show me how to fix it thanks.......
My dot matrix ‘s size 16x 64 including 2 colors (red, green) . common anot this is block circuit and the font

describle my program that I use Keilc I use mcu at89c52//
#include<reg52.h>


sbit sda = p1^0 ; // pin p1.0 supply data for ic 74hc595
sbit sck = p1^1 ; // pin p1. clock pulse to shift the bits into 74hc595
sbit lat = p1^2; // pin p1.2 anable data go out the pins of ic 74hc595

the data for display "
unisigned char code display [] = { 0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff// the empty character
0,68,56,0,56,66,198,198,254,254,198,198,198,0,0,0 // Ă character
..............................................}

//serial data converting to paralle data
void seri2par (unsigned char data_out)
{ int temph;
temph = data_out ; // save data_out to variable temph
for(int i =0 ;i<=7 ;i++) // the loop to put byte of data into 74hc595
{
temph = temph&0x80 ; take the first bit of a byte of data.
if(temph =0x80)

sda =1 ; // put the bit 1 into 74hc595
else
sda =0 ; // put the bit 0 into the 74hc595

sck =0;
sck =1 ; // make a pulse to help the bit 1 or 0 go into 74hc595

data_out * = 2; // to shift the next bit of a byte of data_out
}

void main () // {
int j,m


while (1)
{ for (m=0;m <=15;m++) // sweep 16 rows
{

for (int k =0 ;k <=15++) // the loop to load data for 16 led matrixs
{ seri2par(display[n+8]); //

latch =1 ; // anable the data out from the 74hc595
ontransistor(m) // on transistor to supply power to the led matrix.
delay(300); // delay to watch the character show..
}
}
}

and I wrote delay(), ontransistor() funtion but they are not showned here….
But there is a problem….with this code….the character move on the dot matrix too quickly,, and not nomal that’s mean I shift 1 byte to make the effect on dot matrix…. The recorrecting has to be done to shift each bit of byte.. so I am not sure about It…
Can you show me how to repair my code to fix this program…

Thanks so much ! I hope you soon help me.. thanks again….
 

Attachments

Last edited:
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top