Guys i m making a Scrolling text using 5x7 display with 8051 but i m having a problem that i m unable to figure out that how to scroll a text i wrote this test code but it keeps displaying 'A' .. plz can sumbody tell me what is the prob with this code...... i ll very thankful.....
#include<reg51.h>
int count[5]={0x08,0x10,0x20,0x40,0x80};
int A[5]= {0x7F,0x98,0x98,0x7F,0x00};
int Blank[5]= {0x0F,0x00,0x00,0x00,0x00};
int c;
int i,j ;
int z;
void delay(unsigned int msec) // Function to provide time delay in msec.
{
for(i=0;i<msec;i++)
for(j=0;j<1275;j++);
}
void scroll() interrupt 1
{
TL0=0x36; //Reloading Timer0
TH0=0xA6;
for(z=0;z<5;z++){
P2=~A[z];
P3=count[z];
delay(1);
P2=0xFF;
}
}
void main ()
{
TMOD=0x11; //Intialize Timer 0
TL0=0x36; //Reloading Timer0
TH0=0xA6;
IE=0x82; // Enable Timer 0 interrupt
TR0=1; //Start Timer 0
while(1){
for (c=0;c<5;c++){
delay(100);
for (z=0;z<4;z++){
A[z]=A[z+1];
}
A[4]=Blank[c];
}
}
}
View attachment 4.zip
View attachment ISIS Professional - C__Documents and Settings_Administrator_Desktop_counter_matrix_4.DSN.pdf
i also Attached Schematic's proteus file ...... and its pdf
#include<reg51.h>
int count[5]={0x08,0x10,0x20,0x40,0x80};
int A[5]= {0x7F,0x98,0x98,0x7F,0x00};
int Blank[5]= {0x0F,0x00,0x00,0x00,0x00};
int c;
int i,j ;
int z;
void delay(unsigned int msec) // Function to provide time delay in msec.
{
for(i=0;i<msec;i++)
for(j=0;j<1275;j++);
}
void scroll() interrupt 1
{
TL0=0x36; //Reloading Timer0
TH0=0xA6;
for(z=0;z<5;z++){
P2=~A[z];
P3=count[z];
delay(1);
P2=0xFF;
}
}
void main ()
{
TMOD=0x11; //Intialize Timer 0
TL0=0x36; //Reloading Timer0
TH0=0xA6;
IE=0x82; // Enable Timer 0 interrupt
TR0=1; //Start Timer 0
while(1){
for (c=0;c<5;c++){
delay(100);
for (z=0;z<4;z++){
A[z]=A[z+1];
}
A[4]=Blank[c];
}
}
}
View attachment 4.zip
View attachment ISIS Professional - C__Documents and Settings_Administrator_Desktop_counter_matrix_4.DSN.pdf
i also Attached Schematic's proteus file ...... and its pdf