6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun May 12, 2024 8:32 pm

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sun Apr 28, 2024 11:43 am 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 25
First post in almost 13 years! (Introduction post here: http://forum.6502.org/viewtopic.php?p=17109#p17109 )

Being inexperienced with oscilloscopes, I have some questions regarding what I see when I try my new oscilloscope on a circuit.

Background
After failing to get my SBC working 13 years ago I lost interest and focused on other things instead. But in 2019 I started to gain interest again, empowered by this forum and certain Youtubers, and successfully built a 65C02 computer on breadboard (this time using HC-parts instead of AC-parts). After this I started to design a PCB but for several years the project was stuck in theory/Kicad-limbo. Last week, however, I finalised my design and ordered a set of PCBs from PCBWay (I will probably create a separate post about that and link it here eventually). Now I am currently waiting for the PCBs to arrive.

As I expect there will be a problem or two with the design, and as I also want to design some auxiliary projects for the SBC (VGA, audio etc), I thought, now is a good time to order an oscilloscope, so I did. I received the oscilloscope just two days ago and to get to know it I decided to build a clock circuit in spirit of an (hopefully) upcoming VGA project and measure its output.

The circuit is a standard 25.175 MHz VGA signal which is divided in two to produce a 12.588 MHz pixel clock.

Coming from a software engineer background, I have zero experience with oscilloscopes, a very basic understanding of analog circuits and a decent understanding of digital circuits. Therefore, I write this post to get help with understanding what I am looking at.

Setup
My simple test circuit is as follows.

I have a standard 25.175 MHz oscillator on a BusBoard BB830 breadboard, fed into a 74HC74N D-flipflop to get a 12.587 MHz a signal, according to the clock division circuit in https://wilsonminesco.com/6502primer/ClkGen.html.

Power supply is the 5V/Gnd outputs from an Arduino Uno Rev 3, which in turn gets its power from USB via my Macbook Air. (Yes overly complicated, I will get something a bit more direct soon). I have put an 100 uF electrolytic cap over the power rails where the power enter the board, a 100 nF capacitor near the oscillator power input and a 47 nF capacitor (I had 47nF one lying around nearby and didn't bother to unpack another 100 nF one) near the flip-flop power input.

Scope is a Siglent 1204X-E. According to spec it's 200 MHz, 1 GS/sec when one channel is used, rise time 1.6 ns. Included probes are supposedly matching this spec.

Questions
Attached are some screenshots of my measurements, done with the ground spring mounted on the probe, on a setup with 25.175 MHz, 20 MHz, 10 MHz and 2.5 MHz oscillator. Also attached is a crappy photo of the circuit and a probe in place. :D

My own observations:

1. Oscillator output looks fine, except for some excessive overshoot. Is this to be expected or is something influencing the signal?
2. Oscillator output looks softer with higher frequencies. I assume it has to do with the limitations of the scope?
3. The output from the flip-flop has some ringing. Is the probe causing this or is it the circuit itself? Something I should worry about?
4. At 20 MHz, the output of the flip-flop seems to fall apart. Looking at the specifications for the 74HC74N, it says "25 MHz" so I would expect at least the 20 MHz version to work. Perhaps I am looking at the wrong numbers? Or is it something else causing this? I have a feeling this output is not very suitable as a clock signal.
5. Is there a "better" way to measure than what I am currently doing? I did random googling and found stuff about probe termination and other things I didn't quite grasp. I should probably dig deeper into that.

Also, I know running on a breadboard at these speeds is far from ideal and my ambition is to make partial PCBs on the way but I find it useful for trying out ideas and understanding circuit behavior.

Any input is appreciated!


Attachments:
File comment: 25.175 MHz clock into 74HC74
25_175_MHz_through_HC74.png
25_175_MHz_through_HC74.png [ 22.01 KiB | Viewed 152 times ]
File comment: 25.175 MHz oscillator output
25_175_Mhz_oscillator.png
25_175_Mhz_oscillator.png [ 26.47 KiB | Viewed 152 times ]
File comment: 20 MHz clock into 74HC74
20_MHz_through_HC74.png
20_MHz_through_HC74.png [ 24.22 KiB | Viewed 152 times ]
File comment: 20 MHz oscillator output
20_MHz_oscillator.png
20_MHz_oscillator.png [ 23.83 KiB | Viewed 152 times ]
File comment: 10 MHz clock into 74HC74
10_MHz_through_HC74.png
10_MHz_through_HC74.png [ 23.64 KiB | Viewed 152 times ]
File comment: 10 MHz oscillator output
10_MHz_oscillator.png
10_MHz_oscillator.png [ 25.47 KiB | Viewed 152 times ]
File comment: 2.5 MHz clock into 74HC74
2_5_MHz_though_HC74.png
2_5_MHz_though_HC74.png [ 20.8 KiB | Viewed 152 times ]
File comment: 2.5 MHz oscillator output
2_5_MHz_oscillator.png
2_5_MHz_oscillator.png [ 20.6 KiB | Viewed 152 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 11:46 am 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 25
And the promised crappy photo of the circuit. :D


Attachments:
File comment: Breadboard thing
IMG_9668.JPG
IMG_9668.JPG [ 2.41 MiB | Viewed 151 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 3:26 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3354
Location: Ontario, Canada
JohanFr wrote:
I received the oscilloscope just two days ago
Congrats on your acquisition! :)

Quote:
Attached are some screenshots of my measurements, done with the ground spring mounted on the probe
Good call -- you've avoided a common mistake. If the scope probe doesn't have a good, short ground then you'll see artifacts in the display.

Unfortunately the project itself doesn't match that same high standard. I suspect you can reduce the spikes substantially by improving the connections of the bypass caps to the 74HC74 (and ideally the oscillator too). On a breadboard, this isn't easy.

If I'm being fussy, I'll solder the bypass cap directly on top of the IC. Of course it's not always necessary to be fussy. But if you're curious about improving your observations then this will probably help significantly.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 3:58 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 443
Hi Johan,

A couple of things that might make it a little quieter:

Make sure you tie off the unused inputs from the other unit of your 74HC74 to ground or vcc. Even if it's not causing logic problems, those floating inputs could be causing the other unit to switch randomly and rapidly creating additional noise in your circuit.

Your circuit is not very complex, so this might not make much of a difference, but it couldn't hurt to add a few ground return paths, especially a row of ground pins connecting the two ground rails *between* the oscillator and the `74. This has the added bonus that it will pretty closely track the clock line connecting the oscillator to the `74, creating a ground return path for it. It might not hurt to even connect the ground pin of the oscillator directly to the ground pin of the `74. For best results, twist that wire together with the oscillator's clock output wire.

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 5:17 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3354
Location: Ontario, Canada
Attachment:
bypass capacitors.JPG
bypass capacitors.JPG [ 276.71 KiB | Viewed 129 times ]
I located a photo I posted elsewhere illustrating short connections between a DIP IC and a bypass cap. Soldering (as shown on the left) is not strictly necessary. In a breadboard scenario you may prefer to compromise slightly and have the cap leads plugged into a nearby spot on the breadboard (as suggested on the right). Remember, the goal is to achieve a short connection to the chip itself.

AC performance is a deep subject, JohanFr, but luckily there's a great deal to be gained from one basic and rather superficial insight (and Paganini has hinted at this). What we want, both for the scope probe connections and for connections within our project, is to minimize inductance... and inductance is determined mainly by the area enclosed by the LOOP that the current follows. And -- key point :!: -- it's always a loop, not just a line, because in order for current to flow from A to B there must be a return path from B back to A. And in our sort of work it's the power and ground network that forms the return paths.

To minimize loop area (and thereby minimize inductance), the obvious (and well-known) remedy is to keep connections short. But a less obvious yet highly effective way to reduce loop area is to ensure there's a return path available which is immediately adjacent to the signal path. (And BTW multiple return paths are OK... the current will "choose" the best one, as it's the path of least inductance).

I think if you add a cap to the 'HC74 in the manner I've shown then you'll see a much improved waveform on the Q output. (But only if your scope connection is also kept optimal.)

On another subject, does your oscaillator's output produce rail-to-rail swings (suitable for driving CMOS)?

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 5:32 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 443
Hi Again Johan,

Since my current breadboard project uses the exact same clock divider as the one you're working with, I went out into the garage and took some photos I think you might find useful. Here's my circuit:
Attachment:
PXL_20240428_163219914.MP.jpg
PXL_20240428_163219914.MP.jpg [ 2.12 MiB | Viewed 125 times ]
In particular, notice the rows of green "staples" connecting the ground rails between the ICs making kind of overall grid shape.

Notice that there's no bypass capacitors, not even bulk power supply decoupling. Building on breadboards is like building on a bed of capacitors already so these days I only add bypass caps if I can verify empirically (i.e., plugging the cap in while observing the scope) that it makes things better rather than worse. Often it makes things worse. When I do add bypass caps, I do it like this so that the caps are as close as possible to the ICs' power pins:
Attachment:
PXL_20240428_170717659.jpg
PXL_20240428_170717659.jpg [ 2.34 MiB | Viewed 125 times ]
Here are two views of the clock signals; the 8MHz oscillator output, and the 4MHz system clock output from the 74HC74. One is with bypass caps, the other is without. In this case they didn't make much difference:
Attachment:
PXL_20240428_165237357.jpg
PXL_20240428_165237357.jpg [ 2.09 MiB | Viewed 125 times ]
Attachment:
PXL_20240428_165151327.jpg
PXL_20240428_165151327.jpg [ 2.28 MiB | Viewed 125 times ]
My scope is an old TekTronix 100MHz analogue scope. Because it's inconvenient, I rarely use the spring ground clip when working on breadboards, and instead I use the probe's ground lead with the alligator jaws clipped to a breadboard jumper wire which gives a big sloppy ground loop. Here's a picture of the board's 4MHz clock signal compared to itself, one with the spring clip, and one with the big sloppy ground loop.
Attachment:
PXL_20240428_165026087.jpg
PXL_20240428_165026087.jpg [ 2.26 MiB | Viewed 125 times ]
You can see that the sloppy ground loop is introducing some ringing. I took the reading like this:
Attachment:
PXL_20240428_164750059.jpg
PXL_20240428_164750059.jpg [ 2.55 MiB | Viewed 125 times ]
Here's 25.175MHz / 12.6ish MHz. It's really a bit past what my scope can manage, but you can still get some useful information from it.
Attachment:
PXL_20240428_164301252.jpg
PXL_20240428_164301252.jpg [ 1.92 MiB | Viewed 125 times ]
In closing, here's a really good post from forum member SamCoVT about how to use your scope: viewtopic.php?f=12&t=7371&start=120#p96591

Edit: to note I cross-posted with Jeff, and to say that the "ground return grid" technique is one I learned from him. :)

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 6:00 pm 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 25
You guys are posting so much useful stuff I can't keep up with the answers! :D Much appreciated!

The answers seems to point to the same thing, the circuit needs improvement and the scope reading is most likely correct. This is a relief in itself because then I can probably stop worrying about me doing something wrong when measuring.

Regarding capacitors, I didn't see a single difference on the scope with or without caps. BUT, they were placed sloppily between the Vcc of each component and whatever Gnd was closest, not the Gnd on the component itself like Jeff suggested. I will try connecting them properly and seef it makes a difference. Maybe the 47 nF needs to go as well and I should unwrap another 100 nF while I am at it? (Damn thing sticks to the tape and cardboard like glue)

Also there is just a single wire connecting the top and bottom half of the board with Gnd and Power which, in light of recent answers is probably terrible electrically, so I will add some more strips and move the components closer like you suggested Paganini.


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 6:08 pm 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 25
Dr Jefyll wrote:

AC performance is a deep subject, JohanFr, but luckily there's a great deal to be gained from one basic and rather superficial insight (and Paganini has hinted at this). What we want, both for the scope probe connections and for connections within our project, is to minimize inductance... and inductance is determined mainly by the area enclosed by the LOOP that the current follows. And -- key point :!: -- it's always a loop, not just a line, because in order for current to flow from A to B there must be a return path from B back to A. And in our sort of work it's the power and ground network that forms the return paths.

To minimize loop area (and thereby minimize inductance), the obvious (and well-known) remedy is to keep connections short. But a less obvious yet highly effective way to reduce loop area is to ensure there's a return path available which is immediately adjacent to the signal path. (And BTW multiple return paths are OK... the current will "choose" the best one, as it's the path of least inductance).

I think if you add a cap to the 'HC74 in the manner I've shown then you'll see a much improved waveform on the Q output. (But only if your scope connection is also kept optimal.)


Thank you I will try this. It is a deep subject indeed. I found some good videos on Youtube a while back illustrating the subject of inductance in high speed circuits. Sadly, not much of the information stuck but maybe I should rewatch them now that I have a more practical application for it.

Soldering is probably the last resort, will try to make the capacitors go bendy first :)

Dr Jefyll wrote:
On another subject, does your oscaillator's output produce rail-to-rail swings (suitable for driving CMOS)?


Not sure what to look for in the specifications to answer this?

FWIW, I use the A-version of https://media.digikey.com/pdf/Data%20Sheets/ECS%20PDFs/ECS-100_Series.pdf

EDIT: It links to the 100 MHz version but it's the 25.175 MHz version :) /EDIT

/Johan


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 6:29 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8181
Location: Midwestern USA
One other matter that may have an effect on what you are seeing on your scope is the correct “tuning” of your probe to your scope’s input characteristics.  Quality probes have some sort of equalization adjustment that compensates for the scope’s input capacitance, the latter which can cause the signal displayed by the scope to not accurately reflect reality.  If your probe has this adjustment, you should use it while the probe is connected to a square-wave signal that is known to be “pure.”  If the probe doesn’t have an equalization adjustment, it may be advisable to acquire a probe that does.

Lastly, always use the ×10 setting on your probe when making observations in a digital circuit.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 6:41 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8181
Location: Midwestern USA
JohanFr wrote:
Dr Jefyll wrote:
On another subject, does your oscaillator's output produce rail-to-rail swings (suitable for driving CMOS)?

Not sure what to look for in the specifications to answer this?

FWIW, I use the A-version of https://media.digikey.com/pdf/Data%20Sheets/ECS%20PDFs/ECS-100_Series.pdf

EDIT: It links to the 100 MHz version but it's the 25.175 MHz version :) /EDIT

Good observation, Jeff.  That oscillator has a TTL-compatible output, with a guaranteed VOH of 2.4.  That is not high enough to reliably drive 74HC logic.  While the unloaded output of a TTL device can theoretically reach 3.4 volts, the rate of voltage rise versus time after passing the guaranteed 2.4 volts may get “lazy” and trigger momentary instability in the flop being driven by the oscillator.

Here’s the part I use in my POC units, which has a guranteed VOH of 4.5 in a 5-volt circuit:

Attachment:
File comment: ECS HCMOS Oscillator Series
oscillator_ecs_2100_series.pdf [168.95 KiB]
Downloaded 4 times

The above is in a half-can package, which consumes less space on a PCB.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 7:04 pm 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 25
BigDumbDinosaur wrote:

Good observation, Jeff.  That oscillator has a TTL-compatible output, with a guaranteed VOH of 2.4.  That is not high enough to reliably drive 74HC logic.  While the unloaded output of a TTL device can theoretically reach 3.4 volts, the rate of voltage rise versus time after passing the guaranteed 2.4 volts may get “lazy” and trigger momentary instability in the flop being driven by the oscillator.


Well that's annoying. The one I ordered was the only 25.175 MHz oscillator in DIP-form in stock at Digikey. Mouser has on backorder half-sized cans (which I prefer as well), ETA September this year :cry:

But indeed good observation. I didn't even consider that.


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 7:06 pm 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 25
The 20 MHz version I ordered seems to be HCMOS-compatible so maybe I'll try 400x300 instead :D https://abracon.com/Oscillators/ACH.pdf


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 7:14 pm 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 25
BigDumbDinosaur wrote:
One other matter that may have an effect on what you are seeing on your scope is the correct “tuning” of your probe to your scope’s input characteristics.  Quality probes have some sort of equalization adjustment that compensates for the scope’s input capacitance, the latter which can cause the signal displayed by the scope to not accurately reflect reality.  If your probe has this adjustment, you should use it while the probe is connected to a square-wave signal that is known to be “pure.”  If the probe doesn’t have an equalization adjustment, it may be advisable to acquire a probe that does.

Lastly, always use the ×10 setting on your probe when making observations in a digital circuit.


The probe is adjustable and this was mentioned in the manual so I have adjusted the compensation using the function generator. I have the probe set to 10x. The scope persists on switching to 1x but I suppose that only affects the scale of voltage (showing 0,1 V instead of 1 V).


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 9:10 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8181
Location: Midwestern USA
JohanFr wrote:
The 20 MHz version I ordered seems to be HCMOS-compatible so maybe I'll try 400x300 instead :D https://abracon.com/Oscillators/ACH.pdf

The data sheet is always your friend when choosing parts.  The stuff listed in the fine print is important and needs to be understood.  Failure to account for such things as VIH and VOH ratings can result in a DOA unit with non-obvious causes.

With oscillators, the key characteristics, aside from nominal frequency, are the aforementioned VOH, frequency stability (expressed as parts per million...PPM) and output duty cycle.  In our applications, 100 PPM oscillators are usually more than adequate. I do use a 50 PPM part to generate the clock signal for the DUARTs in my POC units, since the timer in one of the DUARTs produces a 100 Hz jiffy IRQ that is the time-keeping base for the system.  The 50 PPM oscillator keeps time drift to less than one second per month.

The output duty cycle, usually expressed as a fraction, e.g., 45/55, is the ratio between the amount of time the oscillator’s output is in the high (logic 1) state and in the low (logic 0) state.  The ideal is 50/50, but some deviation from ideal is common, and usually harmless.  Asymmetry becomes a problem when the circuit being clocked by the oscillator is running near its maximum capabilities, as the shorter of the two oscillator output states may result in a difficult-to-diagnose timing violation.  Running the output of an oscillator through a flip-flop effaces asymmetry at the expense of cutting the output frequency in half.

Speaking of clock signals, WDC MPUs have relatively strict Ø2 clock requirements.  The signal is expected to swing rail-to-rail and with no more than 5ns rise and fall time.  Over the years, we’ve helped people diagnose DOA or instability problems that proved to be the result of nothing more than a faulty clock signal.  Things such as asymmetry, slow transition times and ringing are not uncommon with breadboard setups, and can doom a circuit if severe enough.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 30, 2024 7:25 am 
Offline

Joined: Wed Nov 16, 2011 9:39 am
Posts: 25
I've learned my lesson. I usually look at the propagation delay figures and the timing diagrams. I should pay more attention to the electrical specifications as well.

Can I use a HCT part to read from the oscillator in a stable manner and have that part translate the clock signal to HC domain or should I consider the oscillator a useless part in a HC design? I have way too many HC parts so it would be nice to get some use out of them. For example, maybe a 74HCT08 could be used as a delay for the clock signal and translate it to HC for free?

As for the clock signal to 65C02, so far I have been using can oscillators (all of them except the latest one I got have been HCMOS parts) and occasionally the output pins of an Arduino. No homemade 555 timer clocks or stuff like that.


Last edited by JohanFr on Tue Apr 30, 2024 7:45 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: