JGG 65C816 Single Board Computer
Posted: Wed Jul 29, 2020 1:07 pm
The objective:
------------------
A 65C816 based SBC, with built in VGA and keyboard interface, UART, and some sort of mass storage. I want it to be as self-contained as possible, meaning that it should be able to operate without being connected to a PC, and being able to write code for it on itself. That's the long term goal anyway.
Some "specifications":
-Regarding video, I just want it to be usable as a terminal and do rudimentary graphics. A screen resolution of 400 by 256 would result in 50 columns and 32 rows for text. That would result in 16 K of RAM for monochrome video. I could implement it with discrete IC's or using a CPLD. I want the video circuit to read off the system RAM directly.
-Keyboard, PS/2 interface using a couple of shift registers should do, could be integrated in the CPLD as well.
-UART: Either using a suitable IC or inside a CPLD if space left.
-Mass storage: Maybe an SD card with a rudimentary file system. This will come later.
-Memory: I may stick to 64 K address space, or have an extra 64 K of RAM in bank 1. I just want to build a "experimental" computer to play around with. I don't quite envision a use for large amounts of RAM.
I have quite a lot of things to figure out. I have also been fighting with the WDC software (and documentation) without much luck. I need to spend more time on it. I could try other assemblers, but having a simulator/debugger is certainly desirable. For initial development I can use the 6502 emulation mode anyway.
A possible prototype build:
-------------------------------
I have some 65C816's around (I have done the NOP test on a couple in a breadboard, they work, but not sure if they are legit as they came off eBay) , plus HM628128-ALP-7 128 KB 70 ns static RAMs and AT28C256 15PU EEPROMs.
I thought I could build a minimal prototype system, just to get used to the 65C816 and to try out some ideas.
Of most interest would be RAM accesses during phi 1 by the video card. My TTL 6502 computer's video card detects writes to a range of addresses and saves that same data to the internal RAM.
I intend the video circuitry on this system to read directly from system RAM, as the Apple II did. The easy way is, of course, to use dual ported RAM, but I'll try not to for the time being.
So the idea is to build a simple system, in order to get that working, sticking to 64 K. I don't have to build an entire video card, just the part that interfaces with the system RAM. As for I/O, it may suffice with some push-buttons and LEDs, or even a character LCD.
Clock speed would be 2.5 MHz (20 MHz pixel clock/8, for a screen resolution of 400 by 256, using 800 by 600 SVGA timing). Significantly lower than some of the projects around here, but the Apple II GS did run at 2.8 MHz, so it should be enough for my purposes. On the future version, with faster parts, one could go with 5 Mhz and have video access RAM every other cycle...
Below is a block diagram and timing diagram of what I'm thinking about.
RAM address would be selected from either the CPU or the Video circuit by a multiplexer driven by phi 1, while ROM address would be coming straight from the CPU in order to allow it some extra time to respond (it takes 150 ns from /CS to data valid, and 70 from /OE to data valid)
Driving /OE with phi 1 would ensure it does not output while the video circuit is accessing RAM.
Also, RAM's /WE is "forced" high during phi 1, regardless of RWB.
I surely have missed something, I'm just thinking out loud.
But
-------------
A lot of my design decisions are based on my parts bin. I don't want to build a more limited system just because I wan't to use those parts. So it may be better to design a final system, order some parts, then do a simple prototype towards designing a PCB or go to the PCB directly and expect to add bodge wires and what not.
If I decide to use a CPLD, I would have to find a suitable one and learn to use it. ATF15xx seem suitable as stated in several places on this forum. I'd have to acquire some, and needed programming cables and such. They are in-system-programmable by JTAG yet I don't know if I could use my TL86 programmer for that. It does support ATF16XX devices, which are maybe too limited. I don't mind purchasing Atmel's cable/adapter if I get some decent use out of their CPLDs.
Some random thoughts and ideas
---------------------------------
One could use the VPA and VDA pins in order to overlap ROM and a portion of RAM dedicated to video, say 16 K. As no code would be executed from that portion of RAM, we would be getting an extra 16 K. Not sure if it makes much sense on a 65C816 system, capable of addressing 16 MB, but if one sticks to 64 K it may be useful.
EEPROMs are more difficult to adquiere in faster speed grades, so if one wants to go faster there's the option of using a microcontroller/CPLD to copy code to RAM before start up. It occurred to me that one could put $EA on the data bus upon power up, and use the increasing addresses to copy contents of a ROM to RAM from $EAEA to $FFFF at a slower clock speed, then disable the ROM, and reset the CPU while switching to a faster clock.
I could use the 65C265 microcontroller as well, it has built in UART and other commodities. I don't mind if I'm limited to 5 or 8 MHz.
Conclusion:
------------------------
I didn't want to use a CPLD if I could avoid it, to keep things simple. But not using it would complicate matters and increase board size (I have to put a discrete VGA controller somewhere). And also it would give me more flexibility to modify things later on.
So I think I'm going towards something like Daryl's SBC-3.
Apologies for the long and messy post. It is just a brain-dump (looked it up, the expression actually exists...). I just want to get things going and writing it down helps a bit. Any suggestions are welcome.
Juan
------------------
A 65C816 based SBC, with built in VGA and keyboard interface, UART, and some sort of mass storage. I want it to be as self-contained as possible, meaning that it should be able to operate without being connected to a PC, and being able to write code for it on itself. That's the long term goal anyway.
Some "specifications":
-Regarding video, I just want it to be usable as a terminal and do rudimentary graphics. A screen resolution of 400 by 256 would result in 50 columns and 32 rows for text. That would result in 16 K of RAM for monochrome video. I could implement it with discrete IC's or using a CPLD. I want the video circuit to read off the system RAM directly.
-Keyboard, PS/2 interface using a couple of shift registers should do, could be integrated in the CPLD as well.
-UART: Either using a suitable IC or inside a CPLD if space left.
-Mass storage: Maybe an SD card with a rudimentary file system. This will come later.
-Memory: I may stick to 64 K address space, or have an extra 64 K of RAM in bank 1. I just want to build a "experimental" computer to play around with. I don't quite envision a use for large amounts of RAM.
I have quite a lot of things to figure out. I have also been fighting with the WDC software (and documentation) without much luck. I need to spend more time on it. I could try other assemblers, but having a simulator/debugger is certainly desirable. For initial development I can use the 6502 emulation mode anyway.
A possible prototype build:
-------------------------------
I have some 65C816's around (I have done the NOP test on a couple in a breadboard, they work, but not sure if they are legit as they came off eBay) , plus HM628128-ALP-7 128 KB 70 ns static RAMs and AT28C256 15PU EEPROMs.
I thought I could build a minimal prototype system, just to get used to the 65C816 and to try out some ideas.
Of most interest would be RAM accesses during phi 1 by the video card. My TTL 6502 computer's video card detects writes to a range of addresses and saves that same data to the internal RAM.
I intend the video circuitry on this system to read directly from system RAM, as the Apple II did. The easy way is, of course, to use dual ported RAM, but I'll try not to for the time being.
So the idea is to build a simple system, in order to get that working, sticking to 64 K. I don't have to build an entire video card, just the part that interfaces with the system RAM. As for I/O, it may suffice with some push-buttons and LEDs, or even a character LCD.
Clock speed would be 2.5 MHz (20 MHz pixel clock/8, for a screen resolution of 400 by 256, using 800 by 600 SVGA timing). Significantly lower than some of the projects around here, but the Apple II GS did run at 2.8 MHz, so it should be enough for my purposes. On the future version, with faster parts, one could go with 5 Mhz and have video access RAM every other cycle...
Below is a block diagram and timing diagram of what I'm thinking about.
RAM address would be selected from either the CPU or the Video circuit by a multiplexer driven by phi 1, while ROM address would be coming straight from the CPU in order to allow it some extra time to respond (it takes 150 ns from /CS to data valid, and 70 from /OE to data valid)
Driving /OE with phi 1 would ensure it does not output while the video circuit is accessing RAM.
Also, RAM's /WE is "forced" high during phi 1, regardless of RWB.
I surely have missed something, I'm just thinking out loud.
But
-------------
A lot of my design decisions are based on my parts bin. I don't want to build a more limited system just because I wan't to use those parts. So it may be better to design a final system, order some parts, then do a simple prototype towards designing a PCB or go to the PCB directly and expect to add bodge wires and what not.
If I decide to use a CPLD, I would have to find a suitable one and learn to use it. ATF15xx seem suitable as stated in several places on this forum. I'd have to acquire some, and needed programming cables and such. They are in-system-programmable by JTAG yet I don't know if I could use my TL86 programmer for that. It does support ATF16XX devices, which are maybe too limited. I don't mind purchasing Atmel's cable/adapter if I get some decent use out of their CPLDs.
Some random thoughts and ideas
---------------------------------
One could use the VPA and VDA pins in order to overlap ROM and a portion of RAM dedicated to video, say 16 K. As no code would be executed from that portion of RAM, we would be getting an extra 16 K. Not sure if it makes much sense on a 65C816 system, capable of addressing 16 MB, but if one sticks to 64 K it may be useful.
EEPROMs are more difficult to adquiere in faster speed grades, so if one wants to go faster there's the option of using a microcontroller/CPLD to copy code to RAM before start up. It occurred to me that one could put $EA on the data bus upon power up, and use the increasing addresses to copy contents of a ROM to RAM from $EAEA to $FFFF at a slower clock speed, then disable the ROM, and reset the CPU while switching to a faster clock.
I could use the 65C265 microcontroller as well, it has built in UART and other commodities. I don't mind if I'm limited to 5 or 8 MHz.
Conclusion:
------------------------
I didn't want to use a CPLD if I could avoid it, to keep things simple. But not using it would complicate matters and increase board size (I have to put a discrete VGA controller somewhere). And also it would give me more flexibility to modify things later on.
So I think I'm going towards something like Daryl's SBC-3.
Apologies for the long and messy post. It is just a brain-dump (looked it up, the expression actually exists...). I just want to get things going and writing it down helps a bit. Any suggestions are welcome.
Juan