Author Topic: Waveforms in a 74LS04 ring oscillator.  (Read 37085 times)

0 Members and 5 Guests are viewing this topic.

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2803
  • Country: nz
Waveforms in a 74LS04 ring oscillator.
« on: March 30, 2015, 08:26:28 pm »
I was playing around last night, and decided to see if I could measure the propagation time through a 74LS04's NOT gate.

So on a breadboard I made a five-stage ring oscillator, and had a look at the waveforms. I hooked up a scope, and if I divide the frequency by five I should get the delay. So far so good.

But then I decided to put a probe on both the input and output of a single gate, and see what the X/Y plot looks like. I was expecting to see something like a roughly square box, but got something far more interesting (see image - input on X, output on Y) - this was with a three stage oscillator, a five stage is even more interesting, with more little loops.

So where does the negative voltages come from? It must be some sort of charge pump, but the only capacitance present is strays from the breadboard and links, and I've used the shortest jumpers possible.

Adding/removing decoupling caps make little difference.

Also using the extra gates to buffer the output (so the gate being probed is not part of the ring) still gives the nice swirls and - voltages.

Hummm... has me thinking...
« Last Edit: March 30, 2015, 08:28:47 pm by hamster_nz »
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #1 on: March 30, 2015, 08:38:50 pm »
Ringing due to stray inductance. Probably distributed and amplified by the multiple stages. Would need more data to analyze more thoroughly.
,
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #2 on: March 30, 2015, 08:46:01 pm »
So where does the negative voltages come from?
Show us a schematic and the details of how you are measuring the voltage (e.g probe type, whether HF calibrated, ground lead), and a voltage-vs-time trace.

A "charge pump" wouldn't explain a 7Vpp output.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2803
  • Country: nz
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #3 on: March 30, 2015, 09:08:41 pm »
Show us a schematic and the details of how you are measuring the voltage (e.g probe type, whether HF calibrated, ground lead), and a voltage-vs-time trace.

A "charge pump" wouldn't explain a 7Vpp output.

Schematic : build on a breadboard down one side of a 74LS04N using solid wire links.

Probe type - 100mm flying wires to the on-board scope channels on on a Digilent Electronics Explorer.
I am at work at the moment, but can also hook up a Rigol tonight. Do you have a hypothesis I can test?

A "charge pump" wouldn't explain a 7Vpp output.

Why not? if the real swing is 0.5 to 3V, wouldn't any charge held in stray capacitance get pushed up to 5.5v on a rising edge, and down to -2.0v on a negative edge?
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21609
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #4 on: March 30, 2015, 09:39:37 pm »
What's the time domain waveform look like?
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #5 on: March 30, 2015, 10:09:55 pm »
Show us a schematic and the details of how you are measuring the voltage (e.g probe type, whether HF calibrated, ground lead), and a voltage-vs-time trace.

A "charge pump" wouldn't explain a 7Vpp output.

Schematic : build on a breadboard down one side of a 74LS04N using solid wire links.

I'm impressed that you are getting logic to work without a power supply. (Hint: the power and ground distribution details are important with medium speed logic)

Quote
Probe type - 100mm flying wires to the on-board scope channels on on a Digilent Electronics Explorer.
I am at work at the moment, but can also hook up a Rigol tonight. Do you have a hypothesis I can test?

Yes.

The method you use to probe can significantly affect the trace seen on the scope; see https://entertaininghacks.wordpress.com/library-2/scope-probe-reference-material/

Each input has 24pF and 100nH inductance. See https://entertaininghacks.wordpress.com/2015/03/09/modified-scope-probe-improves-signal-fidelity/ for an indication of the affect that might be having. A plain-vanilla time-domain trace will be revealing.

(I presume you are using 4 wires.)

Quote
A "charge pump" wouldn't explain a 7Vpp output.
Why not? if the real swing is 0.5 to 3V, wouldn't any charge held in stray capacitance get pushed up to 5.5v on a rising edge, and down to -2.0v on a negative edge?
I have no idea what that means.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #6 on: March 30, 2015, 10:21:06 pm »
I suppose he means sort of a parasitic charge pump. But it doesn't work that way, for a charge pump you have a floating capacitor connected over the supply rails, then switch it 'free', then connect it to the upper rail and the output rail. You just don't have that sort of situation anywhere here.
,
 

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2803
  • Country: nz
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #7 on: March 31, 2015, 09:34:18 am »
So I played around some more tonight - image is attached

For my original configuration, when the external oscilloscope probes are placed close to the pins the signal looked a lot more like I expected. I started suspecting something weird was going on with the Electronics Explorer's boards input filters, but then I attached my scope probes to the Analog inputs I got the weirdness on my oscilloscope  too.

So I rebuilt my circuit right beside the on-board oscilloscope inputs, using about 0.5" wires rather than 4" wires, and now things are pretty much in agreement.

The X/Y plot still has some an interest loop, but it is no longer completely loopy :D

And to answer my original question that I asked myself, because the three stage ring oscillator's period is around 42ns, a single gate in the 74LS04N that is about 1/6ths of that - around 7.0ns.




Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #8 on: March 31, 2015, 10:58:23 am »
Add some decoupling capacitors!
What's the scope's bandwidth? (sampling rate is irrelevant)
Reduce the length of the scope probe ground lead: use a spring clip between the LS04 GND pin and the signal pin.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Richard Head

  • Frequent Contributor
  • **
  • Posts: 685
  • Country: 00
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #9 on: March 31, 2015, 11:30:31 am »
And don't use breadboard for a test like this. Rather use a piece of copper clad or protoboard with a solid ground plane. Use short leads everywhere, particularly ground leads.
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #10 on: March 31, 2015, 11:50:58 am »
Yes. My standard technique for high frequency and similar stuff looks like this and gives very good RF characteristics even for DIP packages:

for DIP packages: Cut the pins off about a mm from the molded case. Then solder some SMD (0805 or 1206) 100 nF X7R caps to the supply pin(s). Solder device with caps directly to solid copper clad board.
For SMD packages with pins: bent GND pins down, solder to board, stuff smallest 100 nF caps you have under supply pins.
SMD packages without pins: glue flipped on board, use smallest caps directly by the package

Hot packages with extra exposed pad need extra care. E.g. cooper wire for heat transfer.
,
 

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2803
  • Country: nz
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #11 on: April 01, 2015, 10:29:22 am »
Using Spring clips on the probe  made little difference, and removing/moving/adding more decoupling caps made no visible difference (the original cap is just out of photo). The scope is 100Mz, so the approx 25 MHz signal is close much at the limit.

Just to check, I a found a better source to test on, using equally shoddy technique. The following are from two scope probes just clipped to pin headers that are inserted into an FPGA dev board's PMOD connector. The board is generating  two 25Mhz, with 120 degrees of phase difference.

The waveforms look a bit better, but not much like square waves.

I then discounted all the advice above, and made a couple of simple changes, and got the "fixed" waveforms seen below. Anybody want to hazard a guess at what I did?


Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline nuno

  • Frequent Contributor
  • **
  • Posts: 606
  • Country: pt
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #12 on: April 01, 2015, 10:36:53 am »
Added termination resistors?
 

Offline Richard Head

  • Frequent Contributor
  • **
  • Posts: 685
  • Country: 00
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #13 on: April 01, 2015, 11:04:50 am »
Lowered the supply voltage?
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #14 on: April 01, 2015, 11:55:36 am »
and removing/moving/adding more decoupling caps made no visible difference (the original cap is just out of photo).

In which case it cannot have been a decoupling capacitor. I suggest you do some research on how decoupling capacitors work, in particular placement and capacitor type/value.

I suspect your background is software or VHDL/Verilog or audio frequency; mediulm speed digital has different issues.

Quote
The scope is 100Mz, so the approx 25 MHz signal is close much at the limit.

No. Provided you understand what you can and cannot expect from a 100MHz scope, you can usefully inspect signals that are significantly higher than 25MHz.

Of course analogue scopes are conceptually simpler than digital scopes, and therefore there is less scope (ho ho) for "interesting" surprises. But please don't let this degenerate into a tedious pointless analogue-vs-digital discussion; both have well known advantages and disadvantages.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2803
  • Country: nz
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #15 on: April 01, 2015, 05:49:31 pm »
Added termination resistors?

Bingo - carefully wedged a couple of empirically selected 120 ohm resistors across the header pins.
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2803
  • Country: nz
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #16 on: April 01, 2015, 06:18:35 pm »
Quote
The scope is 100Mz, so the approx 25 MHz signal is close much at the limit.
No. Provided you understand what you can and cannot expect from a 100MHz scope, you can usefully inspect signals that are significantly higher than 25MHz.

Agreed, but it is getting to close to the limits of a 100MHz scope to look at the shape of the edges on a 25MHz square wave. If it was a 50Mhz signal I was looking at I say I would be asking for trouble...

Oh, and as for the decoupling caps, I agree that they are needed, but in this case they made no measurable difference to the performance of circuit.

In my original playing around used 0.1u Tants - either over the chip and/or on the power rows, so I moved them a little out the way. They made zero difference in the visible waveforms, and only the tiniest difference in the frequency of the ring oscillator, speeding up switching by a small percentage  (which was what I was really interested in).

I had the benefit that that only one gate is switching at a time, which is rather non-typical for digital logic, and I'm using a 'S' part...

However, I could have been doing it all wrong. Do you have a 74LS04 kicking round - perhaps recreate it see what effect proper decoupling it has.
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #17 on: April 01, 2015, 08:41:16 pm »
Quote
The scope is 100Mz, so the approx 25 MHz signal is close much at the limit.
No. Provided you understand what you can and cannot expect from a 100MHz scope, you can usefully inspect signals that are significantly higher than 25MHz.
Agreed, but it is getting to close to the limits of a 100MHz scope to look at the shape of the edges on a 25MHz square wave. If it was a 50Mhz signal I was looking at I say I would be asking for trouble...

Agreed, but at least you can spot timing differences to <<10ns.

Quote
Oh, and as for the decoupling caps, I agree that they are needed, but in this case they made no measurable difference to the performance of circuit.

... except that they changed the effective threshold voltage, which manifested itself as a frequency change...

Quote
In my original playing around used 0.1u Tants - either over the chip and/or on the power rows, so I moved them a little out the way. They made zero difference in the visible waveforms, and only the tiniest difference in the frequency of the ring oscillator, speeding up switching by a small percentage  (which was what I was really interested in).

I had the benefit that that only one gate is switching at a time, which is rather non-typical for digital logic, and I'm using a 'S' part...

However, I could have been doing it all wrong. Do you have a 74LS04 kicking round - perhaps recreate it see what effect proper decoupling it has.

Well, I've recently done something similar to teach people about scopes and probing techniques, using 74S04 and didn't see anything like your traces. Well, that's not quite true - the waveforms were horrible (-1V) when using a 6" ground probe ground lead, which was the main point of the exercise.

The significant difference was that I used dead-bug technique on unetched PCB, and had a decoupler from pin 14 to the PCB. There were no pullup/down/termination resistors, because they are theoretically and practically unnecessary with electrically short signal wires.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #18 on: April 01, 2015, 08:57:37 pm »
Added termination resistors?

Bingo - carefully wedged a couple of empirically selected 120 ohm resistors across the header pins.

Basically your experience surprises me to the extent that I know there's something amiss. What do you mean "across the header pins"? If you mean as a series termination resistor, then that would, of course, reduce the peak current transients thus making the decoupling less critical.

I recently built an "edge" generator using multiple 74alvc1g14 gates, which have a much faster risetime than LS series (probably around 1ns) and a much higher symmetrical output drive capability. Each gate had its own 10nF 0603 decoupling capacitor. The circuit was one '14 as a relaxation oscillator, driving one '14 as a buffer, driving 6 '14s in parallel. Half of those simply had their outputs paralled up so that any reasonable capacitance was a non-issue. The other half approximated a 50ohm output by each gate having a 130ohm series resistor, and the other side of the resistors connected in parallel to the "50ohm" output (150/2 => 50, of course).

The overall output was extremely clean when driving either a standard 150MHz high impedance probe, provided the ground lead was short. See the relevant oscillograms with short and long ground leads at https://entertaininghacks.wordpress.com/2015/04/23/scope-probe-accessory-improves-signal-fidelity/ The signal was identical when driving a 1.5GHz 500ohm low impedance Z0 probe, and identical with the 50ohm output.

Hence I can only conclude that the lousy breadboard construction is the root cause of your waveforms.

Soon, I hope, I'm going to get around to building a homebrew 2GS/s 2GHz scope, so then I'll be able to see the edges of the 74alvc1g14 :)
« Last Edit: April 23, 2015, 10:05:47 am by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: us
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #19 on: April 02, 2015, 01:03:51 am »
I'm not sure why you care about the waveforms.  Can't you just use your counter to measure the delay?   Or, be lazy like me and pull the numbers from the data sheets? 
 
What happens when you use all the gates and buffer the signal?   In other words, don't add extra load to the oscillator.  Just buffer, then measure.   Does the frequency change?

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #20 on: April 02, 2015, 08:11:09 am »
I'm not sure why you care about the waveforms.  Can't you just use your counter to measure the delay?   Or, be lazy like me and pull the numbers from the data sheets? 
 
What happens when you use all the gates and buffer the signal?   In other words, don't add extra load to the oscillator.  Just buffer, then measure.   Does the frequency change?

I don't think he does care: he started the OP with "I was playing around last night". And that's just fine by me - it is surprising how much you (me, everybody) learns by doing something out of the ordinary.

After all, the most exciting sound in science isn't "Eureka!" - rather it is "That's ... funny...?!"
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2803
  • Country: nz
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #21 on: April 02, 2015, 09:45:24 am »
Well, I've recently done something similar to teach people about scopes and probing techniques, using 74S04 and didn't see anything like your traces. Well, that's not quite true - the waveforms were horrible (-1V) when using a 6" ground probe ground lead, which was the main point of the exercise.

The significant difference was that I used dead-bug technique on unetched PCB, and had a decoupler from pin 14 to the PCB. There were no pullup/down/termination resistors, because they are theoretically and practically unnecessary with electrically short signal wires.

So tonight I dead-bugged it, probed with a 10x probe and spring clip, then used probe with hook and ground wire, then snipped out the capacitor and used the hook and ground wire again.

Deadbugged it tonight - I didn't have and blank PCB to use as a ground plane so it was hanging in free air. Frequency was 33MHz, up from early/mid 20MHz when on a solderless breadboard - and strangely enough as earlier, snipping out the 0.1u cap made about 1% difference to the frequency.

Not that I'm saying you don't need decoupling, but it makes very little difference in this circuit....

Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #22 on: April 02, 2015, 10:38:26 am »
Well, I've recently done something similar to teach people about scopes and probing techniques, using 74S04 and didn't see anything like your traces. Well, that's not quite true - the waveforms were horrible (-1V) when using a 6" ground probe ground lead, which was the main point of the exercise.

The significant difference was that I used dead-bug technique on unetched PCB, and had a decoupler from pin 14 to the PCB. There were no pullup/down/termination resistors, because they are theoretically and practically unnecessary with electrically short signal wires.

So tonight I dead-bugged it, probed with a 10x probe and spring clip, then used probe with hook and ground wire, then snipped out the capacitor and used the hook and ground wire again.

Deadbugged it tonight - I didn't have and blank PCB to use as a ground plane so it was hanging in free air. Frequency was 33MHz, up from early/mid 20MHz when on a solderless breadboard - and strangely enough as earlier, snipping out the 0.1u cap made about 1% difference to the frequency.

Not that I'm saying you don't need decoupling, but it makes very little difference in this circuit....

As you noted previously, with a 33MHz fundamental and 100MHz scope, the 3rd hamonic will be 3dB down.

If I was doing that circuit, I would try to ensure that the period is sufficiently long that any edge effects have dies out before the next edge occurs. With my 'S04 circuit I inserted a short RC delay between gates 1 and 2, connected gates 2->3->4->5->1, and observed outputs of gates 4 and 5. Despite being an 'S04 not an 'S14, the "analogue" input caused no problems.

Having said that, LS had the reputation of being "simple to use" whereas S was "lookout for dragons" territory for the obvious reasons.

I remember back in '79-'80 my project built a ~100 LSTTL ic double-sided PCB, paying very good attention to power layout and decoupling. It worked flawlessly first time, and other teams specifically told us that surprised them. I've always been very attentive to electromagnetics ever since :)
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline nuno

  • Frequent Contributor
  • **
  • Posts: 606
  • Country: pt
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #23 on: April 02, 2015, 11:08:32 am »
Get a better capacitor (and still use the spring)?

Use 10n or 1n cap, use 2 or 3 in parallel.

You can also try this, with and without the capacitor: double or triple the power supply wires length.
« Last Edit: April 02, 2015, 11:10:11 am by nuno »
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: us
Re: Waveforms in a 74LS04 ring oscillator.
« Reply #24 on: April 03, 2015, 02:47:40 am »
Pulled out some old DIP chips to try and replicate your setup.   Shown using Motorola SN74LS04N, three gates for the ring, then two more gates to buffer then invert.   Just using some RG58.   Bypass cap is 0.47uF ceramic.   Pictures shows the mess.   

First two plots are using 10X probes with the long wire and no bypass.

Plot three is no bypass, using coax, Wavecrapper set to 50 ohm inputs. 

Plot four is the same as plot three with the bypass stuck in.   Bypass if we call it that, still appears to have some effect.   

1/(2*3*40MHz) = 4nS propagation
« Last Edit: April 03, 2015, 05:12:12 pm by joeqsmith »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf