Older entries are here
The Zok board is a simple test board for atmega644 (and similar atmel avr form factor) chips; good for small projects or as a breakout board, it can be minimally populated (just the avr chip and a couple capacitors) to work, or can have optional buttons, LEDs, crystal, etc put on. It has a toggle button, can take power in and out via header pins, and has space for an FTDI FT232RL chip .. which can allow a host PC/brick to supply power and/or serial over USB.
I hadn't actually tested the USB side of that pcb yet (didn't need it!), as the board was mostly being used for hacking around with robot cars and so forth.
(FWIW, if anyone wants a Zok, let me know, I can sell you a pcb and a few passives to go with it.)
But, I'm back on the Zikzak trail and waffling between making a full rev 4 pcb (with all the jacks, an audio amp, and more) on the main PCB (essentially a full pcb rework) or just make a shield that plops onto the existing rev3 pcb. A shield being just another pcb, that you use extra long headers on and just sandwich it onto the other pcb, offering the peripheral jacks and audio amp and so forth on _that_, without changing the host pcb. Much easier routing job, maybe much cheaper to do…
The core exercise for both options though, is to get the CAD objects put together; as I've ranted about before, CAD libraries are nightmarish things and everyone has to eventually just draft their own parts (schematic symbol, and the physical representation for pcb, and the mapping between.) Making both of those sides to each object is a lot of work.. the schematic is easier, as it needn't be precisely laid out, but requires you to have the correct datasheet or reverse engineering going on. The physical representation requires very precise measuring, so you can define where solder pads will be needed, where to drill holes, etc, and it has to be perfect. I find this part creation for libraries to be a huge de-motivator. Still..
.. so now I've gone and put together parts for all the extra peripherals the ZZ r4 or r3-shield needed; a POT wheel for volume control on the amp; joystick jack; VGA jack; barrel power jack; headphone jack; USB jacks; PS/2 keyboard jack; SD slot; etc and so on. I've got about 20 or so of each part in baggies, so can actually make a few boards as well.
Before committing to a shield design, it'd be wise to test out a few things; the amp circuit has already been tested. The FTDI USB for power and serial.. that needs testing and hence why the Zok pcb has been busted out. Fortunately, it works like a champ, so I can just clone the circuit from the Zok schematic over to the ZZ r4 or rr3-shield projects, and away we go.
So, part libraries.. down. FTDI USB test .. down.
Time to finalize the goal for the shield, and get that schematic laid out, and then the pcb layout, then print to paper to verify against a ZZ r3 pcb, and send to the boardhouse for etching … fun stuff!
Assuming I go down the shield route, it'll break out most of the features the ZZ r3 already offers, but more conveniently; keyboard, SD, etc will all be on there, and maybe link over the i2c and SPI headers and so on. The end goal is .. given an r3 pcb, and clip on the shield to top or bottom of it, it'll be able to run with just a USB cable from a computer or wall wort. Add on a VGA monitor, or speakers, or keyboard, or cart, or SD or whatever you want, and it can do useful (?!) work. No more piles of jumpers or external power pcb needed.. just nice and clean, like a raspberry pi or other modern board. Plug and play!
On 3d printing and cases..
It has been too long since I updated this blog space - about 10 months or so; i actuality, the last zikzak hackery was probably 6 or 8 months back, as I started to think about making a case for it, which led me back to the idea of a 3d printer .. and to buy one, or make one from scratch? I ended up tooling around with designing my own CNC machine (cutter) and combine it with a 3d printer (additive) - they're really the same machine design more or less, where you cut with one and draw with the other, but the same x-y-z machine, right? Well turns out with CNC you make waste, and little bits of wood or metal are flying off all over the place so you need a vacuum and a shield, and its noisey as all hell. Awesome to be sure, but just not as useful for me, right now. Also, its a lot more stress on the machine to do CNC (lateral grinding) than to just draw out a bead of plastic. Of course, drawing plastic is a whole world of pain too – thermal control is a nightmare, to heat and cool at just the right spots (cool on top, so molten plastic doesn't spooge out of your assembly; hot inside, so it flows; cool again, so that it doesn't melt all over the place and puddle, when you want it to stick; then heat underneath, so it doesn't cool _too quickly_ … ugggh). In the end, I built a incrementally better and better 3d printer, and then started merging in pieces from kits since I got less interested in designing my own printer to actually wanting it to be productive… so now I've got a beast half frankenstein thing of mine, with some really nice kit parts to make it work. So there, that was last winters project :) Then summer came.. and well, with a 3d printer, and summer, what things can you do … so I designed and flew a tricopter and quadcopter. Designed and fly RC machines is really tricky stuff.. but success! I suck as a pilot, but the blasted things work.
Did I end up with a case for zikzak? Well .. no. Not yet. But I've got a 3d printer, and learnt enough CAD that I could.. and thats a whole other exercise; the zikzak sbc rev3 pcb is a pretty nice board, but all the jacks on it are just header pins .. I figured at the time, just mount jacks on a case, and run the jumper wires to the header pins.. good to go right? Jacks take up a lot of space, and the pcb is already pretty darned tight, and you pay for every mm of size on there. Well, in practice, screwing metal jacks onto a printed plastic case is asking for cracks when those jacks are used (especially cartridge ports with a lot of stress around them.) The jacks should really be on the PCB, where you can screw them down and have a lot of solder, so they're good and sturdy, and no janky jumper wires to get loose.
There were a couple changes to make rev3 .. the audio chip just did not seem happy on the main system bus; all the signals are good, just the chip can't seem to get the data bus values. I suspect the waitstates are just not long enough for the old chip - a 1983 chip working with somethign 20 years its junior. Being sick of making costly revisions I've tied the eZ80 spare GPIO to the data bus on the audio chip, and now all is well.. excepting that GPIO is nolonger spare when the audio chipselect is active. A real shame not having a completely spare GPIO, but on the off chance it gets needed.. add some chipselect handling in your GPIO consumer, or don't drive audio at the same time :) (Or use the joystick GPIOs, or I2C, or SPI, or the cartridge expansion slot or stm32 spare GPIO or… lots of options. Anyway.)
I've also added the option to go to 512K RAM chip (128KB, 256KB and 512KB supported now – same pinout more or less); there are some extra pads added for setting a few choices or even adding a USB bus.
But all told, I think this is a 'good' gate; I've not tested everything (need to write a keyboard protocol driver to really test that, and make sure the full colour DAC still working), but none of that has changed in some revisions.
So. what is next?
Lots of roads to go down in the software side – making an actual cart game or two? getting BASIC interpreter working? formalizing the BIOS and memory map? Adding a SD card reader shield? A larger actual cart .. maybe an EPROM instead of EEPROM (seems they're getting harder to get..)
Some sick ideas are .. now that 512KB of RAM is in place, could perhaps port over uclinux; imagine a Linux cartridge for a Z80 system? Minds blown!
Or NuttX port..
Whose to say?
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.)