Improving my PCB design
Improving my PCB design
Hi guys
I'm looking at my 6502GPD-D design and what can be improved to get a faster and less noisy design. The design so far runs ok at 16MHz, but 18MHz or higher is unreliable-to-not usable.
So far I'm looking at possibly adding serial to it (rather than relying on a card) and a few other things with regards functionality.
However, at the moment I'm looking at layout and PCB layer stack up.
Stack up wise, I've been doing a little research and 4 layers is less than optimal (although it does work, obviously).
I was thinking of going to 6 layers with the following:
1: SIG
2: GND
3: PWR
4: PWR
5: GND
6: SIG
Then using plenty of large vias to connect the two ground planes together, along with putting in vias near signals running to ground. This means that return paths are improved and radiate less.
I did think about converting layer 4 into SIG (signal) as well, but I want to keep power planes as close to each signal layer as possible.
What does everyone think? Is this overkill for a 65C02?
Also, does any one have any recommendations component placement? I'm, looking at dropping the clock generation cirtcuit down a little and moving the RAM/ROM down and to the left towards the slots, making for shorter bus traces.
In addition, I was possibly looking at moving the CPLD and MPU (65C02) from below the slots to the left instead. The Address and Data bus headers will be moved in closer to the RAM/ROM ICs as well.
Am I barking up the wrong tree on this?
See attached file for a layout.
[edit to clear up some confusion: It's been pointed out below that the PCB refers to slower 55ns RAM, but just to advise that I'm actually using 12ns AS7C4096A SRAM via an adapter]
I'm looking at my 6502GPD-D design and what can be improved to get a faster and less noisy design. The design so far runs ok at 16MHz, but 18MHz or higher is unreliable-to-not usable.
So far I'm looking at possibly adding serial to it (rather than relying on a card) and a few other things with regards functionality.
However, at the moment I'm looking at layout and PCB layer stack up.
Stack up wise, I've been doing a little research and 4 layers is less than optimal (although it does work, obviously).
I was thinking of going to 6 layers with the following:
1: SIG
2: GND
3: PWR
4: PWR
5: GND
6: SIG
Then using plenty of large vias to connect the two ground planes together, along with putting in vias near signals running to ground. This means that return paths are improved and radiate less.
I did think about converting layer 4 into SIG (signal) as well, but I want to keep power planes as close to each signal layer as possible.
What does everyone think? Is this overkill for a 65C02?
Also, does any one have any recommendations component placement? I'm, looking at dropping the clock generation cirtcuit down a little and moving the RAM/ROM down and to the left towards the slots, making for shorter bus traces.
In addition, I was possibly looking at moving the CPLD and MPU (65C02) from below the slots to the left instead. The Address and Data bus headers will be moved in closer to the RAM/ROM ICs as well.
Am I barking up the wrong tree on this?
See attached file for a layout.
[edit to clear up some confusion: It's been pointed out below that the PCB refers to slower 55ns RAM, but just to advise that I'm actually using 12ns AS7C4096A SRAM via an adapter]
Last edited by banedon on Sat Jul 08, 2023 6:28 pm, edited 1 time in total.
Re: Improving my PCB design
If I was going for speed, I'd put the CPU and RAM close together along with the clock and CPLD, and keep peripherals and expansion slots on a slow bus on the other side of a transceiver perhaps (or maybe the CPLD can be the glue there too). The idea is to allow the critical components to work together in as ideal an arrangement at possible, to achieve the fastest possible speed for general processing, and use wait states (e.g. clock stretching) to slow things down for infrequent I/O operations. I'd also consider copying the ROM to RAM on startup over the slow bus, to keep the fast bus as unencumbered as possible.
This was broadly my plan for a modular system where the CPU board would contain pretty much just those components I mentioned above, and most operations stay within that board, which can also comfortably be quite small and cheap to produce. Everything else (probably including ROM) would be on other boards.
I'm not sure what the benefit would be of having multiple ground and power planes in your case. I'd have thought one dedicated plane of each would be fine.
This was broadly my plan for a modular system where the CPU board would contain pretty much just those components I mentioned above, and most operations stay within that board, which can also comfortably be quite small and cheap to produce. Everything else (probably including ROM) would be on other boards.
I'm not sure what the benefit would be of having multiple ground and power planes in your case. I'd have thought one dedicated plane of each would be fine.
Re: Improving my PCB design
6 layers does seem overkill for a 65C02 SBC, if you consider that my 65816 SBC is a 4 layer board (not even manually routed) and it runs fine at 20MHz.
the PCB i made for it is also one of the most compact i've made so far. it's 10x10cm and it's packed with compoenents.
so i think keeping traces short and pushing your components closer together will already give you some good results.
plus i would start to move away from parallel expansion slots that are directly connected to the System bus, as it just slows things down. (for example if i insert my Video Card into my SBC it won't run at 20MHz anymore)
i would just rely on something serial like SPI (maybe implemented in hardware the CPLD). hardware SPI is fast enough for basically anything you could want to connect, except video and audio maybe.
if you do want to keep atleast 1 parallel connector for some high speed device like a video card, maybe put it behind some buffers that are only enabled when the card is accessed.
also consider using some faster RAM, a fast clock won't do anything if you're slowing the CPU down every bus cycle.
the AS6C4008-55 is a 55ns chip. so consider using the IS61C5128AL-10, which is a 10ns chip with the same capacity 512kB, and it's usually cheaper as well.
you will still need wait states for the ROM (though the VIA and whatever you'll throw into the CPLD should be fast enough), but that shouldn't be an issue if you only use the ROM to bootload code into RAM (or copy itself into RAM before disabling the ROM).
the PCB i made for it is also one of the most compact i've made so far. it's 10x10cm and it's packed with compoenents.
so i think keeping traces short and pushing your components closer together will already give you some good results.
plus i would start to move away from parallel expansion slots that are directly connected to the System bus, as it just slows things down. (for example if i insert my Video Card into my SBC it won't run at 20MHz anymore)
i would just rely on something serial like SPI (maybe implemented in hardware the CPLD). hardware SPI is fast enough for basically anything you could want to connect, except video and audio maybe.
if you do want to keep atleast 1 parallel connector for some high speed device like a video card, maybe put it behind some buffers that are only enabled when the card is accessed.
also consider using some faster RAM, a fast clock won't do anything if you're slowing the CPU down every bus cycle.
the AS6C4008-55 is a 55ns chip. so consider using the IS61C5128AL-10, which is a 10ns chip with the same capacity 512kB, and it's usually cheaper as well.
you will still need wait states for the ROM (though the VIA and whatever you'll throw into the CPLD should be fast enough), but that shouldn't be an issue if you only use the ROM to bootload code into RAM (or copy itself into RAM before disabling the ROM).
Re: Improving my PCB design
Thanks for replying, guys.
Just to note that I'm using faster RAM - it was original build for AS6C4008 memory, but I now use 12ns AS7C4096A SRAM using an SOJ to DIP adapter (I should have said).
The CPLD slows the system down when accessing the ROM, but runs at full speed when accessing the RAM. Also, I am planning to copy ROM to RAM.
With regards the GND planes. distance between the signals and the ground planes is something of an issue, but this is more of an issue with higher speeds. I think this might not include something like 14-20MHz, which is really why I'm asking.
The reason I had the slots on the main busses was really for something like a video card, but perhaps (as suggested) I could move two off for slower buffered access and keep one for video?
Just to note that I'm using faster RAM - it was original build for AS6C4008 memory, but I now use 12ns AS7C4096A SRAM using an SOJ to DIP adapter (I should have said).
The CPLD slows the system down when accessing the ROM, but runs at full speed when accessing the RAM. Also, I am planning to copy ROM to RAM.
With regards the GND planes. distance between the signals and the ground planes is something of an issue, but this is more of an issue with higher speeds. I think this might not include something like 14-20MHz, which is really why I'm asking.
The reason I had the slots on the main busses was really for something like a video card, but perhaps (as suggested) I could move two off for slower buffered access and keep one for video?
Re: Improving my PCB design
I would buffer the video port as well, with a transceiver near the CPU. If it's write-only then bus speed doesn't matter much - the 6502 will struggle to send more than one byte every four or five cycles anyway. Especially for read operations you may have to tolerate a slower clock even if its directly connected, as the signals have a long way to go - so you might as well separate that off and avoid bogging down the main bus with driving those long off-board traces.
Are the peripherals going to be connected by ribbon cables or directly attached? It may be wise to alternate all the signal pins with ground or power pins if you're using cables.
Are the peripherals going to be connected by ribbon cables or directly attached? It may be wise to alternate all the signal pins with ground or power pins if you're using cables.
Re: Improving my PCB design
The peripherals are edge card connected only. I.e. PCB to PCB.
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Improving my PCB design
Obviously for smallish boards and 10MHz, people are having a degree of success with less than ideal skills. Their projects wouldn't pass FCC testing of radiated electrical noise for selling a finished consumer product, but who cares. But as speeds (mainly meaning edge rates, not MHz, although faster edge rates will be needed at high MHz numbers) continually creep up, good layout will become more and more important just to make our creations work at all. I half expect that eventually someone will be offering 65xx FPGAs that run at much higher speeds.
I have all the information you'll want, and more, about good layout for good behavior at high speed, in the applicable chapter of the 6502 primer, at http://wilsonminesco.com/6502primer/construction.html, with links to industry gurus' videos at the end of the page. I'm thinking especially of Eric Bogatin, Suzy Webb, and Rick Hartley, mostly on Altium's YouTube channel. Robert Feranec has a good YouTube channel too. He doesn't seem to be particularly expert on these things, but he's aware of why we need to listen to these experts, and he talks with them at length on his videos, about these things, and lets them explain, with good graphics. You might be thinking "I'm not doing multi-GHz stuff, so this stuff isn't relevant;" but our larger packages and connectors bring the same principles down into much lower frequencies to bite us.
Since you have an expansion bus, I'll mention that #4, about 40% of the way down the AC-performance page linked above, is a point that constantly gets violated. I should add the information about layer stackup that's in viewtopic.php?p=96682#p96682, referring to the separation distance between layers (since they're not equally spaced like most people think). The next chapter is about expansion buses, at http://wilsonminesco.com/6502primer/construction.html .
I have all the information you'll want, and more, about good layout for good behavior at high speed, in the applicable chapter of the 6502 primer, at http://wilsonminesco.com/6502primer/construction.html, with links to industry gurus' videos at the end of the page. I'm thinking especially of Eric Bogatin, Suzy Webb, and Rick Hartley, mostly on Altium's YouTube channel. Robert Feranec has a good YouTube channel too. He doesn't seem to be particularly expert on these things, but he's aware of why we need to listen to these experts, and he talks with them at length on his videos, about these things, and lets them explain, with good graphics. You might be thinking "I'm not doing multi-GHz stuff, so this stuff isn't relevant;" but our larger packages and connectors bring the same principles down into much lower frequencies to bite us.
Since you have an expansion bus, I'll mention that #4, about 40% of the way down the AC-performance page linked above, is a point that constantly gets violated. I should add the information about layer stackup that's in viewtopic.php?p=96682#p96682, referring to the separation distance between layers (since they're not equally spaced like most people think). The next chapter is about expansion buses, at http://wilsonminesco.com/6502primer/construction.html .
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?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: Improving my PCB design
banedon wrote:
I now use 12ns AS7C4096A SRAM using an SOJ to DIP adapter
That's because the DIP pinout is a relic from the slow, old days. It features only a single Vcc pin and a single Gnd pin. You'll notice that more modern RAMs feature two significant changes: multiple Vcc and Gnd pins, and moreover they're located centrally (rather than at the corner of the package).
Also, I second George's suggestions, especially putting the CPU and RAM close together along with the clock and CPLD.
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Improving my PCB design
Hi garth
Many thanks. I'll have a reread as it's been a number of years since I read your guides/tutorials and I think some of it's been possibly been updated since (and my memory isn't as good as it once was!). I'm going to go through the videos over the next few days. With regards point #4: my connectors do have grounds dotted up and down and some VCCs (not as many as I would like!) - also, they are set so reverse connection isn't super bad. I learned that from you a while ago
.
I didn't realise the distance between the two middle layers of a 6 layer baord was so small - so having 2 VCC plains seems pointless in retrospect. However, I thought 2 ground plains might be the main benefit. Maybe not worth the cost of a 6 layer PCB though. What I might do is go for a 1.2mm 4 layer instead.
Anyhoo, going to watch those videos and have a reread. Cheers!
Many thanks. I'll have a reread as it's been a number of years since I read your guides/tutorials and I think some of it's been possibly been updated since (and my memory isn't as good as it once was!). I'm going to go through the videos over the next few days. With regards point #4: my connectors do have grounds dotted up and down and some VCCs (not as many as I would like!) - also, they are set so reverse connection isn't super bad. I learned that from you a while ago
I didn't realise the distance between the two middle layers of a 6 layer baord was so small - so having 2 VCC plains seems pointless in retrospect. However, I thought 2 ground plains might be the main benefit. Maybe not worth the cost of a 6 layer PCB though. What I might do is go for a 1.2mm 4 layer instead.
Anyhoo, going to watch those videos and have a reread. Cheers!
Re: Improving my PCB design
Dr Jefyll wrote:
banedon wrote:
I now use 12ns AS7C4096A SRAM using an SOJ to DIP adapter
That's because the DIP pinout is a relic from the slow, old days. It features only a single Vcc pin and a single Gnd pin. You'll notice that more modern RAMs feature two significant changes: multiple Vcc and Gnd pins, and moreover they're located centrally (rather than at the corner of the package).
Also, I second George's suggestions, especially putting the CPU and RAM close together along with the clock and CPLD.
-- Jeff
I use DIPs becasue it's just so much easier to swap out a duff part - but perhaps I should revisit that. Can I get away with having a custom DIP pinout reflecting all of the pins on the AS7C4096A? Or would it still not be quite good enough and I have to directly solder?
Re: Improving my PCB design
Ok, so far here's what I'm looking at. It is quite subject to change given the comments in this thread and also what I mean hear/see in those link Garth has kindly provided:
- Main bus ICs as close together as humanly possible
- Keep 'moslo' clock stretch circuit for ROM access, copy ROM to RAM on boot (already implemented, but will keep)
- SOJ package SRAM soldered directly to the PCB -or- on custom DIP adapter reflecting the pinnout of the IC, including power - see previous post.
- Move slots off main bus. Put behind buffers or VIAs? I prefer buffers. Would this be good enough? I'll reread Garth's posts.
- 1 bank of 16KB dual port ram will connect to main buses, but the port B to a slot. Any issues with this?
- Signal vias to have ground vias next to them for return paths
- 4 layer PCB 1.2mm. Stackup: SIG GND PWR SIG
I'm going to have to reroute the buses. Is crying permitted?
- Main bus ICs as close together as humanly possible
- Keep 'moslo' clock stretch circuit for ROM access, copy ROM to RAM on boot (already implemented, but will keep)
- SOJ package SRAM soldered directly to the PCB -or- on custom DIP adapter reflecting the pinnout of the IC, including power - see previous post.
- Move slots off main bus. Put behind buffers or VIAs? I prefer buffers. Would this be good enough? I'll reread Garth's posts.
- 1 bank of 16KB dual port ram will connect to main buses, but the port B to a slot. Any issues with this?
- Signal vias to have ground vias next to them for return paths
- 4 layer PCB 1.2mm. Stackup: SIG GND PWR SIG
I'm going to have to reroute the buses. Is crying permitted?
Re: Improving my PCB design
Having done a number of 6502 overclocking experiments into 30+ Mhz, I believe you need to simplify your design, reduce component count, reduce wiring length and signal loads and put them all in a small pc board. All my overclock boards are either 2-layer pcb or hand-wired prototype boards (no groun/Vcc planes); the key is small board and short connections.
Bill
Edit, this is my most recent overclocking experiment, viewtopic.php?f=4&t=7433. I was shooting for a 40Mhz DOS/65 computer, but that requires supply voltage of 5.4V. 36Mhz is probably the limit for nominal voltage
Bill
Edit, this is my most recent overclocking experiment, viewtopic.php?f=4&t=7433. I was shooting for a 40Mhz DOS/65 computer, but that requires supply voltage of 5.4V. 36Mhz is probably the limit for nominal voltage
Last edited by plasmo on Sat Jul 08, 2023 9:40 pm, edited 1 time in total.
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Improving my PCB design
banedon wrote:
Hi garth
Many thanks. I'll have a reread as it's been a number of years since I read your guides/tutorials and I think some of it's been possibly been updated since
Many thanks. I'll have a reread as it's been a number of years since I read your guides/tutorials and I think some of it's been possibly been updated since
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?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: Improving my PCB design
GARTHWILSON wrote:
banedon wrote:
Hi garth
Many thanks. I'll have a reread as it's been a number of years since I read your guides/tutorials and I think some of it's been possibly been updated since
Many thanks. I'll have a reread as it's been a number of years since I read your guides/tutorials and I think some of it's been possibly been updated since
Re: Improving my PCB design
banedon wrote:
Dr Jefyll wrote:
[...]
I use DIPs becasue it's just so much easier to swap out a duff part - but perhaps I should revisit that.
Quote:
Can I get away with having a custom DIP pinout reflecting all of the pins on the AS7C4096A?
If maximum clock rate is the goal, I'd seriously consider starting over. Begin by laying out a tight RAM/CPU/CPLD core, then then arrange Everything Else (including ROM) around it... ideally separated from the core by buffer ICs or at least damping resistors, and running with a wait-state. (And for the latter I'd maybe lean toward using the CPU's RDY input. A comparison of that technique vs. clockstretching can be found here.)
-- Jeff
Last edited by Dr Jefyll on Sun Jul 09, 2023 6:11 am, edited 1 time in total.
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html