I've come across a circuit I'm not too familiar with:

enter image description here (Goggle Drive version)

How do I tune R1, R2, R3, and C1 to adjust frequency and duty cycle?

I get the general idea of how it works, but I've asked 4 engineers that I work with already, and the only answer I get is "That's an old school approach, ask the other guy". I'd like a better understanding of how this circuit works - Any help would be appreciated.

  • 1
    \$\begingroup\$ Remember this circuit will only work if your first NAND gate has Schmitt trigger inputs. \$\endgroup\$ – Doodle Jun 15 '17 at 14:42
  • \$\begingroup\$ @Doodle it does not have them but the circuit works. Just not sure how to tune it. \$\endgroup\$ – Jedi Engineer Jun 15 '17 at 15:15
  • \$\begingroup\$ I'm not quite sure how your circuit works without schmitt trigger inputs. Your output should be flickering all over the place using something like a 74HC00. Transistors answer tells you how to tune it exactly. \$\endgroup\$ – Doodle Jun 15 '17 at 15:27
  • \$\begingroup\$ That's two of us. Which is why I posted... \$\endgroup\$ – Jedi Engineer Jun 15 '17 at 17:12

Initial conditions:

  • C1 discharged so NAND pin 4 is high.
  • This feeds back to AND pin 1 and since 2 is permanently high AND pin 4 goes high charging up C via the parallel paths of (R1 and diode) and R3.
  • When C1 voltage is high enough NAND pin 4 goes low.
  • AND pin 1 now goes low and C discharges through R3 only.
  • Repeat.

The diode makes the waveform asymmetric. C charges through R1 and R3 but can only discharge through R3.

How do I tune R1, R2, R3, and C1 to adjust frequency and duty cycle?

  • C1 charge-up time, \$ \tau_1 \$, will be given approximately by the time constant \$(R1 || R3) \times C\$. (where "||" is the parallel resistor value.)
  • The discharge time, \$ \tau_2 \$, by \$R3 \times C\$.
  • The total period of each cycle will be \$ {\tau_1 + \tau_2} \$.
  • The frequency will be \$ \frac {1}{\tau_1 + \tau_2} \$.
  • The duty cycle will be \$ \frac {\tau_1}{\tau_1 + \tau_2} \$.
  • The diode introduces a further slight complication in that there is a voltage drop across it. The effect seems to have been minimised by using a Schottky diode which has a lower voltage drop than a regular silicon diode.

The \$V_{IH} \$ level is 3.5 V, and the \$V_{OL} \$ level is 1.6 V. How does that change the equation?

It doesn't. I assumed the thresholds would be about those proportions.

Going from low to high C will initially be at 1.6 V and the charging voltage close to 5 V. Switching will take place at 3.5 V which is \$ \frac {3.5 - 1.6}{5 - 1.6} = 56\% \$ of the way to fully charged. You can see from Figure 1 that this is quite close to the 63% value of one RC time constant, \$ \tau \$.

Going from high to low C will initially be at 3.5 V and the discharging voltage close to 0 V. Switching will take place at 1.6 V which is \$ \frac {3.5 - 1.6}{3.5} = 55\% \$ of the way to fully discharged. This time you can see from Figure 1 that this is not close to one time constant, \$ \tau \$ but probably good enough.

Don't forgot that you will have variation from chip to chip.

enter image description here

Figure 1. RC charge / discharge curve.

Furthermore, what role does R2 play? I was presuming there was some discharge through it, at one point at least....

On power-off the NAND gate will have no supply. C will discharge through the input protection diodes and will try to power up everything on the PCB that's connected to that power rail. R2 limits that current to a value that the protection diodes can handle. In normal operation it has no effect on the timing because the NAND inputs have such high impedence - typically GΩ.

  • \$\begingroup\$ Thanks for the edits, Andrew. Too much of a hurry, I'm afraid. \$\endgroup\$ – Transistor Jun 15 '17 at 14:23
  • \$\begingroup\$ I recommend you wait a day or so before accepting the answer. You might get a better one. \$\endgroup\$ – Transistor Jun 15 '17 at 16:06
  • \$\begingroup\$ if I only had the time... lol \$\endgroup\$ – Jedi Engineer Jun 15 '17 at 17:04
  • \$\begingroup\$ Besides, it's locked. I can't uncheck it if I wanted to. Let's see what pops up. \$\endgroup\$ – Jedi Engineer Jun 15 '17 at 17:10
  • \$\begingroup\$ let me throw a cog in the works - these are 5V parts, and the VIH level is 3.5V, and the VOL level is 1.6V. How does that change the equation? Or do I need the exponential function for this? \$\endgroup\$ – Jedi Engineer Jun 15 '17 at 17:12

Your Answer

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

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