leds flikkering

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi guys

i want to know something bout the leds. when i programm the leds. like PORTA.1 = 0. only the led1 is on. (bright light). but when i have all the leds on. they start flikkering. do you guys have this too ?

Robbin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It sounds like the power supply you are using to run the circuit is not strong enough.

I am using a 12v/1a supply on my STK500 and everything works fine

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i use 9v, that could be the issue, cause i can burn 6 leds normal, but if i connect another led (totat of 7 leds now) then the flikkering starts again.

could it be the fuse bits maybe ?

Robbin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We need:

Hardware description. (Including, but not limited to, power supply. What AVR? What clock source and frequency? How are the LEDs connected?)

Sample code - smallest possible program that demonstrates the problem.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the code:

  DDRA = 0xFF;   //  We put port B pins in output mode  
  PORTA = 0xFF;   // put all leds in off state    

PORTA.0 = 0;
    PORTA.1 = 0;
    PORTA.2=0;  
    PORTA.3=0; 
    PORTA.4=0; 
    PORTA.5=0;     
    PORTA.6=0; 
    PORTA.7=0; 

when i use this code, the leds are flikkering, when i use 2 leds less they burn normal.

the programm is in a Atmega16l on a STK500.

clock speed = 3.68mhz

leds are connected via a 10-wired cable, PORTA to LEDS.

9v adapter

Last Edited: Wed. Sep 26, 2007 - 12:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Check the output current on your supply .5amps is about the minimum I would suggest. Johan's questions are also things to look at

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can we see the ENTIRE code please? If for example your program had acutally been:

void main(void) {
  DDRA = 0xFF;   //  We put port B pins in output mode  
  PORTA = 0xFF;   // put all leds in off state    

PORTA.0 = 0; 
    PORTA.1 = 0; 
    PORTA.2=0;  
    PORTA.3=0; 
    PORTA.4=0; 
    PORTA.5=0;      
    PORTA.6=0; 
    PORTA.7=0;
}

Then your problem is that after the PORTA.7=0 the program "drops out of the bottom" and it could well be that the AVR resets so DDRA reverts momentarily to input. I could well believe that might cause a "flicker". Hopefully your program ends with a "while(1);" or your compiler provides this automatically in which case this wouldn't be an issue.

Another source of "repeated restes" would be if there WAS a while(1) but the watchdog is enabled.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it was the power supply, my bose gave me 9v, and that was not enough. the problem is fixed with 12v.

to clawson, we checked everything you said, and yes there is move code above and lower.

thanks for the help!!

Robbin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It sounds like not enough current (Amps) rather than not enough voltage. You might want to investigate the difference, if this is your job.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the adapter gave 9v and .5 Amps. i think that it was not enough for all 8 leds. with the increase of voltage, the amps increased aswell. time to play again with the avr ^^

Robbin