dattlara76
Junior Member level 2
HI ALL,
I am trying to convert the code written for avr into XC8 16F877A(https://circuitdigest.com/microcontroller-projects/8x8-led-matrix-with-avr-atmega8)
and the modified code.
The ckt diagram and dot matrix with internal pin configuration(from datasheet) what I am using is also been attached.
>>>>But why not getting EXPECTED O/P in the display? Only getting invert character.
I have tested LEFT-UPPER-MOST-CORNER LED to check the position for placement of the module and the same LED is glow when pin (9) -> is given GND and pin (13) -> is provided VCC.
The module has been placed as per image shown here.
>>>>And another issue that, along with inverse character some LEDs glowing brightly and some dimmed?
What i am doing wrong for both cases.
Thnk in advance..
I am trying to convert the code written for avr into XC8 16F877A(https://circuitdigest.com/microcontroller-projects/8x8-led-matrix-with-avr-atmega8)
and the modified code.
The ckt diagram and dot matrix with internal pin configuration(from datasheet) what I am using is also been attached.
>>>>But why not getting EXPECTED O/P in the display? Only getting invert character.
I have tested LEFT-UPPER-MOST-CORNER LED to check the position for placement of the module and the same LED is glow when pin (9) -> is given GND and pin (13) -> is provided VCC.
The module has been placed as per image shown here.
>>>>And another issue that, along with inverse character some LEDs glowing brightly and some dimmed?
What i am doing wrong for both cases.
Thnk in advance..
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 // CONFIG #pragma config FOSC = HS // Oscillator Selection bits (HS oscillator) #pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled) #pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT enabled) #pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled) #pragma config LVP = OFF // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3 is digital I/O, HV on MCLR must be used for programming) #pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off) #pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control) #pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off) // #pragma config statements should precede project file includes. // Use project enums instead of #define for ON and OFF. #include <xc.h> #include <stdint.h> // include stdint header /* To display a still letter 'F' in the display */ #define _XTAL_FREQ 20000000 //static int ALPHA[26][8]= { const char ALPHA [26][8] = { {0,0b01111111,0b11111111,0b11001100,0b11001100,0b11001100,0b11111111,0b01111111}, //A//1 {0,0b00111100,0b01111110,0b11011011,0b11011011,0b11011011,0b11111111,0b11111111}, //B//2 {0,0b11000011,0b11000011,0b11000011,0b11000011,0b11100111,0b01111110,0b00111100}, //C//3 {0,0b01111110,0b10111101,0b11000011,0b11000011,0b11000011,0b11111111,0b11111111}, //D//4 {0,0b11011011,0b11011011,0b11011011,0b11011011,0b11011011,0b11111111,0b11111111}, //E//5 {0,0b11011000,0b11011000,0b11011000,0b11011000,0b11011000,0b11111111,0b11111111}, //F//6 {0b00011111,0b11011111,0b11011000,0b11011011,0b11011011,0b11011011,0b11111111,0b11111111}, //G//7 {0,0b11111111,0b11111111,0b00011000,0b00011000,0b00011000,0b11111111,0b11111111}, //H//8 {0b11000011,0b11000011,0b11000011,0b11111111,0b11111111,0b11000011,0b11000011,0b11000011}, //I//9 {0b11000000,0b11000000,0b11000000,0b11111111,0b11111111,0b11000011,0b11001111,0b11001111}, //J//10 {0,0b11000011,0b11100111,0b01111110,0b00111100,0b00011000,0b11111111,0b11111111}, //K//11 {0b00000011,0b00000011,0b00000011,0b00000011,0b00000011,0b00000011,0b11111111,0b11111111}, //L//12 {0b11111111,0b11111111,0b01100000,0b01110000,0b01110000,0b01100000,0b11111111,0b11111111}, //M//13 {0b11111111,0b11111111,0b00011100,0b00111000,0b01110000,0b11100000,0b11111111,0b11111111}, //N//14 {0b01111110,0b11111111,0b11000011,0b11000011,0b11000011,0b11000011,0b11111111,0b01111110}, //O//15 {0,0b01110000,0b11111000,0b11001100,0b11001100,0b11001100,0b11111111,0b11111111}, //P//16 {0b01111110,0b11111111,0b11001111,0b11011111,0b11011011,0b11000011,0b11111111,0b01111110}, //Q//17 {0b01111001,0b11111011,0b11011111,0b11011110,0b11011100,0b11011000,0b11111111,0b11111111}, //R//18 {0b11001110,0b11011111,0b11011011,0b11011011,0b11011011,0b11011011,0b11111011,0b01110011}, //S//19 {0b11000000,0b11000000,0b11000000,0b11111111,0b11111111,0b11000000,0b11000000,0b11000000}, //T//20 {0b11111110,0b11111111,0b00000011,0b00000011,0b00000011,0b00000011,0b11111111,0b11111110}, //U//21 {0b11100000,0b11111100,0b00011110,0b00000011,0b00000011,0b00011110,0b11111100,0b11100000}, //V//22 {0b11111110,0b11111111,0b00000011,0b11111111,0b11111111,0b00000011,0b11111111,0b11111110}, //W//23 {0b01000010,0b11100111,0b01111110,0b00111100,0b00111100,0b01111110,0b11100111,0b01000010}, //X//24 {0b01000000,0b11100000,0b01110000,0b00111111,0b00111111,0b01110000,0b11100000,0b01000000}, //Y//25 {0b11000011,0b11100011,0b11110011,0b11111011,0b11011111,0b11001111,0b11000111,0b11000011} //Z//26 };//characters a,b,c,d,e,f,g,...z binary codecs int main(void) { TRISB = 0x00;//PORTB,C,D are set as output TRISC = 0x00; TRISD = 0x00; //PORT[8] = {1,2,4,8,16,32,64,128};//pin values of PORTD int VAL[8] = {1,2,4,8,16,32,64,128};//pin values of PORTD char NAME[]={2,8,17,2,20,8,19,3,8,6,4,18,19};///circuitdigest character values uint8_t l =0; while(1) { for (int m=0;m<sizeof NAME;m++) { l = NAME[m]; for (int n=0;n<200;n++)//execute 200 times for the eye to catch { for (int j=0;j<4;j++) { PORTB = ~VAL[j];// ROW PORTD = ALPHA[l][j];//show half of character (COLUMN) __delay_us(500); } PORTB=0xFF;//clear screen after show for (int k=0;k<4;k++) { PORTC = ~VAL[k];// ROW PORTD = ALPHA[l][k+4];//show other half of character(COLUMN) __delay_us(500); } PORTC=0xFF;//clear screen after show. } } __delay_ms(220); __delay_ms(220); __delay_ms(220); __delay_ms(220); __delay_ms(220); } }