Older entries are here
See the revisions page for a few details about these guys; I will have to update the site here to make it a little cleaner .. maybe have the dev blog as the default page and stick About on the side, since the blog is the real meat of things anyway, right?
I've been fortunate that all the revisions have worked well; a few glitches are to be expected, but overall I've been very pleased!
The “SBC” is the single-board-computer model of zikzak; previous versions were multiboard to make them easier to build and test and design, and to afford the possible idea of stacking them up to make a little inexpensive cube; combining into a SBC form makes the pcb a little more expensive, but is much easier to work with.
Rev1 was the first stab at this integration, and broadly works; the audio was acting up however.. turns out the Pokey (PSG, AY-3-8910, AY-3-8912, YM2149 by other names) wasn't really well behaved on the bus .. so whenever trying to read from ROM or RAM, it was clobbering some of the values. With just audio chip it worked fine, and without audio worked fine.. but all of them together, and glitchy display etc.. blast! Most of my tests are in isolation, and I managed to not perform a combined audio+others test on the previous standalone component boards. Oops.
Rev2 was a quick modification to address that; time has been very tight, so just applied a change to AY-3-8913 from -8912 edition. Same chip, but with a few less pins; the -8910 base model has a lot of extra pins no one used - dual I/O ports that could be handy for CPUs to avoid building their own IO system; -8912 has a single IO port, saving a bunch of pins; -8913 has no IO ports, but does have a proper chipselect (just like a RAM or ROM has.) So -8913 shoudl be better behaved on the bus .. when not its turn to function, it should get out of the way. Well, turns out it was still janky a little – the eZ80 even with slow crystal is too fast, and the data bus is not holding long enough; the audio wouldn't sound, since as the opcodes step by the data bus in updating, and not enough wait states. If only the AY-3-891x had a WAIT pin to inform the CPU when it was done latching the values…
Rev3 will be another stab to try and correct the audio; I've popped out the -8913 chip and plugged into a breadboard; then jumper over the data lines from the eZ80 GPIO-B port to the audio data bus lines, and jumpered over the other regular bus control pins to breadboard - essentially just using GPIO to drive the databus, but leaving everything else the same. This works a treat .. playing music out of zikzak SBC just fine. I really hate to lose GPIO-B as an available port, so I'll just leave the breakout header for it on the SBC.. if you're not driving the audio chip at the same time, you can use GPIOB just fine. - as a bonus though, with just a little bit of free time, I'll rotate a couple of the headers around to make using them easier - why not add a RAM upgrade? Currently 128KB but very similar pinout to go to 256KB or 512KB, and still support all 3 - Maybe add a USB header in case we want to talk to a USB device without goofing around…
One interesting aspect of robotics hacking is the broad skillset required; building my own retro computer from scratch was a lot of work but mostly in digital electronics, CAD, protocols like VGA etc.. Working on a robot car implies mechanical, learning about control of motors and servos and cameras, analog electronics and high voltage and high amperage management. Discovering that when a motor jams its amperage doubles and melts your wiring is an eye opener!
One of the bigger challenges I've encountered and generally avoided is making cases and support structures.. You can hit ebay for a bag of capacitors cheap.. But struts or metal or plastic plates, no dice!
Well, it turns out you can buy 4' by 8' sheets of hdpe plastic for say $50cdn at local shops. The thin stuff is used in making pop bottles.. Its strong by weight and light; it doesn't splinter like glass or acrylic.. Instead it tears. You can cut it with a jigsaw or hacksaw or circular saw etc so its nice to work with.
I don't need 32 square feet of material but the plastic guys sell scraps cheap! I picked up some square foot pieces quarter inch and 3/8 inch thick.. Can get half dozen good pieces in multiple colors for a ten spot!
Awesome find.. Good for Bolting pcbs and motors and sensors and such to, for making little ramps.. Wood is stronger but when you want some shiny black plates for making multilevel floors to sandwhich components between this stuff seems ideal. Doesn't break when you toss a quarter inch thick piece straight into a wall either.
(My current little car needs a layer for motor driver and batteries, a layer for distance sensors and radio/wifi receivers, maybe some ultrasonic sensors.. And a little ceiling piece perhaps. Once 'done' could add walls around to afford it some protection and look better.)
The zik80 SBC (or zikzak single board computer) pcb revision arrived a little while ago; this is 'everything on one board', excepting power; my current power pcb is needing a full redesign (using the 7805 at near an amp of draw is ridiculous .. the down conversion of voltage and current bleeds off as heat, and that much current needs a heat sink the size of your fist.) The actual computer/console design itself is pretty solid - the features are where I want them, the pcb layout is pretty good (not perfect, but few things ever are), and the damned thing works :) (mostly.)
The GPU-only pcb went through 2 revisions; the CPU pcb was only 1; putting them together so far - just one revision, but one wart has shown through. Blast! Still, it is probably fixable with just a jumper wire ('bodge'), but I'll get thigns fully working with hacks before making another pcb revision.. the pcb is large enough (6“x4”) that is costs a bit to make, and the components add up a little.
What went right? - merging it all into one pcb has mostly succeeded! A big complex board, but gorgeous imho; the cpu-only and gpu-only previous pcbs will be great for general projects (which is why they're full of breakout headers) so I don't consider them 'lost' or purely as 'cost of research' .. they're great little project boards; anyway, the SBC board works - RAM works, ROM works, audio works, CPU↔GPU via RAM works; I've not tested ps/2 keyboard yet (I need to write a driver for eZ80 yet), but using USB→serial→ works to either/both CPU and GPU; I've got a nice full colour little text menu shown when no cart present, to do some debug tests and demos. I have every confidence 99% of the board works.
What went wrong? - turns out I've managed not to test graphics and sound _at the same time_ before; when the AY-3-891x PSG Pokey sound chip is not taking instructions, its screwing with my bus for some reason. Maybe theres a little bug in the design somewhere, or maybe that chip just does that. Or maybe the address range for the audio isn't set right and the chip select is going at the wrong time. Either way.. it should be fixable; I may have to slice the current trace on the pcb, and jumper from an unused high address pin (or from an unused GPIO, or i2c, or some spare pin), and use that as the one control pin to audio .. or maybe I blew the inverter or something. Will check datasheets later. –> for now.. pop the PSG out of the socket and the RAM bus works fine; pop i tin, and I have to use every other address. Will sort it out soon.
Whats awesome? - added a basic 8×8 pixel font, and can draw text or graphics onto the raw framebuffer, and the gpu shows it. Pretty amazing. See video on youtube!
What to change? - At full 60 frames per second, sending 64KB of framebuffer data each time, sure kills the bus (and by extension, the eZ80 CPU's available time.) I was thinking of sending a scenegraph of instructions over RAM instead - a script of things to do (“draw lines here; draw sprites here”), which would reduce memory bandwidth enormously, but be a little goofy.. and non-retro. So instead I think I'll work on a tilemap based solution instead.. with 8×8 tiles, you end up with 1KB needed in RAM for a full screen tilemap; add in some slots for 'sprite 1, goes to (x,y)', and you're essentially needing just over a KB of data for each frame .. instead of 64KB/frame. (You also push the compositing from the eZ80 over to the GPU, but the GPU is pretty quick so thats okay.) This is also retro - thats more or less how the C64 does it, or the SNES, etc. “More or less”, without getting into details.
So .. the pcb is 'nearly there', just one or two small little issues (blast!), but otherwise working very well. *Happy*
Real life does get in the way of projects sometimes! Anyway, the zikzak PCBs so far are working out very well - the cpu/base pcb ribbonned over to the gpu pcb, and with a eeprom cartridge plugged in.. all working exactly right. The power pcb's first stage is a 7805 which gets very hot at nearly 1A draw, before feeding into the TI chips to downvolt to 3.3 (which runs super cool, even over spec.) .. ultimately I think I need to cut over to switching voltage regulator instead of LDOs, so I do not have any heat problems. Using a giant heatsink on a little pcb is goofy :)
The PCB layouts are not ideal either .. the ribbon cables have to twist in a spaghetti-like fashion to marry up, which is slightly annoying – gets in the way of the reset buttons and is just too ugly for me.. very distracting. But alas, as these are not 'final solution' boards, that was okay.
A few options did present themselves in the way of workarounds .. make a tiny inexpensive little bridge pcb that acts in place of the ribbon cables, but the connectors are all over the GPU board and overly distant, making for a large mostly empty bridge pcb; best to pass; could redesign the boards so the connectors are the proper orientation and on closest-facing sides as Dobbs intended, but a redesign of the mini pcbs seems wasteful. Redesigning to make them stackable is pretty slick - the boards work great, and a redesign of the actual PCB routing would be hard work (a couple weeks effort), but be really nifty – redoing the power PCB at same time would be joyous - imagine a 3 stack of PCBs, with a cart stick out of one. Awesome. But all of these ideas merely distract from the original goal .. a single board computer, or SBC. Still, the options come to mind so I thought I'd share them.. and they came to mind because the Zikzak pcbs so far, using full size through hole components, are fairly challenging (ie: time consuming) to route. It would seem SMT chip designers (the eZ80 and STM32) love putting pins all over the place and not in continuous regions, so you end up routing a mess; what happened to the days when a bus would come straight out the side of a chip and go straight across a pcb, with all the daughter components leaching off in orderly fashion? Anyway, the SBC board is fairly complex (fair number of components, a lot of traces, and not a lot of space to work in.) I've upped the pcb size a little, which costs quite a bit more. (At my preferred boardhouse, a 4“ square PCB is 10 for $12 more or less; add an inch or two, and its $30+ for 5. Add shipping and it starts to hurt. First world problems :O)
Anyway, I've slogged through and submitted a first rev of the zik80 SBC edition.. a single board (plus the power board, so it can be updated without concern); rushed it a bit so its not as ideal or attractively laid out, but it should prove an excellent test to see if I've merged the schematics correctly (merging multiple smaller PCBs into one larger one); I've also optimized a little.. taken out a bunch of headers (some are duplicates when you merge boards, but some are no longer needed .. theoretically, the breakout headers for Address and Dada bus for example are not needed, since its all on one pcb; I've left some on for test headers, but you see where I'm going.) Also a few fixes .. better sizing on drill holes, needed pullups on the PS/2 keyboard section, stuff like that. I have high hopes it'll work as I've had good luck so far, but you never know; still, it should mostly work, if not fully work, I think .. will find out in a week or two!
As real life has been busy, the firmware side has not progressed at all; once the zik80 SBC has been tested basicly (add the eZ80 and STM32 and sockets for audio chip, RAM, etc), can get back to coding; I'd like to get a basic cartridge template going, and a basic .. not OS, but say 'monitor' and 'BIOS'/boot test. Some basic code to establish 'BIOS' subroutine vector table, some firmware to check for presence of cart and do one thing if found, another if not (ie: go to a monitor or BASIC, say, for lulz.) Would like to add some built-in cart flash code for example, so you can flash a cartridge via serial or USB, without needing dev tools or electronics experience.
Lots to do, and all very fun; but so far, so good!
The rev1 base pcb with eZ80 support arrived today and I was able to partially populate it .. get the decoupling caps on there, the pull up resistors, and some headers. Firing up the Windows ZDS II based tools, was able to connect, upload a basic program, step through it and do breakpoints, memory and register dumps… awesome stuff. (And yes, I do intend to either run it under Wine and use the network based programmer, or build my own programmer… or maybe do something with bus-pirate, etc. Lots of options, but least of which is running another machine with Windows on it, just as an uploader.. bleh.)
So given the eZ80 seems to be working nicely, that implies keyboard and joysticks are likely okay; the bus stuff needs testing, but I've a pretty high confidence that stuff will work .. not much prototyped, but reasonably hard to screw up. Unless I crossed traces in the pcb or schematic of course, which is entirely possible, but easily fixed. Theres a couple uncertainties yet.. such as when the 5V and 3V items are chattering, if the low/hi voltages work out just right or not.. those that, if its a problem, is probably sortable by proper choice of HC, HCT or LS ICs, and I've got most of those in my parts-drawer already, so good to go. No, the only real concern is that I blew the wiring.. so, in pretty good shape, and we'll find out in awhile once I get some of the testing code in place.
I am exceedingly pleased at this point .. all the parts of the zikzak are on the bench, right now, just waiting code code to bring them to life! Going to be a fun few weeks .. if only I had more free time!
Picture of the current trio of boards (cartridge is not pictured.) The boards aren't connected together or fully populated here, but they can each do their own thing standalone.
edit: And another picture, without the GPU board, but with a cartridge plugged in; note that the cartridge slot connector is supposed to be mounted vertically but due to a drill-hole-size error in my layout, it doesn't fit right.. so as a workaround to continue testing, I just soldered it on the side :)