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

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: VCC Capacitor
PostPosted: Mon Sep 15, 2003 12:17 am 
Offline

Joined: Thu Sep 11, 2003 5:47 am
Posts: 45
I have a simple question about the capacitor between VCC and GND in relation to the 6502.

Should it link VCC to all the GND pins, or is one enough?

I realize this sounds a little silly, since GND is a common connection - but the file I looked at said 'as close as possible to the mchip'. Since the 6502 has GND pins at opposite ends of the chip, and my GND circuit runs around the edge of the board, should I run a second capacitor for the pin21 GND? or is one enough?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Sep 15, 2003 5:44 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
First the long answer—  (Why do I always get carried away at the keyboard?)

If you're only running a 1MHz 6502 and a couple of similarly slow peripheral ICs, you can get away with some pretty sloppy construction and it'll still work.  However until you've worked in some kind of engineering at the higher frequencies, it's hard to grasp just how much stray inductance and capacitance your connections have, and how severely they can hamper operations when you do drop some faster parts in.

Even in our electronics for private aircraft, I commonly get an installer calling from a hangar somewhere having a devil of a time with noise getting into our system, and it virtually always turns out that they thought ground is ground is ground, and their ground scheme is all messed up.  The fact is that any length of conductor, even wing spars and large aluminum aircraft fuselage structural members do not have zero ohms' impedance between two places.  If a current is passed through this non-0 impedance, you develop a voltage across it, which could end up referencing an input against a noise signal instead of a quiet ground.

One result of the same concept in a digital circuit board is ground bounce.  To make a silly but perhaps easier-to-understand analogy, imagine lying on an air mattress in a calm swimming pool, and then someone jumps in and you suddenly find yourself bobbing up and down.  An IC's output which should be at a steady state does this when it is referenced against a ground that is going up and down as a result of other outputs changing the load on the ground connections.  The supposedly steady-state output can easily go up and down enough to change states, and even repeatedly trigger a flip-flop or something that shouldn't be getting triggered at the time.  When you see it on the oscilloscope, you will see that the ringing takes time to die out.  If the clock speed is fast enough that there's not time for the ringing to die out before you're into the critical set-up time, what is the processor, memory, or other IC input supposed to latch onto?  You'll have reliability problems which might turn the whole thing non-operational.  The clock line is the most critical though, and even at low clock speeds (meaning long periods), the bouncing may render the computer non-op.

[Edit, 10/8/20: URLs updated.]
For a good discussion on ground bounce, see Fairchild's applications note AN-640 at https://www.onsemi.com/pub/Collateral/AN-640.pdf .  If it seems all too theoretical, at least look at the design rules near the end to keep the problems from turning all too real.  Another ap. note on design considerations, including decoupling requirements is AN-520 at https://web.archive.org/web/20121024043 ... MS-520.pdf .  If you still haven't had enough math and graphs and so on, see AN-340 on transmission-line effects at https://www.onsemi.com/pub/Collateral/AN-393-D.PDF .  If you have even a small grasp on these concepts, you can make some really first-rate home computer designs.

Now if you really want the short answer, use a small board with parts close together so the connections are no longer than necessary, and do put a capacitor in the range of .01µF to .1µF from power to ground at each IC, keeping the connections to the IC's power and ground pins just as short as possible.  Ideally you'd have at least a ground plane (a power plane, if not done correctly, may not be helpful); but next-best would probably be to have kind of a spider-web arrangement so all the power and ground connections go to a central power distribution point on the board, in addition to daisy-chaining them in circles around the center, so the return currents of signals between neighboring ICs don't have to go clear in to the center and down the next spoke.  Edit: Later, I think I prefer just doing a fine grid of power and ground connections.

It wouldn't hurt to put a second capacitor to your other µP power pin, but the WDC 65c02 in a DIP only has ground on pin 21, while pin 1 is the VP\ (vector pull-not) output. The other packages, PLCC and PQFP, have extra power and ground pins, and in addition, the connections from the board to the die (the actual chip inside the IC) are shorter due to the smaller packages, so they're better suited for higher speeds.

_________________
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 Mon Sep 22, 2008 12:22 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Sep 15, 2003 2:43 pm 
Offline

Joined: Thu Sep 11, 2003 5:47 am
Posts: 45
Hey Garth.. feel like doing some mathematics?? :)

You got me interested in the decoupling capacitance (mainly because I want to do it right). I read over the Fairchild document, and their formula is kinda confusing. Would you mind checking my working....

6502 (commodore data sheet)
max current draw - 160mA
rise/fall time - 10ns
vdd droop - <250mV (from the 5V +- 5% = 250mV)

gives a capacitance of 0.0064uF

The WD65c02 is lower still due to its lower max current.

Is this in some way related to your advice of using a 0.01uF for the decoupler?

It seems to make sense to me at the moment (although it is 3am), but I want to make sure I get it right so I can do it properly on other chips as well. Is there any harm in going too large?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Sep 15, 2003 8:52 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Your .006uF is sure close to .01uF; but if you're looking at the equation I think you are on page 12 of MS-520, the current is not the overall DC draw (remember NMOS takes a lot of current even when not switching), but the current to charge up the load capacitances at the time of switching. This might take a little more time to figure out from things like the number of CMOS input loads the various pins will be driving. In the case of the ap. note, they were talking about driving a controlled-impedance bus, a little bit simpler situation for this calculation. Now understanding the potential problem and what causes it, if you want to get really detailed you could add up the capacitive loads from the data sheets of the parts in your design, calculate things like inductances of pins and traces or wire-wrap wires, and come up with optimized capacitances.

If you don't want to go to that extent, you can just take advantage of others' experience and just put a .01uF across each IC with leads as short as possible and call it done. It will still get you in the ballpark. The understanding will keep you from making common mistakes and maybe some not-so-common ones too. We call it "good engineering practice," a nebulous term that is even used in some government documents, referring to going on experience and related knowledge to do what you think is best when it's not possible to fully model all the invisible elements of a circuit for analysis.

I feel like the more I write, the less I'm saying, so I'll shut up now. Hopefully this helped at least a tiny bit.

_________________
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:
PostPosted: Tue Sep 16, 2003 12:48 am 
Offline

Joined: Thu Sep 11, 2003 5:47 am
Posts: 45
Please don't ever shut up Garth :P

Even when you think you've said nothing, I still find something interesting in it.

I've only been on the site a week now, and you're turning into my local 6502 guru :) Hope you don't mind :P


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

All times are UTC


Who is online

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