WDC65816 & WDC65C22 Decoding
WDC65816 & WDC65C22 Decoding
I am trying to understand the dynamics of address decoding for the 65816 using more than 64k and how it impacts the 65C22 chip selection.
The '816 asserts A16-A23 on the databus and is clocked into a latch on the rising edge of PH2. By the way, my March 2000 copy of the datasheet shows this in the timing diagram while the later 2004 versions have removed it. The setup and hold times are still listed but the diagram is missing.
Now, as Garth had pointed out, the 65C22 expects the RS and CS to be valid on the rising edge of PH2 also.
Now comes the dilema. How can you put IO space in the lowest 64k page only? You cannot wait until the A16-A23 are latched on the rising edge to decode the page because the 65C22 is already expecting the RS & CS to be valid! At 14MHz, the A16-A23 setup time is 33ns max and the clock pulse low time is 35ns. There is not enough time to decode A16-A23 unless you reduce the max clock from 14MHz to allow for the decoder propagation delays.
Am I reading too much into the datasheets? Has anyone else experimented with this?
Thanks
Daryl
The '816 asserts A16-A23 on the databus and is clocked into a latch on the rising edge of PH2. By the way, my March 2000 copy of the datasheet shows this in the timing diagram while the later 2004 versions have removed it. The setup and hold times are still listed but the diagram is missing.
Now, as Garth had pointed out, the 65C22 expects the RS and CS to be valid on the rising edge of PH2 also.
Now comes the dilema. How can you put IO space in the lowest 64k page only? You cannot wait until the A16-A23 are latched on the rising edge to decode the page because the 65C22 is already expecting the RS & CS to be valid! At 14MHz, the A16-A23 setup time is 33ns max and the clock pulse low time is 35ns. There is not enough time to decode A16-A23 unless you reduce the max clock from 14MHz to allow for the decoder propagation delays.
Am I reading too much into the datasheets? Has anyone else experimented with this?
Thanks
Daryl
-
Nightmaretony
- In Memoriam
- Posts: 618
- Joined: 27 Jun 2003
- Location: Meadowbrook
- Contact:
1. you can make a lower address latch and merely wait for both to have valid addys before asserting cs and rw.
2. Latch only the 6522 select address so it holds over into a valid time for the lower addresses, then assert at that time...
stupid ideas from a wierd person here
//need coffee
////hates coffee
//////thats my own problem
2. Latch only the 6522 select address so it holds over into a valid time for the lower addresses, then assert at that time...
stupid ideas from a wierd person here
//need coffee
////hates coffee
//////thats my own problem
"My biggest dream in life? Building black plywood Habitrails"
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
It seems that reality shows their actual parts are always better than the timing specifications. This is definitely not the first time we've found things in the spec.s that would seem to indicate the part can't work at all at 14MHz, yet WDC had a customer (I don't remember who, and maybe they're still doing it) who was making and selling a product that ran them at 20MHz. Even if they did 100% testing at the temperature extremes and lower end of the allowable power supply range, you know they couldn't build a business unless most of these parts could do at least 20MHz consistently w/o problems. I do wish WDC would get their timing spec.s corrected. This is getting quite irritating. At least the parts are proving to do better than the spec.s and not worse, which is good, but we find that some of the spec.s are worthless and we have to do our own experimentation to find out the truth. What you're pointing out should be brought to Bill Mensch's attention. You wrote, Remember to include the delay in the '573 latch as well.
Quote:
At 14MHz, the A16-A23 setup time is 33ns max and the clock pulse low time is 35ns. There is not enough time to decode A16-A23 unless you reduce the max clock from 14MHz to allow for the decoder propagation delays.
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Tony wrote, "1. you can make a lower address latch and merely wait for both to have valid addys before asserting cs and rw." but the problem is still that the 65c22 requires the CS1, CS2\, and R/W\ to be valid before its phase-2 rises. Delaying the rise of the phase-2 signal to the VIA is what I did to make a 6522 work with the Commodore 64 as shown at http://www.6502.org/users/garth/projects.php?project=7 but that was at 1MHz and slow parts where you can get away with murder. The phase-2-high time (tPWH) of the 65c22 is specified to be be 35ns min, which doesn't give any room to eat into at 14MHz in order to give more time for the high address byte to get settled.
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?
GARTHWILSON wrote:
It seems that reality shows their actual parts are always better than the timing specifications. This is definitely not the first time we've found things in the spec.s that would seem to indicate the part can't work at all at 14MHz, yet WDC had a customer (I don't remember who, and maybe they're still doing it) who was making and selling a product that ran them at 20MHz.
Daryl
-
Nightmaretony
- In Memoriam
- Posts: 618
- Joined: 27 Jun 2003
- Location: Meadowbrook
- Contact:
Re: WDC65816 & WDC65C22 Decoding
8BIT wrote:
The '816 asserts A16-A23 on the databus and is clocked into a latch on the rising edge of PH2. By the way, my March 2000 copy of the datasheet shows this in the timing diagram while the later 2004 versions have removed it. The setup and hold times are still listed but the diagram is missing.
Quote:
Now comes the dilema. How can you put IO space in the lowest 64k page only? You cannot wait until the A16-A23 are latched on the rising edge to decode the page because the 65C22 is already expecting the RS & CS to be valid!
Quote:
At 14MHz, the A16-A23 setup time is 33ns max and the clock pulse low time is 35ns. There is not enough time to decode A16-A23 unless you reduce the max clock from 14MHz to allow for the decoder propagation delays.
That being said, you are absolutely correct in that you need to slow the clock down to ensure proper setup time for the 65C22.
The only reasonable way to get 14MHz performance out of the discrete processor package is to introduce wait-states for slower logic. This is the curse of single-clock-per-memory-cycle designs. With most other CPUs, this is hidden because it usually takes 2 clocks to 4 clocks per memory cycle anyway.
I've designed a circuit that allows the 65816 to couple with slower, synchronously clocked peripherals. It's probably a good idea to draw it up and put it on my website for others to learn from.
Is there any point to running it at 14MHz in a complex design?
It seems any data to be 'read' by the processor must be presented in 35ns, including all your decoding. A CPLD/FPGA can easily decode fast enough, but DRAM tops out at 60ns. So, every time you access DRAM, you have to have logic that detects this, puts on the brakes, waits for the system to catch up, and then lets the processor go again. Why not just run it at 8MHz, have a cycle time slow enough so you don't need any sync logic, and you can use all the ISA spec'ed I/O chips out there, like the 16C550 with minimal external logic?
A modern system would address this with caching, and I suppose you COULD design your own cache controller using SRAM if you really wanted, but I've done the theory behind it, and it's reasonably ugly.
It seems any data to be 'read' by the processor must be presented in 35ns, including all your decoding. A CPLD/FPGA can easily decode fast enough, but DRAM tops out at 60ns. So, every time you access DRAM, you have to have logic that detects this, puts on the brakes, waits for the system to catch up, and then lets the processor go again. Why not just run it at 8MHz, have a cycle time slow enough so you don't need any sync logic, and you can use all the ISA spec'ed I/O chips out there, like the 16C550 with minimal external logic?
A modern system would address this with caching, and I suppose you COULD design your own cache controller using SRAM if you really wanted, but I've done the theory behind it, and it's reasonably ugly.
My next design will either run at 10MHz or 14MHz. I'd like to core to run as fast as possible. Cypress sells a 512kx8 SRAM chip with 12ns access time. This would support 14MHz without caching.
I plan on building a prototype core so I can test it at 14MHz and test the interactions outside the core. One thought was to use a 65C22 as the interface to the lower-speed peripherals. Thus my original questions concerning access to the 65C22 at 14MHz.
I would probably fall back to 10MHz or even 8MHz if the 14MHz speeds prove troublesome.
Daryl
I plan on building a prototype core so I can test it at 14MHz and test the interactions outside the core. One thought was to use a 65C22 as the interface to the lower-speed peripherals. Thus my original questions concerning access to the 65C22 at 14MHz.
I would probably fall back to 10MHz or even 8MHz if the 14MHz speeds prove troublesome.
Daryl
henrik51 wrote:
Is there any point to running it at 14MHz in a complex design?
Quote:
A modern system would address this with caching, and I suppose you COULD design your own cache controller using SRAM if you really wanted, but I've done the theory behind it, and it's reasonably ugly.
I was thinking of something like this for a memory map:
Code: Select all
=======================================
FROM DESCRIPTION TO
---------------------------------------
$000000 Fast RAM (2MB max) $1FFFFF
$200000 Slow RAM window $3FFFFF
$400000 I/O $5FFFFF
$600000 unused $FFFFFF
=======================================
I was thinking about this because SDRAM has such an awkward bus interface (it makes perfect sense for caching or streaming applications, but is HORRIBLE for random-access chips like 65816). Another way of looking at it is to have up to 2MB of core memory, and 256MB to 16GB of SDRAM "ram disk" for swap space.
Anyway, it's just an idea.
8BIT wrote:
Thus my original questions concerning access to the 65C22 at 14MHz.
If the 65C22 proves troublesome, why not just resort to using a 74AC573s for dedicated input or output ports? Although it takes more board space, and you lose the ability to use the timers (though it's possible to work around that as well, using 74AC573s and dedicated down-counter chips).
I figure one 74AC138 to decode write accesses to 8 write-only output ports, one '138 to decode 8 read-only input ports, and maybe one '138 to decode up to 4 16-bit wide timers. That pretty much covers everything I can think of.
Yes, that was one possibility I had considered if the 65C22 can't cut it.
I'm still playing with numbers and layout. For the speed, I am figuring on using the TQFP package (or maybe the PLCC) and a 4 layer PCB.
I have this FPGA chip I want to experiment with also.... I just need more time!!!!!
Daryl
I'm still playing with numbers and layout. For the speed, I am figuring on using the TQFP package (or maybe the PLCC) and a 4 layer PCB.
I have this FPGA chip I want to experiment with also.... I just need more time!!!!!
Daryl
lordsteve wrote:
You mean a TQFP package for the 65816 or 65C22? WDC doesn't make the TQFP 65816 anymore.
On another note, I was hoping that their 65C51 would support faster speeds than 4MHz. That was somewhat disappointing. Hopefully, they will improve their design over the next few years.
Daryl
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
> I was hoping that their 65C51 would support faster speeds than 4MHz.
They say they will, and may in fact meet the 14MHz or so speeds right now; but they're still working bugs out.
They say they will, and may in fact meet the 14MHz or so speeds right now; but they're still working bugs out.
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?