Page 1 of 2

Harry The Bastard

Posted: Wed Oct 11, 2006 4:43 pm
by kernal34
Can anyone explain how the clock circuit works. I can't seem to find Harry The Bastards website anywhere, which supposedly will explain it.

Thanks

Posted: Wed Oct 11, 2006 9:07 pm
by fachat
ahmmm... which clock circuit? The 6502 takes a clock signal as input, and does not have a clock circuit itself.

Andre

Posted: Thu Oct 12, 2006 1:42 am
by Nightmaretony
www.archive.org has it on there, at least the code, dont know bout the rest....

Posted: Thu Oct 12, 2006 4:22 am
by GARTHWILSON
kernal34, I think we need to know a little more precisely what you're looking for. Do you want to know how an oscillator works, or how the 65xx processor and bus uses the clock, or how to use the on-board oscillator on a 65c02, or something else?

Posted: Thu Oct 12, 2006 2:46 pm
by kernal34
I guess nobody caught the title....

"Harry The Bastard's" clock circuit is used in several of the projects on this sight, but no one explains how it works. They point you to his web site, but it doesn't work.

Posted: Thu Oct 12, 2006 5:25 pm
by BitWise
He's referring to this circuit:
Image

Posted: Fri Oct 13, 2006 9:53 am
by fachat
Considering that it uses half a '04 and additional board space for a crystal, I'd rather stay with my approach of using a clock generator (available in various frequencies) in a DIL14 case (with only the 4 edge pins used).
That's probably why I didn't catch it...

Andre

Posted: Fri Oct 13, 2006 1:42 pm
by Nightmaretony
That clock circuit is the standard crystal circuit. It is used on the arcade game Space Invaders. Stable and cheap to make. Basically, it is a simple loop with the signal inverting over one end of the loop to the other in a dynamic way. I dont pretend to understand exactly how it works, though.

http://www.hanssummers.com/radio/penning/index.htm
shows the schematic hand drawn

Posted: Fri Oct 13, 2006 8:10 pm
by blackadder
Here's a page with some info
http://www.gaby.de/z80/uexosc.htm

Posted: Sat Oct 14, 2006 4:09 pm
by kc5tja
It is essentially a 180-degree phase-shift oscillator -- in this configuration, a Colpitts oscillator. The two inverters provide (over-)unity gain for the otherwise analog signal coming from the crystal. The fact that it's over-unity gain means that the signal is being clipped at the Vcc/GND rails -- thus, a digital output. Inside the circuit, however, the crystal acts as a band-pass filter, selecting only the frequency of the desired oscillation. The signal thus fed back to the initial inverter should approximate a real sine wave.

Posted: Mon Oct 16, 2006 8:37 am
by faybs
fachat wrote:
Considering that it uses half a '04 and additional board space for a crystal, I'd rather stay with my approach of using a clock generator (available in various frequencies) in a DIL14 case (with only the 4 edge pins used).
That's probably why I didn't catch it...

Andre
Hi, I'm a newb :)

Long time C64 user, pro software developer, wanting to get into 6502 hardware as a hobby now that I have settled down a bit in life.

I've been looking at the 65816's datasheet from WDC, and it specifies that the maximum clock slew must be 5ns. Most of the TTL oscillators I see on web stores quote slews of 10ns for the kind of clock speeds the 65816 is normally used at (ie sub-20MHz). Are you using some sort of clock waveform shaping, am I looking at the wrong parts, or is the datasheet a bit too conservative?

Posted: Mon Oct 16, 2006 8:56 am
by fachat
I'm currently not using the 65816. But you made a good point, I shall have to look into that when I get to the 65816.

Andre

Posted: Mon Oct 16, 2006 3:06 pm
by kc5tja
Don't bother -- I can already answer this one, since I have built a 65816-based system already.

The answer is, anything slower than 5ns slew on the clock input WILL cause the CPU to perform in a very flakey manner. Expect many crashes, and even memory locations being overwritten randomly. In short, unless you're driving the clock input with F-series logic, don't even think it will work. Because it won't.

It is best to drive the clock input with one of those pre-packaged CMOS clock oscillator cans; most of those already meet the 5ns slew rate requirement (though just barely).

Posted: Mon Oct 16, 2006 5:05 pm
by GARTHWILSON
There's more discussion of the 5ns stuff at:
viewtopic.php?t=646
viewtopic.php?p=5655
viewtopic.php?t=786

although the last one has links to two other discussions that it's now saying don't exist:
http://www.6502.org/forum/viewtopic.php?p=895
http://www.6502.org/forum/viewtopic.php?t=195
so I'd like to find out from Mike what's happening-- what the numbers at the end mean, and if they change.

Posted: Mon Oct 16, 2006 7:26 pm
by faybs
Thank you for the info! Sounds like the way to go then is a simple can TTL oscillator with say a 74F04 to shape the waveform? But then, except for the passives, we're sortof back to Harry's design...

One last question about Harry's design if I may. I'm a bit confused by the combination of digital and analog circuitry he uses so I can't tell - is the resulting clock frequency going to be that of the crystal, or half it? Also, I'm thinking of making my first board run at 4 MHz or below, so I don't have to worry about RF interference between circuit traces (or more likely wires in my wirewrap :)) Could his circuit handle that frequency as-is? I suspect so, but from reading this forum it seems like the clock is the 65xx's achilles heel (and linear electronics is not my forte right now) so I might as well save myself the headache and ask :)