6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 10:27 pm

All times are UTC




Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
PostPosted: Sun May 01, 2022 8:46 am 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
This is what I did in my ARM2 project - on reset, the CPU is held in reset state while a counter ticks up driving the address bus, and ROM is copied to RAM. Then after that the CPU is let out of reset and runs from RAM only.

It's essentially a DMA operation, and it's very fast (one copy per clock cycle). The overall complexity on a 6502 would be something like a pair of flipflops, an 8-bit counter or two, and maybe a tiny bit of glue logic - I showed a possible circuit diagram for that cut-down version here: https://youtu.be/gA_D3plgqgI

Edit: adding a black and white copy here, sorry for the quality as I only have a low resolution snapshot now.

Attachment:
File comment: Schematic for 6502 memory preloading circuit
sch-6502-bw.png
sch-6502-bw.png [ 47 KiB | Viewed 446 times ]


Top
 Profile  
Reply with quote  
PostPosted: Sun May 01, 2022 1:45 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1121
Location: Albuquerque NM USA
tokafondo wrote:
My two cents about what would be the contents of a small ROM that would be copied to RAM before booting is a small bootloader that would load the rest of the code from a storage device to a fixed location and then jump there. That way the use would not need to update the ROM itself but the contents of the storage device.

Instead of 65C51 as ZG6502 I/O device, a 65C22 may be a better choice. This way it can be configured to interface to compact flash or SD disk and load & run more sophisticated software. 65C22 is also a more versatile I/O that can even do serial I/O in bit-banging fashion. I believe zero-glue logic approach is still possible with 65C22.
Bill


Top
 Profile  
Reply with quote  
PostPosted: Sun May 01, 2022 6:59 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1043
Location: near Heidelberg, Germany
Sorry, but I'm not sure I got how the Zero-Glue 6502 works....

On Reset I understand that the ROM is always active, in all the 64k, while RAM is active in the low 32k.
So, I can read without bus contention in the ROM area, but when I write to the RAM area, the CPU will have bus contention with the ROM output, doesn't it?

So, my guess is - and I've probably missed it in the discussion above - that the ROM in its lower 32k already contains a copy of the data that is copied to from the upper ROM area? Then CPU and ROM would output the same value, and not generate contention (depending on output voltages etc), right?

That also means that during this coexistence phase the lower 32k must not be read before it is written or otherwise the RAM and ROM outputs have bus contention, right?
After copying to the RAM, both RAM and ROM have the same value, and no contention occurs, right?

Very cool design!

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
PostPosted: Sun May 01, 2022 8:09 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1121
Location: Albuquerque NM USA
fachat wrote:
Sorry, but I'm not sure I got how the Zero-Glue 6502 works....

On Reset I understand that the ROM is always active, in all the 64k, while RAM is active in the low 32k.
So, I can read without bus contention in the ROM area, but when I write to the RAM area, the CPU will have bus contention with the ROM output, doesn't it?

So, my guess is - and I've probably missed it in the discussion above - that the ROM in its lower 32k already contains a copy of the data that is copied to from the upper ROM area? Then CPU and ROM would output the same value, and not generate contention (depending on output voltages etc), right?

That also means that during this coexistence phase the lower 32k must not be read before it is written or otherwise the RAM and ROM outputs have bus contention, right?
After copying to the RAM, both RAM and ROM have the same value, and no contention occurs, right?

Very cool design!

Yes you are exactly correct. So let me explain in my own words which should match what you've said.

The EPROM data is duplicated in upper 16K as well as 16K from $4000-$7FFF. RAM's active-high chip select is tied to 6502's clock so when EPROM is copying data from its upper 16K to RAM from $4000-$7FFF, the same data already existed in EPROM. So it is true that EPROM is always enabled and driving the data bus while reading and writing, the data it wrote to RAM in the range of $4000-$7FFF is exactly the same data as already existed in EPROM. Another word, for the write operation both 6502 and EPROM are driving the same data out to the bus so there are no contention. The RAM is disabled until high phase of the clock where 6502's RWB force RAM's output buffer in tri-state mode, so again there is no contention caused by RAM.

One the 16K copying operation is done, program jumps to RAM area where both RAM and EPROM are driving the bus but with the same data. The program spin for enough time for reset supervisor to timeout and disable EPROM at that point RAM is solely in charge of the bus.

Bill


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: