Close

Prototyping the ZAViouR

A project log for ZAViouR Board - AVR/Z80 Hybrid

A Z80 experimenters board with a supervisory AVR and 64K of SRAM

steve-smithSteve Smith 08/20/2015 at 11:410 Comments

So far, I have had prototype boards fabricated by the excellent www.hackvana.com and have built the first one. I tested it in stages, adding first the Z80 oscillator chip (7404), then the AVR, Then the Z80 and lastly the SRAM. The two other chips are on order and aren't necessary for testing.

I was going to use a cheap eBay serial to USB module for uploading, however, therein lies a problem. Because the Z80 is connected to the same pins that the serial port uses on the AVR, whilst the Z80 is free running, the serial port shows garbage. If I hold the Z80 in reset with the on-board switch, the Arduino IDE freezes and doesn't upload either. Ideas on a post card....

So, to temporarily work around this, I'm programming the AVR with ICSP instead. This works fine since I have dedicated the relevant pins for this purpose.

Whilst thinking about the serial issue, I will be writing a simple Z80 routine to fill a block of SRAM with a number using the LDIR trick:

start:	
	LD HL, DESTINATION
	LD DE, DESTINATION + 1
	LD BC, SIZE - 1
	LD (HL), 170 ;Specific binary pattern 1010101010
	LDIR
Ah, the memories...

Z80 is easy. I also discovered ZMAC and bin2h on Domipheus's site blogging about his TeensyZ80. It's a simple task to write Z80 machine code in a text editor and after compiling with ZMAC, use bin2h to convert the .CIM file produced to an array declaration for use in the Arduino IDE.

const char TEST[] = {
0x21,0x00,0x00,0x11,0x01,0x00,0x01,0xff,0x1a,0x36,0xaa,0xed,0xb0,0xc3,0x0d,0x00};
Excellent! At least I have some progress. Now, I'm looking at ways of converting each of those characters in the array to binary and loading them on to the databus, after which I will make the /CE and /WR lines active (Low) and load the code into the SRAM.

Discussions