Hi all, I was trying to display alphabets A to Z using p18f4520,ULN2003 and 5x7 led matrix.
I use mplab c compiler,20MHz, and the program was compiled successfully but I doesn't work on protues simulation.
Here's z code, would u tell me why it doesn't display the letters?
unsigned short count, column, num, repeat;
unsigned char fill_1[130]={ 0x7e, 0x09, 0x09, 0x09, 0x7E, // A
0x7f, 0x49, 0x49, 0x49, 0x36, // B
0x3e, 0x41, 0x41, 0x41, 0x22,
0x7f, 0x41, 0x41,0x22, 0x1c,
0x7f, 0x49, 0x49, 0x49, 0x63,
0x7f, 0x09, 0x09, 0x09, 0x01,
0x3e, 0x41, 0x41, 0x49, 0x7a,
0x7f, 0x08, 0x08, 0x08, 0x7f,
0x00, 0x41, 0x7f, 0x41, 0x00, // I
0x20, 0x40, 0x41, 0x3f, 0x01,
0x7f, 0x08, 0x14, 0x22, 0x41,
0x7f, 0x40, 0x40, 0x40, 0x60,
0x7f, 0x02, 0x04, 0x02, 0x7f,
0x7f, 0x04, 0x08, 0x10, 0x7f,
0x3e, 0x41, 0x41, 0x41, 0x3e,
0x7f, 0x09, 0x09, 0x09, 0x06,
0x3e, 0x41, 0x51, 0x21, 0x5e,
0x7f, 0x09, 0x19, 0x29, 0x46,
0x46, 0x49, 0x49, 0x49, 0x31, // S
0x01, 0x01, 0x7f, 0x01, 0x01,
0x3f, 0x40, 0x40, 0x40, 0x3f,
0x1f, 0x20, 0x40, 0x20, 0x1f,
0x3f, 0x40, 0x30, 0x40, 0x3f,
0x63, 0x14, 0x08, 0x14, 0x63,
0x07, 0x08, 0x70, 0x08, 0x07,
0x61, 0x51, 0x49, 0x45, 0x43 // Z
};
//====================MAIN================================
void main(void)
{
ADCON1 = 0b00111101; // configure RA2 and RA5 as digital I/O
ADCON2 = 0b10110100; //// Set result right justified, manual acquisition time, Fosc/4
TRISD=0b00000000; //configure PORTD as output
TRISC=0b00000000; // RC7(RX) as input , RC6(TX) as output
PORTC=0; //intial value of PORTC is zero
PORTD=0; //intial value of PORTD is zero
do{
// Display 26 alphabets
for (num=0; num<26; num++) {
for (repeat=0; repeat<100; repeat++){
column = 1;
for(count = num*5;count < (num*5+6);count++){
PORTC = fill_1[count];
PORTD = column;
Delay10TCYx(200);
column = column<<1;
}
}
}
}
while(1);
}