Omnimaga

General Discussion => Technology and Development => Other => Topic started by: c4ooo on December 24, 2017, 03:41:09 pm

Title: z80 computer with arduino coprocessor.
Post by: c4ooo on December 24, 2017, 03:41:09 pm
I built a prototype for a z80 computer that uses an arduino for communication and bootstrapping. I can assemble a z80 source program with brass, and send it to the arduino with a small python program. The arduino is running a firmware program that waits for a program to be sent over serial, which it loads into the ram chip for the z80 to execute. The z80 communicates with the arduino via IO requests. The arduino<-->z80 API only contains 3 commands, but these can be used for the z80 to send messages to the PC via serial.

This is a small test program to send "test1" and "12345" to the PC via serial:
Code: [Select]
#define output(x, y) ld a,y \ out (x),a
#define command(x) output(PORT_COMMAND, x)
 output(PORT_ADD_LOW, writeTo & FFh)
 output(PORT_ADD_HIGH, writeTo >> 8) ;set data act-on address to writeTo
 ld hl,string1
 ld de,writeTo
 ld bc,6
 ldir ;copy string1 to writeTo
 command(COMMAND_WRITE_SERIEL) ;tell arduino to send data from act-on address to PC
 ;stuff
 ld hl,string2
 ld de,writeTo
 ld bc,6
 ldir ;copy string2 to writeTo
 command(COMMAND_WRITE_SERIEL) ;tell arduino to send data from act-on address to PC
 jr $ ;do nothing
string1:
 .db "test1",0
string2:
 .db "12345",0
writeTo:

Picture:
(https://i.imgur.com/Q77AmVo.jpg)

Todo: