I have been thinking on making my own portable 6502 based system.This is the basic layout for it.
Specs: RAM 32K,ROM 16K, I/O 1-4 W65C22S
Peripherals:
DIOS Ultra: PS/2 keyboard,LCD 40X4, RS-232 terminal, I2C EEPROM
Power:
AC: Old PC power supply
DC: RC car battery 9.6 Volts 1600 milliamp OR 4 volt 5 amp lead acid battery (x3)
Memory Map:
0000-3FFF RAM 0
4000-7FFF RAM 1
8XX0-8XXF I/0 0
9XX0-9XXF I/0 1
AXX0-AXXF I/0 2
BXX0-BXXF I/0 3
C000-FFFF NVRAM
Notes:
W65C02s,W65C22s (I/O 0),NVSRAM 16k X 8, SRAM 16K X 8 (X2)
I/0 0, 6522: 6502 <-> DIOS interface <-> terminal
I plan on using a micro controller to handle the terminal I/O and ermanent storage.
I/0 1-3: Future expansion
Software: EhBASIC
From what I have seen it is best to use AC and ACT chip's for speed. I would like to have it run at 10mhz or more. I don't think that I will be having a problem designing a power supply. I may have some problems with the clock design but there are enough posts about that I should be able to work it out with some local help. I plan on doing switching so that I can use either the keyboard/LCD or rs-232 for the console. I have yet to deside on weither to use interupts or polling to get console input.
From what I have found it is hard if not Imposable to get 16kx8 sram.
Which would be the most effective way of dealing with this:
1. Use half of 3 32kx8 chips
2. Use a bunch of 8kX8 chips
3. Use 2 32kX8 Chips and a OR gate.
or is there a better option?
What is the slowest RAM/NVSRAM I could use and still be able to meet the timing requirements for 10mhz?
Idea for 6502 system
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
AFAIK, 16Kx8 SRAMs have never been made. My current workbench computer uses half a 32Kx8.
Remember that the 6502 basically does a complete read or write in half a clock, or 50ns @ 10MHz, and some of that time will be taken by set-up time and glue logic propagation delay. Your RAM should be 35ns or faster, which is getting easy to find. (E)EPROM and probably even NVRAM OTOH is not easy to find in those speeds; but if it's read-only as far as the 6502 system is concerned, you don't need to gate it with phase 2, so that buys you some time. 55ns may be borderline fast enough for consistent operation. One way to get around the problem of slow boot-up memory is to start at a slower clock speed and have the compuer copy the boot-up non-volatile memory to faster SRAM before kicking the speed up.
It is normal for those new to the particular field to go overboard with address-decoding logic and make it too complex and end up with horrendous propagation delays. You can get all the memory you want and even lots more I/O with an address-decoding scheme like the one in the middle of the address-decoding page of the 6502 primer. Actually the whole thing could be done with a single 74ACT00. I have 32K of ROM and 16K of RAM, but with a small change in the circuit you can get 32K of RAM and 16K of ROM just as simply. Note that the I/O addresses will not end up on evenly spaced boundaries. (See the workbench computer page.)
One idea for my next one (if I ever get around to building it) is to have 65,280 bytes of 10ns RAM, only 256 bytes for I/O space, and no ROM in the actual memory map. The OS will have to be loaded into the fast SRAM before the main processor comes out of reset. With a couple of tricks, the address-decoding scheme is almost as simple and fast as the single-74ACT00 method above.
One of the 6502's greatest strengths is in interrupt performance. I take advantage of that and run a lot of things on interrupts. Your RS-232 port should be run this way. See my interrupts primer.
The PC keyboard interface is almost the same thing as I²C, so you can double up, making the I²C port available when the PC keyboard is not being used.
Remember that the 6502 basically does a complete read or write in half a clock, or 50ns @ 10MHz, and some of that time will be taken by set-up time and glue logic propagation delay. Your RAM should be 35ns or faster, which is getting easy to find. (E)EPROM and probably even NVRAM OTOH is not easy to find in those speeds; but if it's read-only as far as the 6502 system is concerned, you don't need to gate it with phase 2, so that buys you some time. 55ns may be borderline fast enough for consistent operation. One way to get around the problem of slow boot-up memory is to start at a slower clock speed and have the compuer copy the boot-up non-volatile memory to faster SRAM before kicking the speed up.
It is normal for those new to the particular field to go overboard with address-decoding logic and make it too complex and end up with horrendous propagation delays. You can get all the memory you want and even lots more I/O with an address-decoding scheme like the one in the middle of the address-decoding page of the 6502 primer. Actually the whole thing could be done with a single 74ACT00. I have 32K of ROM and 16K of RAM, but with a small change in the circuit you can get 32K of RAM and 16K of ROM just as simply. Note that the I/O addresses will not end up on evenly spaced boundaries. (See the workbench computer page.)
One idea for my next one (if I ever get around to building it) is to have 65,280 bytes of 10ns RAM, only 256 bytes for I/O space, and no ROM in the actual memory map. The OS will have to be loaded into the fast SRAM before the main processor comes out of reset. With a couple of tricks, the address-decoding scheme is almost as simple and fast as the single-74ACT00 method above.
One of the 6502's greatest strengths is in interrupt performance. I take advantage of that and run a lot of things on interrupts. Your RS-232 port should be run this way. See my interrupts primer.
The PC keyboard interface is almost the same thing as I²C, so you can double up, making the I²C port available when the PC keyboard is not being used.
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?
Idea for 6502 system
It took me 20 mins of stairing at you address decoding diagram to figure out what you were doing in it. I always thought of alocating addresses for I/O in terms of blocks of memory that needed to be access individually. When I first saw:
the first thing to come to mind was "What about r/ws to XX11 XXXX?" 20 mins later I relized "If you program right it never happen!"
I am going to try to adapt my idea around that set up.
As for the memory I was orginally planning on using the microcontroller to load data into the upper memmory from the I2C EEPROM. I would just need to get ahold of a couple of PCF8574's to do it.
Is there anything else I need to keep an eye on like distances from the CPU to RAM, ROM and IO?
On a side note isn't there a simple circuit that can be used to make a battery backup for normal SRAM?
Quote:
a13->cs1 of via1
a12->cs1 of via2
a12->cs1 of via2
I am going to try to adapt my idea around that set up.
As for the memory I was orginally planning on using the microcontroller to load data into the upper memmory from the I2C EEPROM. I would just need to get ahold of a couple of PCF8574's to do it.
Is there anything else I need to keep an eye on like distances from the CPU to RAM, ROM and IO?
On a side note isn't there a simple circuit that can be used to make a battery backup for normal SRAM?
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Quote:
the first thing to come to mind was, "What about R/Ws to XX11 XXXX?" 20 mins later I realized, "If you program right, it will never happen!"
Quote:
Is there anything else I need to keep an eye on like distances from the CPU to RAM, ROM and IO?
Be sure to bring phase 2 into the RAM select but not into the VIA selects. The address lines are not guaranteed to be valid and stable before R/W\ goes down, so writing to a wrong RAM address during phase 1 is quite possible if the RAM is selected and R/W\ is down. The VIAs OTOH will not work right if the CS pins are not valid before phase 2 rises.
Quote:
On a side note isn't there a simple circuit that can be used to make a battery backup for normal SRAM?
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?
Battery backup for normal SRAM
Hi Garth, now that we have attachments, would you be so good as to scan that article?
I found the text, but not the diagrams:
http://www.edn.com/design/other/4341478 ... OS-devices
"sprow" reckons a couple of diodes are enough: http://www.sprow.co.uk/bbc/hardware/epromemu.txt
Cheers
Ed
I found the text, but not the diagrams:
http://www.edn.com/design/other/4341478 ... OS-devices
"sprow" reckons a couple of diodes are enough: http://www.sprow.co.uk/bbc/hardware/epromemu.txt
Cheers
Ed
Re:
GARTHWILSON wrote:
One idea for my next one (if I ever get around to building it) is to have 65,280 bytes of 10ns RAM, only 256 bytes for I/O space, and no ROM in the actual memory map. The OS will have to be loaded into the fast SRAM before the main processor comes out of reset. With a couple of tricks, the address-decoding scheme is almost as simple and fast as the single-74ACT00 method above.
Apologies if I strayed off-topic.
Cheerful regards, Mike
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Battery backup for normal SRAM
BigEd wrote:
Hi Garth, now that we have attachments, would you be so good as to scan that article?
I found the text, but not the diagrams:
http://www.edn.com/design/other/4341478 ... OS-devices
I found the text, but not the diagrams:
http://www.edn.com/design/other/4341478 ... OS-devices
Here it is. I didn't have a scanner when I wrote the post above nearly ten years ago.
Quote:
Please let me know if you decide to do this. I may be able to help, based on some of my experience and research.
Thanks. What did you have in mind? Programmable logic? Things have changed in the last ten years, probably for all of us, and hopefully for the better. I wasn't exactly a 6502 beginner when I made my primary workbench computer in 1993, but I've learned a lot since then, thanks partly to the fine folks here. That computer has undergone quite a few improvements over the last 20+ years. For many of those years I was planning my next workbench computer to have more I/O (especially different expansion buses), more speed, more memory, etc., but as I gained experience with what I had on the workbench, I found ways to expand it, which breathed new life into it, and I began to see that the expansion buses and various things I thought I needed were not only unnecessary, but were getting so complex that I wouldn't live long enough to carry out my ideas. I'd still like to build another one, with an '816 and at least 4MB of RAM and pull a few tricks to see how fast I can get it to go. The push at the moment now is to do several new features for my website, some being major. At the moment, I temporarily have a second job, both jobs being enjoyable, and don't have enough time to do everything.
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?
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Battery backup for normal SRAM
GARTHWILSON wrote:
Here it is. I didn't have a scanner when I wrote the post above nearly ten years ago.
Darn. I just looked at Mouser, and found they no longer carry any of the NiCd batteries that used to be mounted on PC boards for memory back-up. Jameco shows one, but it's no longer available. There are other sizes, so if you want to use one of them, I'm sure we can help you find appropriate parts values for this circuit. Otherwise, it'll be a different chemistry, so we may need to modify the circuit, depending on the battery's data sheet. We can probably do that, too. I suppose it's mostly lithium-ion now, which doesn't have the memory effect that NiCd had, and probably also has a lower self-discharge rate.
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?