Zikzak - crummiest 8bit console/computer ever .. but I'm making it!


I was figuring to put a speaker right on the board (why not? :) , but occurs to me.. maybe I should put a 1/8th inch jack instead, so that headphones or speakers could be used externally. Guess I'd need an audio amp circuit then too.

But I'll fiddle with speakers.. canm't wait for the PSGs to arrive, fiddle with audio :) Audio and VGA are my top fiddle priorities, so of course waiting on parts is taking for ever..

jeff
 
The project scope and grown and shrunk a few times, but at its heart.. yes, an 8bit machine.

The trouble is the VGA output; you'll note that in modern machines the GPU is often far more beefy than the CPU; theres somethign to be said for that in the older machines as well.. though they usually did say NTSC/PAL which is pretty easy to spit out (and most TVs do not support it anymore), they still often had hardware assistance (like the VIC chip, say.) So even in 8bit land.. if you're making a new machine from scratch, the video subsystem is a challenge. I'm trying to do VGA or other vaguely modern display protocol .. I did NTSC originally, and its _Really annoying_ to do (I just had bad taste from doing it ;) , and I don't actually have any TVs that can do it beyuond an old C64 monitor. So I cut over to VGA, which is very simple to implement conceptually, but in actuallity.. you get challenged by speed. The VGA protocol demands you do various minimum speeds, and for most of the basic 8bit stuf fI originaly designed for.. its hard to keep up. You end up with a very limited VGA display .. I've got mono text modes pretty well, basic colour text modes, and basic colour displays (low res); I've done double buffered (at hardware level) with a pretty useful resolution .. but that was a 'lot' of chips on a board (ie: where you might have 1 cpu, 1 ram, one rom, one IO, .. and then 17 or 20 chips for a nice display? that seems overkill.)

So lately (aside from losing a month or two to sick kids/wife/hell :) I've been trying to sort out other VGA generation techniques that are small chipcounts, but providing a better VGA output.. but 'without cheating'. "cheating" is the rule for this project which implies i) simple to understand, so that noobies (like me :) can understand and hack it, and ii) not using modern do it all chips. Honestly, you can get a single-chip for $10 that runs linux, has many MB of RAM, spits out DVI, does it all. That defeats the purpose of learning it from scratch with an old school bent. I've got chips pulledfrom old Ataris and arcade pcbs I'm using for audio, that sort of thing :)

So my goal is something like a Vic-20 or Spectrum, that level of usefulness.. but lacking my own chiob fab ot make a VIC chip.

So the _current_ (it changes a lot ;) thought is using a 32bit chip as a display; I had fiddled with some funky chips like Propeller and some high speed low RAM 8bits.. (I've got an 8bit cpu that runs at 80MHz but has only like 150b of RAM :) , but in the end.. going 32bit seems like a valid option .. greatly reduced chipcount, but not 'cheating' per se.

Originally I was sticking with atmel avr8 chips since I'm fond of them, they're cheap and readily available, and well documented and with good toolchain support but the 32bit avrs are goofy. PIC32 from Microchip look pretty good, but to get higher speed ones is goofy as well.

Someone above suggested STM's which I'd not looked into yet (I was looking into TI MSPs at the time actually), but the STM32 platform looks pretty hot.. I've gotten some of the ICs, and going to solder up some DIP adaptors so I can breadboard up some tests. (the ones I ordered are 64 pin TQFP surface mount chips.. really teeny.) Weird toolchain issues and stuff will make it 'fun', but implementing VGA in code shoudl be a piece of cake (I've done it a dozen times in avr8 land already.)

So, yeah, current plan is something along the lines of..

Z80 (classic 70s/80s era cpu)

a RAM

a ROM (eeprom really) to hold the 'firmware'/OS/game/whatever

a VGA chip (STM32, say)

a IO chip (we'll see.. STM32 is beefy enough it may be able to do it for us, but that might be 'cheating', but does save me a chip.. we'll see when I design the schematic up.) Plan is avr8 for IO, since I love them :) But not sure I want z80 + avr + stm32.. 3 different chip families is a bit much for noobies to swallow.

The STM32 I have runs at 120MHz, which is pretty awesome. (the avr8's tend to max out at 16 or 20MHz, and VGA really wants 26MHz and up, and you want a lot more so you can actually code things up on it instead of just ticking up a counter.) So imagine if your VGA generator is 15 or 20MHz, every single opcode that goes by is like a finger-width of pixels on your VGA display gone; doesn't leave room for _anything_, and at best you're getting pretty crummy :) (my big daddy double buffering one was clever and did pretty high res and such, but thats out of scope for this posting.) STM32 at 120MHz gives a lot of room, and also has some RAM for a framebuffer; theres faster ones but with nastier packages (like 100pin or more) so I just avoided that.

120MHz should make coding a bit easier (interrupt overhead cost shoudl be swallowable, or just using busy loops and timers); it shoudl allow enough room to generate a pretty nice higher res colour displsy and still leave a bit of performance left over for other stuff (such as perhaps sprites or scaling or effects, or doing IO work such as joystick and keyboard interface.) I've already coded up keyboard and joystick reading for avr8 mind you.

So.. its 8bit cpu and RAM and so on, with a 32bit GPU just to make VGA generation nicer; with enough ram for framebuffer, we can probably keep speed of display up, run the cpu fast and so on..with the avr8 doing VGA, those suckers tend to have 4K or 8K or the like of RAM, not enough even for a framebuffer except for realyl warped or limited ones. You really ideally want a framebuffer, so your cpu can run game logic, handling input etc, and let the video system run itself independantly.

Sorry for my usual digression and wandering around the point.. I don't sleep much.

jeff
 
So.. how much is it supposed to do.. well..

- ps2 keyboard input

- a joystick or two (atari style connectore; amiga etc, cool)

- speaker or headphone jack (or both?!) for audio

- ooool school cpu (z80) for old school coding fun (space invaders for instance, or a BASIC; in fact, original CPM MS BASIC might even _just run_ on this sucker!)

- basic GPU (maybe just a framebuffer, but it should be easy to have some basic effects like panning, sprites, etc)

So we're talking an old school level console (possibly up to SNES level, but more likely NES level), with keyboard.. so it can run text adventures and crap; think vic-20.

Oh, and mostly I wanted to do it to learn digital electronics and have fun with it; it seems likely I can make a kit or sell some pcbs or something, for a few people who may also want to assemble one. I should open up a website for it, collect th einfo and pictures and schematics and so forth sensibly, as I suspect some numebr of dozen people on the internet may care :p

jeff
 
So we're talking an old school level console (possibly up to SNES level, but more likely NES level), with keyboard.. so it can run text adventures and crap; think vic-20.
Still impressive work Skeezix!
 
The approach for a z80 based machine I've been working with so far is leveraging the OUT to send commands to various peripherals, including the screen; now, if its running the z80 at say 1, 2, 4 MHz, and an OUT sequence takes a few steps.. (command, value x, value Y, value Z, that sort) then its a few cycles per instruction. Not blazing fast.

Consider a common dumb loop:

address = screen

while forever:

  screen = somevalue

  screen++

  if screen done: break loop

The same holds true for OUT mostly:

port = screen

while forever:

  OUT port, command

  OUT port, valueX

  OUT port, valueY

  OUT port valueZ

  if screen done: break

So you can see, if many OUT arguments, it slower; if OUT argument is single, its more or less the same. I'd figured to do it cleverish..

OUT screen, X-start

OUT screen, Y-start

while loop:

  OUT port, sprite#

that sort, and each OUT of a sprite would auto-increment the target cursor, that sort of thing.. so leverage the faster video circuit, to assist the slower z80. More protocol intelligence.

...

2) But if I've got a fast VGA handler.. and assuming I pick a reoslution and colour depth that permits the VGA some spare time, and if we have enough pins, then why not just memory map the sucker, and have the video pretend to be RAM more or less.

ie: When the z80 tries to write to address 0x1000 (example) that screen top left; 0x1001 would be the second cel, etc.

This way the loop is like the former, writing to RAM without an OUT, but all the magic framebuffer is done on the VGA circuit; so you get to treat it like memory, and just write to it.

Assumption: that the VGA receiver is fast enough to have spare cycles that it will not miss any of these updates; if you set up an interupt on it, you have to be careful so that if the memory interupt triggers, you don't interupt the video update and cause a 'turd' for that frame. At the same time, it would be 'quaint' to have a bunch of flicker whenevertheres a screen update :p

... the trick is that, given enough pins, could support option (1) _and_ option (2), and just leave it up to the zikzak hacker to flash in whatever sort of display logic they want.

(3) Another option of course is if the VGA circuit is fast enough that it can slip in, read the real z80's ram, and out again, without breaking the z80, that'd be very traditional.

ie: On a lot of machines, they ran at double clock; so if the cpu was 4MHz, they'd run the clock at 8, and then send every other clock to cpu, the other to the video circuit, and the RAM was fast enough it couled switch gears between clocks without screwing up; so the video coudl read RAM, and the cpu coudl read RAM, and 'no collision'; (there were often exception cases, some display modes where the video circuit would 'run long' and have to block the cpu a bit.)

So far in zikzakery thats not been an option, due to our relatively low display circuit (can't even keep up to the VGA, let alone doing tricks.) It'd end up hogging the RAM 100% of the time and still being behind.

But if our VGA is fast enough, its possible we could maybe get away with it; if we can hog the RAM for half the time, and copy changes into local framebuffer, we might pull it off; ie: look in in a special address of shared RAM called 'dirty buffer'; if its got a 1 in it, something has changed in thew screen ram (say), so block the cpu, read through screen ram, and release the cpu; if thats quick enough that it doesn't hang the cpu, coudl be cool.. and since the cpu controls the dirty flag, it coudl even do batching things up.. it could _schedule_ when the hold up could occur. Alternatively, the video circuit just sneaks in and holds cpu, grabs a few bytes dof screen ram, releases it; if its fast enough, the cpu might not even have noticed it was held at all.

Thats the fun one.. more traditional, and if we can do it, it surte makes things _interesting_.

So I guess, we'll see if I can get the STM32 or PIC32 doing VGA _at all_, and if so, will have to prototype up these various options.

Options (1) and (2) can live together, and options (1) and (3) can live together probably; but options (2) and (3) cannot coexist in the same design sensibly.

If only I had free time, this whole year of screwing around could've been done in a month :) Still, I hope my bursts of activity are entertaining :)

jeff
 
Trying to solder some LQFP 0.5 mm SMT part now; can barely see the separation between pins, and they bridge so easily.. a little tiny hair is all you need to short pins. Nightmare!

My ring-magnifier light is 2x with a little bubble of 5x or something .. its not quite enough to work with; I need those dentist loupes, the head mount binoculars .. but I'd need some serious magnification to have a fair fight.

I've got a hot air rework gun coming ($50 shipped from a nearby city!) .. probably garbage, but might help; I'm seriously thinking I need a reflow oven sometime, but thats a couple months off before I can save my pennies; theres cheapies and used ones on ebay for $200, or you can buy a controller and stick it into any shitty old toaster oven, or roll your own .. but time is not on my side for such side projects. So maybe I'll save up $200 and see about buying a shitty reflow oven to do this smt stuff with :p

For now, soldering iron and trying to have patience :)

jeff

Thought I'd do it a little different to my normal approach; I tinned the 64 pads on my little pcb first, and then tried to maneauver the chip into place with tweezers; nigh impossible, since the tinning isn't perfectly flat .. a little jaggy here or there and you can't get position perfect; but with 10mins of tweezer and breathing heavy, I got it close-enough I think; I solder-wicked the pads too, to make sure no extra solder lieing around, and then clean iron, just brush a couple corner points to freeze it in place, and then tap away.

But I've got a dozen bridges, from the tiny skin of solder that was there :/

I do have a vacuum pump solder iron, so I have a fair chance to suck out any bridge thats not hiding under the IC; worst case, when the hot air station shows up I can blow the IC off the board to receover it, and probably clean off the board as well with the pump then; so not likely to lose a part like I'd have done 6mo ago, but still annoying :) (with the rework station, might be able to get away with just blobbing solder paste down and then heating it, and it may just all magicly move into place.)

* skeezix pulls out the 40x-400x magnification cheapy USB microscope; time to earn your pay ($11 lol)!

edit: actually, the microscope is pretty good; not a great clear image without a lot of adjustment, and glare from the lighting and such.. but you know, adjust this or that and can see well enough; *QFP means 4 sides flat pack SMT .. pins on all 4 sides of a tiny little square pizza box. I got 3 sides on good, but one side is ever so slightly ajar, so I think some of the pins are too close to adjacent pads :/ Not sure I can fix that before the rework station comes and I can blow it off and retry.

--> maybe pre-tinning the pads wasn't a good idea.. wasn't able to get them smooth enough for a perfect placement, and it cost me here.
 
Last edited by a moderator:
Try #2 with the STM32 solder to a pcb.. (I've got 5 STM32s :p )

This time didn't pre-tin the pads, and getting it aligned wasn't too bad; having the microscope on and at hand is pretty awesome.. get it into place by eye, then rotate it around slow and look at it with the microscope to see yep, its pretty good; no way I can get it perfect.. my hands are steady but this is just too small! But close enough.

Tacked down a couple corners to hold it .. now the press-down and continuity test, see if I blew it right off.

Then soldering it very gently.. normal humans always bridge a few pins - hard not to - but at least this time bridges should likely be on the outside, and maybe wickable.

Will find out in a minute.. worst case I end up waiting another week for hot air station, and try it _that_ way.

TQFP .65mm seems a lot easier.. still hard, but I've had good success; but these LQFP 0.5mm are rough; seems that .15mm is crossing a pain threshold for me :)

Dang .. tonight is not my night; first two sides went great; did 3 sides.. no bridges, being very careful. The microscope is AMAZING for this, so I can only imagine a good high mag head binoc would be the king.

Anyway, 2 sides were beauty; third side could see some of the pins were off adjar a bit, but worked out okay; but got to the 4th side and they're too far ajar. BLAST.

This sucker is so small its just too easy to misalign :/

Again, the hot air rework station should be able to clean this up and recover the parts .. and its due Friday looks like. But damnit, I want this sucker on a board Now :)

Damn smt :p
 
Last edited by a moderator:
Maybe third time is the charm..

Did the entire thing under microscope; tack down one corner, rotate the IC just .1mm to position, tack another corner, then try turning it a bit more, tack it again; putting a bit of stress on the pins, but was able to get it centered right, and then the rotation and tack worked. Had to be just right center position though.

No bridges; using the microscope makes it pretty easy to check this stuff as you go .. I took a couple microscope pics, so I can post if anyone cares.

Maybe I just suck at this, but given most hobbyists just assume they can't do SMT at all, I know a lot of people are frustrated.

Looking forward to getting the rework station and clearing off those two first foiled attempts and fixing the bloody things up ..

--> but now, no bridges.. time to ensure I've actually got continuity on all 64 pins. But thats easy test.. once you've proved no adjacent bridges, you can just swipe across the IC pin and the far away pcb-pin/via/point and Beep!

report back in a sec..

--> and got one; no bridges, and all adapter pins connect to IC pins. whew.

I think I've got the technique down, so just a matter of fixing up those prior attempts .. hopefully easy. I'd hate to burn $30 in bits :eek:

jeff

So, assuming I have a STM32 in a breadboardable pcb working .. next step is figuring out the basic requirements to bring it up (looks like it needs a dozen caps and power), and hopefully I don't pop it ;) "Too bad" New Years Eve is tomorrow, so next shot is Wed or Thursday night I imagine. Baby steps and patience is story of my sleep deprived life .. but at least tonight, its nearly 1:30am and no babies awake yet. Maybe I'll be lucky and they dont' wake up at 5am ... but the last 3 weeks approx, they've been up around midnight or 1am, and play time (argh!), and then up for the day 5am or so .. (double arg). God knows why I punish myself by staying up to hack ;)
 
Last edited by a moderator:
Heres a shot from the $11 ebay microscope, half zoomed in, while I was aligning the IC:

2013-12-31-lqfp-microscope.jpg

Final adapter pcb:

1526625_686186188080357_2090760101_n.jpg

Notice that the DIP pins on the bottom are 0.1 inch apart, and how many of the 0.5mm pins fit between a pair of DIP pins :p

jeff
 
Last edited by a moderator:
$11,- microscope you say? I want one!


Do you use flux when soldering? That really helps avoiding bridges (and fixing the ones you have). This video helped me a lot:


https://www.youtube.com/embed/wUyetZ5RtPs?feature=oembed
I should of watched that drag soldering video a few months ago before I destroyed a surface mount ADC I was playing with..


Yeah I'm not steady as I used to be myself..
 
^ It's much easier watching someone else do it. Also: "I already tacked the opposing corners". That the hardest part dammit! :)
 
I wonder if dental loupes are any good .. Sunglasses with flip down magnifiers and lights


Most are listed at 420mm distance - pre set focus; 2.5x and 3.5x seem common


I'd like adjustable focus distance and adjustable focus but that seems pricey .. Without the flexibility they'd be useless?


--


I guess jeweller loupe is better .. Seems you can pop out the magnifier and swap in various size:distances


Ahh always fun scraping tools bottom of the barrel; if I only had $500 to burn could get a half dozen really handy tools (reflow oven!)
 
Last edited by a moderator:
Hi I used to own a speccy,

Im just wondering, would it be feasible to use z80 chips for everything?

1 for sound

1 for video

1 for IO 

4 for logic

it would be like a spectrum on steroids

I dont really know anything about the hardware side of things but the Genesis used a z80 for sound
 
Last edited by a moderator:
Not really; the z80 isn't fast enough for video, and isn't designed for I/O; it generally relied on peripheral chips so the z80 (and contemporary 6502) come in families - the cpu, a chip for parallel peripherals, a chip for serial and modem etc. Thise chips could be used but they're getting hard to get an expensive .. I was going to use an ACIA for instance. Z80 isn't good at working with pins .. It wants peripheral chips or memory mapped stuff. Talking to a keyboard .. Out.


This will still be like a speccy on steroids, I assure you :)


I didn't own a speccy (were very available in Canada) .. I'll have to look up what they used for audio but could well be the pag I'm using .. It was enormously popular (beaten by the mighty SID perhaps ..)

Z80 is the brain of the zikzak .. All the logic and processing and telling other things what to do .. Anything else in there is a slave.
 
Just had 'parcelmas' :) All the packages being presumably held up by Christmas shipments plowed in this week; about 7 parcels so far? driving my wife crazy, and 1 more tomorrow to finish off all my pending orders :)

Too bad the little guys are ramping up their efforts to kill me .. finalyl got my chores done 11:30pm today, and not had a continuous block of sleep longer than 3 hours in _5 weeks_ (well, there was _1_ good night in there, couple weeks back.) Seriously, w-t-f guys.. you're 2 years old now! :)

Still trying to find a good pair of head mounting binoculars, and SMD stencils and solder paste; store near me sells kits .. you get 2 adaptor pcbs and a stencil and some paste for about $40 .. steep, but not entirely unreasonable for what you get; but I just want the stencils.. mylar or tin.. maybe $1 ea? come on! But naturally, if I get those, I jhave to get a reflow oven sorted out to really make it peachy....

.. but parcels so far include a pile of free samples (more microprocessors), programmer cables, a bunch of samples for line drivers with voltage regulation (for serial conversion), some audio amps (LM386's), some voltage regulator (LM316s if memory serves), the hot air rework station (ooooooh yes!), and some other junk. Mind you, a $50 rework station has to be shit, but lets hope its a peach somehow :) We'll find out .. see if I can repair my botched two STM32 attempts .. but down the road, I hope to get some solder paste SMD action going with this.. with these teeny parts I've got about a 50% hit rate, maybe more.. if I'm super careful and slow and not jacked on coffee, I can get it tacked down just right and then it goes pretty well; but with the STM32s I got unlucky somehow and the guy shifted ever so slightly, and thats all it takes :/ But with a rework station, once I get good at it, should be pretty 'easy'. Certainly makes it easier to un-screwup.

I'm thinking, when I get a moment (!!), my first priority will be a quick hack to see if I can drive the sound chip nicely; it shoudl be pretty satisfying and pretty easy.. throw onto the breadboard an avr8, and the AY-3-8910 (I'm actually using AY-3-8912s, just throws off some unused pins), and see if I can play a tune; just wrap wire right onto headphone 3.5mm jack and see how it sounds; may need to use the LM386's to amplify the volume though, but we'll see. (Itchign to fire up some Atari ST demo music from zikzak, you see :)

Then after I get that working (should be quick) its onto the STM32 VGA driver, which should be quick once I get the toolchain put together.. but lots of reading to do quite yet, as the documentation is spread out, and in dozens of places, no solid concise data sheet for these ARM chips :)

Exciting for me .. but if the STM32 pans out for VGA driving, then it'll change my board design quite a ibt, but really gets us on track; VGA has been hangingme up waaaay too long.

If STM32 doesn't pan out, I'll try the PIC32s I've got .. (free samples, woowoo!).. 80MHz I think they are; good, but STM32 is 120... better :)

Then back to testing the Z80 brain of it all, but that should be the easy part.

In case you are curious, I did put a bit more work into the ultra-shitty SkeeBASIC OS for zikzak, but I'm figuring to just have reflash-your-app-and-go going on, or maybe run MS Basic CPM or something for lulz; If I get time, I'll design in a cart port, so that we can have a simple OS firmware in there, and then plop in a flashable cart to switch things up, but we'll see how ambitious we get :)

jeff

Rest assurred.. I don't get much free time, but I'm spending what little I get on zikzak; its moving forward.

(The funny thing to me is.. this is not the 'best' I could design at all; use modern parts, add SD etc, way better is doable pretty easily; the 'constraints' I put in day-zero and using retro style and parts, thats what makes it interesting to me. So this is not the best, but it sure is fun, and learning a lot, and if we ever get a few kits out I hope everyone enjoys the simplicity of it all. I really shoudl add a pile of LEDs and such, so we can see the opcodes stepping through on the CPU, see the audio in action, etc :p )
 
Back
Top