Files
Wolfgang Hottgenroth b2249c06e9
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
mdwiki test starts
2025-04-14 22:22:45 +02:00

242 lines
14 KiB
HTML

<!DOCTYPE html>
<html lang="en-us">
<head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;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>PL 9823 meets MSP430 - 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/rgb-driver/">
<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/rgb-driver/">
<meta property="og:site_name" content="Minimal Setups">
<meta property="og:title" content="PL 9823 meets MSP430">
<meta property="og:description" content="Generating signals for PL 9823 using a MSP430 Debugging mspdebug rf2500 gdb msp430-gdb -x firmware.gdb Attention: the gdb in the TI toolchain package is broken, use the one from Debian
Signals Working Cycler These signals are related to code under tag cycler_works_include_output_stage.
First octets:
Last octets:
Schematics and legend for signals:
Some more explanations Consider above schematics and the screen shot “Last octets” from the oscilloscope.
Timer TA1 is running in “up mode” to the value 45 set in compare register TA1CCR0. The compare registers TA1CCR1 is set to 10, TA1CCR2 is set to 22. The output mode of the timer is set to “Reset/Set”, which means the GPIO associated with TA1CCR1 (P2.1) and TA1CCR2 (P2.4) are set at the overflow and restart of the counter and reset when the counter matches the associated compare value.">
<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-25T00:00:00+00:00">
<meta property="article:modified_time" content="2024-05-25T00:00:00+00:00">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="PL 9823 meets MSP430">
<meta name="twitter:description" content="Generating signals for PL 9823 using a MSP430 Debugging mspdebug rf2500 gdb msp430-gdb -x firmware.gdb Attention: the gdb in the TI toolchain package is broken, use the one from Debian
Signals Working Cycler These signals are related to code under tag cycler_works_include_output_stage.
First octets:
Last octets:
Schematics and legend for signals:
Some more explanations Consider above schematics and the screen shot “Last octets” from the oscilloscope.
Timer TA1 is running in “up mode” to the value 45 set in compare register TA1CCR0. The compare registers TA1CCR1 is set to 10, TA1CCR2 is set to 22. The output mode of the timer is set to “Reset/Set”, which means the GPIO associated with TA1CCR1 (P2.1) and TA1CCR2 (P2.4) are set at the overflow and restart of the counter and reset when the counter matches the associated compare value.">
<meta itemprop="name" content="PL 9823 meets MSP430">
<meta itemprop="description" content="Generating signals for PL 9823 using a MSP430 Debugging mspdebug rf2500 gdb msp430-gdb -x firmware.gdb Attention: the gdb in the TI toolchain package is broken, use the one from Debian
Signals Working Cycler These signals are related to code under tag cycler_works_include_output_stage.
First octets:
Last octets:
Schematics and legend for signals:
Some more explanations Consider above schematics and the screen shot “Last octets” from the oscilloscope.
Timer TA1 is running in “up mode” to the value 45 set in compare register TA1CCR0. The compare registers TA1CCR1 is set to 10, TA1CCR2 is set to 22. The output mode of the timer is set to “Reset/Set”, which means the GPIO associated with TA1CCR1 (P2.1) and TA1CCR2 (P2.4) are set at the overflow and restart of the counter and reset when the counter matches the associated compare value.">
<meta itemprop="datePublished" content="2024-05-25T00:00:00+00:00">
<meta itemprop="dateModified" content="2024-05-25T00:00:00+00:00">
<meta itemprop="wordCount" content="547"><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>PL 9823 meets MSP430</h1>
<time>Sat, May 25, 2024</time><h2 id="generating-signals-for-pl-9823-using-a-msp430">Generating signals for PL 9823 using a MSP430</h2>
<h3 id="debugging">Debugging</h3>
<pre tabindex="0"><code>mspdebug rf2500 gdb
msp430-gdb -x firmware.gdb
</code></pre><p>Attention: the gdb in the TI toolchain package is broken, use the one from Debian</p>
<h3 id="signals-working-cycler">Signals Working Cycler</h3>
<p>These signals are related to code under tag <code>cycler_works_include_output_stage</code>.</p>
<p>First octets:</p>
<p><img src="/cycler_working_first_octets.png" alt=""></p>
<p>Last octets:</p>
<p><img src="/cycler_working_last_octets.png" alt=""></p>
<p>Schematics and legend for signals:</p>
<p><img src="/schematics.jpeg" alt=""></p>
<h4 id="some-more-explanations">Some more explanations</h4>
<p>Consider above schematics and the screen shot &ldquo;Last octets&rdquo; from the oscilloscope.</p>
<p><img src="/timing.png" alt=""></p>
<p>Timer TA1 is running in &ldquo;up mode&rdquo; to the value 45 set in compare register <code>TA1CCR0</code>. The compare registers <code>TA1CCR1</code> is set to 10, <code>TA1CCR2</code> is set to 22.
The output mode of the timer is set to &ldquo;Reset/Set&rdquo;, which means the GPIO associated with <code>TA1CCR1</code> (P2.1) and <code>TA1CCR2</code> (P2.4) are set at the overflow and
restart of the counter and reset when the counter matches the associated compare value.</p>
<p>So, on P2.1 (D1 on the oscilloscope) we have a long pulse and at P2.4 (D0 on the oscilloscope) we have a short pulse, with synchronous raising edge.</p>
<p><img src="/74hc74-function-table.png" alt=""></p>
<p>The inverted signal P2.4 is connected to the Clock input of a 74HC74 D-flipflop, the data input of the flipflop is connected to GPIO P1.0 (D2 on the oscilloscope).</p>
<p>The interrupt service routine <code>shifter_isr</code> is triggered by the overflow and restart of the timer, this interrupt service routine provides the next bit to be
signaled on P1.0. This bit is stored at the falling edge of P2.4 (long pulse) in the flipflop.</p>
<p>The short pulse (P2.1, D1) is ANDed using a 74HC08 with the inverted output of the flipflop, the long pulse (P2.4, D0) is ANDed with the non-inverted output of
the flipflop, the ANDed results are ORed using a 74HC32.</p>
<p>So, at the output of the OR gate (yellow on the oscilloscope) we get a long pulse for a 1 at P1.0 provided by the ISR and a short pulse for a 0 at P1.0.</p>
<p>The routine <code>drawscreen</code> takes color values from the &ldquo;frame buffer&rdquo; beginning at <code>screendata</code> and translated them into the red, green and blue values and provides these values, first red, then green and finally blue to the ISR via the <code>DATA_REGISTER</code>.</p>
<p>The ISR cycles over the <code>DATA_REGISTER</code> and presents the bits at P1.0.</p>
<p>Additionally, when the first bit of a full draw screen cycle is presented at P1.0 by the ISR, it also sets the data enable signal at P1.1 and when the last bit has been provided it disabled the data enable signal. This signal is also synchronized using a flipflop and used to enable the short/long pulses using an AND gate.</p>
<h3 id="timing">Timing</h3>
<p>Complete cycle: 2.48us</p>
<p><img src="/pulse_complete.png" alt=""></p>
<p>Short pulse: 550ns</p>
<p><img src="/pulse_short.png" alt=""></p>
<p>Long pulse: 1.18us</p>
<p><img src="/pulse_long.png" alt=""></p>
<h3 id="load-time">Load Time</h3>
<p>During of loading data into five LEDs: 297us</p>
<p><img src="/five_leds.png" alt=""></p>
<p>During of loading data into six LEDs: 297us</p>
<p><img src="/six_leds.png" alt=""></p>
<table>
<thead>
<tr>
<th># of LEDs</th>
<th>Load Time measured</th>
<th>calculated</th>
</tr>
</thead>
<tbody>
<tr>
<td>5</td>
<td>297us</td>
<td></td>
</tr>
<tr>
<td>6</td>
<td>354us</td>
<td>356.4us</td>
</tr>
<tr>
<td>10</td>
<td></td>
<td>594us</td>
</tr>
<tr>
<td>100</td>
<td></td>
<td>5.9ms</td>
</tr>
<tr>
<td>200</td>
<td></td>
<td>11.8ms</td>
</tr>
</tbody>
</table>
<h3 id="reset-circuitry">Reset Circuitry</h3>
<p>It appears that the output voltage of the power supply raises that slow, that the MCU
will not handle the reset correctly.</p>
<p>The following circuitry should generate a valid reset signal far enough from the raise
of the supply voltage:</p>
<p><img src="/reset-circuit.jpeg" alt=""></p>
<p>The circuit generates the following signals:</p>
<p><img src="/reset-signal.png" alt=""></p>
<h5 id="reference-voltage-green">Reference voltage (green):</h5>
<pre tabindex="0"><code class="language-math" data-lang="math">U_ref = 3.3V \frac{22k\Omega}{22k\Omega + 10k\Omega} = 2.2V
</code></pre><h5 id="trigger-voltage-purple">Trigger voltage (purple):</h5>
<pre tabindex="0"><code class="language-math" data-lang="math">U_trigg = 3.3V \frac{330k\Omega}{330k\Omega + 82k\Omega} = 2.64V
</code></pre><h5 id="rc-constant">RC constant:</h5>
<pre tabindex="0"><code class="language-math" data-lang="math">\tau = 82k\Omega \cdot 100nF = 8.2ms
</code></pre><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=""><a href="http://172.16.3.33:1313/blog/tetris/">2024-05-27<br/> Tetris </a></li>
<li class="active"><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>