Hi All
I've been reading and learning from 6502.org for a while - great site, and it gave me the information I needed to start my own project.
But I hope the gurus here can help me with a problem I have been grappling with for several days now.
I am building a homebrew computer based on a w65c02s (see
https://hackaday.io/project/5789-6502-homebrew-computer).
Currently it is working in the following configuration:
- CPU : w65c02s
- RAM : HM628128 SRAM
- EEPROM : w27c512
- IO : 2 x MOS 2625 PIA
- VDP : TMS9918
- Serial : CMD65sc51
- Sound : AY-3-8910
I am decoding the address space through a 74HCT138 which basically gives me the /CS signal I need. All timing is from a master 21.477MHz clock, divided down to 10.7MHz for the VDP, and 2.68MHz for the rest of the system (except the AY-3 which operates at 1.34MHz).
All was well with this, until I recently found that the 6526 can't keep up reliably at 2.68MHz, but works fine at 1.34MHz - not a massive surprise I guess as it normally operates around 1MHz in a C64, so I was seriously overclocking it.
So I bought a few w65c22s VIAs from ebay and plugged a couple in. The pinout is very similar to the 6526, but this is what I have done to wire up:
- CS1 is tied direct to +5V
- PHI2 is fed from the clock divider as for all other PHI2 signals
- /CS2 is wired to the appropriate 74HCT138 line
- R/W is fed from the CPU R/W
- /IRQ I have left unconnected for the moment (but will wire-OR it using a diode to the /IRQ of the CPU)
- D0-7 is wired back to the CPU data bus
- RS0-3 is wired back to the CPU A0-A3 address bus
I thought this should work fine - but I am getting absolutely zilch. I am using a simple monitor program to constantly read back from register 0 (or any register from 0x0 to 0xf) and it always comes back 0xB2 (which happens to be the high byte of the address the VIA maps to - 0xB200). If I plug the 6526 back in without any other changes to wiring, I get something sensible back.
I have tried putting pull-ups on various control lines (/CS, CS1 being the only ones that made sense) - but nothing. The return value of 0xB2 is what I get if nothing is plugged in to that IO address space (e.g. if the 6526 is plugged in, I get data back - but taking it out completely, I get 0xB2). So it is as if the w65c22 is completely unresponsive. I've tried other VIAs (I had a batch of 5) - all the same. I even tried a Rockwell R6522 - that also does nothing.
I can't understand why this doesn't work. Although I am using a mix of CMOS and NMOS parts, the CPU is driving the address and data bus and that is CMOS. The /CS decoder is a CMOS part too. And the clock is also a CMOS part.
So I must be doing something incredibly stupid - I hope someone can point out my schoolboy error!
Thanks in advance, Dolo