hello all..
i need your help. i want to build program even one word to display on dot matrix (7x5) with pic16f877a. i use c language. but when i compile it don't have any error. but it can't work on dot matrix after i load that program. anyone can help me.. i'm on stuck. hope you all can help me. here my program. i want use port a n port b.
#include <16f877a.h>
#use delay(clock=20000000)
#fuses hs,nowdt,nocpd,nolvp,noprotect
#byte porta=0x06
#byte portb=0x08
#bit clock=portd.6
#bit data=portd.7
unsigned int8 i,j,index1,n,
addr[11]={0xEA,0xEA,0x2A,0x2A,0x2A,0x2A,0xAA,0x82,0xFF,0xF F,0xFF},
cont[11];
void main()
{
set_tris_a(0x00);
set_tris_b(0x00);
while(1)
{
for(n=0;n<=99;n++)
{
data=1;
for(i=0;i<=5;i++)
{
clock=1;
portb=addr[i];
delay_ms(1);
clock=0;
data=0;
}
}
for(j=0;j<=7;j++)
{
cont[j]=addr[j];
}
for(j=0;j<=7;j++)
{
addr[j]=cont[j+1];
}
addr[10]=cont[0];
}
}
besides that i'm a new in programming. hope n hope anyone can help me.. thank you.
Bookmarks