Hi guys
I'm thinking of creating my first ROM emulator/copier and just want to run my rough plan of action passed some folks who have done it previously.
This is what I was thinking of doing:
* The entire memory map uses 64KB RAM - no ROM. Some space is reserved for I/O
* Use an uC (Atmel 328P or 324P) to control the clock source for PHI2
* Allow the uC to control the 65C02S using the /RESET line
* When the system starts up, the uC hold /RESET low and stop PHI2
* It then copies the 6502 firmware/BIOS into the upper part of RAM and set the Reset, NMI and IRQ vector addresses
* the 6502 /RESET is released and PHI2 is started
What do you think?
My main question: if the 65C02 /RESET is held low, is the address and data buses tri-stated by the 65C02?
ROM emulation/copier
- Oneironaut
- Posts: 734
- Joined: 25 May 2015
- Location: Gillies, Ontario, Canada
- Contact:
Re: ROM emulation/copier
I think that works perfectly up to 25MHz on a 65C02 with 10ns SRAM.
But that is only because I have it working that way right now!
Note: Using BE as per BDD's info below as well.
brad
But that is only because I have it working that way right now!
Note: Using BE as per BDD's info below as well.
brad
Last edited by Oneironaut on Fri Aug 28, 2015 5:29 pm, edited 1 time in total.
- BigDumbDinosaur
- Posts: 9426
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: ROM emulation/copier
banedon wrote:
I'm thinking of creating my first ROM emulator/copier and just want to run my rough plan of action passed some folks who have done it previously.
This is what I was thinking of doing:
* The entire memory map uses 64KB RAM - no ROM. Some space is reserved for I/O
* Use an uC (Atmel 328P or 324P) to control the clock source for PHI2
* Allow the uC to control the 65C02S using the /RESET line
* When the system starts up, the uC hold /RESET low and stop PHI2
* It then copies the 6502 firmware/BIOS into the upper part of RAM and set the Reset, NMI and IRQ vector addresses
* the 6502 /RESET is released and PHI2 is started
What do you think?
My main question: if the 65C02 /RESET is held low, is the address and data buses tri-stated by the 65C02?
This is what I was thinking of doing:
* The entire memory map uses 64KB RAM - no ROM. Some space is reserved for I/O
* Use an uC (Atmel 328P or 324P) to control the clock source for PHI2
* Allow the uC to control the 65C02S using the /RESET line
* When the system starts up, the uC hold /RESET low and stop PHI2
* It then copies the 6502 firmware/BIOS into the upper part of RAM and set the Reset, NMI and IRQ vector addresses
* the 6502 /RESET is released and PHI2 is started
What do you think?
My main question: if the 65C02 /RESET is held low, is the address and data buses tri-stated by the 65C02?
I'm not sure what the purpose would be of stopping Ø2 while loading your ROM image into RAM. Continuously holding reset down is sufficient halt the 65C02. Note that Ø2 must be running and stable before releasing reset.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: ROM emulation/copier
Thanks guys: That is very useful info. I'll let you know how it goes when I build it. In the mean time, if you have further thoughts please let me know. 
Re: ROM emulation/copier
OK. Doing some testing on my existing 65C02 system, when I send BE low the buses all go high-z as advertised by the datasheet. However, I cannot seem to get the CPU to resume unless I reset it.
Is this by design or does anyone know a way of getting the CPU to continue? I.e. can you use a arbitrator to pull BE low, thus pausing the 65C02 so that another uC/uP can drive the buses and then tell the 65C02 to resume. I thought driving BE high would do this, but it doesn't seem to.
[edit] I wonder if an NMI or IRQ would do it?
Is this by design or does anyone know a way of getting the CPU to continue? I.e. can you use a arbitrator to pull BE low, thus pausing the 65C02 so that another uC/uP can drive the buses and then tell the 65C02 to resume. I thought driving BE high would do this, but it doesn't seem to.
[edit] I wonder if an NMI or IRQ would do it?
Re: ROM emulation/copier
banedon wrote:
I.e. can you use a arbitrator to pull BE low, thus pausing the 65C02 [...]
Failing to pause the CPU when BE has gone low means any program presently running will crash (tristate buses mean no more instructions arriving from memory!). That's tolerable prior to initial reset, but otherwise might not agree with your plans.
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: ROM emulation/copier
So can you get away with asserting RDY followed by BE, do whatever, then send BE high and then RDY? However, I'm guessing this will still empty out what the 65C02 was doing so would still have the same issue?
So how on earth do you take control of the bus without getting possible contention and without having to reset? It must be do-able as I think this was done with the Commodore 128. Although that might have been with a modified 6510... not sure.
Or combine the above with detecting the next rising edge of PHI2 and then do it then?
So how on earth do you take control of the bus without getting possible contention and without having to reset? It must be do-able as I think this was done with the Commodore 128. Although that might have been with a modified 6510... not sure.
Or combine the above with detecting the next rising edge of PHI2 and then do it then?
- BigDumbDinosaur
- Posts: 9426
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: ROM emulation/copier
banedon wrote:
So can you get away with asserting RDY followed by BE, do whatever, then send BE high and then RDY? However, I'm guessing this will still empty out what the 65C02 was doing so would still have the same issue?
Last edited by BigDumbDinosaur on Sat Aug 29, 2015 7:37 pm, edited 1 time in total.
x86? We ain't got no x86. We don't NEED no stinking x86!
- BigDumbDinosaur
- Posts: 9426
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: ROM emulation/copier
Dr Jefyll wrote:
Sounds as if you're overestimating BE...Failing to pause the CPU when BE has gone low means any program presently running will crash (tristate buses mean no more instructions arriving from memory!).
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: ROM emulation/copier
Oh well. At least I should be able to do the ROM simulator/copy.
Re: ROM emulation/copier
(To avoid confusion, it might be worth avoiding this "asserting" word- half the time it's used incorrectly. For an active-high signal like RDY, assert means take it high. But generally we're interested in using RDY to stall the machine, which means we need to take it low, which is de-asserting it. For an active-low signal like NMI, it's asserted when it's brought low. As noted before, it would be more consistent and less surprising if RDY were called STALL and were an active low input. That would be exactly the same as it is now, with respect to logic levels, but would have us correctly saying that we assert STALL by bringing it low. More precisely, we'd call it \STALL or STALL* or STALLB.)