I'm attempting to transfer over an Arduino Uno project to an ATTiny85. I have the blink example working, but when I try my project it doesn't quite work correctly. (I'm using Arduino as an ISP).
The circuit is the ATTiny driving 3 74HC595 registers chained together to control 20 LED's. The power source is a CR2032 cell, but I've also tried it from the Arduino's 3V supply. What happens is that the shift registers light up the LED's in completely the wrong order, sometimes flickering. There doesn't seem to be any logic behind how it's driving the registers it's driving.
Am I missing something obvious? I thought the internal clock speed (I've tried 1Mhz and 8Mhz), same result.
nkunicki:
The circuit is the ATTiny driving 3 74HC595 registers chained together to control 20 LED's. The power source is a CR2032 cell, but I've also tried it from the Arduino's 3V supply. What happens is that the shift registers light up the LED's in completely the wrong order, sometimes flickering. There doesn't seem to be any logic behind how it's driving the registers it's driving.
a) There's no way a CR2032 is going to power all that (not enough amps).
b) You probably need some decoupling capacitors. Add some 0.1uF ceramic capacitors close to the chips between Vcc and GND.
fungus:
a) There's no way a CR2032 is going to power all that (not enough amps).
b) You probably need some decoupling capacitors. Add some 0.1uF ceramic capacitors close to the chips between Vcc and GND.
Thanks for that! I'll try the decoupling capacitor idea and report back. About the power, I had thought about that, but only one LED will ever be lit at a time (There's a button which when pressed will light the next one down each time, turning off the last), so I think it should have enough to drive the shift registers and one LED?
nkunicki:
Thanks for that! I'll try the decoupling capacitor idea and report back. About the power, I had thought about that, but only one LED will ever be lit at a time (There's a button which when pressed will light the next one down each time, turning off the last), so I think it should have enough to drive the shift registers and one LED?
nkunicki:
What happens is that the shift registers light up the LED's in completely the wrong order, sometimes flickering. There doesn't seem to be any logic behind how it's driving the registers it's driving.
Am I missing something obvious?
Have you tried this with anything other than an ATtiny and had it work out right?
Maybe it's your sketch or maybe it's how you have things wired. Possible?