Dual port ram

Building your first 6502-based project? We'll help you get started here.
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Dual port ram

Post by BigEd »

(Ah, of course, yes, you have a need to share a slow peripheral too. So indeed, normally you'd generate both the fast and slow clocks from the same circuit, so you know the phase relationships and can switch or stretch. It's tricky to do this safely, but it's something which has often been done.)

It would be great to see a block diagram! A picture being worth a thousand words.
KhanTyranitar
Posts: 81
Joined: 21 Dec 2016

Re: Dual port ram

Post by KhanTyranitar »

I actually need to update my block diagram.

The final design will probably have either a CPLD or a FPGA, but I have no experience with those. The initial proof of concept (on protoboard) may end up using simple logic gates. But I need to have a good block diagram to lay that out.

It look like I've gotten a few good ideas from this discussion so far. I guess for me to go much further the rough logic diagram must be completed. That will take its own thread. In the mean time I think I'm pretty close to both confirming that the dual port RAM will in fact work and does in fact solve problems without introducing any new problems that aren't easily resolved.
I am working on building a 65816 based computer (for personal use)

Eventual goals include:
65816 CPU up to 14-16 MHz (In Turbo Mode)
up to 16MB RAM (512K on the main board)
Dual YM3438 audio
IEC serial device support
User avatar
KC9UDX
Posts: 246
Joined: 07 Dec 2013
Location: The Kettle Moraine

Re: Dual port ram

Post by KC9UDX »

It will be interesting to see if you run into problems using P6 and P7. I've seen examples of software that assumes the unused bits should be 1 and some that assumes they should be 0. But that situation may be as rare as using the unsupported opcodes.
KhanTyranitar
Posts: 81
Joined: 21 Dec 2016

Re: Dual port ram

Post by KhanTyranitar »

KC9UDX wrote:
It will be interesting to see if you run into problems using P6 and P7. I've seen examples of software that assumes the unused bits should be 1 and some that assumes they should be 0. But that situation may be as rare as using the unsupported opcodes.
Officially according to Commodore, just like any register where you change selected bits, you should OR or XOR to change only the ones you want and leave the others untouched. How many programmers follow this convention? I don't know. Obviously such software could cause unexpected behavior.

As far as unsupported opcodes, they are very common in the demo scene. But if something doesn't work, I won't run it. Or I'll have to try my hand at patching it. ;)
Last edited by KhanTyranitar on Wed Jan 18, 2017 8:25 pm, edited 2 times in total.
I am working on building a 65816 based computer (for personal use)

Eventual goals include:
65816 CPU up to 14-16 MHz (In Turbo Mode)
up to 16MB RAM (512K on the main board)
Dual YM3438 audio
IEC serial device support
KhanTyranitar
Posts: 81
Joined: 21 Dec 2016

Re: Dual port ram

Post by KhanTyranitar »

Related question. In an application where there is only 4 data lines (yeah, 4 bit) can I use an 8 bit chip? Will that represent a problem? I would assume that I only connect the 4 low byte lines.
My reason for asking is that apparently Commodore installed a 1k 4 bit RAM as the Color RAM in a C64. But in my design, assuming the 4bit limitation doesn't present a problem, can I use 8 bit RAM instead? Or is there a technical reason it won't work?
I am working on building a 65816 based computer (for personal use)

Eventual goals include:
65816 CPU up to 14-16 MHz (In Turbo Mode)
up to 16MB RAM (512K on the main board)
Dual YM3438 audio
IEC serial device support
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Dual port ram

Post by BigDumbDinosaur »

KhanTyranitar wrote:
Related question. In an application where there is only 4 data lines (yeah, 4 bit) can I use an 8 bit chip? Will that represent a problem? I would assume that I only connect the 4 low byte lines.
My reason for asking is that apparently Commodore installed a 1k 4 bit RAM as the Color RAM in a C64. But in my design, assuming the 4bit limitation doesn't present a problem, can I use 8 bit RAM instead? Or is there a technical reason it won't work?
You would connect the unused data bits to ground. You don't want them to be floating.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
KhanTyranitar
Posts: 81
Joined: 21 Dec 2016

Re: Dual port ram

Post by KhanTyranitar »

BigDumbDinosaur wrote:
KhanTyranitar wrote:
Related question. In an application where there is only 4 data lines (yeah, 4 bit) can I use an 8 bit chip? Will that represent a problem? I would assume that I only connect the 4 low byte lines.
My reason for asking is that apparently Commodore installed a 1k 4 bit RAM as the Color RAM in a C64. But in my design, assuming the 4bit limitation doesn't present a problem, can I use 8 bit RAM instead? Or is there a technical reason it won't work?
You would connect the unused data bits to ground. You don't want them to be floating.
Ok thanks.
I am working on building a 65816 based computer (for personal use)

Eventual goals include:
65816 CPU up to 14-16 MHz (In Turbo Mode)
up to 16MB RAM (512K on the main board)
Dual YM3438 audio
IEC serial device support
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Dual port ram

Post by BigEd »

Strictly it feels like you should connect through resistors, because they are bidirectional signals. Although in practice there might be no issue - the circuit writes zeros and reads them back. But it will eagerly be reading before any writes have been done.
Post Reply