Files
RP2040-Decoder/sphinx/html/hardware/Legacy/hw_description.html
T
2025-04-27 08:21:48 +00:00

301 lines
14 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview &mdash; RP2040-Decoder unknown documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
<script src="../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../_static/documentation_options.js?v=3f1b9271"></script>
<script src="../../_static/doctools.js?v=9bcbadda"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Software" href="../../software/index.html" />
<link rel="prev" title="Overview" href="../USB/hw_description.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home">
RP2040-Decoder
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../gs/getting_started.html">Getting started</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Hardware</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../index.html#usb">USB</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#legacy">Legacy</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">Overview</a></li>
<li class="toctree-l3"><a class="reference internal" href="#electrical-characteristics">Electrical Characteristics</a></li>
<li class="toctree-l3"><a class="reference internal" href="#input-stage">Input Stage</a></li>
<li class="toctree-l3"><a class="reference internal" href="#motor-driver">Motor Driver</a></li>
<li class="toctree-l3"><a class="reference internal" href="#auxiliary-outputs">Auxiliary Outputs</a></li>
<li class="toctree-l3"><a class="reference internal" href="#gpio">GPIO</a></li>
<li class="toctree-l3"><a class="reference internal" href="#microcontroller">Microcontroller</a></li>
<li class="toctree-l3"><a class="reference internal" href="#complete-schematic">Complete Schematic</a></li>
<li class="toctree-l3"><a class="reference internal" href="#wiring-the-decoder">Wiring the Decoder</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../software/index.html">Software</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../other/index.html">Other</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">RP2040-Decoder</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../index.html">Hardware</a></li>
<li class="breadcrumb-item active">Overview</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/hardware/Legacy/hw_description.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="overview">
<h1>Overview<a class="headerlink" href="#overview" title="Link to this heading"></a></h1>
<figure class="align-center" id="id1">
<img alt="Block Diagram" src="../../_images/Block_Diagram_Hardware.svg" />
<figcaption>
<p><span class="caption-text">Harware block diagram</span><a class="headerlink" href="#id1" title="Link to this image"></a></p>
</figcaption>
</figure>
<p>The above block diagram gives a general overview regarding the operation of components. For better illustration it has been divided into four functional blocks. Furthermore, these functional blocks can be subdivided and will be explained below.</p>
<ul class="simple">
<li><dl class="simple">
<dt><strong>Input Stage</strong></dt><dd><ul>
<li><p>DCC Signal Level Shift</p></li>
<li><p>Bridge Rectifier &amp; Voltage Regulator</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><strong>Motor Driver</strong></dt><dd><ul>
<li><p>Motor Driver</p></li>
<li><p>Back EMF measurement (ADC)</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><strong>General Purpose</strong></dt><dd><ul>
<li><p>GPIO</p></li>
<li><p>Auxiliary output</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><strong>Microcontroller</strong></dt><dd><ul>
<li><p>Flash memory</p></li>
<li><p>Crystal oscillator</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
</section>
<section id="electrical-characteristics">
<h1>Electrical Characteristics<a class="headerlink" href="#electrical-characteristics" title="Link to this heading"></a></h1>
<table class="docutils align-default" id="id2">
<caption><span class="caption-text">Electrical Characteristics &amp; Absolute Maximum Ratings</span><a class="headerlink" href="#id2" title="Link to this table"></a></caption>
<thead>
<tr class="row-odd"><th class="head"><p>Parameter</p></th>
<th class="head"><p>Symbol</p></th>
<th class="head"><p>Minimum</p></th>
<th class="head"><p>Maximum</p></th>
<th class="head"><p>Unit</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>Absolute max. DCC Input Voltage difference</p></td>
<td><p>V<sub>DCC</sub></p></td>
<td><p>0</p></td>
<td><p>+24</p></td>
<td><p>V</p></td>
</tr>
<tr class="row-odd"><td><p>Absolute max. GPIO Voltage<sup>(0)</sup></p></td>
<td><p>V<sub>PIN</sub></p></td>
<td><p>-0.5</p></td>
<td><p>3.3+0.5</p></td>
<td><p>V</p></td>
</tr>
<tr class="row-even"><td><p>Input Voltage High<sup>(0)</sup></p></td>
<td><p>V<sub>IH</sub></p></td>
<td><p>2.145</p></td>
<td><p>3.6</p></td>
<td><p>V</p></td>
</tr>
<tr class="row-odd"><td><p>Input Voltage Low<sup>(0)</sup></p></td>
<td><p>V<sub>IL</sub></p></td>
<td><p>0</p></td>
<td><p>1.155</p></td>
<td><p>V</p></td>
</tr>
<tr class="row-even"><td><p>Total GPIO Current<sup>(0)</sup></p></td>
<td><p>I<sub>IOVDD</sub></p></td>
<td></td>
<td><p>50</p></td>
<td><p>mA</p></td>
</tr>
<tr class="row-odd"><td><p>Absolute max. motor output current<sup>(1)</sup></p></td>
<td><p>I<sub>MOTOR</sub></p></td>
<td></td>
<td><p>2.8</p></td>
<td><p>A</p></td>
</tr>
<tr class="row-even"><td><p>Absolute max. auxiliary output current <sup>(2)</sup></p></td>
<td><p>I<sub>AUX</sub></p></td>
<td></td>
<td><p>400</p></td>
<td><p>mA</p></td>
</tr>
</tbody>
</table>
<p>(0): According to: <a class="reference external" href="https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf">RP2040 Datasheet</a> (assuming V<sub>DD</sub>= 3.3V)</p>
<p>(1): According to: <a class="reference external" href="https://www.lcsc.com/datasheet/lcsc_datasheet_2409291808_Bardeen-Micro--BDR6133_C2687793.pdf">BDR6133 Datasheet</a></p>
<p>(2): According to: <a class="reference external" href="https://toshiba.semicon-storage.com/info/T2N7002BK_datasheet_en_20191025.pdf?did=30376&amp;prodName=T2N7002BK">T2N7002BK Datasheet</a></p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Keep in mind that realistically these maximum ratings can’t be reached in practice due to thermal limitations. For example the motor current can probably not exceed 1.5A for continuous operation.</p>
</div>
</section>
<section id="input-stage">
<h1>Input Stage<a class="headerlink" href="#input-stage" title="Link to this heading"></a></h1>
<figure class="align-center" id="id3">
<img alt="Input Stage" src="../../_images/Input_Stage.svg" />
<figcaption>
<p><span class="caption-text">Input stage</span><a class="headerlink" href="#id3" title="Link to this image"></a></p>
</figcaption>
</figure>
<p>D1 Rectifies the DCC square-wave into +V, the amplitude is not critical as long as it’s within the 25V limit. The rectified voltage +V is then provided to the 3.3V voltage regulator (U1) and to the motor driver (U2).</p>
<p>The MOSFET on the right effectively translates the rather high DCC voltage to a suitable level for the microcontroller to process. When Q1 is turned off GPIO21 is pulled high by the RP2040 internal pull-up resistor, as soon as Q1 gets turned on (V<sub>GS</sub>&gt; V<sub>GS,th</sub>), GPIO21 gets pulled to GND potential. R1 and R2 ensure that V<sub>GS</sub>doesn’t exceed ±20V.</p>
</section>
<section id="motor-driver">
<h1>Motor Driver<a class="headerlink" href="#motor-driver" title="Link to this heading"></a></h1>
<figure class="align-center" id="id4">
<img alt="Motor Driver" src="../../_images/Motor_Driver.svg" />
<figcaption>
<p><span class="caption-text">Motor driver</span><a class="headerlink" href="#id4" title="Link to this image"></a></p>
</figcaption>
</figure>
<p>The Motor Driver is a special H-Bridge IC that is made for DC motors. To control the motor, it is necessary to measure the back-EMF voltage, which is directly related to the motor’s speed. This is done by the ADC, which measures at Points ADC_EMF_A and ADC_EMF_B. The two resistors work together as a voltage divider.</p>
</section>
<section id="auxiliary-outputs">
<h1>Auxiliary Outputs<a class="headerlink" href="#auxiliary-outputs" title="Link to this heading"></a></h1>
<figure class="align-center" id="id5">
<img alt="Auxiliary Outputs" src="../../_images/Aux_Outputs.svg" />
<figcaption>
<p><span class="caption-text">Auxiliary Outputs</span><a class="headerlink" href="#id5" title="Link to this image"></a></p>
</figcaption>
</figure>
<p>Switching of loads can be done using four N-Channel MOSFETs (Q2 to Q5). The amount of current is somewhat dependend on either static R<sub>DS(on)</sub>losses and/or switching losses using PWM. They are switching on the low-side, which means the load effectively gets connected to GND potential as the transistor starts to conduct. GPIO24 - GPIO27 are used.</p>
</section>
<section id="gpio">
<h1>GPIO<a class="headerlink" href="#gpio" title="Link to this heading"></a></h1>
<p>To switch lighter loads, six GPIO soldering pads are connected to GPIO0 to GPIO5 pins. Although not yet set up in the software, they could be used as inputs as well (e.g. reed switch). GPIO0 and GPIO1 can also be used to facilitate stdio logging via UART, which can easily be set up in CMakeLists.txt.</p>
</section>
<section id="microcontroller">
<h1>Microcontroller<a class="headerlink" href="#microcontroller" title="Link to this heading"></a></h1>
<figure class="align-center" id="id6">
<img alt="Microcontroller" src="../../_images/Microcontroller.svg" />
<figcaption>
<p><span class="caption-text">Microcontroller, flash memory, crystal oscillator, …</span><a class="headerlink" href="#id6" title="Link to this image"></a></p>
</figcaption>
</figure>
<p>The Microcontroller needs a crystal oscillator for its clock. External flash memory holds the configuration variables and the program itself. R3 &amp; C14 are used to filter ADC_AVDD (ADC Reference Voltage).</p>
</section>
<section id="complete-schematic">
<h1>Complete Schematic<a class="headerlink" href="#complete-schematic" title="Link to this heading"></a></h1>
<figure class="align-center" id="id7">
<img alt="Complete Schematic" src="../../_images/RP2040-Decoder.svg" />
<figcaption>
<p><span class="caption-text">Complete Schematic</span><a class="headerlink" href="#id7" title="Link to this image"></a></p>
</figcaption>
</figure>
</section>
<section id="wiring-the-decoder">
<span id="wiring-legacy"></span><h1>Wiring the Decoder<a class="headerlink" href="#wiring-the-decoder" title="Link to this heading"></a></h1>
<figure class="align-center" id="id8">
<a class="reference internal image-reference" href="../../_images/Wiring_diagram.svg"><img alt="Wiring Diagram" src="../../_images/Wiring_diagram.svg" style="width: 700px;" />
</a>
<figcaption>
<p><span class="caption-text">Wiring Diagram</span><a class="headerlink" href="#id8" title="Link to this image"></a></p>
</figcaption>
</figure>
<p>The illustration above provides an example of a wiring configuration.
It supports the connection of up to 4 transistor-switched outputs and 6 GPIOs for lighter loads or custom applications.
When switching inductive loads, always include a free-wheeling diode to protect the circuit.</p>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="../USB/hw_description.html" class="btn btn-neutral float-left" title="Overview" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="../../software/index.html" class="btn btn-neutral float-right" title="Software" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2024, Gabriel Koppenstein.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>