int dataPin = 10; //Define which pins will be used for the Shift Register control int latchPin = 9; int clockPin = 8; int counter = 0; //The counter for storing the byte value void setup() { pinMode(dataPin, OUTPUT); //Configure each IO Pin pinMode(latchPin, OUTPUT); pinMode(clockPin, OUTPUT); } void loop() { for (counter = 0; counter < 15; counter++) { digitalWrite(latchPin, LOW); //Pull latch LOW to start sending data shiftOut(dataPin, clockPin, MSBFIRST, counter); //Send the data digitalWrite(latchPin, HIGH); //Pull latch HIGH to stop sending data delay(500); } }
What'd I do wrong?
Is it the circuit? The code? The "dirt cheap" chips I bought from ebay?
I note that in your diagram that you'd not connected Vcc to your source. This can cause some strange behaviour - although normally in CMOS and not TTL.
ReplyDeleteIn short - if your logic pins go over the Vcc voltage, then artifacts of the manufacturing or design of the chip could start to behave in odd ways and create a short circuit.
This explains it far better than I could - http://www.youtube.com/watch?v=S0TZMivVzVk.