Ready for github publishing

This commit is contained in:
Daniele Verducci (ZenPenguin)
2021-07-11 09:49:42 +02:00
parent 1c77bc82ac
commit aa844687c8
47 changed files with 697 additions and 71 deletions

103
README.md
View File

@@ -1,47 +1,60 @@
# Software utilizzato
Compilatore assembly: z80asm (da repo debian)
Compilatore c: sdcc (da repo debian)
Eeprom flash: minipro (da https://gitlab.com/DavidGriffith/minipro/)
Disegnatore schemi logici: logisim (jar da sourceforge)
Per usarlo su hdpi: `java -Dsun.java2d.uiScale=2 -jar logisim-generic-2.7.1.jar`
Disegnatore circuiti: fritzing (da repo debian)
# Pat80
# Assembly
## Deploy
### Compilare assembly:
`z80asm -i hd44780_lcd_test_procedure.asm -o rom.bin`
### Portare binario alla dimensione dell eeprom:
`dd if=/dev/zero of=rom.bin bs=1 count=0 seek=8192`
### Scrivere su EEPROM:
`minipro -w rom.bin -p "AT28C64B"`
### Leggere EEPROM:
`minipro -r rom_read.bin -p "AT28C64B"`
## Istruzioni
### Dichiarare una variabile:
Usare EQU per assegnare una posizione di memoria nota (nella RAM) al nome variabile.
```
myVar: EQU 0x800F ; init variable
ld hl, "A" ; load value into register
ld (myVar), hl ; copy value into variable
```
NB: Se il programma si blocca, verificare che la variabile non sia stata dichiarata in una parte non scrivibile della memoria (ROM)
### Accedere ad una variabile
Modificarne il valore (nell'esempio: incrementarla di 1)
```
ld a, (myVar)
inc a
ld (myVar), a
```
Passarne il puntatore ad una funzione:
```
ld bc, myVar
call lcd_print
```
### Segmentation fault
Controllare che non si stia puntando ad un registro con le parentesi:
`ld (ix), a`
![Pat80 Home Computer Logo](/assets/media/pat80-banner-colour-raster.png)
# C
## Deploy
### Compilare c:
`sdcc -mz80 test.c`
Pat80 Home Computer is an attempt to develop the simplest possible Zilog Z80 based computer in 2021.
## Hardware
Instead of being another single board computer, Pat80 focuses on modularity:
- The Core board contains Z80 CPU, 32k ram, 32k rom, memory and I/O decoding logic
- The Backplane is a stupid I/O bus board with no active components, 1 socket for the Core board and 8 sockets for I/O boards
- Each I/O board must implement tri-state and go to high impedance according to its EN pin to avoid bus contention
- The Power Supply module contains a 7805-based linear power supply capable of delivering 1A @5v for the core and I/O boards
Here is a picture of the early stages of development:
![Pat80 Breadboard prototype](/assets/media/photos/breadboard.jpg)
### I/O Boards
#### Parallel terminal interface
A parallel terminal based on Arduino is used for development purposes and will be replaced by an UART card.
#### Keyboard controller
Pat80 features a blue-switches mechanical matrix keyboard, seen by the system as a memory area in I/O space. The keyboard doesn't use interrupts and is polled by the OS.
#### Video controller
The monochrome 368x248 pixels video output is software-generated by an ATMega 1284 MCU. The timings are generated by the MCU's 16 bit internal timer and the vertical sync time is used to update the framebuffer.
## Software
The OS is a simple Memory Monitor. It can show memory content in hex and ascii with the typical hex editor tabular view.
Programs can be loaded from the keyboard, writing Z80 opcodes and data in hex. The program can be executed from any ram position and the Memory Monitor can be brought to screen in any moment issuing an INT signal (the Z80 INT pin should be connected to a button with pull-up resistor).
There is an experimental and unfinished quick load function using a python terminal to load a binary file directly to memory and execute it.
![Pat80 Memory Monitor](/assets/media/photos/memory_monitor.jpg)
## Status
The project is heavily work in progress.
### Working
- Core board
- Sound board
- Arduino parallel terminal with its own Python companion script (or any UART terminal)
The only fully working configuration as now is the Core board with two devices hooked to its I/O bus: the Arduino Parallel Terminal (see `pat80-io-devices/parallel-terminal` and `pat80-computer/software/z80-assembly/os/drivers/arduino_terminal.asm`) and the SN76489 sound chip (see `pat80-computer/software/z80-assembly/os/drivers/hd44780.asm`)
### Partially working
The keyboard is only partially tested, as it's not completed.
![Pat80 keyboard pcb](/assets/media/photos/keyboard_before_etching.jpg)
![Pat80 keyboard layout](/assets/media/photos/keyboard_layout.jpg)
The composite video card is partially working, but has some nasty bugs on text cursor positioning and the graphics mode is not yet implemented (the only way to output graphics ATM is to place the bitmap in the MCU flash and load it to VRAM manually).
![Pat80 composite monitor text mode](/assets/media/photos/composite_text.jpg)
![Pat80 composite monitor graphics mode](/assets/media/photos/composite_graphics.jpg)
For the moment, better to stick with the Arduino Parallel Terminal.
### Not working
All the rest
## License
All the project is under GPL v3 license