In my project, this section is faulty.

I'm doing a bit-banging operation with shift registers and I'm trying to make shift register data reset after 15 bits are shifted out from the micro controller. I connected the CLR lines of both 74HC164's in my project to pin 4 of the 74HC02 shown here. I know I could have used inverters but nor gates were what I had.

As I test, I notice at least a few times the reset operation on the 4024 not working. I verified this by temporarily connecting an LED from each output (one at a time) to ground through a 180 ohm resistor. Power supply is 5VDC.

I did try adding 1K pull-up resistors to the clock, reset and pin 5 of the nor gate and that did not help.

The purpose of this particular circuit is to reset the counter and shift registers (shift registers not shown) every 16 clock pulses made to the 4024.

Why is my 4024 behaving so strangely and how can I fix this?


  • 3
    \$\begingroup\$ INMHO this is a typical race condition. Reset pulse duration will depend on propagation thru IC3B, IC3C and 4024 internal circuitry from RES to Qn. This pulsewidth may be too short to reliably reset all the 4024 flip-flops and/or external shifters. This should definitevily turned into a syncronous machine. Otherwise you should try to lengthen reset pulsewidth. Sometimes a ballparking solution could be adding a small (10s pF range)capacitor across reset network. Not a very reliable nor repeatable way though. \$\endgroup\$ – carloc Nov 27 '16 at 11:24
  • \$\begingroup\$ Agree with @carloc. This is a poor asynchronous design with unpredictable reset pulse width. A reliable enough hack might be to put a series R on pin 10 of 74HC02 and add a small cap to RES input of 4024 to generate a longer reset pulse. The best fix would be as he said to turn it into a synchronous state machine design. \$\endgroup\$ – Vince Patron Dec 28 '16 at 8:17
  • \$\begingroup\$ @VincePatron, did you mean 'synchronous machine' as carloc suggested or actually a synchronous state machine? This would just be a synchronous design for a logic sequencer, wouldn't it, not an FSM. \$\endgroup\$ – TonyM Mar 3 '17 at 23:37
  • 74HC4024 clocks use negative edge and positive Reset (not shown on your schematic)
  • 74HC164 clocks use positive edge with negative Reset

  • This should count 1/2 after the shift register is clocked and reset after the - 16th bit when you only have 15 bits. Is that what where you went wrong??

    • How many clock pulses did you send?
  • Also 74HC4024 counters should be labeled Q0 to Q6 ( 7 bit counter ) although you have the Q1 as the correct pin for Q0, the first binary output.

  • \$\begingroup\$ mine is a CMOS 4024 (not HC series) for the counter. I intentionally have 15 bits as code for an 8K ram (13 bits for address, 1 bit for read/write control, and 1 to enable ram) \$\endgroup\$ – user116345 Sep 28 '16 at 2:11
  • \$\begingroup\$ I want to add that the pulses are coming from the AT89C4051 microcontroller with an 11.0592Mhz crystal connected to it. This gives me a maximum pin pulse speed of about 1Mhz (921,583 times per second). Looking at the data sheet indicates to me that the maximum operating frequency of the cmos 4024 is 3.5Mhz. Also, my PCB is fine and everything is physically connected according to schematic, so I can't see it being a hardware issue unless I need different value pull-up or even pull-down resistors. \$\endgroup\$ – user116345 Sep 28 '16 at 2:25
  • \$\begingroup\$ If the signal is more than 6" or so I hope you are using twisted pair or low impedance pair. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Sep 28 '16 at 2:51
  • \$\begingroup\$ The length of each track on the PCB is less than 1 inch long and the width of each track is 0.28mm. I also use a ground plane. \$\endgroup\$ – user116345 Sep 28 '16 at 3:07
  • 3
    \$\begingroup\$ then slow down the rate and test it \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Sep 28 '16 at 12:07

As was mentioned by Carloc in the comments, the behavior that you are seeing is most likely caused by a race condition. The flip-flop that drives output Q5 is resetting faster than the other flip-flops.

The easiest way to fix this problem is to increase the width of the reset pulse. The NOR gates that you use to create the reset pulse can easily be configured to be a monostable timer which will deliver a fixed-width pulse when triggered.

Adjust the values of R1 & C1 for your desired reset pulse width.


simulate this circuit – Schematic created using CircuitLab


I don't know if this helps, or is too simple. But it looks like the transition time of the 74HC02 is 20 to 40nsec (if I'm reading the specs correctly), but the minimum reset pulse width of the 4024 at 5V is 200nsec

  • \$\begingroup\$ After a quick 2nd thought I am not reading the 74HC02 specs (operation) correctly. Its pin 10 goes high and stays there until the 4024 output changes state and that wont be until the RESET changes it. My 1st answer at best took up otherwise valuable space. Sorry. \$\endgroup\$ – RodB Feb 22 '19 at 20:06
  • \$\begingroup\$ please edit your answer, rather than commenting. \$\endgroup\$ – Daniel Feb 22 '19 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy