I joined the forum as I am currently working on a project to set up an Arduino Mega for bus emulation with a 65C02 based system. What I have done is obtained two VIC-20 "cores"(working boards with out case, keyboard, etc.) and tested good but lack their socketed ICs - so I am populating them with W65C02S6TPG-14 and W65C22S6TPG-14. I figured go with CMOS parts because they were cheaper, more readily available, and I could single-step the clock.
The purpose of the Arduino Mega is to emulate ROM/RAM resources. There at least three other projects where the Mega is used as either a ROM/RAM emulator or as a Processor emulator so I am not reinventing the wheel.
Anyways, I thought I would share my project to see if there was anyone else doing same/similar or have any feedback on this project goal.
Arduino Mega for 6502 Bus Emulation
Re: Arduino Mega for 6502 Bus Emulation
Welcome, energysteven
Briefly, to replace a vintage 6522 with a modern chip from WDC you want W65C22N, not W65C22S. The S version is updated (and arguably improved) by making the /IRQ pin a normal, totem-pole output, but for backward compatibility you want an Open Drain output as featured on the N version.
Re the WDC CPU, be aware that pin 36 (BE) needs to be pulled high and pins 1 and 5 (which are now outputs) must be no-connect. To make these changes you can either inspect and modify the traces on the PCB, or bend the 3 pins outward so they don't engage the IC socket then solder a jumper on 36.
Have fun and keep us posted,
Jeff
Briefly, to replace a vintage 6522 with a modern chip from WDC you want W65C22N, not W65C22S. The S version is updated (and arguably improved) by making the /IRQ pin a normal, totem-pole output, but for backward compatibility you want an Open Drain output as featured on the N version.
Re the WDC CPU, be aware that pin 36 (BE) needs to be pulled high and pins 1 and 5 (which are now outputs) must be no-connect. To make these changes you can either inspect and modify the traces on the PCB, or bend the 3 pins outward so they don't engage the IC socket then solder a jumper on 36.
Have fun and keep us posted,
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: Arduino Mega for 6502 Bus Emulation
energysteven wrote:
I joined the forum as I am currently working on a project to set up an Arduino Mega for bus emulation with a 65C02 based system.
...
The purpose of the Arduino Mega is to emulate ROM/RAM resources. There at least three other projects where the Mega is used as either a ROM/RAM emulator or as a Processor emulator so I am not reinventing the wheel.
...
The purpose of the Arduino Mega is to emulate ROM/RAM resources. There at least three other projects where the Mega is used as either a ROM/RAM emulator or as a Processor emulator so I am not reinventing the wheel.
To add to Jeff's points...
I think perhaps a major question is where the clock comes from. If the clock is free running and full speed and comes from the existing system, there are some hard real-time constraints on responding to the bus. But you mention CMOS and the ability to single step, so it may be that the microcontroller in your case controls the clock, which makes for an easier set of timing problems.
Another fairly major question is about which devices get to control the bus: does the CPU have a BE input that you can use, are there other devices (such as the VIC) which are relatively inflexible about bus accesses, and so on.
It might be handy to see a block diagram. It makes a difference, I think, as to whether you are putting the microcontroller into the CPU socket, or onto the cartridge port, or whether you have flying leads to various signals. Also whether you are able to disconnect any pins or connections on the existing board.
Should be a good adventure, and I hope you pursue it with lots of updates here.
-
energysteven
- Posts: 6
- Joined: 10 Jun 2020
Re: Arduino Mega for 6502 Bus Emulation
Dr Jefyll wrote:
Welcome, energysteven
Briefly, to replace a vintage 6522 with a modern chip from WDC you want W65C22N, not W65C22S. The S version is updated (and arguably improved) by making the /IRQ pin a normal, totem-pole output, but for backward compatibility you want an Open Drain output as featured on the N version.
Re the WDC CPU, be aware that pin 36 (BE) needs to be pulled high and pins 1 and 5 (which are now outputs) must be no-connect. To make these changes you can either inspect and modify the traces on the PCB, or bend the 3 pins outward so they don't engage the IC socket then solder a jumper on 36.
Have fun and keep us posted,
Jeff
Briefly, to replace a vintage 6522 with a modern chip from WDC you want W65C22N, not W65C22S. The S version is updated (and arguably improved) by making the /IRQ pin a normal, totem-pole output, but for backward compatibility you want an Open Drain output as featured on the N version.
Re the WDC CPU, be aware that pin 36 (BE) needs to be pulled high and pins 1 and 5 (which are now outputs) must be no-connect. To make these changes you can either inspect and modify the traces on the PCB, or bend the 3 pins outward so they don't engage the IC socket then solder a jumper on 36.
Have fun and keep us posted,
Jeff
Upon inspection I discovered the 2114 SRAM was soldered to the board but the main MOS Technology parts were indeed pulled (and that was they way it was sold.)
I ordered two W65C22N6TPG-14 and one W65C02S6TPG-14 from Mouser Electronics. I found that Mouser had the N part from a Lemon forum post.
-
energysteven
- Posts: 6
- Joined: 10 Jun 2020
Re: Arduino Mega for 6502 Bus Emulation
BigEd wrote:
energysteven wrote:
I joined the forum as I am currently working on a project to set up an Arduino Mega for bus emulation with a 65C02 based system.
...
The purpose of the Arduino Mega is to emulate ROM/RAM resources. There at least three other projects where the Mega is used as either a ROM/RAM emulator or as a Processor emulator so I am not reinventing the wheel.
...
The purpose of the Arduino Mega is to emulate ROM/RAM resources. There at least three other projects where the Mega is used as either a ROM/RAM emulator or as a Processor emulator so I am not reinventing the wheel.
To add to Jeff's points...
I think perhaps a major question is where the clock comes from. If the clock is free running and full speed and comes from the existing system, there are some hard real-time constraints on responding to the bus. But you mention CMOS and the ability to single step, so it may be that the microcontroller in your case controls the clock, which makes for an easier set of timing problems.
Another fairly major question is about which devices get to control the bus: does the CPU have a BE input that you can use, are there other devices (such as the VIC) which are relatively inflexible about bus accesses, and so on.
It might be handy to see a block diagram. It makes a difference, I think, as to whether you are putting the microcontroller into the CPU socket, or onto the cartridge port, or whether you have flying leads to various signals. Also whether you are able to disconnect any pins or connections on the existing board.
Should be a good adventure, and I hope you pursue it with lots of updates here.
I am proposing to feed it to the main board and then the CPU by jumping onto UE3 pin 13 which is normally tied to the UAB7 6560 pin 35. If I am off in the weeds, please advise.
Re: Arduino Mega for 6502 Bus Emulation
Sorry, I don't know the VIC-20 well enough to comment, but hopefully you've got a circuit diagram to refer to. You should probably be prepared to do some debugging, whatever you do, because most things don't work exactly right first time.
- floobydust
- Posts: 1394
- Joined: 05 Mar 2013
Re: Arduino Mega for 6502 Bus Emulation
I have 4 or 5 Vic-20 machines. My original from 1982 plus some others. All are working sans one, which is the short board with a pair of 6116 SRAM chips to replace most of the original 2114 memory chips used. It appears to have a bad 6560, which is also soldered in. The clock oscillator is running, but there's no clock output to drive the CPU.
However, I've completely socketed two of the machines and rechipped them with CMOS chips (sans the RAM, ROMs and the 6560 VIC chip). I've also used the WDC 65C22N in one of them and they work fine and run much cooler. I've also yanked 10 of the 2114 chips, plus the 74LS138 decoder and replaced with a single 8KB CMOS SRAM... lovely!
Here's the real problem... I've tried using a WDC W65C02S, along with the proper lift for pin 1, adding pull-up resistors for certain lines, etc. The machine boots to the Basic screen, then craters quickly. I didn't spend a ton of time trying to hunt it down. I even had some dialogue with Bill Mensch and he couldn't think of anything specific that would cause this either.
I've also found out (later) that the Vic-20 had some changes in logic on some later manufactured boards (the full size boards using all 2114 memory)... I have a mix of boards, so perhaps this might be workable with one of the other (boards). I've been using Rockwell R65C02 CPUs for my Vic-20 mods... which has worked out fine for some different projects. I've also used Atmel EEPROMs with adapters to replace the standard Kernel and Basic ROMs without issue.
Good luck getting them running.... lots of resources out here to help of course.
However, I've completely socketed two of the machines and rechipped them with CMOS chips (sans the RAM, ROMs and the 6560 VIC chip). I've also used the WDC 65C22N in one of them and they work fine and run much cooler. I've also yanked 10 of the 2114 chips, plus the 74LS138 decoder and replaced with a single 8KB CMOS SRAM... lovely!
Here's the real problem... I've tried using a WDC W65C02S, along with the proper lift for pin 1, adding pull-up resistors for certain lines, etc. The machine boots to the Basic screen, then craters quickly. I didn't spend a ton of time trying to hunt it down. I even had some dialogue with Bill Mensch and he couldn't think of anything specific that would cause this either.
I've also found out (later) that the Vic-20 had some changes in logic on some later manufactured boards (the full size boards using all 2114 memory)... I have a mix of boards, so perhaps this might be workable with one of the other (boards). I've been using Rockwell R65C02 CPUs for my Vic-20 mods... which has worked out fine for some different projects. I've also used Atmel EEPROMs with adapters to replace the standard Kernel and Basic ROMs without issue.
Good luck getting them running.... lots of resources out here to help of course.
Regards, KM
https://github.com/floobydust
https://github.com/floobydust
-
energysteven
- Posts: 6
- Joined: 10 Jun 2020
Re: Arduino Mega for 6502 Bus Emulation
floobydust wrote:
I have 4 or 5 Vic-20 machines. My original from 1982 plus some others. All are working sans one, which is the short board with a pair of 6116 SRAM chips to replace most of the original 2114 memory chips used. It appears to have a bad 6560, which is also soldered in. The clock oscillator is running, but there's no clock output to drive the CPU.
However, I've completely socketed two of the machines and rechipped them with CMOS chips (sans the RAM, ROMs and the 6560 VIC chip). I've also used the WDC 65C22N in one of them and they work fine and run much cooler. I've also yanked 10 of the 2114 chips, plus the 74LS138 decoder and replaced with a single 8KB CMOS SRAM... lovely!
Here's the real problem... I've tried using a WDC W65C02S, along with the proper lift for pin 1, adding pull-up resistors for certain lines, etc. The machine boots to the Basic screen, then craters quickly. I didn't spend a ton of time trying to hunt it down. I even had some dialogue with Bill Mensch and he couldn't think of anything specific that would cause this either.
I've also found out (later) that the Vic-20 had some changes in logic on some later manufactured boards (the full size boards using all 2114 memory)... I have a mix of boards, so perhaps this might be workable with one of the other (boards). I've been using Rockwell R65C02 CPUs for my Vic-20 mods... which has worked out fine for some different projects. I've also used Atmel EEPROMs with adapters to replace the standard Kernel and Basic ROMs without issue.
Good luck getting them running.... lots of resources out here to help of course.
However, I've completely socketed two of the machines and rechipped them with CMOS chips (sans the RAM, ROMs and the 6560 VIC chip). I've also used the WDC 65C22N in one of them and they work fine and run much cooler. I've also yanked 10 of the 2114 chips, plus the 74LS138 decoder and replaced with a single 8KB CMOS SRAM... lovely!
Here's the real problem... I've tried using a WDC W65C02S, along with the proper lift for pin 1, adding pull-up resistors for certain lines, etc. The machine boots to the Basic screen, then craters quickly. I didn't spend a ton of time trying to hunt it down. I even had some dialogue with Bill Mensch and he couldn't think of anything specific that would cause this either.
I've also found out (later) that the Vic-20 had some changes in logic on some later manufactured boards (the full size boards using all 2114 memory)... I have a mix of boards, so perhaps this might be workable with one of the other (boards). I've been using Rockwell R65C02 CPUs for my Vic-20 mods... which has worked out fine for some different projects. I've also used Atmel EEPROMs with adapters to replace the standard Kernel and Basic ROMs without issue.
Good luck getting them running.... lots of resources out here to help of course.
The boards I am using are marked 324002-01 rev E and 324002-01 rev F. The have the soldered in the 10 SRAM.
The parts missing upon receipt are:
1x 6502 / CPU
2x 6522 / VIA
1x MOS 6560 / VIC
1x MOS 901460-03 / Character ROM
1x MOS 901486-01 / BASIC ROM
1x MOS 901486-06 / KERNAL ROM
So I am putting in a new WDC 6502 and 6522 parts.
I did see where WDC 65C02 has reportedly choked on versions of BASIC.
My hope is I can avoid using the 9VAC and just supply and external P5Vdc with the CMOS and lack of 6560 seriously reducing the power budget.
-
energysteven
- Posts: 6
- Joined: 10 Jun 2020
Re: Arduino Mega for 6502 Bus Emulation
I have posted a picture of my test bed or hot mockup of a known working VIC-20 main board with only 65C02 and 65C22 populated.
It includes the other items I am using to support my "experiment."
It is a Dorktronic Expansion Port Breakout that will plug into a solder-less breadboard.
(http://www.c64os.com/buyersguide/vic20e ... rtbreakout)
(Similar: https://www.tindie.com/products/syzygy_ ... out-board/)
A Ben Eater 65C02 Clock Module for slow clocking and stingle-stepping.
(https://hackaday.io/project/162955-yet- ... ock-module)
An external P5VDC Power Supply for the interfaces and the main board.
Finally the Arduino Mega "Bus Monitor" that will be wired similarly to how the Paul Swan "Arduino Mega Based In-Circuit Tester" is wired.
(http://www.zzzaccaria.com/arcade/ArduinoMegaICT.htm)
It includes the other items I am using to support my "experiment."
It is a Dorktronic Expansion Port Breakout that will plug into a solder-less breadboard.
(http://www.c64os.com/buyersguide/vic20e ... rtbreakout)
(Similar: https://www.tindie.com/products/syzygy_ ... out-board/)
A Ben Eater 65C02 Clock Module for slow clocking and stingle-stepping.
(https://hackaday.io/project/162955-yet- ... ock-module)
An external P5VDC Power Supply for the interfaces and the main board.
Finally the Arduino Mega "Bus Monitor" that will be wired similarly to how the Paul Swan "Arduino Mega Based In-Circuit Tester" is wired.
(http://www.zzzaccaria.com/arcade/ArduinoMegaICT.htm)