How to transform a signal into a square wave ?

MrChips

Joined Oct 2, 2009
34,855
You are already learning a few things here by trial and error, careful observation and application of prior knowledge.

1. When you used the scope probe at 1x attenuation you observed triangular waveforms.
That is because you do not achieve the full 100MHz bandwidth of the oscilloscope.
The scope is designed to be used in coordination with a proper 10x attenuation probe as a system together to achieve the full bandwidth.

2. Yes, there are two complimentary ways of analysing signals - in the time domain and in the frequency domain.
This is where your knowledge of fourier series and fourier transformation becomes useful.

3. A capacitor in parallel with a signal becomes an integrator. What do you get when you integrate a constant voltage, like the flat portion of a square wave? Hence a square wave becomes a triangular wave, given the suitable R-C time constant.

Similarly, a capacitor in series with the signal gives you differentiation.
Feed a triangular wave into a C-R circuit and you get the derivative, i.e. a square wave.
 

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
You are already learning a few things here by trial and error, careful observation and application of prior knowledge.

1. When you used the scope probe at 1x attenuation you observed triangular waveforms.
That is because you do not achieve the full 100MHz bandwidth of the oscilloscope.
The scope is designed to be used in coordination with a proper 10x attenuation probe as a system together to achieve the full bandwidth.

2. Yes, there are two complimentary ways of analysing signals - in the time domain and in the frequency domain.
This is where your knowledge of fourier series and fourier transformation becomes useful.

3. A capacitor in parallel with a signal becomes an integrator. What do you get when you integrate a constant voltage, like the flat portion of a square wave? Hence a square wave becomes a triangular wave, given the suitable R-C time constant.

Similarly, a capacitor in series with the signal gives you differentiation.
Feed a triangular wave into a C-R circuit and you get the derivative, i.e. a square wave.


I tried using a different crystal, the ones you need to connect capacitors and gates for it to work, however for those I only get noise output on my scope. I've tried multiple configurations but all I get is noise. Why would this be ?
 

MrChips

Joined Oct 2, 2009
34,855
The crystal by itself does not oscillate. It has to be configured into some form of oscillator circuit which will provide an excitation voltage.
 

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
You are already learning a few things here by trial and error, careful observation and application of prior knowledge.

1. When you used the scope probe at 1x attenuation you observed triangular waveforms.
That is because you do not achieve the full 100MHz bandwidth of the oscilloscope.
The scope is designed to be used in coordination with a proper 10x attenuation probe as a system together to achieve the full bandwidth.

2. Yes, there are two complimentary ways of analysing signals - in the time domain and in the frequency domain.
This is where your knowledge of fourier series and fourier transformation becomes useful.

3. A capacitor in parallel with a signal becomes an integrator. What do you get when you integrate a constant voltage, like the flat portion of a square wave? Hence a square wave becomes a triangular wave, given the suitable R-C time constant.

Similarly, a capacitor in series with the signal gives you differentiation.
Feed a triangular wave into a C-R circuit and you get the derivative, i.e. a square wave.


And also, a strange thing happens. In this new circuit with a new crystal + components, there is a resistor from the input to the output of a NOT gate. and another from the output onto a crystal. When I touch each of these, the waveform on the scope changes and remains so even even if I stop touching. Then I tough the second resistor and it changes back on and remains so.

It seems some metastability thing is happening, but I dont know exactly why ? I tried recording a video but the upload it's not working, Here;s a photo:

If I touch and hold each resistor, the waveform changes and stabilizes as something different... If I hold the resistor at the top of the photo, the waveform becomes noise and stays so. Then I hold the bottom one, and it becomes a nice square wave and remains so!

 
Last edited:

RichardO

Joined May 4, 2013
2,270
Here are some quick pictures of how I would wire the circuit.Warning they are large since I did not have time to edit them.

The waveform is of a 20 MHz crystal oscillator on a scope/probe system that has a bandwidth of about 200 MHz.

SBB_20MHz_osc_wave.JPG SBB_20MHz_osc_top.JPG SBB_20MHz_osc_side.JPG SBB_20MHz_osc_probes.JPG
 

MrChips

Joined Oct 2, 2009
34,855
All crystals are not created equal.
All crystal oscillator circuits are not created equal. Some will oscillate, some wouldn't.
Crystals are designed for series resonant circuits and parallel resonant circuits.
Crystals have different impedances and require different loading capacitances.
Crystals are cut and designed to run in specific modes or at higher harmonic frequencies.
For example, a 30MHz crystal could actually be a 10MHz crystal designed to work at the 3rd harmonic, 30MHz.
Depending on the oscillator circuit and the loading capacitance you may get it to oscillate at either two or more frequencies,
or it may not oscillate at all.
 

bertus

Joined Apr 5, 2008
22,932
Hello,

The TS is using the canned crystal oscilators.
There is a crystal with an oscilator inside the can.
There should be a stable, well decoupled powersupply be used.

Bertus
 

MrChips

Joined Oct 2, 2009
34,855
74HC74. I thought 7474 was just a short way of saying it...
74HC74 is vastly different from 7474. In fact they are incompatible and normally not interchangeable in the same circuit.

Make sure you specify exactly which family of logic IC you are using.

7400
74S00
74LS00
74ALS00
74C00
74HC00
74HCT00

are all different. Do not mix willy-nilly unless you read the data sheets and know what you are doing.
 

EM Fields

Joined Jun 8, 2016
583
I realized I was completely ignorant about compensation. I forgot I had to adjust both the x10 and the compensation on the probe...


The wave has cleaned considerably however there is still a little ringing on it even though I adjusted it.

Shame I dont have a proper square wave oscillator to adjust it
You probably do, since somewhere on the front panel of the scope there should be a terminal you can use to calibrate your probe.
It's usually labeled "CAL" or somesuch, and what you do is to hook the hot end of your probe onto that terminal and then adjust your probe for the best square wave you can get.
 

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266

RichardO

Joined May 4, 2013
2,270
Why is your wave not a square wave even though you wired it correctly?
It is not "wired correctly". There are many limitations to using a solderless breadboard (SBB). Here are some:
No ground plane.
No power plane.
Highly inductive contacts.
High capacitance between contacts.
Long connecting wires.
Small gauge wires.
Long leads on components.
Long connection lengths.
Poor high frequency power supply bypass caused by all of the above.

There are also limitations in the way I measured the waveforms:
Long ground lead on scope probe.
Used long tip on scope probe.
Lack of a quality ground for the measurement. (No ground plane).

Some of what is in the waveform is real:
The overshoot and undershoot are caused by fast signals and some will always be there. The amount is acerbated by the SBB wiring.

The overshoot and ringing can be indications of poorly matched circuit impedances causing reflections. A signal travels at about 1 ns per foot. If you look at the the top of the waveform you will see about 2.5 cycles of ringing. That would be about 5 cycles of ringing if stretched over the entire square wave. 20 MHz has a period of 50 ns. So, each of those cycles of ringing is about 10 ns. This says that the ringing is _not_ caused by reflections in the wiring caused by poor impedance mismatch. The ringing is caused by distributed inductance and capacitance in the wiring and SBB -- as well as the scope probe ground and tip.

The scope has 200 MHz bandwidth (200 MHz is a 5 ns period). This is faster than a lot of the logic can "see" so it may be showing problems with a signal that do not create problems in real life. Modern logic is specifically designed to damp overshoot and undershoot. The logic also is designed to ignore overshoot and undershoot.


For more on how to get the best out of your SBB see the PDF I have attached. Use the PDF as a checklist. Any of the points made in the PDF that you miss will degrade the operation of your circuit.
 

Attachments

Plamen

Joined Mar 29, 2015
111
I tested many crystals. All my 5MHz ones give weird signals. My 20MHz ones give a triangle wave. I expected to get square waves out of these oscillators. What is happening please ?
Petkan:
Your scope may be too slow for this waveform or your scope probe may have too much input capacity.
Use the probe grounding wire directly at the GND pin of the oscillator and the tip directly at the output. Switch your probe to 10:1 (if you can)
 

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
It is not "wired correctly". There are many limitations to using a solderless breadboard (SBB). Here are some:
No ground plane.
No power plane.
Highly inductive contacts.
High capacitance between contacts.
Long connecting wires.
Small gauge wires.
Long leads on components.
Long connection lengths.
Poor high frequency power supply bypass caused by all of the above.

There are also limitations in the way I measured the waveforms:
Long ground lead on scope probe.
Used long tip on scope probe.
Lack of a quality ground for the measurement. (No ground plane).

Some of what is in the waveform is real:
The overshoot and undershoot are caused by fast signals and some will always be there. The amount is acerbated by the SBB wiring.

The overshoot and ringing can be indications of poorly matched circuit impedances causing reflections. A signal travels at about 1 ns per foot. If you look at the the top of the waveform you will see about 2.5 cycles of ringing. That would be about 5 cycles of ringing if stretched over the entire square wave. 20 MHz has a period of 50 ns. So, each of those cycles of ringing is about 10 ns. This says that the ringing is _not_ caused by reflections in the wiring caused by poor impedance mismatch. The ringing is caused by distributed inductance and capacitance in the wiring and SBB -- as well as the scope probe ground and tip.

The scope has 200 MHz bandwidth (200 MHz is a 5 ns period). This is faster than a lot of the logic can "see" so it may be showing problems with a signal that do not create problems in real life. Modern logic is specifically designed to damp overshoot and undershoot. The logic also is designed to ignore overshoot and undershoot.


For more on how to get the best out of your SBB see the PDF I have attached. Use the PDF as a checklist. Any of the points made in the PDF that you miss will degrade the operation of your circuit.
Thank you for your time and through response.

Can I please ask why does the fact that the period is 50ns, and the signal travels at 1ns per foot implies that the ringing is not caused by impedance mismatch? I can't see the connection and I'd like to see it!
 
Top