All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
172 lines
13 KiB
HTML
172 lines
13 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en-us">
|
||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script><meta charset="utf-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||
<title>Tetris - Minimal Setups</title>
|
||
<meta name="generator" content="Hugo 0.140.2">
|
||
<link href="http://172.16.3.33:1313//index.xml" rel="alternate" type="application/rss+xml">
|
||
<link rel="canonical" href="http://172.16.3.33:1313/blog/tetris/">
|
||
<link rel="stylesheet" href="http://172.16.3.33:1313/css/theme.min.css">
|
||
<link rel="stylesheet" href="http://172.16.3.33:1313/css/chroma.min.css">
|
||
<script defer src="http://172.16.3.33:1313//js/fontawesome6/all.min.js"></script>
|
||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
||
<script src="https://cdn.jsdelivr.net/npm/jquery.easing@1.4.1/jquery.easing.min.js" integrity="sha256-H3cjtrm/ztDeuhCN9I4yh4iN2Ybx/y1RM7rMmAesA0k=" crossorigin="anonymous"></script>
|
||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js" integrity="sha256-4XodgW4TwIJuDtf+v6vDJ39FVxI0veC/kSCCmnFp7ck=" crossorigin="anonymous"></script>
|
||
<script src="http://172.16.3.33:1313/js/bundle.js"></script><style>
|
||
:root {}
|
||
</style>
|
||
<meta property="og:url" content="http://172.16.3.33:1313/blog/tetris/">
|
||
<meta property="og:site_name" content="Minimal Setups">
|
||
<meta property="og:title" content="Tetris">
|
||
<meta property="og:description" content="Tetris - Hardware and Software Update Amplifier (separate input circuitry per PSG, it appears, that a silent PSG has a DC level on its output which is summarized to the AC output of the working PSG, so two input circuits with individual couping capacitor):
|
||
Update of the power switch of the amplifier (at appears, that the small transistor couldn’t deliver enough current):
|
||
This Tetris implementation consists of a hardware and a software (running on that hardware).">
|
||
<meta property="og:locale" content="en_us">
|
||
<meta property="og:type" content="article">
|
||
<meta property="article:section" content="blog">
|
||
<meta property="article:published_time" content="2024-05-27T00:00:00+00:00">
|
||
<meta property="article:modified_time" content="2024-05-27T00:00:00+00:00">
|
||
|
||
<meta name="twitter:card" content="summary">
|
||
<meta name="twitter:title" content="Tetris">
|
||
<meta name="twitter:description" content="Tetris - Hardware and Software Update Amplifier (separate input circuitry per PSG, it appears, that a silent PSG has a DC level on its output which is summarized to the AC output of the working PSG, so two input circuits with individual couping capacitor):
|
||
Update of the power switch of the amplifier (at appears, that the small transistor couldn’t deliver enough current):
|
||
This Tetris implementation consists of a hardware and a software (running on that hardware).">
|
||
|
||
<meta itemprop="name" content="Tetris">
|
||
<meta itemprop="description" content="Tetris - Hardware and Software Update Amplifier (separate input circuitry per PSG, it appears, that a silent PSG has a DC level on its output which is summarized to the AC output of the working PSG, so two input circuits with individual couping capacitor):
|
||
Update of the power switch of the amplifier (at appears, that the small transistor couldn’t deliver enough current):
|
||
This Tetris implementation consists of a hardware and a software (running on that hardware).">
|
||
<meta itemprop="datePublished" content="2024-05-27T00:00:00+00:00">
|
||
<meta itemprop="dateModified" content="2024-05-27T00:00:00+00:00">
|
||
<meta itemprop="wordCount" content="554"><script type="text/javascript" id="MathJax-script" async
|
||
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
|
||
</script>
|
||
</head>
|
||
<body>
|
||
|
||
<div class="container"><header>
|
||
<h1>Minimal Setups</h1>
|
||
</header>
|
||
<div class="global-menu">
|
||
<nav>
|
||
<ul>
|
||
<li class=""><a href="/keys/">Keys</a></li>
|
||
<li class=""><a href="/about/">About</a></li></ul>
|
||
</nav>
|
||
</div>
|
||
|
||
<div class="content-container">
|
||
<main><h1>Tetris</h1>
|
||
<time>Mon, May 27, 2024</time><h1 id="tetris---hardware-and-software">Tetris - Hardware and Software</h1>
|
||
<p><img src="/IMG_4936.jpg" alt=""></p>
|
||
<p>Update Amplifier (separate input circuitry per PSG, it appears, that a silent PSG has a DC level on its output which is summarized to the AC output of the working PSG, so two input circuits with individual couping capacitor):</p>
|
||
<p><img src="/IMG_4941.jpg" alt=""></p>
|
||
<p>Update of the power switch of the amplifier (at appears, that the small transistor couldn’t deliver enough current):</p>
|
||
<p><img src="/IMG_4958.jpeg" alt=""></p>
|
||
<p>This Tetris implementation consists of a hardware and a software (running on that hardware).</p>
|
||
<p>The hardware utilizes four MSP430 microcontrollers for 1.) the game play, 2.) the play ground canvas, 3.) the score display and 4.) the sound effects.</p>
|
||
<p>Further documentation including calculations and drawing can be found in the <code>docs</code> subdirs of the four main subdirs.</p>
|
||
<h2 id="game-play">Game Play</h2>
|
||
<p>Code is in subdir <code>game-ctrl</code> (<a href="https://gitea.hottis.de/wn/tetris/src/branch/main/game-ctrl)">https://gitea.hottis.de/wn/tetris/src/branch/main/game-ctrl)</a>.</p>
|
||
<p>In the firmware for this MSP430 microcontroller the whole game mechanics, reading the buttons, reading and writing the highscore EEPROM and the control of the peripherial microcontrollers are implemented.</p>
|
||
<p>The buttons are debounced using RC circuitry and Schmitt triggers and connected to GPIOs of the microcontroller.</p>
|
||
<p>The peripherial microcontrollers and the EEPROM are connected via SPI including individual chip select lines.</p>
|
||
<p><img src="/game-ctrl.jpg" alt=""></p>
|
||
<h2 id="play-ground-canvas">Play Ground Canvas</h2>
|
||
<p>Code is in subdir <code>rgb-driver</code> (<a href="https://gitea.hottis.de/wn/tetris/src/branch/main/rgb-driver)">https://gitea.hottis.de/wn/tetris/src/branch/main/rgb-driver)</a>.</p>
|
||
<p>The play ground is implemented using a 10 * 20 matrix of PL9823 RGB LEDs which are controlled by another MSP430 microcontroller. The firmware for this microcontroller is implemented for performance and real time requirements in assembly code. Through some discret logic the signals for PL9823 LEDs are generated. Major challenge was to generated the signals according the datasheet of all 200 (including a mini canvas for the stone preview: 212) LEDs in real time without interrupts.</p>
|
||
<p>The communcation with the game play controller is implemented as a sequences of tuples of LED address (0 to 211) and color code. A single octet of 253 where the LED address is expected is taken as the end-of-telegram mark. Readiness to receive a telegram is signaled to the game play controller via a single line connected to a GPIO of the game play controller.</p>
|
||
<p><img src="/rgb-driver.jpg" alt=""></p>
|
||
<p><a href="http://172.16.3.33:1313/blog/rgb-driver/" title="Details are here">Details are here</a></p>
|
||
<h2 id="score-display">Score Display</h2>
|
||
<p>Code is in subdir <code>display-driver</code> (<a href="https://gitea.hottis.de/wn/tetris/src/branch/main/display-driver)">https://gitea.hottis.de/wn/tetris/src/branch/main/display-driver)</a>.</p>
|
||
<p>In the first place, a MAX7221 was meant to be used for connecting a multiple digit seven-segment display. However, it appears, that the MAX7221 requires 3.5V as minimum voltage for the high-level, which caan’t be provided by the MSP430 (which runs on 3.3V) and level-shifters haven’t been around. Thus, the minimal required amount of functionality of the MAX7221 has been implemented in C on an MSP430. Just four digits are supported.</p>
|
||
<p>Communication with the game play controller is just a 16 bit number to be displayed.</p>
|
||
<p><img src="/display-driver.jpg" alt=""></p>
|
||
<h2 id="sound-effects">Sound Effects</h2>
|
||
<p>Code is in subdir <code>sound-driver</code> (<a href="https://gitea.hottis.de/wn/tetris/src/branch/main/sound-driver)">https://gitea.hottis.de/wn/tetris/src/branch/main/sound-driver)</a>.</p>
|
||
<p>An MSP430 microcontroller and two mediaeval AY-3-8913 sound chips are deployed. The sound chips themselve run on 5V, their 8-bit-address/data bus is connected to the port 2 (bit 0 to 7) of the microcontroller. The bus control signal <code>_CS</code>, <code>BC1</code> and <code>BDIR</code> are generated in software and provided via GPIOs.</p>
|
||
<p>An amplifier following the proposal of the AY-3-8913 datasheet is implemented using a LM386 chip. A MOSFET BS108 controlled via a GPIO is use the shortcut the input of the amplifier to ground to mute sound effects.</p>
|
||
<p>The clock generator proposed by the AY-3-8913 does not work reliably, so an alternative design from “The Art of Electronics” has been used.</p>
|
||
<p><img src="/sound-driver-1.jpg" alt="">
|
||
<img src="/sound-driver-2.png" alt="">
|
||
<img src="/sound-driver-3.jpg" alt="">
|
||
<img src="/sound-driver-4.jpg" alt=""></p>
|
||
<footer>
|
||
</footer>
|
||
</main>
|
||
<div class="sidebar">
|
||
|
||
<nav class="slide-menu">
|
||
<ul>
|
||
<li class=""><a href="http://172.16.3.33:1313/">Home</a></li>
|
||
|
||
<li class="parent has-sub-menu"><a href="http://172.16.3.33:1313/blog/">Blogs<span class="mark opened">-</span></a>
|
||
|
||
<ul class="sub-menu">
|
||
<li class="active"><a href="http://172.16.3.33:1313/blog/tetris/">2024-05-27<br/> Tetris </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/blog/rgb-driver/">2024-05-25<br/> PL 9823 meets MSP430 </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/blog/timeserver2/">2025-03-13<br/> Stratum 1 NTP Server participating in ntppool.org </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/blog/timeserver/">2025-02-11<br/> Just another Stratum 1 Timeserver </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/blog/debouncing/">2018-04-30<br/> Yet Another Debouncing Method </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/blog/three-phase-inverter-ng/">2016-12-19<br/> Three Phase Inverter - Second Service </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/blog/three-phase-inverter/">2016-10-14<br/> Three Phase Inverter </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/blog/theremin/">2013-07-01<br/> Theremin </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/blog/email-childprot/">2013-06-27<br/> Children Protection for Postfix-based EMail-Server </a></li>
|
||
</ul>
|
||
|
||
</li>
|
||
|
||
<li class=" has-sub-menu"><a href="http://172.16.3.33:1313/articles/">Articles<span class="mark closed">+</span></a>
|
||
|
||
<ul class="sub-menu">
|
||
<li class=""><a href="http://172.16.3.33:1313/articles/quotes/"> Quotes </a></li>
|
||
</ul>
|
||
|
||
</li>
|
||
|
||
<li class=" has-sub-menu"><a href="http://172.16.3.33:1313/howtos/">HowTos<span class="mark closed">+</span></a>
|
||
|
||
<ul class="sub-menu">
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/colors-in-minicom/"> Colors in Minicom </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/engel-des-herrn/"> Engel des Herrn </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/occ-in-nextcloud-pod/"> Execute occ in Nextcloud pod </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/gitlab-backup/"> Gitlab Backup and Restore </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/gitlab-change-baseurl/"> Gitlab Change BaseURL in Database </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/gitlab-upgrades/"> Gitlab Upgrades </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/ca-certificate-in-debian/"> How to add a CA certificate in Debian </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/iscsi-on-linux/"> iSCSI on Linux </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/magnifikat/"> Magnifikat </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/neovim/"> Neovim Setup </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/putty-and-hardware-keys/"> PuTTY and OPENGPG hardware keys </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/resize-hdd-on-running-system/"> Resize HDD on running system </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/snmpwalk-with-numeric-and-text-output/"> snmpwalk with numeric and text output of oid </a></li>
|
||
<li class=""><a href="http://172.16.3.33:1313/howtos/prince-of-persia-1/"> Solution for Prince of Persia 1 </a></li>
|
||
</ul>
|
||
|
||
</li>
|
||
</ul>
|
||
</nav>
|
||
|
||
|
||
|
||
<div class="sidebar-footer"></div>
|
||
</div>
|
||
|
||
</div><a href="#" id="backtothetop-fixed" class="backtothetop"
|
||
data-backtothetop-duration="600"
|
||
data-backtothetop-easing="easeOutQuart"
|
||
data-backtothetop-fixed-fadeIn="1000"
|
||
data-backtothetop-fixed-fadeOut="1000"
|
||
data-backtothetop-fixed-bottom="10"
|
||
data-backtothetop-fixed-right="20">
|
||
<span class="fa-layers fa-fw">
|
||
<i class="fas fa-circle"></i>
|
||
<i class="fas fa-arrow-circle-up"></i>
|
||
</span></a>
|
||
</div>
|
||
</body>
|
||
</html>
|