Question:

How to add a time delay to a square wave?

by  |  earlier

0 LIKES UnLike

hey i was wondering if someone could give me a schematic or guide me in the general direction. the problems is to Design the simplest circuit to delay a square wave by 1/4 of its period.

it should have 1kHz frequency and amplitude from 0 to 5 V.

 Tags:

   Report

4 ANSWERS


  1. OK, here's the absolute easiest way.

    Feed it into an RC filter, followed by a schmitt trigger. Square wave goes through resistor to input of schmitt trigger. Capacitor goes from schmitt trigger input to ground. Output comes from schmitt trigger output.

    I think a 22nF capacitor and a 16K resistor would be just about right, but you could replace the resistor with a 10K and a 10K pot in series so you can adjust it. The schmitt trigger should be HCTTL or CMOS, so that would be 74HC14 or 4093, if memory serves. These are inverters, but you can use one of the other gates to re-invert the signal if you want.

    Edit:

    Even better - use a spare gate to buffer and invert the square wave signal before you feed it into the RC filter. That way you are sure that the input to the filter is 5V, which is important for the wave shape.


  2. This is a TTL signal, so you can use digital techniques.

    Assuming the 1kHz is fixed, then you want a fixed delay of 250us.

    I'd extract the rising edge with a cap and a diode, run that into a 74123 confugured as a 250us one-shot. Use the back edge of the one-shot to fire a 7474 latch, whose D is connected to the square wave. The output of the latch should be the square wave delayed.

    If the frequency can vary, that gets more complicated. You need a PLL to generate a 4 times higher frequency and use that in place of the one-shot

    .

  3. An 8bit micro controller could provide a very simple solution using built in timers to develope squarewaves

    A uC CPU will run at say a 10Mhz clock rate.   Using a prescaler setting for a timer /64 mean 64 CPU clock cycles will be counted as 1.   The prescaler effectively slows the 10Mhz clock

    So 10Mhz  / 64 = 156250 Hz

    An 8 bit counter can count upto 256 befor it generates an overflow

    156250 /256 = 600Hz  

    Timers come with two compare match registers which can be set at any value from 0 to 255  

    To generate 1Khz  using the prescaled value of 156250 would be done by setting a compare match register to 156

    156250 / 156 =   1001.6 Hz a period of approx 1ms

    The timer is configured to use the "A" Compare match register to reset the counter and to toggle the state of an output pin  .    So it takes approx 1ms to count to the comparmatch value at which tme the output pin is changed from high to low or from low to high.    The total duration is 2ms = 1ms hi and 1ms low which gives use a 500Hz square wave.    To speed this back up to 1Khz means we either have to lower the counter value by half (not count so hi) , preload teh counter with a value to start counting not from zero but half way  OR reduce the prescale value by half and have the counter work at a faster speed.

    Since a prescale of 64 was used it is easy to use a smaller prescale value of 32 and teh counter will count twice as fast and generate a 1 Khz square wave.

    That generates One Square wave  using a count of 156 in a Compare match register.  Atmel microcontrollers have two compare match registers so you can set a second "B" compare match register to toggle a different output pin. This B register only toggles the pin it doesn't reset the counter (the A register handles that.    SO    156/4 = 39   if your set the B compare match register to toggle its output 39 counts before or after the A compare match toggle you will generate a second square wave that is 90 degrees out of phase with the other.

    The B compare match register would be set to either

    39   or  117  (156-39-117)

  4. a TTL counter such as a 7490 has 4 outputs, divide by 2, 4, 8, and 16,

Question Stats

Latest activity: earlier.
This question has 4 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.