1
\$\begingroup\$

I am going to make a square wave which has two different kinds of pulse width.At first,i think i can use the digital logic gate to finish it,however,after taking lots of time for trying,i still can't make it,so i come here to ask for help or suggestion.

The square wave i needed is as below enter image description here

x and y means i don't care about its length,x can be bigger or smaller than y

\$\endgroup\$
  • \$\begingroup\$ By what logic will those pulses come out? Random? Deterministic? What purpose? \$\endgroup\$ – a concerned citizen Apr 19 '18 at 12:19
  • 1
    \$\begingroup\$ "x and y means i don't care about its length" Does this mean x and y can be "anything" (literally) or they need to be variable and if so what's the range? Do you intend to build with logic gates only or do you have uC? \$\endgroup\$ – mike65535 Apr 19 '18 at 12:22
  • \$\begingroup\$ x and y are the range.i mean,i don't care x or y is 10us or 15us.if there is a component ,in the virtuoso cadence, can solve my problem,i will use that component.However,if there is no that component ,i think only digital logic may help me to solve this problem \$\endgroup\$ – XM551 Apr 19 '18 at 12:43
  • \$\begingroup\$ Do you need to do this with 'hardware' or can you use a microcontroller? \$\endgroup\$ – Colin Apr 19 '18 at 12:48
  • \$\begingroup\$ You could probably achieve this with a 555 timer and a decade counter or two. \$\endgroup\$ – Colin Apr 19 '18 at 12:50
5
\$\begingroup\$

Use two different timers and sum them together with a summing op amp:

schematic

simulate this circuit – Schematic created using CircuitLab

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

You have multiple options:

  • Using a timer, set a timer to the next time and change the GPIO value.
  • Using PWM, and set a timer to change it at the next flank/up.
  • Using a timer, and finding a 'common' multiplier, e.g. 1 us and check within the timer (interrupt) to change the GPIO or not. You can optionally use DMA.
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Is there a component in the virtuoso cadence? \$\endgroup\$ – XM551 Apr 19 '18 at 12:43
  • \$\begingroup\$ I never heard of virtuoso cadence, sorry. \$\endgroup\$ – Michel Keijzers Apr 19 '18 at 12:44
1
\$\begingroup\$

Use a 16 MHz clock signal and feed it into a 4 bit binary counter. Then decode the outputs to give you a match to the output signal you want: -

enter image description here

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ i surf the internet for the 4 bit binary counter for a little bit.but it seems that 4 bit binary counter produce a square wave for a single kind of pulse width \$\endgroup\$ – XM551 Apr 19 '18 at 13:45
  • \$\begingroup\$ It produces a binary count of 16 of which you can decode a value using extra logic. \$\endgroup\$ – Andy aka Apr 19 '18 at 16:05
1
\$\begingroup\$

This will do what you want.

schematic

simulate this circuit – Schematic created using CircuitLab

While a 74161 is shown, 74LS/74HC/74HCT will all work.

If you step through the 16 possible output states of a 4-bit binary counter, you can verify the output logic.

For a 1 MHz clock, X will be 7 usec, and Y will be 4 usec.

And, just for extra credit, you can do all the output logic using a single 74/74LS/74HC/74HCT00 quad 2-input NAND gate.

And if you're actually going to use this in a logic circuit, you should feed the output through a D flip-flop triggered by the input clock to avoid skew glitches.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

This is just my simple schematic,using two switch and two different kind of pulse width for each.

enter image description here

Schematic

enter image description here

Last wave is the output,the first and the second are the control voltage for each switch

| improve this answer | |
\$\endgroup\$

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.