From 561bac75579391c14e47eaccfabdf9eda98855da Mon Sep 17 00:00:00 2001 From: Thomas Albers Date: Wed, 27 Jul 2022 18:13:20 +0200 Subject: Initial commit --- math/cylindrical_coordinates.org | 37 +++++++ math/derivatives.org | 31 ++++++ math/index.org | 13 +++ math/integrals.org | 20 ++++ math/levi_cevita.org | 26 +++++ math/math.css | 85 ++++++++++++++++ math/matrices.org | 32 ++++++ math/orbit.org | 93 ++++++++++++++++++ math/polar_coordinates.org | 36 +++++++ math/spherical_coordinates.org | 39 ++++++++ math/trigonometry.org | 51 ++++++++++ math/vectors.org | 58 +++++++++++ math_options.org | 5 + options.org | 4 + publish.el | 205 +++++++++++++++++++++++++++++++++++++++ src/abgabe.org | 101 +++++++++++++++++++ src/index.org | 27 ++++++ src/privacy.org | 96 ++++++++++++++++++ src/programs/index.org | 20 ++++ src/style.css | 123 +++++++++++++++++++++++ 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 ++++++ 25 files changed, 1349 insertions(+) create mode 100644 math/cylindrical_coordinates.org create mode 100644 math/derivatives.org create mode 100644 math/index.org create mode 100644 math/integrals.org create mode 100644 math/levi_cevita.org create mode 100644 math/math.css create mode 100644 math/matrices.org create mode 100644 math/orbit.org create mode 100644 math/polar_coordinates.org create mode 100644 math/spherical_coordinates.org create mode 100644 math/trigonometry.org create mode 100644 math/vectors.org create mode 100644 math_options.org create mode 100644 options.org create mode 100755 publish.el create mode 100644 src/abgabe.org create mode 100644 src/index.org create mode 100644 src/privacy.org create mode 100644 src/programs/index.org create mode 100644 src/style.css 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 diff --git a/math/cylindrical_coordinates.org b/math/cylindrical_coordinates.org new file mode 100644 index 0000000..fab185b --- /dev/null +++ b/math/cylindrical_coordinates.org @@ -0,0 +1,37 @@ +#+TITLE:Cylindrical Coordinates +#+SETUPFILE: ../math_options.org +#+LATEX_HEADER: \usepackage{bm} +#+LATEX_HEADER: \usepackage{mathtools} +#+LATEX_HEADER: \newcommand{\deriv}[2]{\frac{\text{d}#1}{\text{d}#2}} +#+LATEX_HEADER: \newcommand{\unitv}[1]{\bm{\hat{e}}_#1} + +* Disclaimer +This site as of now just a technology demonstration and its claims +should not be taken as true (even though I myself am pretty confident +they are) +* Coordinate transformations +\begin{align*} +x &= r \cos\varphi\\ +y &= r \sin\varphi\\ +z &= z +\end{align*} + +* Local unit vectors +\begin{align*} +\unitv{r} &= \cos\theta \unitv{x} + \sin\theta \unitv{y}\\ +\unitv{\theta} &= -\sin\theta \unitv{x} + \cos\theta \unitv{y}\\ +\unitv{z} &= \unitv{z} +\end{align*} +* Kinematic in cylindrical coordinates +** Time derivatives of the local unit vectors +\begin{align*} +\deriv{\unitv{r}}{t} &= \dot{\theta}\unitv{\theta}\\ +\deriv{\unitv{\theta}}{t} &= -\dot{\theta}\unitv{r}\\ +\deriv{\unitv{z}}{t} &= 0 +\end{align*} +** Position vector and its time derivatives +\begin{align*} +\bm{r} &= r\unitv{r} + z\unitv{z}\\ +\bm{v} &= \dot{r}\unitv{r} + r\dot\theta\unitv{\theta} + \dot{z}\unitv{z}\\ +\bm{a} &= \left(\ddot{r}-r\dot{\theta}^2\right)\unitv{r} + \left(2\dot{r}\dot{\theta}+r\ddot{\theta}\right)\unitv{\theta} + \ddot{z}\unitv{z} +\end{align*} diff --git a/math/derivatives.org b/math/derivatives.org new file mode 100644 index 0000000..4d5d4be --- /dev/null +++ b/math/derivatives.org @@ -0,0 +1,31 @@ +#+TITLE:Table of Derivatives +#+SETUPFILE: ../math_options.org +#+LATEX_HEADER: \usepackage{bm} +#+LATEX_HEADER: \usepackage{mathtools} +#+LATEX_HEADER: \newcommand{\dcoff}[1]{\frac{\text{d}}{\text{d}x} #1} +#+LATEX_HEADER: \newcommand{\sdcoff}[1]{\frac{\text{d}#1}{\text{d}x}} +#+LATEX_HEADER: \newcommand{\deriv}[2]{\frac{\text{d}}{\text{d}x} #1 &= #2} + +* Disclaimer +This site as of now just a technology demonstration and its claims +should not be taken as true (even though I myself am pretty confident +they are) + +* General Properties of the Derivative +Let $f$ and $g$ be real valued functions and $c$ some real constant: +\begin{align*} +\dcoff{(cf)} &= c\sdcoff{f}\\ +\dcoff{(f \pm g)} &= \sdcoff{f} \pm \sdcoff{g}\\ +\dcoff{(fg)} &= \sdcoff{f}g + f\sdcoff{g}\\ +\dcoff{\left(\frac{f}{g}\right)} &= \frac{\sdcoff{f}g - f\sdcoff{g}}{g^2} +\end{align*} + +* Trigonometric Funtions +\begin{align*} +\deriv{\sin(x)}{\cos(x)}\\ +\deriv{\cos(x)}{-\sin(x)}\\ +\deriv{\tan(x)}{\sec^2(x)}\\ +\deriv{\sec(x)}{\sec(x)\tan(x)}\\ +\deriv{\csc(x)}{\csc(x)\cot(x)}\\ +\deriv{\csc(x)}{-\csc^2(x)} +\end{align*} diff --git a/math/index.org b/math/index.org new file mode 100644 index 0000000..069c4b6 --- /dev/null +++ b/math/index.org @@ -0,0 +1,13 @@ +#+TITLE: Math and Physics articles +#+SETUPFILE: ../math_options.org + +- [[file:vectors.org][Cross Product]] +- [[file:cylindrical_coordinates.org][Cylindrical Coordinates]] +- [[file:matrices.org][Matrix Properties]] +- [[file:orbit.org][Orbit]] +- [[file:polar_coordinates.org][Polar Coordinates]] +- [[file:spherical_coordinates.org][Spherical Coordinates]] +- [[file:derivatives.org][Table of Derivatives]] +- [[file:integrals.org][Table of Integrals]] +- [[file:levi_cevita.org][The Levi Cevita Symbol]] +- [[file:trigonometry.org][Trigonometric identities]] \ No newline at end of file diff --git a/math/integrals.org b/math/integrals.org new file mode 100644 index 0000000..6a32903 --- /dev/null +++ b/math/integrals.org @@ -0,0 +1,20 @@ +#+TITLE:Table of Integrals +#+SETUPFILE: ../math_options.org +#+LATEX_HEADER: \usepackage{bm} +#+LATEX_HEADER: \usepackage{mathtools} +#+LATEX_HEADER: \newcommand{\intg}[2]{\int #1 \text{d}x &= #2 + C} + +* Disclaimer +This site as of now just a technology demonstration and its claims +should not be taken as true (even though I myself am pretty confident +they are) + +* Trigonometric Funtions +\begin{align*} +\intg{\sin(x)}{-\cos(x)}\\ +\intg{\cos(x)}{\sin(x)}\\ +\intg{\tan(x)}{-\ln(\cos(x))}\\ +\intg{\sec(x)}{\ln(\sec(x) + \tan(x))}\\ +\intg{\csc(x)}{-\ln(\csc(x) + \cot(x))}\\ +\intg{\cot(x)}{\ln(\sin(x))} +\end{align*} diff --git a/math/levi_cevita.org b/math/levi_cevita.org new file mode 100644 index 0000000..aaa2074 --- /dev/null +++ b/math/levi_cevita.org @@ -0,0 +1,26 @@ +#+TITLE: The Levi Cevita Symbol +#+SETUPFILE: ../math_options.org +#+LATEX_HEADER: \usepackage{bm} +#+LATEX_HEADER: \usepackage{mathtools} + +* Disclaimer +This site as of now just a technology demonstration and its claims +should not be taken as true (even though I myself am pretty confident +they are) +* Levi Cevita symbol +\begin{equation*} +\varepsilon_{ijk} = \left\{\begin{array}{rl} +1,&(i,j,k) \in \{(1,2,3), (2,3,1), (3,1,2)\}\\ +-1,&(i,j,k) \in \{(3,2,1), (2,1,3), (1,3,2)\}\\ +0,&\text{otherwise} +\right{} +\end{array} +\end{equation*} + +\begin{equation*} +\varepsilon_{ijk} = \varepsilon_{jki} = \varepsilon_{kij} = - \varepsilon_{ikj} = - \varepsilon_{jik} = - \varepsilon_{kji} = 1 +\end{equation*} + +\begin{align*} +\sum_{k=1}^3 \varepsilon_{ijk}\varepsilon_{kmn} = \delta_{im} \delta_{jn} - \delta_{in} \delta_{jm} +\end{align*} diff --git a/math/math.css b/math/math.css new file mode 100644 index 0000000..d4e1054 --- /dev/null +++ b/math/math.css @@ -0,0 +1,85 @@ +/* +p.author +p.date +p.creator +.title +.subtitle +.todo +.done +.WAITING +.timestamp +.timestamp-kwd +.timestamp-wrapper +.tag +._HOME +.target +.linenr +.code-highlighted +div.outline-N +div.outline-text-N +.section-number-N +.figure-number +.table-number +.listing-number +div.figure +pre.src +pre.example +p.verse +div.footnotes +p.footnote +.footref +.footnum +.org-svg +*/ + +html { + height: 100%; + color: #cccccc; + background-color: hsl(240, 30%, 10%); +} + +body { + margin: auto; + max-width: 64em; + min-height: 100%; + display: flex; + flex-direction: column; + background-color: hsl(240, 30%, 15%); +} + +main { + padding: 2em 2em 2em 2em; + flex-grow: 1; +} + +h1 { + text-align: center; +} + +#content { + max-width: 50em; + margin: auto; +} + +div.outline-2:first-of-type { + padding: 0.25em 1em; + background-color: hsl(60,30%,30%); +} + +.equation-container { + display: block; + padding: 1em 2em; + background-color: hsl(240, 30%, 20%); + overflow: auto; + border: 1px solid hsl(240, 30%, 50%) +} + +img { + max-width: unset; +} + +.equation-container img { + object-fit: contain; + display: block; + margin: auto; +} diff --git a/math/matrices.org b/math/matrices.org new file mode 100644 index 0000000..a7ba58b --- /dev/null +++ b/math/matrices.org @@ -0,0 +1,32 @@ +#+TITLE:Matrix Properties +#+SETUPFILE: ../math_options.org +#+LATEX_HEADER: \usepackage{bm} +#+LATEX_HEADER: \usepackage{mathtools} + +* Disclaimer +This site as of now just a technology demonstration and its claims +should not be taken as true (even though I myself am pretty confident +they are) +* Basic properties +\begin{align*} +A + B = B + A +\end{align*} +* Dot product +\begin{align*} +(A^\text{T})^\text{T} &= A\\ +(A + B)^\text{T} &= A^\text{T} + B^\text{T}\\ +(AB)^\text{T} &= B^\text{T}A^\text{T} +\end{align*} +* Transpose +\begin{align*} +\bm{a} \cdot \bm{b} &= \overline{\bm{b}} \cdot \bm{a}\\ +\bm{a} \cdot \bm{b} &= \bm{a}^\text{T} \bm{b} +\end{align*} + +* Hermitian transpose +\begin{align*} +A^\ast &= \left[\overline{a_{ij}}\right]\\ +(\lambda A)^\ast &= \left[\overline{\lambda a_{ij}}\right] = \overline{\lambda} \left[a_{ij}\right]^\ast = \overline{\lambda}\,\overline{A}\\ +A^\dag &= (A^\ast)^\text{T}\\ +A^{\dag\dag} &= A +\end{align*} diff --git a/math/orbit.org b/math/orbit.org new file mode 100644 index 0000000..88079a6 --- /dev/null +++ b/math/orbit.org @@ -0,0 +1,93 @@ +#+TITLE:Orbit +#+SETUPFILE: ../math_options.org +#+LATEX_HEADER: \usepackage{bm} +#+LATEX_HEADER: \usepackage{mathtools} +#+LATEX_HEADER: \usepackage{amssymb} +#+LATEX_HEADER: \newcommand{\deriv}[2]{\frac{\text{d}#1}{\text{d}#2}} +#+LATEX_HEADER: \newcommand{\unitv}[1]{\bm{\hat{e}}_#1} + +* Disclaimer +This site as of now just a technology demonstration and its claims +should not be taken as true (even though I myself am pretty confident +they are) +* Deriving Kepler's first law from Newton's law of universal gravitation + +The movement of an object with mass $m$ orbiting another body with mass $M$ is +given by Newton's law of gravitation. If $m \ll M$ it is possible to consider +the position of the larger object constant and use it as the origin of our +coordinate system. Then the following equation applies for movement of the +smaller object: + +\begin{equation*} +m\ddot{\bm{r}} = - \frac{GMm}{r^3}\bm{r} \Leftrightarrow \ddot{\bm{r}} = - \frac{GM}{r^3}\bm{r} +\end{equation*} + +In order to solve this differential equation we first consider the angular +momentum of or object around its orbit. + +\begin{equation*} +\bm{L} = \bm{r} \times m \dot{\bm{r}} +\end{equation*} + +In the abscense of external toques, because the only force acting on the object +is parallel to its position, the angular momentum is conserved. + +\begin{equation*} +\deriv{\bm{L}}{t} = \dot{\bm{r}} \times m \dot{\bm{r}} + \bm{r} \times m \ddot{\bm{r}} = 0 +\end{equation*} + +We now multiply both sides of our equation from the right by the angular +momentum and develop the right side of the equation using vector identities. + +\begin{align*} +\ddot{\bm{r}} \times \bm{L} &= -GM\frac{\bm{r} \times \left(\bm{r} \times m \dot{\bm{r}}\right)}{r^3}\\ +&= - \frac{GMm}{r^3} \left(\left(\bm{r} \cdot \dot{\bm{r}}\right)\bm{r} - \left(\bm{r} \cdot \bm{r}\right)\dot{\bm{r}}\right)\\ +&= GMm\left(\frac{\left(\bm{r} \cdot \bm{r}\right)\dot{\bm{r}}}{r^3} - \frac{\left(\bm{r} \cdot \dot{\bm{r}}\right)\bm{r}}{r^3}\right)\\ +&= GMm\left(\frac{\dot{\bm{r}}}{r} - \frac{\left(\bm{r} \cdot \dot{\bm{r}}\right)\bm{r}}{r^3}\right)\\ +&= GMm\left(\frac{1}{r} \deriv{\bm{r}}{t} + \deriv{}{t}\left(\frac{1}{r}\right)\bm{r}\right)\\ +&= GMm\deriv{}{t}\left(\frac{\bm{r}}{r}\right) +\end{align*} + +We observe that each side of our equation is a derivative of a quantity. We know +integrate both sides and take the integrations constant into account. + +\begin{align*} +& \deriv{}{t} \left(\dot{\bm{r}} \times \bm{L}\right) = GM \deriv{}{t}\left(\frac{\bm{r}}{r}\right)\\ +\Leftrightarrow \quad & \dot{\bm{r}} \times \bm{L} = GM \frac{\bm{r}}{r} + \bm{a} +\end{align*} + +Our objective is now to solve the equation for $r$, so we multiply both sides by $\bm{r}$: + +\begin{align*} +\dot{\bm{r}} \times \left(\bm{r} \times \dot{\bm{r}}\right) &= GM \frac{\bm{r}}{r} + \bm{a}\\ +\bm{r} \cdot \left(\dot{\bm{r}} \times \left(\bm{r} \times \dot{\bm{r}}\right)\right) &= GMr + \bm{r} \cdot \bm{a} +\end{align*} + +By applying a cyclic permutation of the resulting triple product and using the +known property of the scalar product we now express the equation only in terms +of the magnitudes of the vectors. + +\begin{align*} +\left(\bm{r} \times \dot{\bm{r}}\right) \cdot \left(\bm{r} \times \dot{\bm{r}}\right) &= GMr + \bm{r} \cdot \bm{a}\\ +\left(\frac{L}{m}\right)^2 &= GMr + \bm{r} \cdot \bm{a}\\ +\left(\frac{L}{m}\right)^2 &= GMr + r a \cos\theta +\end{align*} + +The last steps are to solve for $r$ + +\begin{align*} +r &= \left(\frac{L}{m}\right)^2 \frac{1}{GM + a \cos\theta}\\ +&= \left(\frac{L}{m}\right)^2 \frac{1}{GM} \frac{1}{1 + \frac{a}{GM} \cos\theta}\\ +&= \left(\frac{L}{m}\right)^2 \frac{1}{GM} \frac{1}{1 + e\cos\theta} +\end{align*} + +Finally we reach our result. Objects orbiting according to Newton's Law of +Gravitation follow paths that correspond to the conic sections. Here is Kepler's +first Law a special case, where our object has a stable orbit around the larger +body. + +\begin{equation*} +r &= \frac{L^2}{GM m^2} \frac{1}{1 + e\cos\theta} +\end{equation*} + +* Deriving a physical interpretation of the excentricity of the orbit diff --git a/math/polar_coordinates.org b/math/polar_coordinates.org new file mode 100644 index 0000000..ff07be3 --- /dev/null +++ b/math/polar_coordinates.org @@ -0,0 +1,36 @@ +#+TITLE:Polar Coordinates +#+SETUPFILE: ../math_options.org +#+LATEX_HEADER: \usepackage{bm} +#+LATEX_HEADER: \usepackage{mathtools} +#+LATEX_HEADER: \newcommand{\deriv}[2]{\frac{\text{d}#1}{\text{d}#2}} +#+LATEX_HEADER: \newcommand{\unitv}[1]{\bm{\hat{e}}_#1} + +* Disclaimer +This site as of now just a technology demonstration and its claims +should not be taken as true (even though I myself am pretty confident +they are) +* Coordinate transformations +\begin{align*} +x &= r \cos\theta\\ +y &= r \sin\theta +\end{align*} + +* Local unit vectors +\begin{align*} +\unitv{r} &= \cos\theta \unitv{x} + \sin\theta \unitv{y}\\ +\unitv{\theta} &= -\sin\theta \unitv{x} + \cos\theta \unitv{y} +\end{align*} + +* Kinematic in polar coordinates +** Time derivatives of the local unit vectors +\begin{align*} +\deriv{\unitv{r}}{t} &= \dot{\theta}\unitv{\theta}\\ +\deriv{\unitv{\theta}}{t} &= -\dot{\theta}\unitv{r} +\end{align*} +** Position vector and its time derivatives +\begin{align*} +\bm{r} &= r\unitv{r}\\ +\bm{v} &= \dot{r}\unitv{r} + r\dot\theta\unitv{\theta}\\ +\bm{a} &= \left(\ddot{r} - r\dot\theta^2\right)\unitv{r} ++ \left(2\dot{r}\dot\theta + r\ddot\theta\right)\unitv{\theta} +\end{align*} diff --git a/math/spherical_coordinates.org b/math/spherical_coordinates.org new file mode 100644 index 0000000..1c7fd9c --- /dev/null +++ b/math/spherical_coordinates.org @@ -0,0 +1,39 @@ +#+TITLE:Spherical Coordinates +#+SETUPFILE: ../math_options.org +#+LATEX_HEADER: \usepackage{bm} +#+LATEX_HEADER: \usepackage{mathtools} +#+LATEX_HEADER: \newcommand{\deriv}[2]{\frac{\text{d}#1}{\text{d}#2}} +#+LATEX_HEADER: \newcommand{\unitv}[1]{\bm{\hat{e}}_#1} + +* Disclaimer +This site as of now just a technology demonstration and its claims +should not be taken as true (even though I myself am pretty confident +they are) +* Coordinate transformations +\begin{align*} +x &= r \sin\theta \cos\varphi\\ +y &= r \sin\theta \sin\varphi\\ +z &= r \cos\theta +\end{align*} + +* Local unit vectors +\begin{align*} +\bm{\hat{e}}_r &= \sin\theta \cos\varphi \bm{\hat{e}}_x + \sin\theta \sin\varphi \bm{\hat{e}}_y + \cos\theta \bm{\hat{e}}_z\\ +\bm{\hat{e}}_\theta &= \cos\theta \cos\varphi \bm{\hat{e}}_x + \cos\theta \sin\varphi \bm{\hat{e}}_y - \sin\theta \bm{\hat{e}}_z\\ +\bm{\hat{e}}_\varphi &= - \sin\theta \sin\varphi \bm{\hat{e}}_x + \sin\theta \cos\varphi \bm{\hat{e}}_y +\end{align*} +* Kinematic in spherical coordinates +** Time derivatives of the local unit vectors +\begin{align*} +\deriv{\unitv{r}}{t} &= \dot{\theta}\unitv{\theta} + \dot{\varphi}\sin\theta \unitv{\varphi}\\ +\deriv{\unitv{\theta}}{t} &= -\dot{\theta}\unitv{r} + \dot{\varphi}\cos\theta \unitv{\varphi}\\ +\deriv{\unitv{\varphi}}{t} &= -\dot{\varphi} \left(\sin\theta\unitv{r} + \cos\theta\unitv{\theta}\right) +\end{align*} +** Position vector and its time derivatives +\begin{align*} +\bm{r} &= r\unitv{r}\\ +\bm{v} &= \dot{r}\unitv{r} + r\dot\theta\unitv{\theta} + r\dot\varphi\sin\theta\unitv{\varphi}\\ +\bm{a} &= \left(\ddot{r} - r\dot\theta^2 - r\dot\varphi^2\sin^2\theta\right)\unitv{r} ++ \left(2\dot{r}\dot\theta + r\ddot\theta - r\dot\varphi^2\sin\theta\cos\theta\right)\unitv{\theta} ++ \left(2\dot{r}\dot\varphi\sin\theta + 2r\dot\theta\dot\varphi\cos\theta + r\ddot\varphi\sin\theta\right)\unitv{\varphi} +\end{align*} diff --git a/math/trigonometry.org b/math/trigonometry.org new file mode 100644 index 0000000..3e81eeb --- /dev/null +++ b/math/trigonometry.org @@ -0,0 +1,51 @@ +#+TITLE:Trigonometric identities +#+SETUPFILE: ../math_options.org +#+LATEX_HEADER: \usepackage{bm} +#+LATEX_HEADER: \usepackage{mathtools} + +* Disclaimer +This site as of now just a technology demonstration and its claims +should not be taken as true (even though I myself am pretty confident +they are) + +* Pythagorean identities +\begin{align*} +&\cos^2\left(x\right) + \sin^2\left(x\right) = 1\\ +&\tan^2\left(x\right) + 1 = \sec^2\left(x\right)\\ +&1 + \cot^2\left(x\right) = \csc^2\left(x\right) +\end{align*} +* Sum of angles +\begin{align*} +&\sin\left(a \pm b\right) = \sin\left(a\right)\cos\left(b\right) \pm \cos\left(a\right)\sin\left(b\right)\\ +&\cos\left(a \pm b\right) = \cos\left(a\right)\cos\left(b\right) \mp \sin\left(a\right)\sin\left(b\right)\\ +&\tan(a \pm b) = \frac{\tan(a) \pm \tan(b)}{1 \mp \tan(a) \tan(b)} +\end{align*} +* Multiple angles +\begin{align*} +&\sin(2\theta) = 2\sin(\theta)\cos(\theta)\\ +&\cos(2\theta) = \cos^2\theta - \sin^2\theta = 2\cos^2\theta - 1 = 1 - 2\sin^2\theta +\end{align*} +* Half-angle formulae +\begin{align*} +&\sin \frac{\theta}{2} = \pm \sqrt{\frac{1-\cos\theta}{2}}\\ +&\cos \frac{\theta}{2} = \pm \sqrt{\frac{1+\cos\theta}{2}} +\end{align*} +* Power-reduction formulae +\begin{align*} +&\sin^2\theta = \frac{1 - \cos(2\theta)}{2}\\ +&\cos^2\theta = \frac{1 + \cos(2\theta)}{2} +\end{align*} +* Product-to-sum formulae +\begin{align*} +&2 \cos\theta \cos\varphi = \cos(\theta-\varphi) + \cos(\theta+\varphi)\\ +&2 \sin\theta \sin\varphi = \cos(\theta-\varphi) - \cos(\theta+\varphi)\\ +&2 \sin\theta \cos\varphi = \sin(\theta+\varphi) + \sin(\theta-\varphi)\\ +&2\cos\theta\sin\varphi = \sin(\theta+\varphi) - \sin(\theta-\varphi) +\end{align*} +* Sum-to-product formulae +\begin{align*} +&\sin\theta \pm \sin\varphi = 2 \sin\left(\frac{\theta\pm\varphi}{2}\right) \cos\left(\frac{\theta\mp\varphi}{2}\right)\\ +&\cos\theta + \cos\varphi = 2 \cos\left(\frac{\theta+\varphi}{2}\right) \cos\left(\frac{\theta-\varphi}{2}\right)\\ +&\tan\theta \pm \tan\varphi = \frac{\sin(\theta\pm\varphi)}{\cos\theta \cos\varphi}\\ +&\cos\theta - \cos\varphi = - 2 \sin\left(\frac{\theta+\varphi}{2}\right) \sin\left(\frac{\theta-\varphi}{2}\right) +\end{align*} diff --git a/math/vectors.org b/math/vectors.org new file mode 100644 index 0000000..49d8132 --- /dev/null +++ b/math/vectors.org @@ -0,0 +1,58 @@ +#+TITLE:Cross Product +#+SETUPFILE: ../math_options.org +#+LATEX_HEADER: \usepackage{bm} +#+LATEX_HEADER: \usepackage{mathtools} + +* Disclaimer +This site as of now just a technology demonstration and its claims +should not be taken as true (even though I myself am pretty confident +they are) + +* Definition +We shall define the cross product in terms of two properties we are +interested in: + +- Distributive: $\bm{a} \times \left(\bm{b} + \bm{c}\right) = \bm{a} \times \bm{b} + \bm{a} \times \bm{c}$ +- Orthogonal: $\bm{a} \times \bm{b} = \bm{c} \implies \bm{c} \cdot \bm{a} = \bm{0} \land \bm{c} \cdot \bm{b} = \bm{0}$ + +It is worth mentioning that given a pair of vectors in $\mathbb{R}^3$ +there exist an infinite amount of vectors that satisfy these +properties, so it is also necessary to introduce the following +relations between the basis vectors to properly define the cross +product. + +\begin{align*} +\bm{e}_1 &= \bm{e}_2 \times \bm{e}_3\\ +\bm{e}_2 &= \bm{e}_3 \times \bm{e}_1\\ +\bm{e}_3 &= \bm{e}_1 \times \bm{e}_2\\ +\bm{e}_i \times \bm{e}_i &= \bm{0},\qquad\text{For}\quad i = 1,2,3 +\end{align*} + +We introduce the Levi-Civita symbol to condense our calculations. + +\begin{equation*} +\epsilon_{ijk} \coloneqq \bm{e}_i \cdot \left(\bm{e}_j \times \bm{e}_k\right) +\end{equation*} + +Based on this we may now derive a way to compute the cross product of +two vectors + +\begin{align*} +\left[\bm{a} \times \bm{b}\right]_i &= \left[\left(\sum_j a_j \bm{e}_j\right) \times \left(\sum_k b_k \bm{e_k}\right)\right]_i\\ +&= \left[\sum_{jk} a_j b_k \left(\bm{e}_j \times \bm{e}_k\right)\right]_i\\ +&= \sum_{jk} a_j b_k \bm{e}_i \cdot \left(\bm{e}_j \times \bm{e}_k\right)\\ +&= \sum_{jk} \epsilon_{ijk} a_j b_k\\ +\bm{a} \times \bm{b} &= \sum_{ijk} \epsilon_{ijk} a_i b_j \bm{e}_k +\end{align*} + +* Properties +\begin{align*} +&\bm{a} \times \bm{b} = - \bm{b} \times \bm{a}\\ +&\bm{a} \cdot \left(\bm{b} \times \bm{c}\right) += \bm{b} \cdot \left(\bm{c} \times \bm{a}\right) += \bm{c} \cdot \left(\bm{a} \times \bm{b}\right)\\ +&\bm{a} \times \left(\bm{b} \times \bm{c}\right) += \left(\bm{a} \cdot \bm{c}\right)\bm{b} - \left(\bm{a} \cdot \bm{b}\right)\bm{c}\\ +&\left(\bm{a} \times \bm{b}\right) \times \left(\bm{c} \times \bm{d}\right) += \left(\bm{a}\cdot\bm{c}\right) \left(\bm{b}\cdot\bm{d}\right) - \left(\bm{a}\cdot\bm{d}\right) \left(\bm{b}\cdot\bm{c}\right) +\end{align*} diff --git a/math_options.org b/math_options.org new file mode 100644 index 0000000..5fd9baa --- /dev/null +++ b/math_options.org @@ -0,0 +1,5 @@ +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD_EXTRA: +#+HTML_HEAD_EXTRA: +#+MACRO: date_place $1, $2, {{{date(%B %d\, %Y)}}} diff --git a/options.org b/options.org new file mode 100644 index 0000000..234c394 --- /dev/null +++ b/options.org @@ -0,0 +1,4 @@ +#+HTML_HEAD: +#+HTML_HEAD_EXTRA: +#+HTML_HEAD_EXTRA: +#+MACRO: date_place $1, $2, {{{date(%B %d\, %Y)}}} diff --git a/publish.el b/publish.el new file mode 100755 index 0000000..a327d02 --- /dev/null +++ b/publish.el @@ -0,0 +1,205 @@ +#!/usr/bin/env -S emacs -Q --batch --script + +(require 'ox) +(require 'esxml) + +(defun thomaslabs-navbar () + (sxml-to-xml + `(nav + (ul + (li (a (@ (href "/")) + "Home")) + (li (a (@ (href "/z80/")) + "Z80")) + (li (a (@ (href "/programs/")) + "programs")) + (li (a (@ (href "/math/")) + "math")) + (li (a (@ (href "/privacy.html")) + "contact & privacy policy")))))) + +(defun thomaslabs-footer () + (sxml-to-xml + `(footer + (p + "Copyright © 2021 - 2022 Thomas Albers Raviola" + (br) + "This website and its contents are published under the +following licences, unless otherwise specified" + (ul + (li "Website and images:" + (a (@ (href "https://creativecommons.org/licenses/by-nc-sa/4.0/")) + "CC BY-NC-SA 4.0")) + (li "Schematics:" + (a (@ (href "https://creativecommons.org/licenses/by-nc-nd/4.0/")) + "CC BY-NC-ND 4.0")) + (li "Code:" + (a (@ (href "https://www.gnu.org/licenses/gpl-3.0.html")) + "GPL-3.0"))))))) + +(defun thomaslabs-template (contents info) + (concat + "\n" + (sxml-to-xml + `(html (@ (lang "en")) + (head + ,(org-html--build-meta-info + `(:title ,(if (plist-get info :title) + (format "Thomas' Labs | %s" (car (plist-get info :title))) + "Thomas' Labs") + ,@info)) + ,(org-html--build-head info)) + (body + ,(if-let ((title (plist-get info :title))) + `(header + (p "Thomas' Labs") + (h1 ,(org-export-data title info))) + `(header + (h1 "Thomas' Labs"))) + ,(thomaslabs-navbar) + (div (@ (class "content")) + (main + (article ,contents))) + (hr) + ,(thomaslabs-footer)))))) + +(defun math-preamble (&rest args) + (sxml-to-xml + '(div + (h2 "Disclaimer") + (p "This site as of now just a technology demonstration and its claims +should not be taken as true (even though I myself am pretty confident +they are")))) + +(defun math-sitemap (title entries) + (concat (format "#+TITLE: %s\n#+SETUPFILE: ../math_options.org\n\n" title) + (org-list-to-org entries))) + + +(defun org-local-link-export (link description format info) + (format "%s" + link + description)) + +(defun org-img-link-export (link description format info) + (message "%s" info) + (format "%s" + link + description)) + +(defun org-local-link-follow (&rest args) + t) + +(org-link-set-parameters "local" + :follow #'org-local-link-follow + :export #'org-local-link-export) + +(org-link-set-parameters "img" + :follow #'org-local-link-follow + :export #'org-img-link-export) + +(org-export-define-derived-backend 'thomaslabs-html 'html + :translate-alist + '((template . thomaslabs-template))) + +(defun thomaslabs-publish-to-html (plist filename pub-dir) + "Publish an org file to HTML, using the FILENAME as the output directory." + (org-publish-org-to 'thomaslabs-html + filename + ".html" + plist + pub-dir)) + +(setq org-publish-project-alist + `(("thomaslabs_html" + :base-directory "~/Code/websites/thomaslabs/src" + :publishing-directory "/srv/web/thomaslabs" + :publishing-function thomaslabs-publish-to-html + :with-toc nil + :recursive t + + :language "en_US" + + :html-head-include-default-style nil + :html-head-include-scripts nil + :html-preamble nil + :html-postamble nil + :html-use-infojs nil + :html-html5-fancy t + :html-doctype "html5" + :with-toc nil + :section-numbers nil + :with-latex dvisvgm) + + ("math_html" + :base-directory "~/Code/websites/thomaslabs/math" + :publishing-directory "/srv/web/thomaslabs/math" + :publishing-function thomaslabs-publish-to-html + :with-toc nil + :recursive t + + :language "en_US" + + :html-head-include-default-style nil + :html-head-include-scripts nil + :html-preamble math-preamble + :html-postamble nil + :html-use-infojs nil + :html-html5-fancy t + :html-doctype "html5" + :with-toc nil + + :auto-sitemap t + :sitemap-filename "index.org" + :sitemap-title "Math and Physics articles" + :sitemap-function math-sitemap + + :section-numbers nil + :with-latex dvisvgm) + + ("math_svg" + :base-directory "~/Code/websites/thomaslabs/math/ltximg" + :base-extension "svg" + :publishing-directory "/srv/web/thomaslabs/math/ltximg" + :publishing-function org-publish-attachment) + + ("math_css" + :base-directory "~/Code/websites/thomaslabs/math" + :base-extension "css" + :publishing-directory "/srv/web/thomaslabs" + :publishing-function org-publish-attachment) + + ("thomaslabs_css" + :base-directory "~/Code/websites/thomaslabs/src" + :base-extension "css" + :publishing-directory "/srv/web/thomaslabs" + :publishing-function org-publish-attachment) + + ("thomaslabs_media" + :base-directory "~/Code/websites/thomaslabs/media" + :base-extension "jpg\\|gif\\|png" + :publishing-directory "/srv/web/thomaslabs/media" + :publishing-function org-publish-attachment) + + ("thomaslabs" + :components ("thomaslabs_html" + "thomaslabs_media" + "thomaslabs_css")) + + ("thomaslabs_math" + :components ("math_html" + "math_css" + "math_svg")))) + +(plist-put org-format-latex-options :html-foreground "#cccccc") + +(org-publish "thomaslabs" t) +(org-publish "thomaslabs_math" t) + +;; (let ((opt "--delete -Prlpte 'ssh -p 1764'") +;; (src "'/srv/web/thomaslabs/'") +;; (dst "'root@thomaslabs.org:/var/www/math/'")) +;; (call-process-shell-command (format "rsync %s %s %s" opt src dst))) + +;; (org-publish "thomaslabs" t) +;; (org-publish "math_svg" t) diff --git a/src/abgabe.org b/src/abgabe.org new file mode 100644 index 0000000..772d04d --- /dev/null +++ b/src/abgabe.org @@ -0,0 +1,101 @@ +#+TITLE: Übungsblatt 5 - Aufgabe 3 +#+HTML_HEAD_EXTRA: +#+SETUPFILE: ../options.org + +[[https://thomaslabs.org/shortcoil.m][Quellcode herunterladen]] + +* Ergebnisse des Programms +[[https://thomaslabs.org/media/betrag.png]] + +[[https://thomaslabs.org/media/richtung.png]] + +[[https://thomaslabs.org/media/spulenachse.png]] +* Octave / Matlab Quellcode +#+BEGIN_SRC octave + clear all; + close all; + clc; + + %% length of the observed region in m + len = 40e-3; %m + len = len / 2; %we shall go from -len to +len + %% number of points in x- and z-direction + N_space = 50; + %% number of points for integration along coil + N_phi = 250; + %% radius + R = 5e-3; %m + %% length + L = 23e-3; %m + %% number of windings + N = 5; + %% current + I = 8; %A + %% vacuumpermeability + mu0 = 4 * pi * 1e-7; %Vs/Am + + %% define grid + z = linspace(-len, len, N_space); %m + x = linspace(-len, len, N_space); %m + + %% parameter of coil-wire-path-paramtrisation + phi = linspace(0, N * 2 * pi, N_phi); + dphi = phi(2) - phi(1); + + %% Precalculate cos and sin + p_sin = sin(phi); + p_cos = cos(phi); + + %% loop through all x-z-points + for iz = 1 : N_space + for ix = 1 : N_space + %% r of this x-z-point + r = [x(ix); 0; z(iz)]; + B = [0; 0; 0]; + + %% Riemann sum along the coil + for ip = 1 : N_phi + %% Point along the coil + l = [R * p_cos(ip); R * p_sin(ip); ip * L / N_phi - L / 2]; + %% Vector tangent to the coil of length dl = R * dphi + dl = [- R * p_sin(ip); R * p_cos(ip); L / 2 / N / pi]; + dl = (R * dphi / norm(dl)) * dl; + %% Vector from the coil to the x-z-point + rp = r - l; + %% Add dB + B = B + (mu0 / 4 / pi) * I * (1 / norm(rp) ^ 3) * cross(dl, rp); + end + + B_X(iz, ix) = B(1); + B_Y(iz, ix) = B(2); + B_Z(iz, ix) = B(3); + end + end + + figure('Name', 'Richtung der Flußdichte', 'NumberTitle', 'off'); + quiver(x * 1e3, z * 1e3, B_X ./ sqrt(B_X .^ 2 + B_Z .^ 2), + B_Z ./ sqrt(B_X .^ 2 + B_Z .^ 2)); + title('Richtung der Flußdichte') + xlabel('x [mm]') + ylabel('z [mm]') + axis image + saveas(gca, 'richtung.png') + + betrag = sqrt(B_X .^ 2 + B_Y .^ 2 + B_Z .^ 2) + figure('Name', 'Betrag der Flußdichte', 'NumberTitle', 'off'); + imagesc(x * 1e3, z * 1e3, betrag); + title('Betrag der Flußdichte'); + xlabel('x [mm]') + ylabel('z [mm]') + colormap(gray); + colorbar('title', 'B [T]'); + saveas(gca, 'betrag.png') + + figure('Name', 'Flußdichte entlang Spulenachse', 'NumberTitle', 'off'); + B_2 = B_Z(:, round((N_space - 1) / 2)); + plot(x * 1e3, B_2); + title('Flußdichte entlang Spulenachse'); + xlabel('z [mm]'); + ylabel('Flußdichte [T]'); + saveas(gca, 'spulenachse.png') +#+END_SRC diff --git a/src/index.org b/src/index.org new file mode 100644 index 0000000..77dfc1f --- /dev/null +++ b/src/index.org @@ -0,0 +1,27 @@ +#+DATE: <2021-02-26> +#+SETUPFILE: ../options.org +{{{date_place(Bremen, Germany)}}} + +/Welcome!/ I am Thomas and this is my personal website. + + +/Note: This site is still under development!/ + +The idea behind this site is to share with the world the stuff +I do in my free time. Here you can find articles about +hobbyist electronics, programming and maybe in the future even +math and physics. + +You can contact me through my email +@@html:@@thomas at thomaslabs dot org@@html:@@. +Here is my [[local:/pub.key][OpenPGP key]]. + +** Donations +If you wish to support the things I do, a donation is always welcome. + +- Monero ([[/xmr.png][XMR QR)]]: + @@html:@@ + 4A8brnoX1B9NNopzoYMvAQW1ggA6sWBckN3McRTsU3mtFFkTV71XpWJHn4JHAytdo6CEqrcmhGqx556G7Fb7HNBRUaujwwB + @@html:@@ + +- [[https://paypal.me/thomasalbersraviola][PayPal]] diff --git a/src/privacy.org b/src/privacy.org new file mode 100644 index 0000000..9e48a38 --- /dev/null +++ b/src/privacy.org @@ -0,0 +1,96 @@ +#+TITLE: Privacy Policy +#+HTML_HEAD_EXTRA: +#+SETUPFILE: ../options.org + +Personal data (usually referred to just as "data" below) +will only be processed by us to the extent necessary and +for the purpose of providing a functional and +user-friendly website, including its contents, and the +services offered there. + +Per Art. 4 No. 1 of Regulation (EU) 2016/679, i.e. the +General Data Protection Regulation (hereinafter referred +to as the "GDPR"), "processing" refers to any operation or set of +operations such as collection, recording, organization, structuring, +storage, adaptation, alteration, retrieval, consultation, use, +disclosure by transmission, dissemination, or otherwise making +available, alignment, or combination, restriction, erasure, or +destruction performed on personal data, whether by automated means or +not. + +The following privacy policy is intended to inform you in particular +about the type, scope, purpose, duration, and legal basis for the +processing of such data either under our own control or in conjunction +with others. We also inform you below about the third-party components +we use to optimize our website and improve the user experience which +may result in said third parties also processing data they collect and +control. + +Our privacy policy is structured as follows: + +1) Information about us as controllers of your data +2) The rights of users and data subjects +3) Information about the data processing + +* I. Information about us as controllers of your data +The party responsible for this website (the "controller") for +purposes of data protection law is: + +Thomas Albers Raviola@@html:
@@ +Email: tgalbers2000 /at/ google /dot/ com + +* II. The rights of users and data subjects +With regard to the data processing to be described in more detail +below, users and data subjects have the right + +#+ATTR_HTML: :type disc +- to confirmation of whether data concerning them is being processed, + information about the data being processed, further information + about the nature of the data processing, and copies of the data (cf. + also Art. 15 GDPR); + +- to correct or complete incorrect or incomplete data (cf. also Art. + 16 GDPR); + +- to the immediate deletion of data concerning them (cf. also Art. 17 + DSGVO), or, alternatively, if further processing is necessary as + stipulated in Art. 17 Para. 3 GDPR, to restrict said processing per + Art. 18 GDPR; + +- to receive copies of the data concerning them and/or provided by + them and to have the same transmitted to other providers/controllers + (cf. also Art. 20 GDPR); + +- to file complaints with the supervisory authority if they believe + that data concerning them is being processed by the controller in + breach of data protection provisions (see also Art. 77 GDPR). + +In addition, the controller is obliged to inform all recipients to +whom it discloses data of any such corrections, deletions, or +restrictions placed on processing the same per Art. 16, 17 Para. 1, 18 +GDPR. However, this obligation does not apply if such notification is +impossible or involves a disproportionate effort. Nevertheless, users +have a right to information about these recipients. + +#+BEGIN_EXPORT html + +Likewise, under Art. 21 GDPR, users and data subjects have the right +to object to the controller's future processing of their data pursuant +to Art. 6 Para. 1 lit. f) GDPR. In particular, an objection to data +processing for the purpose of direct advertising is permissible. + +#+END_EXPORT + +* III. Information about the data processing + +We do not store any data. + +#+BEGIN_EXPORT html + +Model Data Protection Statement for +Anwaltskanzlei Weiß & Partner +#+END_EXPORT diff --git a/src/programs/index.org b/src/programs/index.org new file mode 100644 index 0000000..f5ac0b1 --- /dev/null +++ b/src/programs/index.org @@ -0,0 +1,20 @@ +#+TITLE: Programs +#+DATE: <2021-02-26> +#+SETUPFILE: ../../options.org + +{{{date_place(Bremen, Germany)}}} + +The purpose of this section is to serve as place to share the +collections of programs I have written. + +All programs here published are under the conditions of the [[https://www.gnu.org/licenses/gpl-3.0.en.html"][GPLv3 +Licence]] unless explicitly noted and are therefore [[https://www.fsf.org/about/what-is-free-software][Free Software]]. + +Many of these programs were created to solve particular +problems that maybe only I had. As such I may not include +changes to them, unless I really felt that such changes could +improve their performance and use range. That being said, feel +free to adapt them to your own use case. + +- [[https://gitlab.com/thonos/autotag][autotag]] a program designed to fill metadata into songs from within + the terminal (uses dmenu). diff --git a/src/style.css b/src/style.css new file mode 100644 index 0000000..bd731ad --- /dev/null +++ b/src/style.css @@ -0,0 +1,123 @@ +html { + height: 100%; + color: #cccccc; + background-color: hsl(240, 30%, 10%);/*#452b41*/ /*#2c314b*/ +} + +body { + margin: auto; + max-width: 64em; + min-height: 100%; + display: flex; + flex-direction: column; + background-color: hsl(240, 30%, 15%); +} + +nav { + /*#3a2438*/ /*#2a3257*/ + background-color: hsl(240, 30%, 20%); +} + +nav > ul { + display: flex; + margin: 0 auto; +} + +nav > ul > li:last-child { + margin-left: auto; +} + +nav ul { + padding: 0; +} + +nav li { + margin: 2px; + display: block; + list-style: none; +} + +nav li:hover { + background-color: hsl(240, 30%, 30%); +} + +nav .submenu:hover .submenu-contents { + display: block; +} + +nav .submenu-contents { + display: none; + position: absolute; + z-index: 10; + background-color: red; +} + +nav a, +nav span { + text-decoration: none; + color: #dddddd; + display: block; + line-height: 2em; + height: 2em; + margin-left: 1em; + margin-right: 1em; +} + +nav span { + cursor: pointer; +} + +.article-date { + margin-left: auto; +} + +.link-like, a { + color: #eeeeee; + text-decoration: underline; +} + +.rel-header { + padding: 1em 2em 1em 2em; +} + +header { + background-color: hsl(240, 30%, 10%); +} + +header p { + text-align: center; + margin-bottom: 0.15em; +} + +header p ~ h1 { + margin-top: 0.15em; +} + +main { + padding: 2em 2em 2em 2em; + flex-grow: 1; +} + +hr { + margin: 0; + margin-top: auto; +} + +footer { + padding: 1em 2em 1em 2em; +} + +figure { + text-align: center; +} + +figure img { + max-width: 30em; + object-fit: contain; + display: block; + margin: auto; +} + +h1, h2, h3, h4, h5, h6 { + text-align: center; +} 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