Maker Pro
Maker Pro

Shift Register weird response

cl10Greg

Mar 20, 2014
25
Joined
Mar 20, 2014
Messages
25
Hello Everyone,

I am working on a project with a Raspberry PI to control some LEDs with a shift register. I breadboarded the design first and it worked perfectly but now I started to solder it to a perf board, it's acting weird. I am using the PI to get 5V and GND along with the 3 SR signals (the CLEAR and OE are just tied to PWR and GND) and a signal to control a transistor. I have a basic setup as attached. So I am controlling the LED brightness with a PMOS that is driven by a PWM signal. I am controller the LEDs by sinking current through the SR so to turn on the LED I need to set the PMOS signal to low and then Shift in a 0 to complete the circuit. On the breadboard it all worked well and was able to do patterns and all kinds of things. As soon as I started to prototype it on a protoboard it is doing a weird thing. If I am just trying to turn on channel 0 (10000000, LSB first) the result is actually channel 0 and channel 1 turn on (11000000). If I try to turn on just channel one, it turns on channels two and three (01000000 -> 00110000). I didn't change any of the code that was from the breadboard to the design yet. The only thing that I added was a power capacitor for the power line to decouple any noise from the LED/transistor switching. I do have the PMOS wired to all the other LEDs that are currently floating but that shouldn't matter. Maybe I need to add a delay between the Data/Clk? It is consistent so I don't believe it's noise anywhere that is causing a random bit. I will scope the line and see what's going on later and double check my pinouts but at least wanted to jog my thought process with some debate of what could be happening.
 

Attachments

  • PiSRControl.png
    PiSRControl.png
    33.3 KB · Views: 133

cl10Greg

Mar 20, 2014
25
Joined
Mar 20, 2014
Messages
25
Well I figured out the problem but don't totally understand the solution from every example I have seen. I tried to probe the signals with my scope and noticed that when I probed the clock that the circuit worked perfectly. So I looked at the clock signal and looked super clean and worked well. So I added a resistor to the clock signal and it worked perfectly. So something must have been going on with either the clock signal and rise and fall time and how it correlated to the data bit and timing. Anyways, it all works.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
It sounds to me like you do not have a common ground for the two circuits. The ground of the Rasp Pi and your shift register circuit must be connected together.

Bob
 
Top