6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 1:31 am

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: 10MHz 6502 wave form
PostPosted: Mon Feb 09, 2015 2:49 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
Hi guys

I've managed to get my 6502 build to run at 10MHz with some stability now. The clock wave form looks quite distorted - but then again this seems to happen at lower frquencies as well.
Is this normal?
My own knowedge says that it's fine as long as you get the amplitude and a general (-ish) square wave, but I don't have a huge amount of experience so thought I'd ask. I'm especially curious about the M-like shape of the wave.

Attachment:
10MHz6502_medium.jpg
10MHz6502_medium.jpg [ 136.38 KiB | Viewed 1094 times ]


Top
 Profile  
Reply with quote  
 Post subject: Re: 10MHz 6502 wave form
PostPosted: Mon Feb 09, 2015 4:19 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
banedon wrote:
I've managed to get my 6502 build to run at 10MHz with some stability now. The clock wave form looks quite distorted - but then again this seems to happen at lower frquencies as well.
Is this normal?
My own knowedge says that it's fine as long as you get the amplitude and a general (-ish) square wave, but I don't have a huge amount of experience so thought I'd ask. I'm especially curious about the M-like shape of the wave.

Some of that could be due to your test rig. In order to accurately reproduce a 10 MHz square wave, the probe should be good to at least 100 MHz. Ditto for the 'scope.

Also, it's likely that your circuit is producing some ringing, which you may be able to suppress with some resistance to ground at each end of the signal path. As long as the signal makes a clean transition through the affected device's "no man's land" switching characteristic, you should get proper operation.

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


Last edited by BigDumbDinosaur on Mon Feb 09, 2015 4:21 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: 10MHz 6502 wave form
PostPosted: Mon Feb 09, 2015 4:39 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
Thanks for the reply, big D. The scope is an Owon PDS5022S and rated at 25MHz. Not sure about the probes, but as they came with it I suspect they are the same (got it all second hand and for free so no complaints there :)). So you might be right, especially as considering that the following screen shots show things looking more and more distorted from 4MH to 10MHz (I've heard that increased/decreased frequency should have no effect on ringing in and of itself?). I would have included more, but I only have a 4, 8 and 10MHz crystal osc can at the moment.

One thing to say is that I don't really have a ground plane set up as I didn't quite understand Garth's article (a failure on my part!). I've been trying to find a visual demonstration of a star ground plane. I suspect its lack may contribute to this kind of thing.

4MHz
Attachment:
4MHz6502.JPG
4MHz6502.JPG [ 150 KiB | Viewed 1083 times ]


8MHz

Attachment:
8MHz6502.JPG
8MHz6502.JPG [ 151.76 KiB | Viewed 1083 times ]


10MHz
Attachment:
10MHz6502_medium.jpg
10MHz6502_medium.jpg [ 136.38 KiB | Viewed 1083 times ]


Last edited by banedon on Mon Feb 09, 2015 4:59 pm, edited 3 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: 10MHz 6502 wave form
PostPosted: Mon Feb 09, 2015 4:50 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
BigDumbDinosaur wrote:
Also, it's likely that your circuit is producing some ringing, which you may be able to suppress with some resistance to ground at each end of the signal path. As long as the signal makes a clean transition through the affected device's "no man's land" switching characteristic, you should get proper operation.


When you say resistance to ground, are you speaking about putting resistors between ground and, say, the address and data bus (as I noted that the BBC Micro did in this post:
http://forum.6502.org/viewtopic.php?f=4&t=2960)? If so, is it just a case of pulling the clock line to ground through a 6k8 resistor? I've never seen this with the clock so suspect that i've misunderstood.


Top
 Profile  
Reply with quote  
 Post subject: Re: 10MHz 6502 wave form
PostPosted: Mon Feb 09, 2015 5:27 pm 
Offline
User avatar

Joined: Mon Dec 08, 2008 6:32 pm
Posts: 143
Location: Brighton, England
Banedon,

Your waveforms show the typical results of a 'scope with insufficient bandwidth - especially the 10MHz trace where the third harmonic is clearly visible as the humps on the top and bottom of the square wave. Also, the slow rise and fall on the wave edges is another effect caused by insufficient scope bandwidth - the lower the scope bandwidth, the slower the rise and fall of the edges of a pulse will appear on the scope. Truely vertical pulse edges require a theoretically infinate bandwidth to display properly!

As your circuit is working correctly, the poor shape of the pulses on your scope is almost certainly a reflection of the limitations of your oscilloscope. The pulses in your circuit are probably much cleaner and faster than your scope displays.

Even if the pulses in your circuit were as poor as they are shown on your scope, they would be absolutely fine for driving a 65C02 clock input as this has a schmidtt trigger input and the ripple on the tops and bottoms of the pulses would be ignored. The 65C816, on the other hand, doesn't have such a nice clock input and requires much higher quality clock pulses.

_________________
Shift to the left,
Shift to the right,
Mask in, Mask Out,
BYTE! BYTE! BYTE!


Top
 Profile  
Reply with quote  
 Post subject: Re: 10MHz 6502 wave form
PostPosted: Mon Feb 09, 2015 7:34 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Yes, it does look like a deficiency in the 'scope, and the probe is suspect too.  You are using the probe in the x10 position, right?  'Scope probes in the x1 position are only good for a couple of MHz max, and their loading on the circuit will be horrendous.

Quote:
So you might be right, especially as considering that the following screen shots show things looking more and more distorted from 4MHz to 10MHz (I've heard that increased/decreased frequency should have no effect on ringing in and of itself?).

True.  The ringing is a function of the board and the edge rates, not the clock frequency, at least if it mostly dies out before the next edge.

If you don't have a true ground plane (note that copper fills do not qualify), the star topology is good to add to the daisychained ground and power connections to get the lowest possible inductance of these from one IC to all others that the fast signals are interchanged with.  Resistive termination can be used to cut or eliminate the ringing, but the resistance value has to approximate the transmission-lines' characteristic impedance, and those will be all over the place and impossible to calculate for a wire-wrapped board.  It would take a lot of experimentation, and I doubt it's worth it.

_________________
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: 10MHz 6502 wave form
PostPosted: Mon Feb 09, 2015 8:08 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
Thanks for your responses, guys. I'll have to start looking around for a 100MHz+ 'scope. I was thinking perhaps the Owon SDS7102.

With regard to the probes - definitely in the x10 mode :).

I'll look at putting in a star ground plane, although do you happen to have a diagram of one? I'm imagining the grounds for all ICs/devices coming into the centre under the board? Not sure.

While I'm here, a quick question with regard to speed? How does the 6502 deal with speed increases with respect the RAM and ROM ICs? I.e. I've increased the speed on my project from 2MHz to 10MHz and this is within the limits allowed by the CPU and VIA (both WDC parts with a max of 14MHz). I assume that the RAM and ROM are accessed at an appropriately increased speed? If so, this may explain why I was having trouble at 10MHz: I was at random times having rubbish appear on my LCD. As soon as I swapped the RAM (an HY62256B LLP-70) for a Toshiba TC55257DPL-70L it was fine. I.e. although they both run at the same speed, the Toshiba part is coping with the faster access than the HY62256B as it's getting borderline out of spec (too slow for what's needed)?


Top
 Profile  
Reply with quote  
 Post subject: Re: 10MHz 6502 wave form
PostPosted: Mon Feb 09, 2015 9:10 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
banedon wrote:
BigDumbDinosaur wrote:
Also, it's likely that your circuit is producing some ringing, which you may be able to suppress with some resistance to ground at each end of the signal path. As long as the signal makes a clean transition through the affected device's "no man's land" switching characteristic, you should get proper operation.

When you say resistance to ground, are you speaking about putting resistors between ground and, say, the address and data bus (as I noted that the BBC Micro did in this post:
http://forum.6502.org/viewtopic.php?f=4&t=2960)? If so, is it just a case of pulling the clock line to ground through a 6k8 resistor? I've never seen this with the clock so suspect that i've misunderstood.

Resistance to ground is one method, Thevenin termination is another. Still another is the use of a Schottky diode, with the anode connected to ground, that is, reversed biased. Try it first with resistance to ground and see how that goes. Have you read this topic?

Ringing comes from signal reflections on the affected line that are triggered by very abrupt changes in voltage level, especially if the theoretical propagation time of the signal path is a significant fraction of the signal transition time. The clocking frequency itself is usually not the culprit—a low frequency signal may trigger ringing if the state transition time is extremely short. The more rapidly a device can change its output state the greater the likelihood of significant ringing.

Ringing is especially likely when using 74AC or 74ABT logic, or if driving signals with a CPLD or FPGA, due to the very rapid switching speeds such devices are capable of attaining. I get a little ringing on Ø2 with POC V1.1, despite a not-inconsiderable amount of effort to keep that line as short and direct as possible. Ø2 is derived from a 74AC74 flip-flop that is driven by the clock oscillator, and that flop has single digit nanosecond transition time from one state to the other. I'm not concerned with it, as the crossover from one logic state to the other is clean and the circuit will work okay at 15 MHz.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: 10MHz 6502 wave form
PostPosted: Mon Feb 09, 2015 9:18 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
banedon wrote:
I'll look at putting in a star ground plane, although do you happen to have a diagram of one? I'm imagining the grounds for all ICs/devices coming into the centre under the board? Not sure.

I just put a WW IC socket in the middle of the board to act as the hub, ie, the center of the star, and plugged a DIP header into it with the 5V regulator and decoupling capacitors.  There are several pins for +5V and several for ground, so you don't run out of WW space on the pins when you're bringing in so many wire from so many IC's power and ground pins.

Quote:
While I'm here, a quick question with regard to speed? How does the 6502 deal with speed increases with respect the RAM and ROM ICs? I.e. I've increased the speed on my project from 2MHz to 10MHz and this is within the limits allowed by the CPU and VIA (both WDC parts with a max of 14MHz). I assume that the RAM and ROM are accessed at an appropriately increased speed? If so, this may explain why I was having trouble at 10MHz: I was at random times having rubbish appear on my LCD. As soon as I swapped the RAM (an HY62256B LLP-70) for a Toshiba TC55257DPL-70L it was fine. I.e. although they both run at the same speed, the Toshiba part is coping with the faster access than the HY62256B as it's getting borderline out of spec (too slow for what's needed)?

Aside from circuit construction, it's all in the timing diagrams and charts.  The specifications normally guarantee that the worst cases won't be any worse than a certain limit, but they don't usually give you typicals or best cases.  That's usually good, but in rare cases, not so good.  70ns on the RAM from two different manufacturers, or even two different lots from the same manufacturer, doesn't necessarily mean they're the same speed, unless they both just barely passed the test to be qualified for that speed.  Usually they will have passed with some margin, but they won't tell you what it is, except that it might not have been good enough to pass for the next faster speed bin, at least not across the specified temperature range (higher temperature slows it down) and power-supply voltage range (lower voltage slows it down) and load range (more load capacitance slows it down).  The WDC parts are guaranteed to work to 14MHz under the specified conditions, but usually top out around 25MHz at room temperature and 5V and light loading, although the supporting parts will have to work with reduced timing margins.  IOW, they'll usually work well beyond 14MHz, but the guarantees are off.

_________________
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: 10MHz 6502 wave form
PostPosted: Mon Feb 09, 2015 9:34 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
banedon wrote:
While I'm here, a quick question with regard to speed? How does the 6502 deal with speed increases with respect the RAM and ROM ICs? I.e. I've increased the speed on my project from 2MHz to 10MHz and this is within the limits allowed by the CPU and VIA (both WDC parts with a max of 14MHz). I assume that the RAM and ROM are accessed at an appropriately increased speed? If so, this may explain why I was having trouble at 10MHz: I was at random times having rubbish appear on my LCD. As soon as I swapped the RAM (an HY62256B LLP-70) for a Toshiba TC55257DPL-70L it was fine. I.e. although they both run at the same speed, the Toshiba part is coping with the faster access than the HY62256B as it's getting borderline out of spec (too slow for what's needed)?

It sounds as though you may be violating the timing of your RAM and ROM.

The -70 in their part numbers refers to the maximum guaranteed time in nanoseconds in which they will respond to selection and read- or write-enable without error. This number is a guarantee, but oftentimes parts will be faster than advertised. However, you cannot bank on this being the case. Performance will also be affected by operating temperature and voltage, as well as slight differences in the die, which explains why one RAM works okay and the other doesn't.

The key to understanding why your machine occasionally produces "rubbish" (I like that term in a computer context :lol:) on the display is in comparing the RAM's guaranteed performance to the machine cycle time. At 10 MHz, the machine cycle time is 100ns. However, the actual time in which it is possible for the 65C02 to access a device is less than that, as can be seen by studying the MPU's timing diagram. Also a factor is the propagation delay caused by the glue logic and by parasitic capacitance and lead inductance. When all is said and done, the actual time during which the RAM has been selected and can be reliably read and written may be less than that 70ns rating, causing random errors.

In designing your circuit with a specific speed in mind, you have to analyze the timing of the slowest device on the bus (usually a ROM) and compare it to the time that will elapse from when the MPU presents a valid address and RWB state until the appropriate chip select has been asserted and an appropriate read or write signals is applied to the addressed device. You then add to that time the amount of time the addressed device will take to react to the chip select and the read or write signal—response to chip select is usually a bit slower than response to an /RD or /WD signal. If that sum exceeds the device's rating you will be violating its timing and can expect errors.

With a 65C02 (or 65C816), the data bus is not guaranteed to be "valid" until the rise of Ø2, which means that the time in which the addressed device will see usable data during a write cycle will be one-half a machine cycle, or 50ns at 10 MHz. Similarly, during a read cycle the 65C02 samples the data bus at the fall of Ø2, which means the addressed device has to be sure it is driving the data bus before the fall of Ø2.

Succinctly stated, setup should be initiated as early as possible during Ø2 low so that as much of Ø2 high as possible can be used to read or write. If the device cannot respond before the next fall of Ø2, errors are likely, producing "rubbish" on the display, among other things.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: 10MHz 6502 wave form
PostPosted: Mon Feb 09, 2015 11:23 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
@banedon: How is your current build constructed?

banedon wrote:
...One thing to say is that I don't really have a ground plane set up as I didn't quite understand Garth's article (a failure on my part!). I've been trying to find a visual demonstration of a star ground plane. I suspect its lack may contribute to this kind of thing...

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
 Post subject: Re: 10MHz 6502 wave form
PostPosted: Tue Feb 10, 2015 1:05 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
ElEctric_EyE wrote:
@banedon: How is your current build constructed?

banedon wrote:
...One thing to say is that I don't really have a ground plane set up as I didn't quite understand Garth's article (a failure on my part!). I've been trying to find a visual demonstration of a star ground plane. I suspect its lack may contribute to this kind of thing...


The 0V and +5V rails are along one edge of the PCB and look a bit horrid due to it not being wire-wrapped and so a bit of a solder blob due to the amount of connections (my PCB does not have tracks, but single pads making things a bit difficult). The VDD/VSS connections from the various ICs generally go straight to those two points. So in a way, I have created a star ground plane – although a very lopsided one! :). I've attached a picy below:
Attachment:
rear.jpg
rear.jpg [ 146.72 KiB | Viewed 1021 times ]


My next version will be to use Garth’s idea of using a wire wrap DIL socket in the centre which will avoid long VCC/VSS wire lengths and to use thicker wire for those connections.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 54 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: