LED DOT Matrix with 16f876a

Status
Not open for further replies.

john120

Banned
Joined
Aug 13, 2011
Messages
257
Helped
11
Reputation
22
Reaction score
10
Trophy points
1,298
Visit site
Activity points
0
Hello there I want to display the letters ABC with the three seven segment see the circuits here ,can you help me with the codes in ccs c .

Waiting for your help
 

Attachments

  • dot matrix.zip
    11.3 KB · Views: 176



To control LED Dot matrix, you can follow steps:
1. Choose LED matrix, in your schematic, I don't see the chip can select LED matrix.
2. Select COL or ROW will controll, with your schematic: Set RB port (RB0 - RB7), each pin of Port provided power for a COL or ROW.
3. Choose LED Dot on LED matrix by RC port (RC0 - RC7). Each pin controls a LED on ROW or COL.
4. LOOP step 2 to step 3 for 8 COL or ROW.

View attachment 95135

See the image above.Consider if there is any other modification,please help.!!
 


Hello ,I am just running from the following codes:
PHP:
unsigned short Alphabets[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
                               };

const unsigned short characters[30]={
 0x24, 0x2A, 0x7f, 0x2A, 0x12, // $
 0x08, 0x14, 0x22, 0x41, 0x00, // <
 0x41, 0x22, 0x14, 0x08, 0x00, // >
 0x14, 0x14, 0x14, 0x14, 0x14, // =
 0x36, 0x49, 0x55, 0x22, 0x50, // &
 0x44, 0x3c, 0x04, 0x7c, 0x44, // PI

};

unsigned short count, column, num, repeat;
void main() {
TRISB = 0b00000000; // Set PORTB direction to be output
TRISA = 0x00; // Set PORTA direction to be output
PORTB = 0x00; // Turn OFF LEDs on PORTB
CMCON = 7 ; // Disable comparators
ADCON1 = 0x0F;  // Disable Analog functions
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++){
        PORTB = Alphabets[count];
        PORTA = column;
        Delay_ms(1);
        column = column<<1;
        }
     }
    }

    // Display special characters
    for (num=0; num<6; num++) {

     for (repeat=0; repeat<100; repeat++){
      column = 1;
      for(count = num*5;count < (num*5+6);count++)
{
        PORTB = characters[count];
        PORTA = column;
        Delay_ms(1);
        column = column<<1;
        }
     }
    }
    
   } while(1);

}
but I do not understand how to proceed for writing for example this line: for(count = num*5;count < (num*5+6);count++)

can you help me to understand how to proceed?and help me to multiply and consider 3 dot matrix which display differents letters "ABC".


Thanks.

- - - Updated - - -

Can you please help me to collect the schematic I posted on #9 if it is wrong and then help me with the codes in ccs c compiler.
Thanks.
 

This code run for 1 LED with 8x6 LED DOT and display 1 characters at a time.

for(count = num*5;count < (num*5+6);count++) to get value of each COL of LED MATRIX (6 COL of a character).
 

How does this work?


Code C - [expand]
1
for(count = num*5;count < (num*5+6);count++)


I know that it is used to get the characters for each alphabet or character for 6 coloumns of a character but in the above code of john10 there is only 5 columns for a character in the array.

For second character count will be from 5 to 10 (< 11) but john10's array elements are 5 to 9 and not 10.

I think it should be


Code C - [expand]
1
for(count = num*5;count < (num*5+5);count++)



first loop

num = 0
count = 0 to 4 (< 5)

second loop
num = 1
count = 5 to 9 (< 10)

...
 
Last edited:

hello jayanth.devarayanadurga,how can we change this for displaying on 8*8?will we use the following statement?
for(count = num*5;count < (num*5+8);count++)??
can you tell me how make a cascade of more than one led dot matrix?for displaying more than one letter.

Thanks for help.

- - - Updated - - -

can you expalin in few words what about those array used on http://arduino.cc/en/Tutorial/RowColumnScanning,

Thanks.
 

If your character uses 8 columns then it will not be good to see because see for example if you print 'H' and 'H' on side by side using 2 displays then it will appear as 'HH' there will be no gap between the characters. So, better use 6 columns for a character. I haven't done matrix display projects so I can't say much. You can scan either row or col and you can have anodes or cathodes for row or cols.

If row scanning is used then each line of more than 1 matrix is connected to the same line of uC with proper driver. You will be scanning one row of all the matrices at a time and which ever matrices cols are fed with character data those matrices will be displaying data. If you shift the data at o/p of cascaded 74HC595 connected to cols then data on matrix scrolls.


https://embedded-lab.com/blog/?p=2661
https://embedded-lab.com/?p=2478
https://embedded-lab.com/blog/?p=4717

This represents character 'A' using 5 coloumns

Code C - [expand]
1
0x7e, 0x09, 0x09, 0x09, 0x7E



This represents character 'A' using 6 coloumns

Code C - [expand]
1
0x7e, 0x09, 0x09, 0x09, 0x09, 0x7E



This represents character 'A' using 7 coloumns

Code C - [expand]
1
0x7e, 0x09, 0x09, 0x09, 0x09, 0x09, 0x7E



This represents character 'A' using 8 coloumns

Code C - [expand]
1
0x7e, 0x7e, 0x09, 0x09, 0x09, 0x09, 0x7E, 0x7e

 
Last edited:

before scrolling I want only to display fixed characters.

I got those links last time I tried to read but don't understand.
Thanks.
 

what is the link which can help me to understand how to make the conversion?
I am using 8*8 and I want to display three letters GSP,how can I convert them.

Thanks
 


Code C - [expand]
1
for(count = num*8;count < (num*8+8);count++)??



I think above will help you.

First loop num is 0

loops from 0 to 7 (< 8)

Second loop num is 1
loops from 8 to 17 (< 16)

8th loop num is 7

loops from 56 to 63 (<64)


If you need to use multiple matrices then you have to use 74HC595.

You have to send array elements 0, 8, 16. Elements (0 to 7 is 'C') (8 to 15 is 'B') (16 to 23 is 'A') to 74HC595 with proper SH_CP and ST_CP. This will place col1 od 'A', 'B', 'C' on the coloumns and then you scan the row.

I might be wrong. Ask Zuisti. He has done many Matrix display projects.
 
Last edited:

Last edited:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…