I'm making a graphics adapter based on the PPU for an old single-board computer, and I'm wondering what to do about the clock circuit for the PPU. My first thought was to copy the clock circuit in the NES verbatim and use it, since we know it works. For a reference point, used my scope and my NES to look at the clock signal on PPU pin 18, and I have some questions about it.
The NES PPU clock signal ranges from -0.7 V to +3.0 V, which I find odd (see attached scope capture). I would have expected a clock signal going from 0 V to closer to 5 V, and more square than the triangle-like clock the NES generates. Does anyone know if there is anything special about the NES clock circuit, and the waveform it generates, or could I use my own clock circuit -- perhaps one that generates a 0-5 V square wave, instead of the odd shape and voltage range I'm measuring on the NES?
PPU Clock Circuit
Moderator: Moderators
Re: PPU Clock Circuit
For reference, what's the bandwidth of your oscilloscope?
The NES CPU and PPU are NMOS devices and use 5VTTL voltages, so don't need a rail-to-rail clockI would have expected a clock signal going from 0 V to closer to 5 V,
You don't want a square wave. That'll increase accidental RF emissions at the odd multiples of the fundamental. Ideally it'd be a sine wave instead of the triangleish that you see.perhaps one that generates a 0-5 V square wave, instead of the odd shape and voltage range I'm measuring on the NES?
- krzysiobal
- Posts: 1036
- Joined: Sun Jun 12, 2011 12:06 pm
- Location: Poland
- Contact:
Re: PPU Clock Circuit
It's just the simplest generator that can be done with a crystal, single transistor (Q2), configured as common emiter, and a few discrete elements. Q3 is just an common collector, which amplifies by current the the clock for CPU.
viewtopic.php?t=18861
You don't need beautiful square 5vpp signal.
You don't need beautiful square 5vpp signal.
Re: PPU Clock Circuit
Because it amused me, I took the screencap you have there, transformed it into numbers, and then calculated the spectrum of it. You have something that's equivalent in spectrum to a sawtooth wave, which is a little worse than a square wave for accidental RF radiation. (It contains all the even harmonics as well, at the same 1/n attenuation)
Re: PPU Clock Circuit
350 MHz.For reference, what's the bandwidth of your oscilloscope?
Out of curiosity, I dug out a second NES and compared the PPU clock signal to the first one. Both NES PPU clocks seem to have the same basic shape, but the second NES PPU clock has lower peak-to-peak amplitude, and it doesn't drop below 0V like the first one. Not sure why the two would be different, other than component variances, but they both seem to work just fine.
Re: PPU Clock Circuit
Thanks for all the feedback. Based on it, I thought I would try starting with the NES clock circuit and stripping away what I thought I didn't need (I'm not using the NES CPU), and built a prototype with the parts I have on hand:
It seems to give a reasonable waveform, 0-4.7 V PP:
Does anyone see any major issues with me using this? (Please ignore the incorrect frequency -- I'm using a ~22 MHz crystal because my 21.47727 MHz crystals haven't arrived yet).
It seems to give a reasonable waveform, 0-4.7 V PP:
Does anyone see any major issues with me using this? (Please ignore the incorrect frequency -- I'm using a ~22 MHz crystal because my 21.47727 MHz crystals haven't arrived yet).
Re: PPU Clock Circuit
That topology doesn't isolate the crystal from the load of the PPU, so you may have some kind of problem from that. Maybe.
Re: PPU Clock Circuit
Thanks for the schematic! I compared it to my NES, and it mostly matches, but there is one difference I am curious about: unless I'm mistaken, on my NES's, R10 is connected differently from your schematic. Not sure if this is a mistake, or a difference in hardware.krzysiobal wrote: ↑Thu May 06, 2021 10:27 am It's just the simplest generator that can be done with a crystal, single transistor (Q2), configured as common emiter, and a few discrete elements. Q3 is just an common collector, which amplifies by current the the clock for CPU.
nes.png
viewtopic.php?t=18861
You don't need beautiful square 5vpp signal.