Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

HELP WITH LED MESSAGE BOARD (8X64) using ATmega16L micro-controller

Status
Not open for further replies.

codename25

Member level 3
Joined
Jan 15, 2015
Messages
65
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
555
HI all,
I'm planning to build an LED message board with 8X64 led. I'm planning it to do with ATmega16 (Since i have one with me). I'm a beginner in both micro-controller and C program. So, I need all of your generous and valuable help, also this might be helpful for others who are in same situation.

I'll explain my current situation. I want to do the whole 8X64 led project by one Atmega16. Since, It has only 4 ports with 8 pins each. It's impossible to connect all these 64 column pins with the micro-controller ( From four i need one whole port for row execution). So, i decided to use decade counters(CD 4017), each CD 4017 gives me 8 pins of output (to columns) by only giving an input clock from the micro-controller. If you see the circuit & program you can easily understand what i mean. Now my problem is:

1) I don't know whether the program is correct or not (or even don't know whether it works well as expected).

2) I don't know whether the circuit is correct or not.

3) What all should i include or modify my program to make the message in the display scroll.

I haven't started the hardware section of the project till now. since, it needs lot of LEDs and effort, I just thought of starting it only if the circuit and the program works theoretically well.

Now, I need the help from you people to solve this issue and help me to complete and succeed in this project.

Thank You.

Code and circuit diagram are displayed below:


Code:
 #define <avr/io.h>
 #include<util/delay.h>


unsigned char seq[]={
0b01111111,
0b00001001,
0b00001001,
0b00001001,
0b00000110,  
};
                    
int main()
{   
   DDRC=0xFF;
   DDRD=0xFF;
   PORTC=0;
   PORTD=0; 
   int i=0;
    while(1)
       {   
          for(i=0;i<8;i++)
           {  
           PORTC=(1<<PC0); // or PORTC=0X01
           _delay_ms(1);   // clock of 1ms delay pulse to CD 4017
 
           PORTD=~seq[i];  // row execution according to the char seq [] given above
           _delay_ms(2);   // CD 4017 O/P pins delay is double the input pulse (according to its datasheet)     
        }

          for(i=0;i<8;i++)
           {  
           PORTC=(1<<PC1); // or PORTC=0X03
           _delay_ms(1);  // clock of 1ms delay pulse to CD 4017
 
           PORTD=~seq[i]; // row execution according to the char seq [] given above
           _delay_ms(2);  // CD 4017 O/P pins delay is double the input pulse (according to its datasheet)       
        }

          for(i=0;i<8;i++)
           {  
           PORTC=(1<<PC2); // or PORTC=0X07
           _delay_ms(1);  // clock of 1ms delay pulse to CD 4017
 
           PORTD=~seq[i];  // row execution according to the char seq [] given above
           _delay_ms(2);   // CD 4017 O/P pins delay is double the input pulse (according to its datasheet)      
        }

          for(i=0;i<8;i++)
           {  
           PORTC=(1<<PC2); // or PORTC=0X0F
           _delay_ms(1);  // clock of 1ms delay pulse to CD 4017
 
           PORTD=~seq[i]; // row execution according to the char seq [] given above
           _delay_ms(2);   // CD 4017 O/P pins delay is double the input pulse (according to its timing diagram)      
        }



  }
 return 0;
}

 

Before designing circuit details, it may be interesting to make a rough estimation of required row and column currents for suitable display.

You could e.g. plan 1 mA average LED current for moderate display brightness. With 1-outof-64 column scan scheme, peak LED current (= row current) would be 64 mA, column current up to 512 mA. You'll hardly drive this amount of current from ATmega or CD4017 without driver transistors.
 

Hi,
You are right. But i plan to place resisitors of 470E on rows and 10 for columns(as mentioned in circuit dig). Is that sufficient for my 8X64 sign board. I plan to give 12V Dc power supply. Thanks.
 

Hi,
I'll show what i mean with the program to do as an animated image below.

e.gif
 

Yes, column drivers are most urgently needed. People usually prefer PNP transistors in this case because they achieve lower voltage drop.

The 470 ohm resistors give e.g. 5 mA row current (assumng 2.5V LED voltage and 5V supply). Average current with 1:5 multiplex would be 1 mA, which is O.K. But wit 1:64 multiplex, it's only 80 µA. Tis means resistor row drive is acceptable for a small matrix only.

You also mentioned higher supply voltage like 12 V. But it's only possible with 12V capable drivers, not with rows directly driven by the processor.
 

@FvM,

Ok. Then i'll place 5V instead 12V for the whole 8 X 64 matrix. If so, the below circuit (i've edited and shown only one of matrix) is appropriate or it should be changed?

I am attaching the circuit dig of the led matrix, so you'll get an idea about my plan. Here, the rows are connected to the MCU (grounded 0V) and in multiplexing only one led will switched on from each row (may be none, Depending up on the letter displayed on the board) in each 2 ms period. Since, only one led is ON for 2ms period, 470E is adequate to lit the led at 15mA current? If not, what should be the value?

Also, whether CD 4017 will act as an amplifier like NPN transistors do? If so, can we avoid those transistors?

Thank you.
led.JPGLED2.JPG
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top