My Mainboard Design
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA
I'm sorry to have interrupted the flow of your thread Karatorian, but...
This is a solid foundation I use on all my circuits now... Most memory devices today use a WE signal (a clue), whether active low or active high.
In the past, I've also used O2 with an address select signal. And while it does work for slower speeds, when you start to push CPU phase 2 speed limits, you will run into problems.
BigDumbDinosaur wrote:
...On the other hand, R/W should be qualified by Ø2 so a write only occurs while Ø2 is high...
In the past, I've also used O2 with an address select signal. And while it does work for slower speeds, when you start to push CPU phase 2 speed limits, you will run into problems.
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
GARTHWILSON wrote:
Quote:
On the other hand, R/W should be qualified by Ø2 so a write only occurs while Ø2 is high
x86? We ain't got no x86. We don't NEED no stinking x86!
-
Karatorian
- Posts: 17
- Joined: 13 Mar 2011
- Location: Rindge NH USA
- Contact:
GARTHWILSON wrote:
The SRAM's OE\, CS\, and WE\ inputs are just that, meaning active low, not active high. ... You'll need to change some logic.
The OR gates are supposed to function as negative logic AND gates. If the clock is low and A15 is low, /OE is low. Likewise, if the clock is low and /RW is low, /W is low. Unless I've made a mistake somewhere, it should work.
(I changed the RAM's pin names to /E, and /G, following the JEDEC standard, which prefers those names over /CE and /OE. However it seems that no one actually uses them, so perhaps I should change them back.)
GARTHWILSON wrote:
Although the 65816's Φ2 pin is an input, on the 6502 it's an output. Input must come through Φ0 on the 6502. It looks like you don't have any clock input.
BigDumbDinosaur wrote:
GARTHWILSON wrote:
The FRAM's enable circuit has an awful lot of gate delays. See if you can reduce it.
GARTHWILSON wrote:
just a note: Some I/O ICs like the 6522 require that the RS and CS lines be valid and stable before Φ2 rises; meaning you can't select them with a circuit that goes through your '138 which is enabled by Φ2.
BigDumbDinosaur wrote:
I've often said it, with some here disagreeing, but will reiterate. Device selection should not be qualified by Ø2. Doing so needlessly limits the maximum speed at which the circuit can run.
I originally had the '183 only enabled by the A15 line, but I changed it because it simplified the FRAM's select logic. I also like the idea that when one of the IO selectors (Yx on the '183, Px on the bus) goes low, the address lines are valid.
I guess it's a conflict between synchronous and asynchronous devices. Synchronous devices like the 6522 expect their select lines to be valid when clocked. On the other hand, asynchronous devices aren't clocked and (at least some) expect their address lines to be valid when they are selected.
It seems the consensus here is strongly against qualifying device selection with PHI2. In light of that, I suppose I ought to redesign the device selection. Making the '138 not qualified by PHI2 is easy enough. The problem is that the FRAM selection currently depends on the existing behavior.
GARTHWILSON wrote:
As to whether the RST\ line will be pulled down by the LED: That depends on the resistor value you choose for it. Even with no resistor at all, the LED will not pull the line down low enough to be a valid 0, but the MAX6804 may hardly be able to pull it up hard enough to get a valid 1 to let the processor run. (I have not looked up the current-- I'll let you do that.)
GARTHWILSON wrote:
For low operating speeds, the rise and fall times for most things are not very critical since they are level-sensitive.
GARTHWILSON wrote:
Having the oscillator's duty cycle at 50% is not necessary if you're well below the maximum operating speed anyway.
GARTHWILSON wrote:
For the connectors to another board, it would be good to have more grounds sprinkled in, or at least move the ground pins you do have to a quarter of the way in from the ends (ie, half way to the middle of the connector) so that the return path for any given signal is not so far from the signal pin.
BigDumbDinosaur wrote:
Perhaps you can take a cue from "narrow" SCSI. In that layout, every other line is a ground. Hence each signal is separated from the next by a ground, making for a stable, high performance bus that will easily run at 20 MHz.
BigDumbDinosaur wrote:
Lastly, and I'm sure Garth and others will agree with me on this, try not to let too much creeping featurism get into your first effort.
The write protection, which seemed like such a simple idea at first, is quickly becoming complicated and I might just scrap it. However, it does seem like it'd be a nice thing to have when developing my software.
The in-circuit programming stuff is a bit complex. I realized I needed some way to program the FRAM in the first place, so I started to design a programmer. While I was designing the bus, I realized that I could (with a few modifications) just as easily hook the programmer up to the bus as a socket (I'm planning on doing both now). However, to do that, it'd need to override the clock. Luckily the can oscillators I'm planning on using have an enable line, so it's not that complicated to do so. The /REST line was just gravy, but easy to do with the right reset controller.
Perhaps I am going overboard. What do you think?
@loop: lda (src),y — sta (dst),y — iny — bne @loop — inc src+1 — inc dst+1 — dex — bne @loop
Karatorian wrote:
It seems the consensus here is strongly against qualifying device selection with PHI2.
My feeling is that I've seen conversations but I haven't seen a tutorial explaining the various types of devices and the tradeoffs being dealt with by each approach - but I know that it takes a lot of effort to put such a thing together, and I have no right to expect anyone to do it.
-
Karatorian
- Posts: 17
- Joined: 13 Mar 2011
- Location: Rindge NH USA
- Contact:
BigEd wrote:
I don't want to be controversial, but I'm not sure this is true. Garth has a specific point about 6522, and BDD has a general rule which he acknowledges isn't used by everyone.
Quote:
My feeling is that I've seen conversations but I haven't seen a tutorial explaining the various types of devices and the tradeoffs being dealt with by each approach - but I know that it takes a lot of effort to put such a thing together, and I have no right to expect anyone to do it.
Ok, as promised, here's the FRAM's select logic:
6502.org wrote:
Image no longer available: http://static.karatorian.org/hardware/fram-decode.png
The jumpers are to enable or disable write protection for the two separate pages. The original version without separate write protection for the two banks has the same number of gate delays, but is arranged a little bit differently.
I'll try to think about how I can improve this myself, but I'd appreciate any suggestions you may have. Keep in mind that if I don't qualify device IO with PHI2, then I'll have to add it to the FRAM specifically.
@loop: lda (src),y — sta (dst),y — iny — bne @loop — inc src+1 — inc dst+1 — dex — bne @loop
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Quote:
The OR gates are supposed to function as negative logic AND gates. If the clock is low and A15 is low, /OE is low. Likewise, if the clock is low and /RW is low, /W is low. Unless I've made a mistake somewhere, it should work.
Quote:
(I changed the RAM's pin names to /E, and /G, following the JEDEC standard, which prefers those names over /CE and /OE. However it seems that no one actually uses them, so perhaps I should change them back.)
Quote:
The W65C02S's datasheet labels the clock pins PHI2, PHI2O, and PHI1O, with the PHI*O pins being the outputs. I'll double check, but I'm fairly sure that I've got the right pin. Perhaps I should change the label to PHI0...
On the Φ2 qualification, try to do it later in the glue logic, so there aren't so many gate delays between Φ2 and the device you're enabling. Also, instead of bring Φ2 into everything, bring it in only for things that need it. I don't know if the 6522 is particularly synchronous like you're saying, because the time it needs for the RS and CS lines to be valid before Φ2 rises suggests it needs time to do something with them before Φ2 rises, not just a set-up time for latching. Models of the inside of the 6522 are not common like they are for the 6502 though.
Quote:
Quote:
As to whether the RST\ line will be pulled down by the LED: That depends on the resistor value you choose for it. Even with no resistor at all, the LED will not pull the line down low enough to be a valid 0, but the MAX6804 may hardly be able to pull it up hard enough to get a valid 1 to let the processor run. (I have not looked up the current-- I'll let you do that.)
Quote:
The reason I'm worried about the rise times is that if the input to a CMOS circuit spends too long between 0.8 and 2v, it leads to excessive current draw, which causes overheating and can damage the chip. The TI document I linked to earlier explains the details.
Quote:
Quote:
Lastly, and I'm sure Garth and others will agree with me on this, try not to let too much creeping featurism get into your first effort.
Also, plan to take advantage of the synchronous-serial ICs. There are thousands of them on the market, in SPI, I²C, Microwire, other 2- and 3-wire interfaces, even dumb shift registers like the 74xx165 and '595. Besides not loading the processor's buses, these have a big advantage in ease of construction because there are so few lines to connect, and without so many pins, they take a lot less board space too. Daryl (8BIT here on the forum) sells a 65SPI IC which works like a standard 65-family I/O IC with an SPI port for good speed. The 74xx164 and '595 can be connected directly to the 6522's synchronous-serial port. But even without those, you can bit-bang these interfaces very easily-- far faster and more easily than trying to bit-bang an RS-232 port. You can even get a floating-point coprocessor with a serial interface for Pete's sake. Look into our 65SIB also, a very flexible, multi-purpose, multi-protocol, serial interface bus.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA
GARTHWILSON wrote:
... for various 74xx logic families in my National Semiconductor (now Fairchild) data books...
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Quote:
Now TI owns National Semiconductor as of a few days ago. Just FYI...
Edit: cleaned up the quotes as mentioned below /Edit
I'd say it depends. On a device that has its own Phi2 input, I'd not qualify the select lines for the reasons mentioned (although the only one I know is the 6522). Edit: For most RAM chips I would recommend you do qualify the select signal with phi2. /Edit
But my general advice is: always look into the datasheets of the chips you are using. You might have a seemingly asynchronous RAM, where you maybe don't want to qualify the select signal with Phi2, the internal operations may require stable address lines (e.g. row/col selection). Also you have to note that r/-w has the same timing constraints as the address lines. If by any chance r/-w is not stable enough before you assert the select signal, you may even generate a stray write.
So again my advice: look into the datasheets.
André
Karatorian wrote:
I guess it's a conflict between synchronous and asynchronous devices. Synchronous devices like the 6522 expect their select lines to be valid when clocked. On the other hand, asynchronous devices aren't clocked and (at least some) expect their address lines to be valid when they are selected.
It seems the consensus here is strongly against qualifying device selection with PHI2. In light of that, I suppose I ought to redesign the device selection. Making the '138 not qualified by PHI2 is easy enough. The problem is that the FRAM selection currently depends on the existing behavior.
It seems the consensus here is strongly against qualifying device selection with PHI2. In light of that, I suppose I ought to redesign the device selection. Making the '138 not qualified by PHI2 is easy enough. The problem is that the FRAM selection currently depends on the existing behavior.
But my general advice is: always look into the datasheets of the chips you are using. You might have a seemingly asynchronous RAM, where you maybe don't want to qualify the select signal with Phi2, the internal operations may require stable address lines (e.g. row/col selection). Also you have to note that r/-w has the same timing constraints as the address lines. If by any chance r/-w is not stable enough before you assert the select signal, you may even generate a stray write.
So again my advice: look into the datasheets.
André
Last edited by fachat on Thu Apr 14, 2011 7:15 am, edited 1 time in total.
fachat wrote:
If by any chance r/-w is not stable enough before you assert the select signal, you may even generate a stray write.
Something similar happened to me when I did a DRAM board. Phi1 was used for video refresh reads, Phi2 for CPU access. Only that R/-W was asserted too quickly at start of Phi2, while the actual read access wasn't completely finished due to the complex /RAS and /CAS generation delay - but the early R/-W sometimes converted the video read into a write access!
So again my advice: consult the datasheets
André
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
fachat wrote:
Karatorian wrote:
GARTHWILSON wrote:
I guess it's a conflict between synchronous and asynchronous devices. Synchronous devices like the 6522 expect their select lines to be valid when clocked. On the other hand, asynchronous devices aren't clocked and (at least some) expect their address lines to be valid when they are selected.
It seems the consensus here is strongly against qualifying device selection with PHI2. In light of that, I suppose I ought to redesign the device selection. Making the '138 not qualified by PHI2 is easy enough. The problem is that the FRAM selection currently depends on the existing behavior.
It seems the consensus here is strongly against qualifying device selection with PHI2. In light of that, I suppose I ought to redesign the device selection. Making the '138 not qualified by PHI2 is easy enough. The problem is that the FRAM selection currently depends on the existing behavior.
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
The only thing that I qualify with Ø2 in my POC unit is RWB (MPU output). If RWB is high it is used without qualification. If RWB is low, Ø2 must be high before the affected hardware "sees" that a write is in progress. This arrangement reliably functions at 15 MHz on my POC unit.
The theory behind this is that when the MPU is reading data, it doesn't actually sample D0-D7 until very late during Ø2 high (look at tDHR on the timing diagram). Therefore, any glitches on D0-D7 caused by a device responding to a chip select and address bus pattern occur well before the MPU goes looking for data.
Also, the MPU requires that D0-D7 stay valid for a short time after Ø2 goes low again. If you deselect your device when Ø2 goes low you may cause the MPU to get corrupted data, because you haven't met the data hold time.
On the other hand, write has to qualified by Ø2 because the address bus (and hence chip selects) does not become valid until midway through Ø2 low. D0-D7 become valid even later, and in the case of the 65C816, D0-D7 is really BA0-BA7 while Ø2 is low. Therefore, the affected device should be selected as soon as the address bus goes valid but not written until Ø2 goes high.
Note that 65xx family peripheral silicon like the 65C21, 65C22 and 65C51 are exceptions to the above "qualify writes with Ø2 high" rule. As they are synchronous to Ø2, they will not sample the data bus until Ø2 goes high, and will hold the data until shortly after Ø2 goes low again (again, see the timing diagrams).
As I earlier said, qualifying chip selects with Ø2 needlessly limits the maximum usable bus speed. I've never run into anything that can be connected to the 65xx bus (excepting the above peripheral devices) with a requirement that chip selects must be slaved to the clock.
The theory behind this is that when the MPU is reading data, it doesn't actually sample D0-D7 until very late during Ø2 high (look at tDHR on the timing diagram). Therefore, any glitches on D0-D7 caused by a device responding to a chip select and address bus pattern occur well before the MPU goes looking for data.
Also, the MPU requires that D0-D7 stay valid for a short time after Ø2 goes low again. If you deselect your device when Ø2 goes low you may cause the MPU to get corrupted data, because you haven't met the data hold time.
On the other hand, write has to qualified by Ø2 because the address bus (and hence chip selects) does not become valid until midway through Ø2 low. D0-D7 become valid even later, and in the case of the 65C816, D0-D7 is really BA0-BA7 while Ø2 is low. Therefore, the affected device should be selected as soon as the address bus goes valid but not written until Ø2 goes high.
Note that 65xx family peripheral silicon like the 65C21, 65C22 and 65C51 are exceptions to the above "qualify writes with Ø2 high" rule. As they are synchronous to Ø2, they will not sample the data bus until Ø2 goes high, and will hold the data until shortly after Ø2 goes low again (again, see the timing diagrams).
As I earlier said, qualifying chip selects with Ø2 needlessly limits the maximum usable bus speed. I've never run into anything that can be connected to the 65xx bus (excepting the above peripheral devices) with a requirement that chip selects must be slaved to the clock.
x86? We ain't got no x86. We don't NEED no stinking x86!
BigDumbDinosaur wrote:
The only thing that I qualify with Ø2 in my POC unit is RWB (MPU output). If RWB is high it is used without qualification. If RWB is low, Ø2 must be high before the affected hardware "sees" that a write is in progress. This arrangement reliably functions at 15 MHz on my POC unit.
I am also not sure if 65xx chips would handle that well either, I never tried, but I also did not check with the datasheets.
André