I rise from the dead, and this time with a project that made it further than concept!
For a while now i have wanted to make a Z80 based game console, and it went through several iterations each with different features and form factors. I have ended up with this little guy:
Attachment:
20210419_225207.jpg [ 4.78 MiB | Viewed 1886 times ]
This was the first iteration of my console, all the other fancier ones never actually worked. So i went back to this original one since it actually runs code and works "properly." I put that in quotes because there are still a few bugs to work out and to finish the operating system.
Specs and features are as follows:
Z80 CPU at 8 MHZ (although the chip is rated for 10 MHz, i only had 8 MHz oscillators)
32KB SRAM
32KB ROM
Graphics, Sound, and IO handled by an ATMEGA1284
Monochrome Composite video at 120 x 96
Mono sound
Games ran from SPI cartridges
Controllers use UART (this mean controler ports can be used for general serial comms as well)
Now some of you may think there will be problems with trusting graphics, IO, and sound all to one AVR microcontroller, and you are right to think so. Back when i first designed this board i thought it would be fine. Now that i'm working on it again I want to go back in time and slap myself for thinking this was a good idea.
The main problem is there is sever bus timing issues when the Z80 needs to read from or write to the AVR. It takes an entire 2 milliseconds per transfer, and that's because i have to put in a 2 ms delay or else the AVR doesn't actually read the data bus. I blame this to shoddy bus handling code, and i will have to redo it with inline ASM and interrupts so the AVR can service the Z80 as fast as possible without dropping data.
Another issue that hasn't shown yet but i'm sure will once i finish all features, is the speed of the AVR. Handling graphics calculations, Sound calculations, and handling IO will surely put a strain on the AVR core, which means i will have to optimise the hell out of my AVR code. I may even have to rewrite the entire thing in assembly if i can't get C to work well. Next console I will offload at least the graphics to an FPGA or CPLD with a custom core to give whatever microcontroller i use for support a break.
As for the operating system, it will be very basic. It will have a simple ROM monitor, will load games and programs from the cartridge port, load programs into RAM from one of the serial ports, and flash cartridges with programs from serial or stored in RAM. The ROM monitor isn't functional yet, but i have successfully gotten some characters on the screen:
Attachment:
20210419_222706.jpg [ 1.49 MiB | Viewed 1886 times ]
I hope to post an update to this project once i tackle those bus timing issues and get some simple programs running!