6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 15, 2024 9:34 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Thu Apr 15, 2004 7:37 pm 
Offline

Joined: Wed Dec 18, 2002 3:20 am
Posts: 113
Hey all,

until recently, when I've been playing with 6502 projects I've just been fiddling with a circuit like the one from HTB that everyone uses for a 2MHz clock.

With my current project, I want to use something else, namely an oscillator can - of course, these are putting out sine waves - some cleaner then others ;) (my 40mhz oscillator puts out a beautiful wave, my 15mhz osc looks like crud on the scope) - well, needless to say I'm trying to square them off (15Mhz incase I can't get the divider circuit I want to use to work with 40MHz).

Well, I've got the square looking pretty good, but it isn't a perfect/idealic square, and I've read that I need a near perfect square wave - has anyone else run into this, and really how perfect does it need to be?

_________________
-Tony
KG4WFX


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 15, 2004 8:14 pm 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
I've never known a clock oscillator can to put out a sine wave. I have info on lots of brands here, and more-or-less at random pulled up a Saronix brochure, which said 6ns max rise and fall time for CMOS oscillators from 250kHz to 24MHz. To see a square wave output of your 40MHz oscillator, you'll need an oscilloscope capable of at least about 400MHz and preferably more, which you probably don't have there. Having the right probes to go with it (which can get pretty expensive themselves if you buy them separately) and using them in the x10 setting is also essential.

Additionally, the oscillator, especially at those frequencies, will not do nearly as well as it could if it's not in a board with power and ground planes or the traces are long and not terminated in their characteristic impedance. You can get perfboard for wire-wrapping with a plane on each side (so you can use one for power and one for ground), and then just keep everything close together and the connecting wires short to keep the ground bounce, ringing, and other related effects from becoming problems.

If you're in doubt about the squareness though, you could follow the oscillator with a Schmitt-trigger gate and feed the output of that gate into a flip-flop to divide the frequency by two for symmetry.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 15, 2004 9:54 pm 
Offline

Joined: Wed Dec 18, 2002 3:20 am
Posts: 113
Well, you are right with regard to my scope, the fastest I have access to is 200MHz, and it looks fairly sine-ish on it.

My plan was to use either a 40 MHz or a 20 MHz, and divide by 4 and 2 to feed different sections (on the 40 MHz, I'd have a straight 40 for certain expansion areas, 20 for other expansions and div4 to get a 10mhz for the CPU. @20 MHz, it'd be straight 20 and div2, @ 15MHz, it'd be straight 15 and div2 for the CPU. I've worked with 40MHz before and haven't had too much of a problem. I'm thinking I might have a 20MHz clock, but since I have so many 15's and 40's laying around, I figured I might as well use them.

Unfortunately, I think I only had 1 schmitt trigger chip, and it wasn't functional when I wired it up. I'm going to experiment with something else probably this weekend to see if I can get something looking good.

I do know tho that the 15MHz looks like crap on the scope. I don't know why it looks so dirty, but it is definitly nasty. I checked all of my 15MHz cans and they all look the same. I began to think it was the scope doing something, but I tried different scopes, different probe settings, and different circuits buffering. Adding about 150pF got rid of the nasty spikes I was seeing on the down cycle (I mean nasty), but it would round up the signal a little, I wasn't sure how much of a problem that would be.

_________________
-Tony
KG4WFX


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 16, 2004 5:21 pm 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
Tancor wrote:
and really how perfect does it need to be?

Not very is the practical answer. For TTL you need a clean rise/fall between ViL and ViH which is generally 0.6v to 3.4v. Ringing on the start or end of a rise/fall can cause problems, especially near ViL, but a bit of capacitive loading can cure that.

CMOS is a lot more forgiving, as long as there is no noise crossing the Vcc/2 point it will usually work.

The higher the frequency the more 'sine like' you can get away with.

Usual disclaimers apply. 8^)=

Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 17, 2004 8:14 am 
Offline

Joined: Thu Oct 23, 2003 9:07 am
Posts: 12
> Well, you are right with regard to my scope, the fastest I have access to is 200MHz, and it looks fairly sine-ish on it.

Um, you have got all your scope probes compensated for the scope you're using haven't you?
Sprow.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 17, 2004 3:19 pm 
Offline

Joined: Wed Dec 18, 2002 3:20 am
Posts: 113
umm yes Sprow. I do know how to operate my scope and handle the probes - I always check my probes before I do my work to make sure they are functioning properly and properly compensated for the given scope and adjust them for proper operation (if needed) before doing any testing.

Most of the things I need to look at are either not @ much above 15 MHz which my at home scopes are more then qualified to handle, or is just a digital data stream that I can view on a state/timing logic analyzer that I have.

Rarely do I have to look at things above 15MHz, at max 20MHz at home; this was a unique situation as my other projects requiring 40MHz was just to have the oscillator run an 18 series PIC chip, and I wasn't as concerned with the shape of the wave - I was concerned here due to some things I had read on the web and wanted clarification. Operating at the much slower speed in the past (between 1 and about 4 MHz; usually 2 MHz) on the 6502 was really easy as utilizing HTB's circuit worked very well, but I wanted to switch technologies for this experiment.

Leee: The ringing portion is actually all in the negative range. The square wave on the 15MHz osciallator on its down cycle has a brief negative peak at about -.7. W/ about 150pF I can get rid of most of it but it does round the wave a tiny bit which is what I was concerned about, but my guess is from what you said, it isn't rounding it enough to cause any real problems.

_________________
-Tony
KG4WFX


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 17, 2004 6:08 pm 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
The ringing near ViL shouldn't be a problem as long as it doesn't re-cross it. The -ve overshoot could be ground bounce and, as you said all your 15MHz cans look the same, it could be that some part of the supply chain is highZ at 15MHz.

It could also be that all your 15MHz cans ARE crap. 8^)=

Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 17, 2004 8:25 pm 
Offline

Joined: Wed Dec 18, 2002 3:20 am
Posts: 113
leeeeee wrote:
It could also be that all your 15MHz cans ARE crap. 8^)=

Lee.


This was kind of the direction I was leaning ;)

_________________
-Tony
KG4WFX


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Apr 20, 2004 5:44 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
GARTHWILSON wrote:
To see a square wave output of your 40MHz oscillator, you'll need an oscilloscope capable of at least about 400MHz and preferably more,


I patently disagree with this. The sum of a fundamental plus its 1st odd harmonic is plenty sufficient to see a square wave (though it'll exhibit lots of ringing on the display that doesn't actually exist in reality). Thus, to see a 40MHz square wave, a 120MHz scope is plenty.

Quote:
Additionally, the oscillator, especially at those frequencies, will not do nearly as well as it could if it's not in a board with power and ground planes or the traces are long and not terminated in their characteristic impedance.


The characteristic impedance thing is probably the culprit here. I know for a fact (and from first-hand experience) that a cable that is improperly terminated will exhibit higher losses per length than a properly terminated cable of the same impedance. Losses are also dependent on frequency: the higher the frequency, the greater the loss. Consequently, if an impedance mismatch occurs on the board with the oscillator, it's quite possible that all those odd harmonics are being strongly attenuated by the losses in the trace (e.g., they're being radiated as RF or are being shunted to ground through capacitive coupling some how). Thus, only the fundamental remains the strongest, and therefore, looks like a sine wave on the oscilloscope.

Just a hunch, of course, based on my experience. I know this because as soon as I replaced my RG-58U coaxial cable (3dB/10ft loss at 30MHz under properly loaded conditions) with 300-ohm twin-lead cable (0.3dB/10ft loss under the same conditions), I suddenly found that not only could I hear more remote stations better, I could rather regularly make contact with Australia on the 10m band with only 10W ERP. Before the change over, people only city blocks away couldn't hear my signal. Go figure.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Apr 20, 2004 8:18 am 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
> The sum of a fundamental plus its 1st odd harmonic is plenty sufficient
> to see a square wave (though it'll exhibit lots of ringing on the display
> that doesn't actually exist in reality). Thus, to see a 40MHz square
> wave, a 120MHz scope is plenty.

120MHz is only enough to see if it's trying to do a square wave. Looking at my workbench computer's 5MHz flip-flop clock output on my 20MHz oscilloscope, I see a squarish wave, but I can't get much useful info beyond that. If what I see is what's really going on, it would cause a lot of problems in some systems. It certainly falls far short of meeting the rise and fall times specified on the processor's data sheet, and I can't tell if there's enough ringing and ground bounce to clock some processor or I/O chip registers at unintended times. IOW, there's not enough info there to prove that the computer should work at all. (Both theory and the fact that it does work without problems however show me that the reality is better than what I see on the 'scope.)

With 2MHz parts you can get away with murder. But if you want to get into 16MHz and higher speeds, it would do you some good to read up on clock signals and all the problems encountered by engineers who assume too much. Well known lecturer Dr. Howard Johnson has had a lot of good articles about things like this in EDN magazine, one of the major electronics industry trade magazines. He has a good book out called, "High-Speed Digital Design: A Handbook of Black Magic" published by Prentice-Hall. His materials are generally more math-intensive than most of us on this forum need to go, but it is helpful to be aware of the effects that can cause the pitfalls he talks about. Some of the phenomena he addresses at hundreds of MHz on mostly well designed multilayer boards can bite us below 20MHz with wire-wrapped circuits.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Last edited by GARTHWILSON on Fri Apr 30, 2010 7:13 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 22, 2004 12:56 am 
Offline

Joined: Wed Dec 18, 2002 3:20 am
Posts: 113
Well, I finally fired it up today, and after tracking down a few wiring bugs, I found that the amount of ringing I'm experiencing won't be a problem... Of course, now I need to figure out why in the middle of running my code well, it just up and died on me (@ an RTS call it seemed to go to the wrong address, but, my BE pin may have opened up causing the CPU to just stop what it was doing (It was a wiring problem I had put a bandaid on just to get it running, I'll have to get if fixed and re-hooked into my logic analyzer later to see what happens), or I may have a coding problem, but I am not sure where since I don't mess with the stack on the subroutine it died in.)

Oh well, the good news was that I'm furthur along then I was this morning ;)

_________________
-Tony
KG4WFX


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] 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: