sloppy sine to square wave

Discussion in 'The Projects Forum' started by magnet18, Mar 16, 2014.

  1. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    so I have a sine wave generator, made to be used in the RF range, 100kHz to a few Mhz, pics of the waveform attached

    I want to build a circuit that can-
    turn this into a square wave
    have tuning function on the duty cycle(either to tune right in at 50, or full pwm fn, not sure yet)
    frequency division function so I can get down to lower frequencies
    a DC offset feature

    I'm looking for quality a bit better than a 555 timer here

    anyone have ideas to help me get started?
    I know how to use a schmitt trigger and a binary counter for a divider, I'm a bit unpracticed with op-amps though
     
  2. #12

    Expert

    Nov 30, 2010
    16,318
    6,818
    Slow down magnet. All those ideas at once are scary. Let's do this one block at a time.

    20 mv isn't going to work with a Schmidt trigger. Not enough voltage to work with the hysteresis. We need to define a gain bandwidth product and slew rate for an op-amp to jack that 20 mv up to something that will work with probably at least a 5 volt supply on a Schmidt trigger. Or do you have plenty more amplitude in that signal generator?
     
  3. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    Nope, 1v is as high as it goes
    So if I want this to work up to 10 Mhz, amplified to 5Vpp, I need a gbwp of 50Mhz
    Slew rate 5v/.05uS minimum if I'm thinking that through right
    This is sounding like a significant design problem
    Do you think adding a transistor preamp stage might help?
    Or can this be handled with a few opamps?
    I've learned a lot about opamps in school, never had a vhance to design something around one though
     
    Last edited: Mar 16, 2014
  4. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,823
    I think an NPN to amplify your signal a bit and use discrete logic chips might be the right path forward for a square wave at the frequencies you want.

    Look up relaxation oscillator in the ebook section of this site to do the
    PwM (adding two diodes and a potentiometer). You could add a switch to turn off the PWM section and insure the 50% duty cycle instead of diddling with the POT.
     
  5. #12

    Expert

    Nov 30, 2010
    16,318
    6,818
  6. #12

    Expert

    Nov 30, 2010
    16,318
    6,818
    Still, the discrete method has merit.
    Choose your poison.
     
  7. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,542
    1,251
    The first scope shot showed an input scale of 20 mV/div, but the displayed input is between 90and 100 mV. An LM318 should be able to get "a few MHz" up to 1 V p-p, more than enough to clip with another 318. Or even better, an ECL gate. Best FM limiter I ever saw. Once you've got a clean edge representing the input freq, you can turn it into just about anything.

    ak
     
  8. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    Do you think is this going to work?
    Input signal → FET amplifier amplifying to 3~5V → 74HC123 monostable multivibrator
     
  9. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    took some more scope readings today, at 10Mhz I get .9vpp, and I ordered a couple of the AD8099's, which should be more than adequate(I like to de-rate my projects anyway :))


    does the attached schematic appear to be on the right track? (ignore part #s, didn't care to find right ones yet)

    if so I need to manage DC offset, frequency division, output/input protection, and possibly a sync output for scope
     
  10. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    If the square wave will using in the logic circuit then you will need a voltage clamp circuit.
     
  11. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    Hello,

    The input opamp can not see below 0 Volts.
    That can create problems.
    I have inserted a "following" DC offset circuit.
    This will only work if the input signal is riding on a DC voltage.

    [​IMG]

    The speed if this RC filter will determine its reaction speed.
    I also exchanged the + and - inputs of the input amplifier, to have an inverting amplifier.

    Bertus
     
    Last edited: Mar 18, 2014
  12. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,542
    1,251
    Not quite. The first opamp is configured as a comparator with hysteresis, not an amplifier. If it is a fast part, it's output will be a square wave, so the duty cycle adjust will not have any effect.

    Also, If all parts really are running on the same Vcc and GND, then what is the purpose of the resistor and diode at the 7404 input?

    ak
     
  13. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    gah, this is why i don't schematic late at night

    updated schematic, with the correct power pins, and a zener for logic level voltage clamping (5.1 to -.4)

    again, ignore parts numbers for the time being
     
  14. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    and this is why I should read all replies before going and changing things, thanks for noticing the switched pins, I corrected it so they're both inverting
     
  15. #12

    Expert

    Nov 30, 2010
    16,318
    6,818
    That looks good to me.
    (I just love seeing an op-amp being provided with plenty of power supply voltage.)
     
  16. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    Hello,

    That looks fine, as long as your signal is close to the zero line.
    An DC offset will be amplified too.

    Bertus
     
  17. #12

    Expert

    Nov 30, 2010
    16,318
    6,818
    You could add a capacitor before the input to eliminate any DC offset from the signal generator. But then, you're smart enough to know that by yourself.
     
  18. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    yea, probably a good idea, 100nF should do

    does this chip look like a good one to use for the binary divison?
    built in schmidt on the input so it would replace the shcmidt on the current schematic, plus it's programmable which gives me the option to play with the binary input

    74hc7292

    Normally I would use a CD 4040, but at 5V 10MHz is pushing the max frequency, and I'd rather not have the thing locking up all the time

    the 74hc7292 is a bit pricey and a lot overkill, so if you know a better option I'd appreciate it

    http://www.mouser.com/ProductDetail...GAEpiMZZMtdY2G%2bSI3N4UNp8dauZvXKjUMRILUFkN0=

    Thanks!
     
  19. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,292
    1,255
    What am I missing? When I look at an LM293 I see a comparator.
     
  20. #12

    Expert

    Nov 30, 2010
    16,318
    6,818
    Magnet has declared a moratorium on part numbers.
     
Loading...