Go Down

Topic: problems with 595 shift registers (Read 1 time) previous topic - next topic

Dimitree

hello everybody
I'm trying to use 2 74HC595 to power 16 leds. I never had any problem with those shift registers, but now using this code:

Code: [Select]

while(1) {   
   for(int i=0; i<8; i++) {
        digitalWrite(ledL, LOW);
        shiftOut(ledD, ledC, LSBFIRST, B00000001<<i);
        shiftOut(ledD, ledC, LSBFIRST, B00000001<<i);
        digitalWrite(ledL, HIGH);
        delay(1000);
  }
}


it works ok for some time (it cycles through the leds, example: led 1 and led 9 on, the other off, then led 2 and led 10 on, and so on..)
but then suddenly, leds light up at random for some time.
I've used 0,1 cap on power pins of each 595 chip..
what could be the problem?
it should not be a code problem..since it works ok for some cycles..

fungus

I don't think the problem is the software.

Bad wires? Bad breadboard connection? Need more capacitors?


Advanced Arduino

Dimitree

fixed it, the problem was that arduino was using USB supply while 595 a different 5V supply

CrossRoads

Did you have the grounds between the 2 supplies connected?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Dimitree

no, thery were totally separated, arduino powered from USB, the registers from a power supply..the only connections were the 3 digital lines (clock, data and latch)

CrossRoads

That would do it then - connecting the Gnds from the various supplies is needed.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up