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


Victory is mine!

For VGA testing, I've kept a VGA CRT on the side of my desk; its a 17" though from not too far back in time (10 years?), a pretty good high quality one; but its effing huge,m crowding me the hell out of space.

Some time ago, I picked up a 'rear view' display for cars; not too expensive around here, you can find them in used-junk stores too; but I ordered it form China, about $5 with free shipping if memory serves. Check ebay, piles of them. Takes composite RCA input. My plan was to rip out the casing and put the lcd panel onto my robot car/tank/thing, hooked up to raspberry pi, as a cheap debugging terminal for stdout. Course, now I've got single chip VGA text modes working, I can do all sorts of crazyness. Anyway..

A few weeks back, I ordered a VGA->composite adaptor; they're pricey as hell around here.. in cable form about $80-100, or various little devices for $150 or more. But this shitty little unbranded box was $13 shipped from a cheapo auction I won in ebay.. woowoo!

And the damned thing even works! Its a teeny 4" display, but I can now take in composite or VGA, and show it on there. Thats way better than the 17" giant as hell VGA monitor :) Something more junky and cable-y for the desk, but hey, can't win them all.

jeff

edit: Its funny how you can get a 20"+ LCD monitor, high res LCD, for $90CDN at local shops (and less on ebay, etc.) We used to dream about 20" monitors for less than $1000 .... but the weird thing is, if you want _smaller_, its much more expensive; like $150+ .. too much for a spree buy; its like, unheard of to buy small monitors now except for industrial settings :p .. I've got a ancient 13" CRT VGA for consoles in my computer stack in the closet; I've got this big old high quality 17" VGA around in case I need to fire up a old mac or something. They're big.. CRTs suck, as we all know, by comparison to modern shit. I'd love to toss out these two VGA monitors, replace them with a 12" LCD panel or something.. but cost $$ :/

(course, when my picade shows up, that may well be my VGA display!)
 
Last edited by a moderator:
You guys seriously need some thinner gauge wire :D
Look at the zikburner wire-side pic; you can see some AWG30 squirrelled in there. Local shops only carry 22 AWG, 24 AWG, and 30AWG (wire wrap); I've got a good assortment of 22 and 30 (the 30 stuff was cheap as dirt, so little metal in there :) -- and I'm sure if I bought into the whole WW thing, bought a big stack of very pricey IC adaptors, a WW tool, and got to it it'd be a great technique; but sure seems pricey, and WW's tend to look like a undebuggable mess to me (not having tried it), so... bleh. The WW wire is just too fine to use for solder wire I've found.

Some folks build a WW-pencil -- just a normal pen, with the ink tube tossed out; put a little spool on the top-end to hold WW wire, and spool it out through the pen-tip and 'draw' the WW wire onto perfboards; maybe that'd work okay. But just cutting it to length and sticking it into perfboard is pretty annopying.. its like thread and just flops around pretty easily, and I found it hard to work with (I forget in what way, honestly, been a few months since I tried.) I think I like the AWG24 stuff -- sturdy enough for breadboard, not too bad for perfboard.

I bet 28 or 27 or the like woudl be the sweet spot .. fine enough to cram more in, but still strong enough to be good to work with; but can't get any around here easily. *Shrug*

jeff
 
To be honest I reckon what makes it looks overloaded is more the vinyl insulation than the metal in there.  Not a lot you can do about that.

I recall in the electronics starter kits of yesteryear you used to get relatively heavy wire with very thin insulation you could easily scrape off with a knife.  I don't know how well that stuff insulated, and how much it was just colouring so you could distinguish the wires, but either way I've not seen it since.
 
okay,. this is a big image, but hey, its my thread, so I'm slamming you all with it :)

This is basic Z80 schematic..

- omitted 'implied' stuff like decoupling caps, xtal's, etc; will add them next; focus was on address, data buses, memory and I/o maps, etc

- VGA is driven by the atmega microcontroller; its sitting on the data bus, and z80 talks to mcu via IN and OUT operations

- PS/2 keyboard is handled by the mcu; Z80 will get an interupt from mcu, and can do an IN on keyboard port to pull in the value

- cartridge is not yet defined (debating if I'll worry about it this revision or not)

- no sound chip yet either (but could probably hang one off the mcu, and just use another OUT port for it)

- no permanent storage (like SD or whatever) yet .. could hang it off mcu and use z80 IN OUT to do it, though... or memory map in an EEPROM as disk :p

Memory map is .. 16K ROM (starting address 0)

The rest 48K is RAM (starting at 16K, duh.)

I/O map is .. TBD, but we've got 16 address ports to use

My plan for I/O is something like..

port 0: commands to/from atmega; so tell it 'heartbeat arriving' so it can keep its 'active' LED on for a second; or query atmega for various sensors or something

port 1: out byte (command or value) to video channel; so you might go OUT 1, 1 (following is block of text), then OUT 1, n (repeating for each byte of text, finishing with a \0 say)

port 2: in/out communications to host PC (as filtered by the mcu); so if you want to do serial to PC over USB, the mcu or the z80 can do it

port 3: in from keyboard; get interupt from mcu to z80, z80 responds by doing a IN on the port 3 to get the keyb character

Still, I'll build a prototype on breadboard and see if I can sort it out:

- typing in via keyboard!

- display the text on vga

- debug log and some high level commands via serial console over usb to PC

--> this is capable enough to run a shitty text adventure or BASIC or whatever

Take that :)

zik80-001-schem.png
 
Last edited by a moderator:
I forgot about joystick on this one .. Trying to avoid adding another mcu as I/O .. If i can get 1 joy on there be nice.


Cart be nice so we could have game packs .. As is, would have to eeprom burn to change games.. Or upload them from connected pc/pandora to the large ram :) hmm..


Jeffphone
 
Well, you've got serial, so if you can hook an EEPROM set up with a simple pushmepullyou kind of shell thing that lets you upload things to RAM then jump to a defined (possibly predefined) address you're sorted.
 
Last edited by a moderator:
serial/usb is into the atmega, mostly for logging or 'admin hijack' sort of console; but we could always do a data-loader sort of thing, just like zikburner's commandline but piping to RAM instead (or possibly into the eeprom .. it does seem possible would could wire up WAIT or BUSREQ to the mcu, and then write to the eeprom over the bus maybe..) -- but at minimum, the mcu could receive a block of data, then do an INT to the z80 which in turn does IN and finds a bunch of data waiting, and then does an IN-loop to pull in the data and stick it into RAM, and then do a JSR into it.. or something.

So should be hackable :)

A cart slot is just sort of neat for 'retro' sake, but actually making a bunch of carts and such woudl be pretty tedious; so its the sort of thing where, if you design it in, you make one cart per system and call it a day :p so not all that useful.

But being this is for hackers to screw around, I guess assuming a USB uplink to a PC of some sort, is not unreasonable?

So if I get the gumption up maybe I'll design in a cart override for ROM (shoudln't be too hard), or maybe I'll worry later :)

I'm actually _really_ amazed the design seems so simple; like I must be missing something really obvious; or maybe Ineed to add switchable clocks .. a push button single-step clock, a slow clock, a variable clock on a POT and a 555-timer, and a fast clock on a 10MHz crystal or something. Since I omitted the ACIA and VIA and sucvh in this design, we can get away with running high clock and not worrying too much.

(and the z80 uses safe registers, like sram and not dram; so you can hold as long as you want without screwing up the cpu; if you hold a 6502 without letting it refresh it'll get all weird, iirc.)

jeff
 
Because I'm not bombing your browser with giant images enough..

Updated the schem..

- populated the atmega microcontroller (and rather assuming its a atmega644p now, not just a regular atmega644; dual serial ports may be handy.. but subject to change. Right now I'm using UART in SPI mode to spew out data to the VGA, at a ncie constant rate .. but also want UART to USB/serial ..)

- populated VGA for monochrome (1 pin driving all R G B)

- added Joystick (Atari 9pin, .. 8way plus 1 fire button)

- added Speaker (a basic piezo speaker; takes 1 pin to drive square wave fart noises.)

This leaves I think 2 free pins on the atmega..

- could use them for missing interupts .. I forget if I may need one or two more

- could use them for additional fire buttons on a gamepad

- could use them for twi to a audio chip .. or for parallel bitbang chip,m could feed a serial-to-parallel shifter IC

So we'll see how it evolves; but pretty solid looking design right now.

Now, if it _works_ is another story, we'll find out over the next week or two or so..

I'm not sure I can handle keyboard and joystick and serial and all that in the atmega, while also driving VGA; it should be nil overhead to monitor those things (make it interupt driven), but if an interupt goes off it may cost enough cycles to just blow up the VGA slightly. But joystick, keyboard, serial, etc are all relatively low frequency (esp if we're running 16MHz there), so its possible that when they do interupt there might be a little 1/60th of a second jitter in one of the lines or something. That'd be pretty retro-cute again. Thats what we call it when my design is fubar'd a bit, due to on-purpose avoiding putting in 3-4 more chips and complicating things for everyone :)

zik80-002-schem.png


jeff
 
ahright, next step is ..

- acquire a few missing little parts - some piezo speakers, some ps/2 female connectors, that sort of bumf; cheap stuff.

- set up next test rig..

Next test step is building up the full schem, piece by piece, to see if it works; its a bit much to test on breadboard, but we'll see how far I get :)

First part of test is the atmel side .. lets proove the part I know how to prove, before adding in the z80 complexities.

So, given I already have the VGA text mode emitting going on, I want to add to it..

+ joystick

+ sound

+ keyboard

+ switch to atmega644p from atmega644 maybe (dual usart's.. I'm using one usart for VGA timing, and the other would be for swerial/usb to host PC for debugging and console)

+ write some text mode screen API - send cursor to X,Y, clear screen, print character to cursor location, trivial stuff

+ basic protocol to push instructions into the atmel, and pull data from it .. this would be how the Z80 communicates with it; not sure how I'll test this though, short of dropping in another atmega for short term bit bang testing. could do :p

Once that stuff is going, I can add in the data/address bus and z80..

I've updated my own copy of the schem a bit, for corrections.

Atari 9pin joystick is "NO" (normally open) for each of the 5 joystick pins (up, down, left, right, button), and closes (to ground) when stick/button is pressed. You have to pull _UP_ to Vcc to show nothing then, and when the switch closes it will pull down to Ground. So use a 10K resistor say (or anything really) over to Vcc (5V in my case), and you're good to go.

I've now got it so I can plug in an Atari joystick and update the screen to show "up" or "down" or whatever, works a treat without impacting VGA.

--> looks like if I update the entire screen at once (about 500 characters), you can see the VGA blink.. so its so busy I really can't do much during an interupt without throwing the timing off; but thats okay, we'll see.. but a joystick and keyboard are very low traffic, so should be fine. Speaker, we'll see too.

Its the protocol back and forth to the z80 I sort of worry about, but we'll see how fast I clock the z80 :)

....

FWIW, I'm now running on the 4" tiny 'rear view' tv for car, with a VGA to Composite RCA adaptor thingy as discussed previous page. Works well. So I'm running 9V into the kit, with my old 9v->5V linear regulator board giving a ncie clean 5v which I feed into the rest of the board, but with the 9V feeding into the little TV. Development is much faster when you get to display logs to screen :)

jeff

Once I get fart-noises coming out of speaker, or keyboard working, I'll make a shitty little video :p
 
You know, sort of feel like I'm actually getting somewhere lately :p

Picked up a couple ps/2 keyboard connectors (6pin mini-DIN female)

Picked up a few 'speaker widgets'; I didn't realize you ave the option, at this price range and size, to get:

- transducers

- speakers

- buzzers

I'm not entirely clear on the difference yet; 'transducer' is just a device that translates one thing to another, so in this contexct its energy to volume; but I'm not sure what is implied :)

A buzzer .. maybe thats the one with built in driver, so a given voltage implies a given buzz-sound

A speaker .. I should know this, but my brain is old an dmushy and I forget how PCM works.. but I guess you probabyl need to keep vibrating to get anything out of it...

Well, I'll find out; I nabbed one of each for about $2/ea, will see what they do; all 3 have 2 wire interfaces, a plus and a gnd, so just a single wire to mcu as schem'd, and just see what happens when I square wave them.

I really need to build a function generator so I can easily test different wave shapes with different frequencies, on random devices..

Anyway, I'll work on a PS/2 DIP adaptor and work on the PS/2 decode protocol, and they can start typing into the text mode framebuffer; from there, z80 time!

Also picked up some 16pin ribbon cables of various colours; may be easier to run busses with, than doing 16 individual wires each time; maybe keep it more compact? Or maybe they suck to work with .. will see.

jeff
 
In my experience, a buzzer usually is a piezo-electric device which rattles a metal plate which sits in a plastic enclosure with a hole in the top. May also contain the waveform generation stuff so you only need to supply a voltage to get it to buzz.


Whereas a speaker definitely doesn't contain a waveform generator, it may contain a small amp. A speaker usually has a more complex cone/baffle setup and either moves by piezo-electic action or a solenoid type arrangement, and is designed to be able to do more than just buzz.


No idea about a transducer.
 
Does anyone have any input on adding another mcu?

So far I'm aiming (with this revision), to limit the IC count; I'm sort of going for minimal but fully functional approach here. So z80 for the brain, and the avr for VGA and I/O is goal. But its stressing the avr to add extra functionality; joystick and keyboard probably okay; adding a plain buzzer shoudl be okay I think (we'll see), to do fart noises (BZZT!) .. but if we want any significant audio abilities (like a SID chip sort of thing), then theres just not enough spare cycles on the avr.. VGA is too heavy.

I could try to design in anotehr avr as I/O.

I think I'm going to keep at it, see how far I can get with z80 + single avr for VGA+I/O, for now..

jeff
 
Certainly used to be common to have another IC handling general i/o apart from the video out, covering keyboard, joysticks, tape, serial etc. Sound was generally handled by a separate chip like a SID or a AY-wotchacallit, and at least in the case of the AY you needed another chip to drive that chip. Later in the 80s it was more common to combine video and sound into one custom IC, but that's a long way from using a general purpose CPU for the job.


I would not be too disappointed at needing another IC for all the stuff you're trying to do in real time.
 
Hmm, now I'm on the fence.

I can minimize the joystick and keyb damage to the VGA signal, but I worry that if we want to do anything half useful with audio, we're really totally boned; or if we want this hackable at all, be nice to have some processing space on at least one of the chips.. ie: the z80 will be pretty darned flexible, but slow; the VGA is basicly tied up; if we add another mcu, it'd be basicly idle .. it could _fake a SID chip_, since there is already code out there for avr SID as someone pointed out (!) .. I don't know what the capability is there, but maybe using a real little speaker instead of a buzzer would be an option to us then, and end up with some pretty useful audio. Then we could use zikzak on stage :p

Anyway, experiment right now is .. VGA is on; if I check for joystick interupts, its not too bad.. they're pretty infrequent in the grand scheme; you can see a _Slight_ blip, but barely.

Keyboard seems to really show up and deflect the display; I'm pretty surprised, giben the clock from the keyboard is only about 10kHz (order of magnitude out, given we're running at 16MHz .. though VGA occupied.) Now, I did try disabling the keyb interupt except during vblank, which cleans things up pretty nice.. but you can _still_ see the whole screen slide up or down a couple pixels based on how much key repeat or key spamming you're doing; flat out typing fast has the screen jittering up and down a half dozen pixels. Its sort of cute, but annoying. I mean, no one is going to use zikzak for real work I hope, but still :) I coudl go all out like zikzak3, and its rock beautiful solid and scary as hell, but we're compromising here.. but I don't know if IW ant to compromise that miuch.

So, maybe I'll make another schematic addition, to squeeze in another avr, as IO handler. Shouldn't be too hard; leave it at default 8MHz (no crystal or caps on it), and just route IO to it .. most channels; have a single OR on the address lne, so if the 8th bit is set (port 128 and up) it'll go to VGA for sending characters or commands, but any other port will go to the I/O avr. I think I'd planned 4 ports, so that would be 1 to VGA and now 3 to IO avr. Shoudln't be too hard for them to martial the bus properly, and given adding another mcu we'd have plenty of pins to spare so could have them chat back and forth to negotiate as needed. (ie: the avr's running at 8 and 16MHz say, versus the z80 at a max of say 10, bu tmore likely at 1MHz or something, just to keep things traditional.)

(I am actually planning up front for like a couple-of-herttz, a couple of clocks per second!, on the z80, for debugging; I'm thinking of a variable clock, using a 555 with a pot on it maybe, so you can adjust the clock up and down or something, dynamically on the z80.. wouldn't that be cute/handy/neat?)

So.. maybe; not hard to add in.

(who am I kidding, not a single person will ever want a zikzak kit :)

jeff
 
hell, could have a pin come out of the IO avr as clock gen, and have it vary from there :p so z80 itself could send an instruction to the IO to ask things to speed up or slow down :p

Hmmm..

edit: You know what, I think this might totally be the way to go. I just need a square wave even duty cycle, so.. why not? culd set up a timer in the avr so its not even any code to do it :p sheeit, that feels weird, having one cpu drive the clock of another, which in turn is sending indstructions back to the first. Theres something perverted here.

jeff
 
Last edited by a moderator:
I think I need to see a video of this screen jumping effect.  I can't decide if it's retro cute or annoyingly retro.

Regarding joystick interrupts - what's sending the intterupts?  Don't you poll it when you want to (which with VGA being @60Hz should be doable in the vblank just fine)?
 
Last edited by a moderator:
Back
Top