Cleaning up a clock for a CPU - Page 1
Forum section: electronics / projects

author: lnx64
author_rank: Regular Contributor
timestamp: October 26, 2013, 05:09:23 am
content: I'm overclocking my old Sega Genesis to 10MHz, and have done so for the past year, and all has been well for the most part.. This system also had it's PSRAM replaced with real faster SRAM, and a few other mods, but the overclock is the most important.. The stock CPU speed has problems with some shooter games, as all the sprites slow it down. 10MHz clears it up and has worked great.Though it has locked up a few times. At first the primary issue was my resistor array for the Z80 (controls sound), was not right and had the common not at VCC for a pull up, but accidentally at one of the data lines.. This caused many issues.. Made my own array because I couldn't find any with the common pin in the middle, and the locking up has gone down a LOT. In fact, it's rare now.. But it still does.So upon checking everything, I used thin wires suitable for a clock, made them as short as possible, but when looking at a scope, the 10MHz oscillator looks rather, messed up on the bottom half of the waveform.http://img.photobucket.com/albums/v395/Evilweredragon/10.jpg~originalI would assume the waveform should be uniform and not deformed at the bottom like that.About what can I do to improve that? Use even thinner wires? Twist it with a ground for shielding, or something else like maybe filtering it?

author: Alexei.Polkhanov
author_rank: Frequent Contributor
timestamp: October 26, 2013, 05:14:31 am
content: That is XIN or XOUT?

author: lnx64
author_rank: Regular Contributor
timestamp: October 26, 2013, 05:48:15 am
content: Quote from: Alexei.Polkhanov on October 26, 2013, 05:14:31 amThis is the output from a 4-pin oscillator that is going directly to the input of the CLK pin of the mc68000 CPU.

author: Alexei.Polkhanov
author_rank: Frequent Contributor
timestamp: October 26, 2013, 06:13:34 am
content: So it is suppose to be square wave. How do you probe it? Do you have long ground lead going to your probe? Also it is hard to see what your signal is - change horizontal scale on your scope so that it shows 1 period of clock signal only - and same for vertical. Make it same scale like when you want to look at the eye pattern. There are things you can do like adding series resistor or small (10pF) caps in parallel to improve signal integrity for your clock signal, but it is important to make sure that you capture it correctly first.Maybe supply to the oscillator is not bypassed correctly? Is it going into a PLL inside CPU? I am not familiar with mc68000.

author: lnx64
author_rank: Regular Contributor
timestamp: October 26, 2013, 04:41:53 pm
content: I probed it by connecting the probes little clip directly off the output leg on the oscillator.. The ground I connected directly to the ground leg of the oscillator also. The ground wire off my probes is 1" long.Here it is with a different horizontal setting..

author: Alexei.Polkhanov
author_rank: Frequent Contributor
timestamp: October 26, 2013, 08:52:30 pm
content: Looks like the rise time is too slow. I don't think this problem can be corrected by "cleaning" it up by adding some passive elements. This is what happen when you drive capacitive loads or when your oscillator does not have enough power to drive it. Do you have datasheet for oscillator? Check the Vcc pin to see if there is a bypass capacitor there but if there is then adding bigger one probably will have little effect. I would try two things here - first I would add buffer between oscillator and CPU to increase its driving strength.Look at this section in DigiKey -http://www.digikey.ca/product-search/en/integrated-circuits-ics/logic-buffers-drivers-receivers-transceivers/2556308and chose a buffer with higher output current and lower input capacitance and package that you can add into the board. Those SOT-353 packages are really really tiny so look at dimensions not photosThere are specialized clock buffers (http://www.digikey.ca/product-search/en/integrated-circuits-ics/clock-timing-clock-buffers-drivers/2556715) but these are mostly used to distribute clock signal to multiple consumers around the board. This could be a problem in your case, but you never mentioned that clocks output is connected to anything else but CPU.And second I would try to find oscillator with higher output current in same package.

author: lnx64
author_rank: Regular Contributor
timestamp: October 26, 2013, 09:03:48 pm
content: Quote from: Alexei.Polkhanov on October 26, 2013, 08:52:30 pmThank you. Luckily I can use an oscillator in any package, I have several socket types and have no problem wiring up a new socket.The current oscillator is this, here's the datasheet for it:http://www.cdiweb.com/datasheets/vectron/prf55310ss16.pdfAnd as for the clock, it is only connected to the CPU through a switch (as I still want to be able to select the stock clock speed as some games have glitches with a higher clock rate).I will look over those things, thanks!

author: Alexei.Polkhanov
author_rank: Frequent Contributor
timestamp: October 26, 2013, 09:17:40 pm
content: I looked at datasheet, there is no max output current but it seem to imply that it can drive at most 20pF load (10 units of TTL load * 2pF). You probably have much more and your switch adds to it. You need a good buffer.

author: lnx64
author_rank: Regular Contributor
timestamp: October 26, 2013, 09:28:12 pm
content: Ok not a problem, I'll buffer it and see how well it works after.Thanks again!

author: Alana
author_rank: Frequent Contributor
timestamp: October 26, 2013, 10:26:27 pm
content: Stupid idea: have you removed or disconnected whatever was there as clock source before you added that resonator?

author: dannyf
author_rank: Super Contributor
timestamp: October 26, 2013, 10:34:53 pm
content: QuoteThat would be a bad assumption. Your clock waveform is fairly typical and I wouldn't worry about it.If you have to make it "prettier", run it through a gate - like a ST gate (HC132 for example).But it is really not needed.

author: lnx64
author_rank: Regular Contributor
timestamp: October 26, 2013, 11:05:40 pm
content: Quote from: Alana on October 26, 2013, 10:26:27 pmThe original clock is removed from the trace.. I carefully severed the trace on the bottom of the board so both clocks don't accidentally meet.

author: AndyC_772
author_rank: Super Contributor
timestamp: October 27, 2013, 08:38:02 am
content: What is your scope probe? Does it have a bandwidth that at least matches your scope (100MHz), and can you show a photo of exactly how you're probing that clock, including (most importantly) the ground connection between your scope and the board?

author: lnx64
author_rank: Regular Contributor
timestamp: October 27, 2013, 03:06:32 pm
content: Quote from: AndyC_772 on October 27, 2013, 08:38:02 amI don't want to take it apart again just yet, every time I open it up bits of plastic come out with the screws..But the probes were rated for 100MHz, and I have them on X10 mode.

author: AndyC_772
author_rank: Super Contributor
timestamp: October 27, 2013, 03:56:26 pm
content: Well, OK - but before you look again, have a good read on the subject of proper scope probe technique, and why using the 6 inch ground lead that comes with the probe is an absolute no-no if you're interested in the shape of any signal faster than a few MHz (or, sometimes, considerably slower than that).Reading this app note all the way through would be a good start:http://circuitslab.case.edu/manuals/Probe_Fundamentals-_Tektronix.pdf

author: lnx64
author_rank: Regular Contributor
timestamp: October 27, 2013, 04:36:19 pm
content: Quote from: AndyC_772 on October 27, 2013, 03:56:26 pmI'll read it up, thanks, but remember, my probe doesn't have the 6 inch ground clip.They are just 1".