0
\$\begingroup\$

I am trying to control a 74HC595N Shift Register for the first time. If I manually remove move jumpers from high to low etc to cycle the clock, then it appears that I clocked it multiple times.

I figured that this was probably due to bounce, so I made a RC circuit to slowly change the voltage on the clock pin. The time constant of the RC circuit was 7 seconds (10 uf * 680 kOhm). This worked. I was able to send a bit in 14 seconds: 7 to bring it low, 7 to bring it high. But that is way too slow.

I tried lowering the time constant as far as 2 ms. But any lower and it would begin to double clock. I would cycle the clock once, but the register would have clocked twice.

The data sheet says that the 74hc595 should be able to handle like 60 MHz.

I have 10 uf bypass capacitor on the supply to ground to help filter noise on the supply pin.

I have seen this post but I don't think we have the same issue since we are a few orders of magnitude apart in terms of frequency.

Does anyone have advice on how to increase my baud rate?

Edit: Schematic Schematic of control wiring for the 74HC595N shift register

Edit: Solved-The issue was with the power supply. Even with a 10uF cap on the supply lines, it still double clocked. Switching from a Pi pico to a ESP32S3 dev board solved the issue.

\$\endgroup\$
15
  • 6
    \$\begingroup\$ The chip will also require that a clock signal has a fast sharp transition edge or it will work erratically. Are you feeding the slow transitioning RC filtered signal into the clock pin? Can you draw a diagram of your circuit? \$\endgroup\$
    – Justme
    Commented Jul 2, 2023 at 21:33
  • 3
    \$\begingroup\$ To add to @JustMe's comment. A slow clock is counterproductive because it is more likely to result in multiple clocking. Any little noise spike on top of the slow clock signal during the long transition can trigger a shift. Conversely, a fast, sharp clock signal leaves too little time for noise spikes to do any harm. \$\endgroup\$ Commented Jul 2, 2023 at 22:06
  • 1
    \$\begingroup\$ You might need bypass capacitors on the supply near the chip. And maybe use a one-shot or a Schmitt trigger buffer for hysteresis. \$\endgroup\$
    – PStechPaul
    Commented Jul 2, 2023 at 23:24
  • 5
    \$\begingroup\$ 10uF is not going to be an effective supply bypass cap (unless it's ceramic or tantalum). \$\endgroup\$
    – brhans
    Commented Jul 3, 2023 at 2:11
  • 2
    \$\begingroup\$ Yes, the HC595 does nor have Schmitt trigger inputs. And it should not double trigger with MCU, unless your setup is a ratsnest of long airwires between two boards so there are signal reflections or ground bounce, or the MCU actually sends two pulses by accident, or the bypass cap is of unsuitable type. But we don't know these details, you should provide enough details to make any guesses why it works poorly. Almost any RC filter on clock pin will make the signal slew rate out of required specs, at 5V it has to happen in 400 to 500 ns. \$\endgroup\$
    – Justme
    Commented Jul 3, 2023 at 6:06

1 Answer 1

3
\$\begingroup\$

Sounds like you're doing this on a breadboard. The artifacts/multiple clocking, as you mentioned, should be due to contact bounce. The physical contacts on a breadboard has two metal spring-like plates. If you contact one side, then wiggle it just enough to break the connection and hit the other side, you just got yourself two pulses. If the wire is a bit dirty, the problem becomes worse. Likely, you have not only 2 pulse glitches, but many, many more.

If you're insistent on using a hand-triggered clocking method, your best bet is to use a pushbutton. Most buttons are designed so it's got a fast/sharp make-break action. You may still need the RC, but the time constant can be much faster than what's required for the jumper method.

If you've got other parts or some sort of an MCU, You can make a slow oscillator of some sort. Depends on what you're got around.

\$\endgroup\$
6
  • \$\begingroup\$ I forgot to mention in my post that after I got the ultra slow clock to work that I switched over to a microcontroller. I was no longer pulling and inserting legs of jumpers to set the clock. Could there be some other source of the multi clocks? \$\endgroup\$
    – Zeno
    Commented Jul 3, 2023 at 0:20
  • 2
    \$\begingroup\$ MCU pulses should be fairly clean. Check that enough current is available for the MCU + IC combo? Unfortunately, this is probably the point where you pull out a (reasonably high bandwidth) digital oscilloscope and take a look. \$\endgroup\$
    – Avid Coder
    Commented Jul 3, 2023 at 0:49
  • 1
    \$\begingroup\$ @Zeno if even an MCU output edge is causing multiple clock events, then the most likely culprit is poor power supply decoupling. Place a 100nF ceramic capacitor across the power supply pins of each and every IC you have in the circuit, as physically close to those pins as possible. This will ensure that the IC's power supply is able to keep up with spiking current demand at each output transition, and also to prevent its own supply demand fluctuations from messing up the supply for other ICs that share it. \$\endgroup\$ Commented Jul 3, 2023 at 4:10
  • \$\begingroup\$ @SimonFitch, I had tried a 10uF ceramic cap, but it still did not work. However, I switched to a different microcontroller and that seemed to solve it. I was using the Pi Pico. Apparently it has a rather poor power supply. I am now using a ESP32s3 and I can get all the way to 500kHz which is fast enough for my use case. Thanks for the pointing me in that direction \$\endgroup\$
    – Zeno
    Commented Jul 3, 2023 at 18:55
  • \$\begingroup\$ @AvidCoder, It seems that the dev board that I was using has a bad power supply. I was using the Pi pico and it seems that it is common for it to be quite noisy. Even with a 10uF cap on the supply lines, it was still double clocking. I switched to the ESP32S3 and that seemed to solve it. I can now get 500KHz which is all I need \$\endgroup\$
    – Zeno
    Commented Jul 3, 2023 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.