From 561bac75579391c14e47eaccfabdf9eda98855da Mon Sep 17 00:00:00 2001 From: Thomas Albers Date: Wed, 27 Jul 2022 18:13:20 +0200 Subject: Initial commit --- src/z80/index.org | 22 ++++++++++++++ src/z80/plm.org | 66 ++++++++++++++++++++++++++++++++++++++++++ src/z80/prototype1.org | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/z80/prototype2.org | 51 +++++++++++++++++++++++++++++++++ src/z80/spi.org | 30 +++++++++++++++++++ 5 files changed, 247 insertions(+) create mode 100644 src/z80/index.org create mode 100644 src/z80/plm.org create mode 100644 src/z80/prototype1.org create mode 100644 src/z80/prototype2.org create mode 100644 src/z80/spi.org (limited to 'src/z80') diff --git a/src/z80/index.org b/src/z80/index.org new file mode 100644 index 0000000..ab827eb --- /dev/null +++ b/src/z80/index.org @@ -0,0 +1,22 @@ +#+TITLE: Z80 +#+DATE: <2021-03-03> +#+SETUPFILE: ../../options.org + +{{{date_place(Bremen, Germany)}}} + +This section is dedicated sharing all the Z80 related work. This +includes software, schematics and tools that I've designed to +accomplish this task. It also includes a kind of narration of the +project itself, throughout its development and changes. + +** Articles about the history of the project +- [[local:/z80/plm.html][PLM: Pocket Lisp Computer]] +- [[local:/z80/prototype1.html][Prototype 1]] +- [[local:/z80/prototype2.html][Prototype 2]] + +** More technical articles +- [[local:/z80/spi.html][SPI for microprocessors]] + +** External Links +- [[http://www.z80.info/index.htm][z80.info]] useful z80 resources +- [[https://www.zilog.com/index.php][Zilog website]] diff --git a/src/z80/plm.org b/src/z80/plm.org new file mode 100644 index 0000000..b0eef1d --- /dev/null +++ b/src/z80/plm.org @@ -0,0 +1,66 @@ +#+TITLE: PLM +#+SUBTITLE: The Pocket Lisp Machine (except its not) +#+DATE: <2021-03-03> +#+SETUPFILE: ../../options.org + +#+BEGIN_COMMENT +m4_define(`_REL_HEADER', `Next: Prototype 1Up: Z80')m4_dnl +#+END_COMMENT + +{{{date_place(Bremen, Germany)}}} + +* Background + +If you have read my article about my first [[local:/z80/prototype1.html][Z80 prototype]], then you +probably already know, what all of this is about. But, as a small +recap, the idea of my project is to build a pocket computer that can +be carried around like the pip-boy from the [[https://en.wikipedia.org/wiki/Fallout_(series)][Fallout]] series. + +The exact objectives have changed with the development of the computer +itself. I soon realized, that the way a user would interacts with a +pip-boy, was less than optimal. A keyboard was mandatory. I also +changed my mind about what processor I should use for the project, +starting with an AVR and later with a Z80. + + +As of right now, the objectives are the following: + +* Objectives + +- Have a pocket computer, that can be carried like a wrist watch + +- It should have as much RAM as its possible with a 8-bit CPU + +- It will run a lisp interpreter as its operating system + +- It would probably end up being used as a scientific calculator + +- It has to be expandable enough, so that I can be used as a pocket + Arduino replacement + +* Pocket Lisp Machine? +A lisp machine is a computer design to run lisp code. This means, it +is optimized to do so, be that through special hardware or ISA. + +Under this definition, my computer is no lisp machine. But the name +refers to the fact that it designed to run a lisp interpreter, scheme +specifically, as its operating system. + + +* Why don't I use a 6502/65816 instead of a Z80? +Between a Z80 and a 6502 I definitely prefer the Z80. Mainly because +of the instruction set and peripherals available. + +A 65816 would be easier to program than a Z80 due to the built-in +support for memory banking. But again, I still prefer the peripherals +of the Z80. + +The Z80 DMA is also a important factor for my decision. While it could +be used with other processors, I prefer to use it together with the Z80. + +The last reason is that, I began building my computer using a Z80 and +would like to complete this project using the same CPU I started with. + + +I do have the idea of building another computer in the future. This +time based on a WDC 85C816. diff --git a/src/z80/prototype1.org b/src/z80/prototype1.org new file mode 100644 index 0000000..23adec1 --- /dev/null +++ b/src/z80/prototype1.org @@ -0,0 +1,78 @@ +#+TITLE: Prototype 1 +#+DATE: <2019-03-03> +#+SETUPFILE: ../../options.org + +#+BEGIN_COMMENT +m4_define(`_REL_HEADER', `Previous: PLM +Next: Prototype 2Up: Z80')m4_dnl +#+END_COMMENT + +{{{date_place(Temuco, Chile)}}}@@html:
@@ Last edited: Bremen, +Germany, February 02, 2021 + +* Background + +Back in 2015 I used to watch gameplays of the just released [[https://en.wikipedia.org/wiki/Fallout_4][Fallout 4]]. +From this game the thing I loved the most was the pip-boy, so much so, +that I had the brilliant idea, /Why don't I build my own pip-boy? I +mean, How hard could it be?/. + +Unsurprisingly, it turned to be harder than expected. I only knew how +to program at an application level (I wasn't that good at it either) +and had basically no knowledge of electronics, assembly language, nor +did I even have the components at my disposal. + +* Beginning + +Some time after this idea, I got myself an atmel328p and a programmer. +I learned to instruct this AVR to draw text on a 16x4 lcd and could +get input from buttons. + +But I had some challenges. First, microcontrollers are usually based +on the Harvard architecture. This means that running programs from ram +was virtually impossible. + +Added to this was the fact that the AVR had only 2K of ram and no way +to add more. I avoided serial alternatives, because they are slower +and can't be used as normal RAM inside C code. + +These problems were ultimately fixed by switching to a Z80 +microprocessor. The Z80 could in fact handle more memory and run code +from its RAM, but with it came also the limitation of size. All memory +had to be external to the chip's package and the processor itself came +with no peripherals, as microcontrollers usually do. + +* First prototype + +Three years later, and with the help of many people, I finally +managed to get all the components and build my first working +prototype. It did not look beautiful, but it was functional. + +#+CAPTION: Prototype 1 together with its serial terminal +[[https://thomaslabs.org/media/prototype1.jpg]] + +I wasn't satisfied with this prototype though. It was not what I had +envisioned. I wanted to have a pocket computer and this was nothing +like that. It was huge and full of parts. + +* Partial conclusion + +Thanks to this project I learned a lot about electronics, programming, +circuit design and the inner workigs from a computer. + +Reinventing the wheel wouldn't have been the only way to acquire this +knowledge. But I would definitely recommend it to anyone wanting to +learn about the internals of computers. + +This being said, I can't deny that I still have a lot left to learn. + +* The end? +I wouldn't publish something on the Internet just to say I wasn't able +to accomplish my dream. Or would I? + +It turned out that the idea managed to stay alive long enough, to see +the day in which I decided to give it another try. This time, hoping +that the collected knowledge allows me to get further. + +This requires its own [[local:/z80/plm.html][series of articles]] though. diff --git a/src/z80/prototype2.org b/src/z80/prototype2.org new file mode 100644 index 0000000..ba19bd7 --- /dev/null +++ b/src/z80/prototype2.org @@ -0,0 +1,51 @@ +#+TITLE: Prototype 2 +#+DATE: <2021-03-03> +#+SETUPFILE: ../../options.org + +#+BEGIN_COMMENT +m4_define(`_REL_HEADER', `Next: Prototype 1 Up: Z80')m4_dnl +#+END_COMMENT + +{{{date_place(Bremen, Germany)}}} + +#+CAPTION: Prototype 2 +[[https://thomaslabs.org/media/prototype2_1.jpg]] + +Because when moving to Bremen, I wasn't able to take my old Prototype +with me, I had to build a new one. This time though, I needed +something easily modifiable. + + +One of the disadvantages of my first Prototype, was the fact, that it +took me around 3 days to build and, because it was soldered, it was +difficult to modify. This made experimenting with new ideas somewhat +impractical. + +Prototype 2 would be a prototyping tool, as such, it had to be built +with a technique, that allowed for the electrical stability of a +soldered circuit, but with the flexibility of a breadboard. + +This time I chose the wire wrap assembly technique, as it met all +requirements. + +The following is a list of what I was able to accomplish thanks to +Prototype 2 + +- New memory banking system that would allow it to handle up to 4 MiB + of memory, instead of the default maximum of 64KiB. + +- Add a RTC + +- Add video capabilities using a 480x320 18-bit color display + +- Dual serial ports with complete modem control lines + +#+CAPTION: Prototype 2 together with screen +[[https://thomaslabs.org/media/prototype2_2.jpg]] + +It didn't take long until Prototype 2 became incapable of fulfilling +its task. Once it was clear, which parts would definitely be part of +the final design, the flexibility of wire wrapping was no longer +needed. Added to this, the circuit experimented detrimental voltage +drops, due to the length of wire used. It was now time to design a +third prototype, this time using a PCB. diff --git a/src/z80/spi.org b/src/z80/spi.org new file mode 100644 index 0000000..d0e55a5 --- /dev/null +++ b/src/z80/spi.org @@ -0,0 +1,30 @@ +#+TITLE: SPI for microprocessors +#+SETUPFILE: ../../options.org + +Bremen, Germany, {{{date}}} + +SPI is a useful serial communications interface. It is used in +hobbyist projects to control from memory ICs to LCD screens and it's +even possible to read SD cards through it. + +Most modern microcontrollers are equiped with built-in SPI support, +which can be easily used from code without much hardware required. But +what happends when one wants to interface SPI peripherals with old +microprocessors? These usually don't have any built-in peripherals and +, as far as I am aware, there are no enternal peripherals one can buy. + +This article aims to provide an overview of how SPI works, the +instructions on how to build a SPI module for old microprocessors like +the Z80 and the explanation of how such a module operates. + +This is also a part of my ongoing series on the progress of my [[local:/z80][Z80 +based project]]. + +** Table of Contents +1) [[#how-does-spi-work][How does SPI work]] + +#+NAME: how-does-spi-work +** 1. How does SPI work +:PROPERTIES: +:CUSTOM_ID: how-does-spi-work +:END: -- cgit v1.2.3