Hey, trying to get a shift register working with my Pro Micro so I can eventually daisy chain three.
I followed this tutorial like so many others have, and it does not act as I would expect.
I mainly wonder if my using the Micro rather than an Arduino brand board is causing the problems. That's probably not it, so I'm also wondering if the pins I use for clock, data and latch need to have specific capabilities, eg. PWM, SCK etc. Does the tutorial use pins 8, 11 and 12 for any reason? Here is the graphical datasheet for the Pro Micro, and here's the datasheet for the 74HC595.
My circuit is as follows:
74HC595 Pro Micro
SER 10
RCLK 16
SRCLK 14
OE GND
SRCLR VCC
VCC VCC
GND GND
I also have pin 15 on an led to signal transmission states. Here is my code:
#define LATCH_PIN 16
#define CLOCK_PIN 14
#define DATA_PIN 10
#define LED_PIN 15
void setup() {
pinMode(LATCH_PIN, OUTPUT);
pinMode(LED_PIN, OUTPUT);
}
void loop() {
transmitByte(B00010000);
digitalWrite(LED_PIN, LOW);
delay(1000);
transmitByte(B01010000);
digitalWrite(LED_PIN, HIGH);
delay(1000);
}
void transmitByte (byte msgIn) {
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, msgIn);
digitalWrite(LATCH_PIN, HIGH);
}
As you can see, I'm trying to get the numbers 1 and 5 on the second half byte, QE-H. Currently with this sketch running QB, QD, QE and QH are HIGH. I really don't know what's wrong.
Also, as recommended in other posts I took the 0.1uf cap off the latch pin and added it between VCC and GND as a decoupling capacitor.
Any help would be greatly appreciated, thanks!