<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Circuit Design Archives | DMC, Inc.</title>
	<atom:link href="https://static.dmcinfo.com/blog/category/embedded-development-programming/circuit-design/feed/index.xml" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Thu, 20 Aug 2026 21:13:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>

<image>
	<url>https://static.dmcinfo.com/wp-content/uploads/2025/04/site-icon-150x150.png</url>
	<title>Circuit Design Archives | DMC, Inc.</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>MOSFET Power Loss Calculator</title>
		<link>https://static.dmcinfo.com/blog/17021/mosfet-power-loss-calculator/</link>
		
		<dc:creator><![CDATA[Tim Jager]]></dc:creator>
		<pubDate>Mon, 27 Nov 2023 09:10:29 +0000</pubDate>
				<category><![CDATA[Circuit Design]]></category>
		<category><![CDATA[Embedded Development & Programming]]></category>
		<category><![CDATA[Low-Power Embedded Design]]></category>
		<category><![CDATA[MOSFET]]></category>
		<category><![CDATA[online calculator]]></category>
		<category><![CDATA[Power Dissipation]]></category>
		<category><![CDATA[Power loss]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/17021/mosfet-power-loss-calculator/</guid>

					<description><![CDATA[<p>Online MOSFET Power Loss/Dissipation Calculator and Guide for Engineers In the world of power electronics, understanding and minimizing power losses in Metal-Oxide-Semiconductor Field-Effect Transistors (MOSFETs) is crucial for optimizing efficiency and performance. This guide explains the basics of calculating various types of power losses in MOSFETs, including conduction, switching, reverse recovery, deadtime, and gate charge [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/17021/mosfet-power-loss-calculator/">MOSFET Power Loss Calculator</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<style>
    table input[type="number"],
    table select,
    table input[type="text"] {
      font-size: 14px;
      padding: 4px 6px;
      min-width: 90px;
    }
    #share-tools {
      margin: 12px 0 20px 0;
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }
    #project_name,
    #share_button,
    #share_link {
      font-size: 14px;
      padding: 4px 6px;
      height: 28px;
      box-sizing: border-box;
    }
    #project_name {
      min-width: 240px;
    }
    #share_link {
      flex: 1 1 260px;
      min-width: 260px;
      max-width: 520px;
    }
    #project-name-row {
      margin: 8px 0 12px 0;
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }
    #loss-bar-container {
      margin: 14px 0 6px 0;
      width: 100%;
      max-width: 1100px;
    }
    #loss-bar {
      display: flex;
      height: 20px;
      border: 1px solid #ccc;
      border-radius: 4px;
      overflow: hidden;
      background: #f5f5f5;
    }
    .loss-segment {
      height: 100%;
      min-width: 0;
    }
    #loss-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 8px 16px;
      margin-top: 6px;
      font-size: 12px;
    }
    .loss-legend-item {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .loss-swatch {
      width: 12px;
      height: 12px;
      border-radius: 2px;
      display: inline-block;
    }
    #thermal-container {
      margin: 18px 0 10px 0;
      width: 100%;
    }
    #thermal-table {
      border: 1px solid #ccc;
      border-collapse: collapse;
      width: 100%;
    }
    #thermal-table th,
    #thermal-table td {
      border: 1px solid #ccc;
      padding: 6px;
      text-align: left;
      vertical-align: middle;
    }
    #thermal-table input,
    #thermal-table select {
      padding: 4px 6px;
      font-size: 14px;
      min-width: 90px;
    }
    #thermal-table .help {
      font-size: 14px;
      color: #444;
    }
    #thermal-status {
      font-weight: 600;
    }
    #main-table,
    #thermal-table {
      width: 100%;
      box-sizing: border-box;
    }
    /* Keep main and thermal tables aligned */
    col.col-param { width: 22%; }
    col.col-value { width: 22%; }
    col.col-units { width: 15%; }
    /* Consistent cell styling across both tables */
    #main-table th,
    #main-table td,
    #thermal-table th,
    #thermal-table td {
      padding: 6px;
      text-align: left;
      vertical-align: middle;
      border: 1px solid #ccc;
      font-size: 18px;
      font-family: inherit;
    }
    /* Definition blocks as cards */
    .param-block {
      margin: 12px 0;
      padding: 12px 16px;
      border: 1px solid #ddd;
      border-radius: 20px;
      background: #fafafa;
    }
    /* Parameter name at the top of each card */
    .param-name {
      margin: 0 0 6px 0;
      font-weight: 600;
      font-size: 15px;
    }
    /* A row: label on left, text on right */
    .param-detail {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      margin: 6px 0;
      font-size: 16px;
      line-height: 1.5;
    }
    /* Left column: fixed width, bold label */
    .param-detail em {
      font-style: normal;
      font-weight: 600;
      color: #333;
      flex: 0 0 130px;
      text-align: right;
    }
    /* Right column: fill remaining width */
    .param-detail span {
      flex: 1;
    }
    /* Calculation blocks styled similarly to cards */
    .calculation-block {
      margin: 16px 0;
      padding: 12px 16px;
      border: 1px solid #ddd;
      border-radius: 20px;
      background: #fdfdfd;
    }
    .calculation-block h4 {
      margin-top: 0;
      margin-bottom: 8px;
    }
    .formula {
      display: inline-block;
      margin: 4px 0;
      padding: 4px 8px;
      font-weight: 600;
      font-family: Consolas, "Courier New", monospace;
      font-size: 14px;
      border-radius: 3px;
      background: #f3f3f3;
    }
    /* Consistent heading spacing in definitions section */
    h3.wp-block-heading {
      margin-top: 24px;
      margin-bottom: 8px;
    }
    h4.wp-block-heading {
      font-size: 16px;
      margin-top: 0;
      margin-bottom: 6px;
    }
    @media (max-width: 600px) {
      table input[type="number"],
      table select,
      table input[type="text"] {
        font-size: 8px;
        padding: 2px 4px;
        min-width: 40px;
      }
      #main-table th,
        #main-table td,
        #thermal-table th,
        #thermal-table td {
          padding: 4px;
          font-size: 8px;
        }
        #thermal-table .help {
          font-size: 8px;
        }
        #thermal-table input, #thermal-table select {
          padding: 2px 4px;
          font-size: 8px;
          min-width: 40px;
        }
    }
  </style>
<div id="calc-container">
<h2 class="wp-block-heading">Online MOSFET Power Loss/Dissipation Calculator and Guide for Engineers</h2>

<p>In the world of power electronics, understanding and minimizing power losses in Metal-Oxide-Semiconductor Field-Effect Transistors (MOSFETs) is crucial for optimizing efficiency and performance. This guide explains the basics of calculating various types of power losses in MOSFETs, including conduction, switching, reverse recovery, deadtime, and gate charge losses.</p>

<h3 class="wp-block-heading">MOSFET Power Loss Calculator <span id="share_status" style="margin-left: 8px; font-size: 0.9em; color: #555;"></span></h3>
<div class="calc-inner">
<div id="project-name-row">
  <label for="project_name"><strong>Project Name:</strong></label>
  <input id="project_name" oninput="handleProjectNameInput()" type="text" maxlength="30" placeholder="Required for sharing" />
  <button id="share_button" type="button" onclick="copyShareLink()" disabled>Copy shareable link</button>
  <input aria-label="Shareable link" id="share_link" readonly type="text" style="flex:1 1 260px; max-width: 520px;" />
</div>
<div id="loss-bar-container">
  <div><strong>Power Loss Breakdown (largest to smallest)</strong></div>
  <div id="loss-bar">
    <div id="seg_cond" class="loss-segment" style="background:#d62728; width: 16.6%;"></div>
    <div id="seg_sw" class="loss-segment" style="background:#ff7f0e; width: 16.6%;"></div>
    <div id="seg_rr" class="loss-segment" style="background:#f2c94c; width: 16.6%;"></div>
    <div id="seg_dt" class="loss-segment" style="background:#2ca02c; width: 16.6%;"></div>
    <div id="seg_gate" class="loss-segment" style="background:#17becf; width: 16.6%;"></div>
    <div id="seg_coss" class="loss-segment" style="background:#1f77b4; width: 16.6%;"></div>
  </div>
  <div id="loss-legend">
    <span id="legend_cond" class="loss-legend-item"><span class="loss-swatch" style="background:#d62728;"></span><span class="loss-label-text">Conduction</span></span>
    <span id="legend_sw" class="loss-legend-item"><span class="loss-swatch" style="background:#ff7f0e;"></span><span class="loss-label-text">Switching</span></span>
    <span id="legend_rr" class="loss-legend-item"><span class="loss-swatch" style="background:#f2c94c;"></span><span class="loss-label-text">Reverse Recovery</span></span>
    <span id="legend_dt" class="loss-legend-item"><span class="loss-swatch" style="background:#2ca02c;"></span><span class="loss-label-text">Deadtime</span></span>
    <span id="legend_gate" class="loss-legend-item"><span class="loss-swatch" style="background:#17becf;"></span><span class="loss-label-text">Gate Charge</span></span>
    <span id="legend_coss" class="loss-legend-item"><span class="loss-swatch" style="background:#1f77b4;"></span><span class="loss-label-text">Output Capacitance</span></span>
  </div>
</div>
</div>
<!-- Table with input fields and loss calculations -->
  <table id="main-table" border="1" bordercolor="#ccc" cellpadding="5" cellspacing="0" style="border-collapse: collapse; width: 100%;">
  <colgroup>
    <col class="col-param">
    <col class="col-value">
    <col class="col-units">
    <col>
  </colgroup>
  <tbody>
    <tr>
    <th style="text-align: left"><strong>Parameter</strong></th>
    <th style="text-align: left"><strong>Value</strong></th>
    <th style="text-align: left"><strong>Units</strong></th>
    <th style="text-align: left"><strong>Description</strong></th>
    </tr>
    <tr>
    <td>Vbus</td>
    <td><input id="v_bus" onchange="calculateLosses()" type="number" value="24" /></td>
    <td>Volts</td>
    <td>Bus voltage</td>
    </tr>
    <tr>
    <td>Current</td>
    <td><input id="current" onchange="calculateLosses()" type="number" value="10" /></td>
    <td>Amps</td>
    <td>Current</td>
    </tr>
    <tr>
    <td>f_sw</td>
    <td><input id="f_sw" onchange="calculateLosses()" type="number" value="24" /></td>
    <td><select id="f_sw_unit" onchange="calculateLosses()"><option value="1e3">kHz</option><option value="1e0">Hz</option> </select></td>
    <td>Switching frequency</td>
    </tr>
    <tr>
    <td>Vgate_drive</td>
    <td><input id="v_gate_drive" onchange="calculateLosses()" type="number" value="10" /></td>
    <td>Volts</td>
    <td>Gate drive voltage</td>
    </tr>
    <tr>
    <td>Rds(on)</td>
    <td><input id="rdson" onchange="calculateLosses()" type="number" value="2.8" /></td>
    <td><select id="t_rdson_unit" onchange="calculateLosses()"><option value="1e-3">mOhms</option><option value="1">Ohms</option> </select></td>
    <td>Drain-to-source on resistance</td>
    </tr>
    <tr>
    <td>Qg</td>
    <td><input id="q_g" onchange="calculateLosses()" type="number" value="38" /></td>
    <td><select id="q_g_unit" onchange="calculateLosses()"><option value="1e-9">nC</option><option value="1e-6">&micro;C</option> </select></td>
    <td>Gate charge total</td>
    </tr>
    <tr>
    <td>Td(on)</td>
    <td><input id="t_d_on" onchange="calculateLosses()" type="number" value="120" /></td>
    <td><select id="t_d_on_unit" onchange="calculateLosses()"><option value="1e-9">ns</option><option value="1e-6">&micro;s</option> </select></td>
    <td>Turnon delay time</td>
    </tr>
    <tr>
    <td>Tr</td>
    <td><input id="t_rise" onchange="calculateLosses()" type="number" value="22" /></td>
    <td><select id="t_rise_unit" onchange="calculateLosses()"><option value="1e-9">ns</option><option value="1e-6">&micro;s</option> </select></td>
    <td>Rise time</td>
    </tr>
    <tr>
    <td>Td(off)</td>
    <td><input id="t_d_off" onchange="calculateLosses()" type="number" value="120" /></td>
    <td><select id="t_d_off_unit" onchange="calculateLosses()"><option value="1e-9">ns</option><option value="1e-6">&micro;s</option> </select></td>
    <td>Turn-off delay</td>
    </tr>
    <tr>
    <td>Tf</td>
    <td><input id="t_fall" onchange="calculateLosses()" type="number" value="6" /></td>
    <td><select id="t_fall_unit" onchange="calculateLosses()"><option value="1e-9">ns</option><option value="1e-6">&micro;s</option> </select></td>
    <td>Fall time</td>
    </tr>
    <tr>
    <td>Qrr</td>
    <td><input id="q_rr" onchange="calculateLosses()" type="number" value="12" /></td>
    <td><select id="q_rr_unit" onchange="calculateLosses()"><option value="1e-9">nC</option><option value="1e-6">&micro;C</option> </select></td>
    <td>Reverse recovery charge</td>
    </tr>
    <tr>
    <td>Vsd</td>
    <td><input id="v_fv" onchange="calculateLosses()" type="number" value="1.0" /></td>
    <td>Volts</td>
    <td>Body diode Forward Voltage</td>
    </tr>
    <tr>
    <td>Coss</td>
    <td><input id="c_oss" onchange="calculateLosses()" type="number" value="150" /></td>
    <td><select id="c_oss_unit" onchange="calculateLosses()"><option value="1e-12">pF</option><option value="1e-9">nF</option> </select></td>
    <td>Output capacitance of the MOSFET</td>
    </tr>
    <tr>
    <td>Conduction Loss (P_cond)</td>
    <td id="p_cond">&nbsp;</td>
    <td>Watts</td>
    <td>Power loss due to conduction</td>
    </tr>
    <tr>
    <td>Switching Loss (P_sw)</td>
    <td id="p_sw">&nbsp;</td>
    <td>Watts</td>
    <td>Power loss during switching</td>
    </tr>
    <tr>
    <td>Reverse Recovery Loss (P_rr)</td>
    <td id="p_rr">&nbsp;</td>
    <td>Watts</td>
    <td>Power loss due to reverse recovery of the body diode</td>
    </tr>
    <tr>
    <td>Deadtime Loss (P_dt)</td>
    <td id="p_dt">&nbsp;</td>
    <td>Watts</td>
    <td>Power loss during deadtime</td>
    </tr>
    <tr>
    <td>Gate Charge Loss (P_gate)</td>
    <td id="p_gate">&nbsp;</td>
    <td>Watts</td>
    <td>Power loss due to gate charge</td>
    </tr>
    <tr>
    <td><em><strong>Total MOSFET Power Loss</strong></em></td>
    <td id="total_loss">&nbsp;</td>
    <td><em><strong>Watts</strong></em></td>
    <td><em><strong>Total power loss in MOSFET</strong></em></td>
    </tr>
    <!-- <tr>
        <td>Gate Driver Power Loss (P_driver)</td>
        <td id="p_driver">&nbsp;</td>
        <td>Watts</td>
        <td>Power loss due to driving the gate</td>
      </tr> -->
  </tbody>
  </table>
<div id="thermal-container">
  <div><strong>Thermal Check (does not affect power loss calculations)</strong></div>
  <p style="margin: 6px 0 4px 0; font-size: 13px;">
    The thermal section does a quick “what will my junction temperature be?” check using the total power loss you calculated. You supply the thermal resistances and ambient temp; it multiplies total loss by the chosen R&theta;, adds ambient, and shows ΔT, estimated Tj, and whether you’re under your limit.
  </p>
  <p style="margin: 0 0 8px 0; font-size: 13px;">
    Not sure which numbers to use? R&theta;JA comes straight from the MOSFET datasheet and assumes the part is soldered to the datasheet&#8217;s test PCB (usually no custom heatsink). R&theta;JC is also from the datasheet (junction to the case). R&theta;CA is your own path from case to ambient; your heatsink, board, and airflow. If you don’t have a heatsink model, pick R&theta;JA. If you do, choose R&theta;JC + R&theta;CA so the heatsink path is included.
  </p>
  <table id="thermal-table" style="width: 100%;">
    <colgroup>
      <col class="col-param">
      <col class="col-value">
      <col class="col-units">
      <col>
    </colgroup>
    <tbody>
      <tr>
        <th style="text-align: left;"><strong>Parameter</strong></th>
        <th style="text-align: left;"><strong>Value</strong></th>
        <th style="text-align: left;"><strong>Units</strong></th>
        <th style="text-align: left;"><strong>Description / Help</strong></th>
      </tr>
      <tr>
        <td>Mode</td>
        <td>
          <select id="thermal_mode" onchange="updateThermalMode(); calculateThermal(lastTotalLoss);">
            <option value="ja">Use RθJA (datasheet)</option>
            <option value="jc">Use RθJC + RθCA</option>
          </select>
        </td>
        <td>&#8211;</td>
        <td class="help">JA = datasheet junction-to-ambient (often bare PCB). JC+CA = datasheet junction-to-case plus your heatsink/board path.</td>
      </tr>
      <tr>
        <td>RθJA</td>
        <td><input id="theta_ja" type="number" value="35" onchange="calculateThermal(lastTotalLoss)" /></td>
        <td>°C/W</td>
        <td class="help">Datasheet Junction-to-Ambient. Soldered to PCB, no custom heatsink model.</td>
      </tr>
      <tr>
        <td>RθJC</td>
        <td><input id="theta_jc" type="number" value="1.5" onchange="calculateThermal(lastTotalLoss)" /></td>
        <td>°C/W</td>
        <td class="help">Datasheet Junction-to-Case.</td>
      </tr>
      <tr>
        <td>RθCA</td>
        <td><input id="theta_ca" type="number" value="10" onchange="calculateThermal(lastTotalLoss)" /></td>
        <td>°C/W</td>
        <td class="help">Case-to-Ambient for your heatsink/board/airflow.</td>
      </tr>
      <tr>
        <td>T<sub>amb</sub></td>
        <td><input id="t_amb" type="number" value="25" onchange="calculateThermal(lastTotalLoss)" /></td>
        <td>°C</td>
        <td class="help">Ambient temperature around the MOSFET.</td>
      </tr>
      <tr>
        <td>T<sub>J,limit</sub></td>
        <td><input id="t_j_limit" type="number" value="125" onchange="calculateThermal(lastTotalLoss)" /></td>
        <td>°C</td>
        <td class="help">Chosen max junction temperature (125 to 150°C typical).</td>
      </tr>
      <tr>
        <td>ΔT</td>
        <td><span id="delta_t">&#8211;</span></td>
        <td>°C</td>
        <td class="help">Temperature rise from total loss × thermal resistance.</td>
      </tr>
      <tr>
        <td>Estimated T<sub>J</sub></td>
        <td><span id="t_j">&#8211;</span></td>
        <td>°C</td>
        <td class="help">T<sub>amb</sub> + ΔT. First-order estimate.</td>
      </tr>
      <tr>
        <td>Rθ used</td>
        <td><span id="theta_used">&#8211;</span></td>
        <td>°C/W</td>
        <td class="help">The active path (JA or JC+CA) used for the estimate.</td>
      </tr>
      <tr>
        <td>Status</td>
        <td colspan="3"><span id="thermal-status" style="color: #444;">Enter values to estimate junction temperature.</span></td>
      </tr>
    </tbody>
  </table>
</div>

<h2 class="wp-block-heading">&nbsp;</h2>

<h2 class="wp-block-heading">Parameter Definitions &amp; Loss Formulas</h2>

<h3 class="wp-block-heading">Electrical Parameters</h3>

<div class="param-block">
  <p class="param-name"><strong>Vbus</strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The bus or supply voltage applied across the MOSFET and its load. It is the electrical &#8220;push&#8221; driving power through the system.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>A power stage needs a voltage source to move energy. Vbus sets the maximum voltage the MOSFET must block and switch.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Higher Vbus reduces current for the same power which lowers conduction loss. At the same time, higher Vbus increases switching loss because the MOSFET spends time switching with both voltage and current present. It also stores more energy in the MOSFET internal capacitances that must be charged and discharged every cycle, and MOSFETs rated for higher voltage usually have worse on resistance and higher cost.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Higher Vbus improves conduction efficiency but raises switching stress. Lower Vbus helps switching efficiency but increases current. Choose Vbus based on topology, switching frequency, and power level.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Pick MOSFETs with enough voltage headroom, minimize stray inductance in layout, and select a switching frequency that balances conduction and switching losses.</span>
</p>
</div>

<div class="param-block">
  <p class="param-name"><strong>Current</strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The current flowing through the MOSFET when it is on. This is the MOSFET main job, passing load current from drain to source.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>The MOSFET forms the controlled conduction path that sends energy to the load.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Conduction loss rises with the square of current. Higher current increases temperature rise and stresses the package, and layout resistance becomes more important as current climbs.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Your system voltage and power requirements set the current. The MOSFET must be chosen to handle this current without excessive heating.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Use thicker copper, shorten high current paths, parallel MOSFETs when needed, or increase Vbus to reduce required current.</span>
</p>
</div>

<div class="param-block">
  <p class="param-name"><strong>f_sw</strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The switching frequency. It is how many times per second the MOSFET turns on and off.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>Switching allows the converter to control voltage and power. The frequency sets how quickly regulation can respond.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Higher frequency shrinks magnetics which saves size, but higher frequency increases switching loss because the MOSFET transitions more often and increases heating and EMI.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Frequency is a major efficiency lever. Use the lowest frequency that still meets your size, noise, and control requirements.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Use MOSFETs with fast transitions, improve layout to reduce ringing, and use a gate driver with enough current for your chosen frequency.</span>
</p>
</div>

<div class="param-block">
  <p class="param-name"><strong>Vgate_drive</strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The gate to source voltage applied by the gate driver. It controls how strongly the MOSFET turns on.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>A MOSFET channel forms only when the gate is charged. Higher gate voltage strengthens the channel.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Higher gate drive reduces on resistance. Very high gate drive increases gate charge loss and can damage the gate if it exceeds limits, and too low gate drive prevents full enhancement which increases heating.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Use the recommended gate drive voltage from the datasheet. More is not always better.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Use a gate driver capable of delivering enough current, ensure clean gate traces, and follow safe operating limits for the MOSFET.</span>
</p>
</div>

<div class="param-block">
  <p class="param-name"><strong>Rds(on)</strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The drain to source resistance when the MOSFET is fully on. It is an unavoidable resistive component of the channel.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>The channel is made of doped silicon and has finite resistance. Larger silicon area reduces this resistance.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Lower Rds(on) reduces conduction loss directly. Larger die area that gives low resistance often increases gate charge and capacitance, which can increase switching loss, and Rds(on) increases as temperature rises.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Lower Rds(on) is great for high current or low frequency designs. At higher frequency you balance Rds(on) with switching performance.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Choose MOSFETs with balanced Rds(on) and gate charge, keep the device cool, and use the recommended gate drive voltage.</span>
</p>
</div>

<div class="param-block">
  <p class="param-name"><strong>Qg</strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The total gate charge needed per switching cycle. It tells you how much effort it takes to turn the MOSFET on and off.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>The gate behaves like a capacitor. Moving charge in and out shifts the device state.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Higher Qg slows switching if the driver cannot supply enough current and increases gate drive loss. Reducing Qg often increases on resistance.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Low Qg is helpful at high frequency. For low frequency converters it is less critical.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Use a strong gate driver, keep gate traces short, and choose MOSFETs with a good balance of Qg and Rds(on).</span>
</p>
</div>

<div class="param-block">
  <p class="param-name"><strong>Td(on) and Td(off)</strong></p>
  <p class="param-detail">
  <em>What they are</em>
  <span>The delays before the MOSFET begins turning on or off after the gate signal changes.</span>
</p>
  <p class="param-detail">
  <em>Why they exist</em>
  <span>Internal capacitances and the structure of the gate region create brief delays.</span>
</p>
  <p class="param-detail">
  <em>How they affect performance</em>
  <span>Long delays increase deadtime which forces the body diode to conduct. Excessive delay reduces efficiency and raises diode stress.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Shorter delays improve efficiency in synchronous converters.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize them</em>
  <span>Use a faster gate driver, ensure clean signals, and avoid unnecessary gate trace length.</span>
</p>
</div>

<div class="param-block">
  <p class="param-name"><strong>Tr and Tf</strong></p>
  <p class="param-detail">
  <em>What they are</em>
  <span>The rise and fall times during switching transitions. These define how long the MOSFET spends in the region where both voltage and current are present.</span>
</p>
  <p class="param-detail">
  <em>Why they exist</em>
  <span>Gate charge, driver strength, and internal capacitances limit how fast the MOSFET can transition.</span>
</p>
  <p class="param-detail">
  <em>How they affect performance</em>
  <span>Longer transition times increase switching loss. Very fast transitions reduce loss but can cause noise and ringing.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>You want transitions that are fast enough for efficiency but not so fast that EMI or overshoot becomes a problem.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize them</em>
  <span>Tune gate resistance, use proper PCB layout, and pick MOSFETs with suitable switching characteristics.</span>
</p>
</div>

<div class="param-block">
  <p class="param-name"><strong>Qrr</strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The reverse recovery charge of the MOSFET body diode. It is the leftover charge that must be removed when the diode stops conducting.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>The diode stores charge while it conducts. That charge does not disappear instantly when current reverses.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Higher Qrr causes current spikes and additional heating and hurts efficiency in fast switching applications.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Low Qrr is important in synchronous converters and high frequency designs.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Choose MOSFETs with optimized body diodes or move to devices with inherently low Qrr such as superjunction or wide bandgap parts.</span>
</p>

</div>

<div class="param-block">
  <p class="param-name"><strong>Vsd</strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The forward voltage drop of the MOSFET body diode when it conducts.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>The diode is built into the MOSFET structure and conducts during deadtime or reverse current events.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Higher Vsd increases loss during deadtime and the diode heats up more at high current or long deadtime intervals.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Low Vsd is helpful when the diode conducts often, but Qrr typically matters more at high frequency.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Use MOSFETs with optimized diode behavior and minimize deadtime.</span>
</p>

</div>

<div class="param-block">
  <p class="param-name"><strong>Coss</strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The output capacitance between drain and source. It stores energy that must be moved during switching.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>The MOSFET internal structure forms parasitic capacitors.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Higher Coss increases energy loss each time the MOSFET switches, affects switching speed and voltage overshoot, and Coss loss rises quickly with higher bus voltage.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Low Coss is valuable in high voltage, high frequency applications.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Use MOSFETs designed for low capacitance, reduce switching frequency, and keep layout inductance low.</span>
</p>

</div>

<h3 class="wp-block-heading">Thermal Parameters</h3>

<div class="param-block">
  <p class="param-name"><strong>R&theta;JA</strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The junction-to-ambient thermal resistance from the datasheet. It tells you how many degrees the silicon junction will rise for each watt of power the MOSFET dissipates on the specified test PCB with no special heatsink.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>Any real device has to dump its heat into the surrounding air. The package, solder, and PCB copper form a thermal path that resists heat flow, similar to how an electrical resistor resists current.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>A higher R&theta;JA means the junction gets hotter for the same power loss, reducing safety margin and lifetime. A lower R&theta;JA keeps the device cooler and lets you safely run more current or accept higher losses.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>R&theta;JA is most accurate when your mounting and PCB look like the datasheet test conditions. In dense layouts with many hot parts or different airflow, the real effective thermal resistance can be worse.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Use wider copper areas, thermal vias, thicker copper, and avoid trapping hot air around the device. If R&theta;JA alone is not low enough, move to a package that can connect to a heatsink and use the R&theta;JC + R&theta;CA path instead.</span>
</p>
 
</div>

<div class="param-block">
  <p class="param-name"><strong>R&theta;JC</strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The junction-to-case thermal resistance from the datasheet. It describes how easily heat flows from the silicon junction into the package case or exposed pad that touches your heatsink or PCB.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>Between the silicon and the outside world there are die attach materials, leadframe, and package plastic, all of which slow heat flow and add thermal resistance.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Lower R&theta;JC means the junction tracks closer to the case temperature, so a good heatsink can keep the die much cooler. High R&theta;JC limits how effective your heatsink or copper plane can be.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>R&theta;JC is the key number when you plan to mount the MOSFET on a heatsink or heavy copper area. It lets you estimate junction temperature starting from measured or simulated case temperature.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Choose packages with low R&theta;JC (for example power packages with exposed pads), mount them with good thermal interface material, and follow layout recommendations so the thermal pad is fully soldered.</span>
</p>
 
</div>

<div class="param-block">
  <p class="param-name"><strong>R&theta;CA</strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The case-to-ambient thermal resistance for your specific cooling path: heatsink, PCB copper, thermal interface material, and airflow.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>Heat leaving the case must travel through metal, interface material, and surrounding air. Each of these adds resistance to heat flow, just like resistors in series.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Lower R&theta;CA means the case runs closer to ambient temperature for a given power loss, giving the junction more headroom. Poor heatsinking (high R&theta;CA) quickly pushes junction temperature toward its limit.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Combined with R&theta;JC, it sets the effective junction-to-ambient resistance of your custom design (R&theta;JA &approx; R&theta;JC + R&theta;CA). It drives decisions about heatsink size, airflow, and board copper area.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Use larger or more efficient heatsinks, add airflow, choose good thermal interface materials, and design PCBs with solid copper areas and thermal vias under the device.</span>
</p>
 
</div>

<div class="param-block">
  <p class="param-name"><strong>T<sub>amb</sub></strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The ambient air temperature around the MOSFET, usually the air just outside the board or heatsink rather than room temperature measured far away.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>Heat can only flow into something cooler. The temperature of the surrounding air sets the starting point for how far the junction can rise before reaching its limit.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Higher ambient temperature raises junction temperature for the same power loss and thermal resistance, reducing safety margin. Cooler ambient gives you more headroom for power or lifetime.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>You must use realistic ambient assumptions for your product environment, not just 25&nbsp;&deg;C lab conditions. Enclosures, nearby hot components, and limited airflow all make the effective ambient hotter.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Improve airflow, separate hot parts, avoid enclosing the MOSFET in small sealed spaces, and consider derating current or power for worst-case ambient conditions.</span>
</p>
 
</div>

<div class="param-block">
  <p class="param-name"><strong>T<sub>J,limit</sub></strong></p>
  <p class="param-detail">
  <em>What it is</em>
  <span>The maximum junction temperature you are willing to allow, often chosen below the absolute maximum rating in the datasheet.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>Semiconductor reliability and lifetime drop sharply as temperature rises. The datasheet absolute maximum is a do-not-exceed value, not a comfortable operating point.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>A higher chosen T<sub>J,limit</sub> lets you run more loss or current but reduces lifetime margin. A lower T<sub>J,limit</sub> improves reliability but may require a better MOSFET or stronger cooling.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Picking T<sub>J,limit</sub> is a design trade-off between efficiency, cost, and reliability. Safety standards or company guidelines may define the maximum allowed junction temperature for long-life products.</span>
</p>
  <p class="param-detail">
  <em>Practical ways to optimize it</em>
  <span>Start from datasheet limits and application requirements, then adjust MOSFET selection and cooling so the estimated Tj under worst-case conditions stays below your chosen limit with some margin.</span>
</p>
 
</div>

<h3 class="wp-block-heading">Power Loss Calculations</h3>

<div class="calculation-block">
<h4 class="wp-block-heading">Conduction Loss (P_cond)</h4>

<p class="param-detail">
  <em>What it represents</em>
  <span>Losses when the MOSFET is fully on and simply carrying current. This is the resistive heating from Rds(on).</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>The MOSFET channel behaves like a small resistor when on, so any current through it creates I&sup2;R heating.</span>
</p>
<p class="param-detail">
  <em>Formula</em>
  <span>For a simple case with constant current:<br />
  <span class="formula"><code>P_cond = Current^2 &times; Rds(on)</code></span><br />
  In real converters you often use RMS current and include duty cycle. The calculator can account for that behind the scenes if extended.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Grows with the square of current, so higher current hurts a lot. Increases with temperature because Rds(on) rises as the device heats up, and tends to dominate loss in low frequency, high current designs.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Conduction loss is often the first thing to check in high current systems. It pushes you toward lower Rds(on), better cooling, or higher Vbus to reduce current.</span>
</p>
<p class="param-detail">
  <em>Practical tips</em>
  <span>Choose MOSFETs with suitable Rds(on), keep them cool so resistance stays low, and use thick copper and short traces to avoid extra resistive loss.</span>
</p>
</div>

<div class="calculation-block">
<h4 class="wp-block-heading">Overlap Switching Loss (P_sw)</h4>

<p class="param-detail">
  <em>What it represents</em>
  <span>Losses while the MOSFET is turning on and off. In this time the device sees both significant voltage and current.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>The MOSFET cannot jump instantly from off to on. During each transition it passes through a region where it is partially on and the product of voltage and current creates heat.</span>
</p>
<p class="param-detail">
  <em>Formula</em>
  <span>A common approximation for hard switching is:<br />
  <span class="formula"><code>P_sw = 0.5 &times; Vbus &times; Current &times; (Tr + Tf) &times; f_sw</code></span><br />
  Where Tr and Tf are the rise and fall times. This calculator also adds a capacitance related term consistent with the Coss model below.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Increases linearly with bus voltage, current, and frequency, and increases with longer rise and fall times. It becomes dominant in many high frequency converters.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Once switching loss dominates, simply lowering Rds(on) does not help much. You need faster switching devices, stronger gate drive, or lower frequency.</span>
</p>
<p class="param-detail">
  <em>Practical tips</em>
  <span>Use a strong gate driver, keep gate loops tight, tune gate resistance to balance speed and EMI, and avoid unnecessarily high switching frequencies.</span>
</p>
</div>

<div class="calculation-block">
<h4 class="wp-block-heading">Reverse Recovery Loss (P_rr)</h4>

<p class="param-detail">
  <em>What it represents</em>
  <span>Loss caused by the body diode inside the MOSFET when it turns off and dumps its stored charge.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>When the diode conducts, charge accumulates in its junction. When current reverses, that charge must be removed which causes a brief extra current spike and extra heating.</span>
</p>
<p class="param-detail">
  <em>Formula</em>
  <span>A common approximation is:<br />
  <span class="formula"><code>P_rr = Qrr &times; Vbus &times; f_sw</code></span></span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Grows with bus voltage and switching frequency, shows up as current spikes and ringing that stress components and cause EMI, and matters much more in fast synchronous converters than in slow or diode based designs.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Reverse recovery can quietly dominate losses at high frequency even when Rds(on) looks good on paper. Low Qrr becomes a key selection parameter.</span>
</p>
<p class="param-detail">
  <em>Practical tips</em>
  <span>Choose MOSFETs with low Qrr body diodes, consider wide bandgap devices for very high frequency, and keep loop inductance low to reduce overshoot during recovery.</span>
</p>
</div>

<div class="calculation-block">
<h4 class="wp-block-heading">Deadtime Loss (P_dt)</h4>

<p class="param-detail">
  <em>What it represents</em>
  <span>Loss when neither MOSFET in a half bridge is on and the body diode conducts during deadtime.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>You must insert a small deadtime so that high side and low side are never on at the same time. During this time, current has to flow somewhere, usually through the body diode.</span>
</p>
<p class="param-detail">
  <em>Formula</em>
  <span>In a simple synchronous half bridge, an approximation is:<br />
  <span class="formula"><code>P_dt = 2 &times; Vsd &times; Current &times; (Td(on) + Td(off)) &times; f_sw</code></span><br />
  The factor of 2 accounts for both edges in one full switching period.</span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Increases with diode forward drop, current, deadtime, and frequency, and shows up directly as heat in the MOSFET and extra stress on the diode.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>Too much deadtime wastes energy in the diode. Too little risks shoot through. There is a sweet spot that keeps efficiency high and the converter safe.</span>
</p>
<p class="param-detail">
  <em>Practical tips</em>
  <span>Use gate drivers that provide adjustable deadtime, minimize propagation delay mismatch, and choose MOSFETs with good body diode behavior if the diode will conduct often.</span>
</p>
</div>

<div class="calculation-block">
<h4 class="wp-block-heading">Gate Charge Loss (P_gate)</h4>

<p class="param-detail">
  <em>What it represents</em>
  <span>Losses in the gate driver from charging and discharging the MOSFET gate every cycle.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>The gate is capacitive. Moving charge Qg at a voltage Vgate_drive every cycle consumes energy that ends up in the driver and the MOSFET gate network.</span>
</p>
<p class="param-detail">
  <em>Formula</em>
  <span>Each full cycle charges and discharges the gate once, so:<br />
  <span class="formula"><code>P_gate = 2 &times; Qg &times; Vgate_drive &times; f_sw</code></span></span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Grows with Qg, gate drive voltage, and frequency. It does not heat the MOSFET much directly but adds to system power loss and driver heating and limits how many devices you can drive from one controller.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>At very high frequency or in multi phase systems, gate drive loss is no longer negligible and it influences both MOSFET and driver selection.</span>
</p>
<p class="param-detail">
  <em>Practical tips</em>
  <span>Pick MOSFETs with a good balance of Qg and Rds(on), keep gate drive voltage at the recommended level, and use drivers that can handle the required total gate charge.</span>
</p>
</div>

<div class="calculation-block">
<h4 class="wp-block-heading">Output Capacitance Loss (P_coss)</h4>

<p class="param-detail">
  <em>What it represents</em>
  <span>Loss from charging and discharging the MOSFET output capacitance every switching cycle.</span>
</p>
  <p class="param-detail">
  <em>Why it exists</em>
  <span>The MOSFET drain to source capacitance stores energy at Vbus. Each time you switch, that stored energy is moved around and usually ends up as heat.</span>
</p>
<p class="param-detail">
  <em>Formula</em>
  <span>A common approximation is:<br />
  <span class="formula"><code>P_coss = 0.5 &times; Coss &times; Vbus^2 &times; f_sw</code></span></span>
</p>
  <p class="param-detail">
  <em>How it affects performance</em>
  <span>Grows quickly with bus voltage because it scales with V&sup2; and increases linearly with switching frequency. It can become a dominant loss term in high voltage, high frequency converters.</span>
</p>
  <p class="param-detail">
  <em>Design implications</em>
  <span>At higher voltages, Coss performance can matter more than Qg. Selecting a MOSFET with low output capacitance can give a significant efficiency gain.</span>
</p>
<p class="param-detail">
  <em>Practical tips</em>
  <span>Use MOSFETs optimized for low Coss at your operating voltage, keep switching frequency reasonable, and minimize parasitic inductance that interacts with Coss to cause ringing.</span>
</p>

</div>

<h2 class="wp-block-heading">Summary</h2>

<p>This guide provides an introduction to the power dissipation characteristics in MOSFETs under various operating conditions. These calculations are helpful for anyone looking to understand the efficiency and performance of MOSFET-based power electronic systems.</p>

<p><strong>Learn more about DMC&apos;s <a href="https://static.dmcinfo.com/services/embedded-development-and-embedded-programming">Embedded Development and Embedded Programming</a> expertise.&nbsp;</strong></p>
</div>
<p>The post <a href="https://static.dmcinfo.com/blog/17021/mosfet-power-loss-calculator/">MOSFET Power Loss Calculator</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Trying Out ARM Mbed OS’s New Support for USB Device with Some Retro Hardware</title>
		<link>https://static.dmcinfo.com/blog/21018/trying-out-arm-mbed-oss-new-support-for-usb-device-with-some-retro-hardware/</link>
		
		<dc:creator><![CDATA[DMC]]></dc:creator>
		<pubDate>Fri, 30 Aug 2019 09:24:58 +0000</pubDate>
				<category><![CDATA[Circuit Design]]></category>
		<category><![CDATA[Embedded Development & Programming]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Microcontroller Programming]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/21018/trying-out-arm-mbed-oss-new-support-for-usb-device-with-some-retro-hardware/</guid>

					<description><![CDATA[<p>Many products feature USB to facilitate communication between various devices, to transfer files easily, support hardware peripherals or add other features. While working on embedded systems, we have developed a variety of devices that utilize USB in these ways. The ease of implementation of USB largely depends on the hardware and software infrastructure that the [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21018/trying-out-arm-mbed-oss-new-support-for-usb-device-with-some-retro-hardware/">Trying Out ARM Mbed OS’s New Support for USB Device with Some Retro Hardware</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Many products feature USB to facilitate communication between various devices, to transfer files easily, support hardware peripherals or add other features. While working on embedded systems, we have developed a variety of devices that utilize USB in these ways.</p>



<p class="wp-block-paragraph">The ease of implementation of USB largely depends on the hardware and software infrastructure that the microcontroller manufacturer provides. As of release 5.12.0, ARM Mbed OS began supporting USB device for several targets. This provides a nice layer of abstraction between the various manufacturers’ USB implementations and the USB class code. There are a variety of USB classes that are supported by default: USB MSD, USB HID, and USB Audio.</p>



<p class="wp-block-paragraph">In this blog, I’m going to try out this new USB device support and create a USB Mouse out of an old joystick.</p>



<h2 class="wp-block-heading" id="h-setting-up-the-project">Setting up the Project</h2>



<p class="wp-block-paragraph">I want to test out the USB HID class which will allow the device to interface with the PC as a USB mouse. I am going to start by creating a <strong>basic ARM Mbed OS</strong> project. If you have never done that before, take a look at <a href="/latest-thinking/blog/id/9536/nucleo-uart-tutorial-mbed-style">this guide.</a></p>



<p class="wp-block-paragraph">For this project, I am using a <strong>NUCLEO_F429ZI</strong> development board which is one of the supported targets for using mbed’s USB device. I set the target in my project by using the command <strong>“mbed target NUCLEO_F429ZI”.</strong> Make sure that your compiler is also set correctly according to the compiler that you have installed.</p>



<p class="wp-block-paragraph">For the test, I am going to copy-and-paste the example main from the file mbed/usb/device/USBHID/USBMouse.h.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">C++</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>#include "mbed.h"
#include "USBMouse.h" 

USBMouse mouse;

int main(void)
{
  while (1)
  {
      mouse.move(20, 0);
      wait(0.5);
  }
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #C586C0">#include</span><span style="color: #569CD6"> </span><span style="color: #CE9178">&quot;mbed.h&quot;</span></span>
<span class="line"><span style="color: #C586C0">#include</span><span style="color: #569CD6"> </span><span style="color: #CE9178">&quot;USBMouse.h&quot;</span><span style="color: #569CD6"> </span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">USBMouse mouse;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">int</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">main</span><span style="color: #D4D4D4">(</span><span style="color: #569CD6">void</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">  </span><span style="color: #C586C0">while</span><span style="color: #D4D4D4"> (</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">  {</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #9CDCFE">mouse</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">move</span><span style="color: #D4D4D4">(</span><span style="color: #B5CEA8">20</span><span style="color: #D4D4D4">, </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">      </span><span style="color: #DCDCAA">wait</span><span style="color: #D4D4D4">(</span><span style="color: #B5CEA8">0.5</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">  }</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p class="wp-block-paragraph">Try and compile the project by running<strong> “mbed compile.”</strong> If you successfully build this project, then you are ready for the next steps. If not, make sure the target you are using is supported by ARM Mbed OS’s new USB device.</p>



<p class="wp-block-paragraph">Note, not all of the targets with hardware USB support Mbed’s USB device abstraction! Also, make sure you have the latest version of ARM Mbed OS in your project.</p>



<h2 class="wp-block-heading" id="h-running-a-quick-test">Running a Quick Test</h2>



<p class="wp-block-paragraph">Load the compiled program onto your target development kit. I am using a NUCLEO which has a STLINK on-board, so the development kit shows up as a drive when I plug it in. Just drag-and-drop the compiled<strong> “_your_project_name_.bin”</strong> onto the drive to program.</p>



<p class="wp-block-paragraph">To test the USB HID device, plug in the User USB port to the PC in addition to the debugging port which is needed for power. On your PC, you should see that a new USB device is detected. Once setup, your PC’s cursor should slowly move across your screen in 0.5-second steps.</p>



<p class="wp-block-paragraph">We are now ready to bring in the retro hardware to complete our USB device!</p>



<h2 class="wp-block-heading" id="h-adding-some-more-hardware">Adding Some More Hardware</h2>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/mbed-apple-joystick.jpg" alt="apple joystick"/></figure>



<p class="wp-block-paragraph">I have an old Apple Joystick IIe that I want&nbsp;to use&nbsp;as a USB joystick; so I need a custom USB adapter. The joystick electronics are very simple. There are two pushbuttons with pull-down resistors and two variable resistors, one for each axis, with one side tied to V+.</p>



<p class="wp-block-paragraph">To interface to the joystick, I connect 3.3 V on the NUCLEO to the V+, connect the GND on the NUCLEO to the joystick ground, connect the push-button outputs to digital inputs on the NUCLEO, and connect each axis output to a NUCLEO analog input with a 100 K ohm resistor to ground.</p>



<p class="wp-block-paragraph">I pulled all of this together quickly with a small prototyping board. The connector itself is just half of an RS232 serial cable.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/mbed-microcontroller.jpg" alt="microcontroler for joystick"/></figure>



<p class="wp-block-paragraph">Now, with a bit of firmware, we can get this retro joystick to operate with any modern OS.</p>



<p class="wp-block-paragraph">The code below is what I quickly put together to read the analog inputs of the joystick, read the button presses, and send corresponding USB Mouse events. When using one of the various supported USB device classes, Mbed can substantially decrease the required development time.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e"><span style="background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e">C++</span></span><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>#include "mbed.h"
#include "USBMouse.h"

USBMouse mouse;

AnalogIn ainx(A0);
AnalogIn ainy(A1);

DigitalIn right_button(D6);
DigitalIn left_button(D7);

int main()
{
	float x = 0;
	float y = 0;

	bool prev_right_button = true;
	bool prev_left_button = true;
	
	const float mid_x = ainx.read() * 100.0;
	const float mid_y = ainy.read() * 100.0;
	
	while (1)
	{
		// Update the X, Y position
		y = ainy.read() * 100.0;
		x = ainx.read() * 100.0;

		float x_move = x - mid_x;
		float y_move = y - mid_y;

		if (x_move &lt; 0)
			x_move = 2 * x_move;
		if (y_move &lt; 0)
			y_move = 2 * y_move;

		if ((abs(x_move) > 4.0) || (abs(y_move) > 4.0))
		{
			mouse.move(-1 * x_move, -1 * y_move);
		}

		// Update the button presses
		bool current_right_button = right_button;
		bool current_left_button = left_button;

		if (prev_right_button != current_right_button)
		{
			if (current_right_button)
			{
				mouse.press(MOUSE_RIGHT);
			}
			else
			{
				mouse.release(MOUSE_RIGHT);
			}
			prev_right_button = current_right_button;
		}

		if (prev_left_button != current_left_button)
		{
			if (current_left_button)
			{
				mouse.press(MOUSE_LEFT);
			}
			else
			{
				mouse.release(MOUSE_LEFT);
			}
			prev_left_button = current_left_button;
		}

		wait_ms(10);
	}
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #C586C0">#include</span><span style="color: #569CD6"> </span><span style="color: #CE9178">&quot;mbed.h&quot;</span></span>
<span class="line"><span style="color: #C586C0">#include</span><span style="color: #569CD6"> </span><span style="color: #CE9178">&quot;USBMouse.h&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">USBMouse mouse;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #4EC9B0">AnalogIn</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">ainx</span><span style="color: #D4D4D4">(</span><span style="color: #4EC9B0">A0</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #4EC9B0">AnalogIn</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">ainy</span><span style="color: #D4D4D4">(</span><span style="color: #4EC9B0">A1</span><span style="color: #D4D4D4">);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #4EC9B0">DigitalIn</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">right_button</span><span style="color: #D4D4D4">(</span><span style="color: #4EC9B0">D6</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #4EC9B0">DigitalIn</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">left_button</span><span style="color: #D4D4D4">(</span><span style="color: #4EC9B0">D7</span><span style="color: #D4D4D4">);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">int</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">main</span><span style="color: #D4D4D4">()</span></span>
<span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #569CD6">float</span><span style="color: #D4D4D4"> x = </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #569CD6">float</span><span style="color: #D4D4D4"> y = </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #569CD6">bool</span><span style="color: #D4D4D4"> prev_right_button = </span><span style="color: #569CD6">true</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #569CD6">bool</span><span style="color: #D4D4D4"> prev_left_button = </span><span style="color: #569CD6">true</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #569CD6">const</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">float</span><span style="color: #D4D4D4"> mid_x = </span><span style="color: #9CDCFE">ainx</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">read</span><span style="color: #D4D4D4">() * </span><span style="color: #B5CEA8">100.0</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #569CD6">const</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">float</span><span style="color: #D4D4D4"> mid_y = </span><span style="color: #9CDCFE">ainy</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">read</span><span style="color: #D4D4D4">() * </span><span style="color: #B5CEA8">100.0</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">	</span></span>
<span class="line"><span style="color: #D4D4D4">	</span><span style="color: #C586C0">while</span><span style="color: #D4D4D4"> (</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">	{</span></span>
<span class="line"><span style="color: #6A9955">		// Update the X, Y position</span></span>
<span class="line"><span style="color: #D4D4D4">		y = </span><span style="color: #9CDCFE">ainy</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">read</span><span style="color: #D4D4D4">() * </span><span style="color: #B5CEA8">100.0</span><span style="color: #D4D4D4">;</span></span>
<span class="line"><span style="color: #D4D4D4">		x = </span><span style="color: #9CDCFE">ainx</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">read</span><span style="color: #D4D4D4">() * </span><span style="color: #B5CEA8">100.0</span><span style="color: #D4D4D4">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #569CD6">float</span><span style="color: #D4D4D4"> x_move = x - mid_x;</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #569CD6">float</span><span style="color: #D4D4D4"> y_move = y - mid_y;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (x_move &lt; </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">			x_move = </span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4"> * x_move;</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (y_move &lt; </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">			y_move = </span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4"> * y_move;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> ((</span><span style="color: #DCDCAA">abs</span><span style="color: #D4D4D4">(x_move) &gt; </span><span style="color: #B5CEA8">4.0</span><span style="color: #D4D4D4">) || (</span><span style="color: #DCDCAA">abs</span><span style="color: #D4D4D4">(y_move) &gt; </span><span style="color: #B5CEA8">4.0</span><span style="color: #D4D4D4">))</span></span>
<span class="line"><span style="color: #D4D4D4">		{</span></span>
<span class="line"><span style="color: #D4D4D4">			</span><span style="color: #9CDCFE">mouse</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">move</span><span style="color: #D4D4D4">(-</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> * x_move, -</span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> * y_move);</span></span>
<span class="line"><span style="color: #D4D4D4">		}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955">		// Update the button presses</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #569CD6">bool</span><span style="color: #D4D4D4"> current_right_button = right_button;</span></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #569CD6">bool</span><span style="color: #D4D4D4"> current_left_button = left_button;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (prev_right_button != current_right_button)</span></span>
<span class="line"><span style="color: #D4D4D4">		{</span></span>
<span class="line"><span style="color: #D4D4D4">			</span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (current_right_button)</span></span>
<span class="line"><span style="color: #D4D4D4">			{</span></span>
<span class="line"><span style="color: #D4D4D4">				</span><span style="color: #9CDCFE">mouse</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">press</span><span style="color: #D4D4D4">(MOUSE_RIGHT);</span></span>
<span class="line"><span style="color: #D4D4D4">			}</span></span>
<span class="line"><span style="color: #D4D4D4">			</span><span style="color: #C586C0">else</span></span>
<span class="line"><span style="color: #D4D4D4">			{</span></span>
<span class="line"><span style="color: #D4D4D4">				</span><span style="color: #9CDCFE">mouse</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">release</span><span style="color: #D4D4D4">(MOUSE_RIGHT);</span></span>
<span class="line"><span style="color: #D4D4D4">			}</span></span>
<span class="line"><span style="color: #D4D4D4">			prev_right_button = current_right_button;</span></span>
<span class="line"><span style="color: #D4D4D4">		}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (prev_left_button != current_left_button)</span></span>
<span class="line"><span style="color: #D4D4D4">		{</span></span>
<span class="line"><span style="color: #D4D4D4">			</span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> (current_left_button)</span></span>
<span class="line"><span style="color: #D4D4D4">			{</span></span>
<span class="line"><span style="color: #D4D4D4">				</span><span style="color: #9CDCFE">mouse</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">press</span><span style="color: #D4D4D4">(MOUSE_LEFT);</span></span>
<span class="line"><span style="color: #D4D4D4">			}</span></span>
<span class="line"><span style="color: #D4D4D4">			</span><span style="color: #C586C0">else</span></span>
<span class="line"><span style="color: #D4D4D4">			{</span></span>
<span class="line"><span style="color: #D4D4D4">				</span><span style="color: #9CDCFE">mouse</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">release</span><span style="color: #D4D4D4">(MOUSE_LEFT);</span></span>
<span class="line"><span style="color: #D4D4D4">			}</span></span>
<span class="line"><span style="color: #D4D4D4">			prev_left_button = current_left_button;</span></span>
<span class="line"><span style="color: #D4D4D4">		}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">		</span><span style="color: #DCDCAA">wait_ms</span><span style="color: #D4D4D4">(</span><span style="color: #B5CEA8">10</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">	}</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<h2 class="wp-block-heading" id="h-testing-it-out">Testing it Out</h2>



<p class="wp-block-paragraph">Plug it into the PC and try out this retro joystick working with a modern machine!</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/mbed-joystick-and-controller.jpg" alt="joystick and controller"/></figure>



<p class="wp-block-paragraph">This is a great way to get a simple USB device going, but often a product will require more customization or non-supported USB class. If this is the case for you, <a href="/contact">come talk</a> to our <a href="/services/embedded-development-and-embedded-programming">embedded development and programming group</a> to see what solution makes sense for you!</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21018/trying-out-arm-mbed-oss-new-support-for-usb-device-with-some-retro-hardware/">Trying Out ARM Mbed OS’s New Support for USB Device with Some Retro Hardware</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>DMC&#8217;s Custom Bootloader</title>
		<link>https://static.dmcinfo.com/blog/21075/dmcs-custom-bootloader/</link>
		
		<dc:creator><![CDATA[Zachary Gracia]]></dc:creator>
		<pubDate>Thu, 22 Aug 2019 13:44:10 +0000</pubDate>
				<category><![CDATA[Circuit Design]]></category>
		<category><![CDATA[Embedded Development & Programming]]></category>
		<category><![CDATA[Embedded Systems]]></category>
		<category><![CDATA[Microcontroller Programming]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/21075/dmcs-custom-bootloader/</guid>

					<description><![CDATA[<p>For anyone who has worked on an embedded project, you can understand the hassle of loading code onto a microcontroller. To alleviate this issue and cut down on the extra time that comes from this process, DMC designed and built a custom boot loading tool. This boot loader communicates with MCUs using UART (Universal Asynchronous [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21075/dmcs-custom-bootloader/">DMC&#8217;s Custom Bootloader</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">For anyone who has worked on an <a href="/services/embedded-development-and-embedded-programming">embedded project</a>, you can understand the hassle of loading code onto a microcontroller. To alleviate this issue and cut down on the extra time that comes from this process, DMC designed and built a custom boot loading tool. This boot loader communicates with MCUs using UART (Universal Asynchronous Receiver/Transmitter). UART communication uses physical circuitry to send and receive serial data between two devices.</p>

<figure class="wp-block-image"><img decoding="async" alt="dmc custom bootloader" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/dmc-custom-bootloader-edited.png"  /></figure>

<p class="wp-block-paragraph">The DMC boot loader has three important features that help improve its use. The first of which is it has an onboard micro USB port. This port allows for serial communication with a CPU via a USB to micro USB cord (like you would use to charge a phone).</p>

<p class="wp-block-paragraph">The second important feature of the boot loader is that it has onboard reset and boot buttons. This allows for the user to easily put their MCU into boot loading mode by resetting the MCU while pressing the bootloader button.</p>

<p class="wp-block-paragraph">The third feature of this board that is important is the five-pin connector. This connector is how the bootloader communicates with the target MCU.</p>

<p class="wp-block-paragraph">For most DMC embedded projects, there is a standard 5 pin header that is compatible with the boot loader&rsquo;s connector. Through this mounting, we can send and receive the serial data, as well as reset and put the board into boot loading mode. Even if a board doesn&rsquo;t have a compatible mount, you can manually connect the boot loader&rsquo;s TX, RX, boot, ground, and reset pins to the appropriate locations on the target board to achieve the same functionality.</p>

<p class="wp-block-paragraph">This tool is one example of many internal initiatives DMC has undertaken to be more efficient and profitable.</p>

<p class="wp-block-paragraph">Learn more about <a href="/services/embedded-development-and-embedded-programming">DMC&apos;s Embedded Development and Programming Solutions</a>. <a href="/contact">Contact us</a> for additional information.</p>
<p>The post <a href="https://static.dmcinfo.com/blog/21075/dmcs-custom-bootloader/">DMC&#8217;s Custom Bootloader</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How To Disassemble and Fix a Fried S7-1200 PLC</title>
		<link>https://static.dmcinfo.com/blog/22198/how-to-disassemble-and-fix-a-fried-s7-1200-plc/</link>
		
		<dc:creator><![CDATA[Jirka Hladis]]></dc:creator>
		<pubDate>Mon, 21 Jan 2019 09:52:33 +0000</pubDate>
				<category><![CDATA[Circuit Design]]></category>
		<category><![CDATA[Culture]]></category>
		<category><![CDATA[Embedded Development & Programming]]></category>
		<category><![CDATA[PLC]]></category>
		<category><![CDATA[Siemens PLC]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/22198/how-to-disassemble-and-fix-a-fried-s7-1200-plc/</guid>

					<description><![CDATA[<p>Don’t you hate it when your coworker inadvertently wires up a 24V PLC to wall power and lets out the magic smoke? Just such a&#160;mishap happened in our lab a while back and the broken PLC was sitting around in the junk bin for a while. Figuring there wasn&#8217;t anything to lose, I decided to [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/22198/how-to-disassemble-and-fix-a-fried-s7-1200-plc/">How To Disassemble and Fix a Fried S7-1200 PLC</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Don’t you hate it when your coworker inadvertently wires up a 24V PLC to wall power and lets out the magic smoke? Just such a&nbsp;mishap happened in our lab a while back and the broken PLC was sitting around in the junk bin for a while. Figuring there wasn&#8217;t anything to lose,<strong> I decided to try my luck and see if it could be revived</strong>.&nbsp;</p>



<p class="wp-block-paragraph">Fortunately, the Siemens S7-1200 series PLCs are quite easy to disassemble, and&nbsp;I was able to replace the damaged components and restore it to a proper working condition.&nbsp;I definitely wouldn&#8217;t trust this refurbished PLC to run a critical system, but for testing code in our lab, it should be just fine. <strong>I would also recommend reaching out to the manufacturer if you are running into issues with a production&nbsp;PLC, keeping in mind that any warranty may be voided if you attempt to fix it yourself.</strong></p>


<hr />


<h2 id="h-opening-nbsp-the-enclosure" class="wp-block-heading">Opening&nbsp;the Enclosure</h2>



<p class="wp-block-paragraph">Using a small flat blade screwdriver to push in the side tabs, it&#8217;s easy to pull the enclosure apart and <strong>separate the power conditioning PCB from the main board</strong>.</p>


<div><iframe width="100%" height="520" src="https://www.youtube.com/embed/videoseries?list=PLWKqK_J0HJAWrpFIsrnD5tLvYvx8Nad3p&amp;autoplay=1&amp;loop=1&amp;mute=1" title="Video" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>


<p class="wp-block-paragraph">&nbsp;</p>



<h2 id="h-surveying-the-damage" class="wp-block-heading">Surveying The Damage</h2>



<p class="wp-block-paragraph">I immediately noticed the <strong>burn marks </strong>coming from the positive voltage supply pin, but everything else looked okay, and there was no visible damage on the main board.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/S71200fuse.jpg" alt="PCB burn marks"/></figure>



<p class="wp-block-paragraph">The first component in the circuit is a fuse, designed to limit the damage from precisely this type of mishap. Using a <strong>multimeter </strong>to check for continuity showed that it was in fact blown, as one would expect. I went ahead and jumpered it out with a <strong>wire wrap connection</strong>.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/S71200wire_wrap.jpg" alt="wire wrap across fuse leads"/></figure>



<h2 id="h-now-what" class="wp-block-heading">Now What?</h2>



<p class="wp-block-paragraph">Unfortunately, the fix wasn&#8217;t going to be that easy. Measuring the resistance across the voltage supply terminals, I found there was now a <strong>short circuit</strong>. After checking all the components that go across the voltage bus, I found that the culprit was a small <strong>Zener diode</strong>.</p>



<p class="wp-block-paragraph">Its purpose is to suppress spikes in the supply voltage, but unsurprisingly, applying 120 VAC far exceeded its maximum power dissipation rating and caused it to short out. Simply <strong>desoldering the offending diode</strong> from one of its pads&nbsp;fixed the short, and after reassembling the PCBs&nbsp;and applying power, I was surprised that the&nbsp;PLC powered up and was fully functional. Clearly, the protection circuitry had done its job.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/S71200diode.jpg" alt="desoldered diode"/></figure>



<h2 id="h-patching-everything-up" class="wp-block-heading">Patching Everything Up</h2>



<p class="wp-block-paragraph">Even though I now had a working PLC, leaving it as-is would mean that it would most likely <strong>not survive a second jolt </strong>of high voltage, so I went ahead and <strong>replaced the fuse and Zener diode </strong>to make it almost as good as new at a cost of less than $2.</p>


<div><iframe width="50%" height="260" src="https://www.youtube.com/embed/videoseries?list=PLWKqK_J0HJAXYg5nYTHmJIVJppLRf804D&amp;autoplay=1&amp;loop=1&amp;mute=1" title="Video" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe><iframe width="50%" height="260" src="https://www.youtube.com/embed/videoseries?list=PLWKqK_J0HJAUupFaOfVWaSaP214fvv186&amp;autoplay=1&amp;loop=1&amp;mute=1" title="Video" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>


<p class="wp-block-paragraph">&nbsp;</p>



<p class="wp-block-paragraph">After that, it&#8217;s easy to snap everything back together, power it up, and <strong>watch the blinkenlights turn on</strong>!</p>


<div><iframe loading="lazy" width="100%" height="520" src="https://www.youtube.com/embed/videoseries?list=PLWKqK_J0HJAWwQ8QpCsvXHAvbhkNKLjo2&amp;autoplay=1&amp;loop=1&amp;mute=1" title="Video" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>


<p class="wp-block-paragraph">&nbsp;</p>



<h2 id="h-conclusion" class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">I hope you enjoyed this sneak peek under the hood of a device that we work with on a daily basis. It was nice to see that Siemens designs their PLCs to be pretty robust and easy to disassemble, unlike the typical consumer electronics devices you tend to see these days. Share your own stories of hacking PLC hardware in the comments section below!</p>


<hr />


<p class="wp-block-paragraph">Learn more about DMC&#8217;s <a href="/services/manufacturing-automation-and-intelligence/plc-programming/siemens-s7-plc-programming"><strong>Siemens S7 PLC programming expertise</strong></a> and <a href="https://static.dmcinfo.com/services/embedded-development-and-embedded-programming"><strong>embedded design expertise</strong></a>.&nbsp;</p>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://static.dmcinfo.com/blog/22198/how-to-disassemble-and-fix-a-fried-s7-1200-plc/">How To Disassemble and Fix a Fried S7-1200 PLC</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The Product Development Process: How to Bring Your Product to Market</title>
		<link>https://static.dmcinfo.com/blog/25824/the-product-development-process-how-to-bring-your-product-to-market/</link>
		
		<dc:creator><![CDATA[Tim Jager]]></dc:creator>
		<pubDate>Tue, 15 Mar 2016 15:45:38 +0000</pubDate>
				<category><![CDATA[Circuit Design]]></category>
		<category><![CDATA[Embedded Development & Programming]]></category>
		<category><![CDATA[Product Development]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[UI/UX]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/25824/the-product-development-process-how-to-bring-your-product-to-market/</guid>

					<description><![CDATA[<p>Have you ever had a product design idea? Our engineers created this overview of the product development process to&#160;demystify how to bring your product to market.&#160; Learn more about DMC&apos;s Custom Software and Hardware Development services.</p>
<p>The post <a href="https://static.dmcinfo.com/blog/25824/the-product-development-process-how-to-bring-your-product-to-market/">The Product Development Process: How to Bring Your Product to Market</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">Have you ever had a product design idea?</p>

<p class="wp-block-paragraph">Our engineers created this overview of the product development process to&nbsp;demystify how to bring your product to market.&nbsp;</p>

<p class="wp-block-paragraph"><iframe loading="lazy" allowfullscreen="" frameborder="0" height="360" src="https://www.youtube.com/embed/jS-rD6HuxIk?rel=0" width="640"></iframe></p>

<p class="wp-block-paragraph"><strong>Learn more about DMC&apos;s <a href="https://static.dmcinfo.com/services/embedded-development-and-embedded-programming">Custom Software and Hardware Development</a> services.</strong></p>
<p>The post <a href="https://static.dmcinfo.com/blog/25824/the-product-development-process-how-to-bring-your-product-to-market/">The Product Development Process: How to Bring Your Product to Market</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Exploring Altium: Using Design Variants</title>
		<link>https://static.dmcinfo.com/blog/25943/exploring-altium-using-design-variants/</link>
		
		<dc:creator><![CDATA[DMC]]></dc:creator>
		<pubDate>Fri, 29 Jan 2016 09:35:21 +0000</pubDate>
				<category><![CDATA[Circuit Design]]></category>
		<category><![CDATA[Embedded Development & Programming]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/25943/exploring-altium-using-design-variants/</guid>

					<description><![CDATA[<p>One of my absolute favorite things about embedded design is watching a product evolve over the development cycle. From unboxing the first prototype all the way to the release of the deluxe commercial model, each revision of the design poses new and interesting challenges. One of these challenges is managing each revision of the electrical [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/25943/exploring-altium-using-design-variants/">Exploring Altium: Using Design Variants</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">One of my absolute favorite things about embedded design is watching a product evolve over the development cycle. From unboxing the first prototype all the way to the release of the deluxe commercial model, each revision of the design poses new and interesting challenges. One of these challenges is managing each revision of the electrical schematic and PCB layout in a way that minimizes human error and maximizes automation.</p>



<p class="wp-block-paragraph"><a href="http://www.altium.com/altium-designer/overview" target="_blank">Altium Designer</a> has an excellent tool to assist the embedded engineer in managing changes between revisions and within different variations of a base design: Design Variants (sometimes called Assembly Variants).</p>



<p class="wp-block-paragraph"><strong>Introduction to Design Variants</strong></p>



<p class="wp-block-paragraph">So, when do Design Variants come into play? At DMC, we use this tool primarily to manage situations where components that exist on the schematic are not intended to be installed on the PCB. There are many reasons why a component might be placed on the schematic but not on the final board. Here are a few key cases:</p>



<ul class="wp-block-list">
<li>Designs with functionality that can be stripped away for &#8220;basic&#8221; flavors of the product/solution</li>



<li>Prototypes intended to test functionality of two or more similar (but not identical) circuits; one example would be evaluating two 5V power supplies for the lowest noise</li>



<li>Designs with a matrix of pull-up and pull-down resistors to indicate the PCB/hardware revision to the microprocessor so that it can re-assign I/O addresses or enable/disable functionality accordingly</li>
</ul>



<p class="wp-block-paragraph">Let&#8217;s take the first case above. DMC recently executed an embedded design for <a href="http://dialindicator.com/" target="_blank">Chicago Dial Indicator</a> (CDI), a company that manufactures (among many other products) high-quality electronic dial indicators. DMC originally connected with CDI to help innovate their flagship electronic dial indicator (read more <a href="https://static.dmcinfo.com/our-work/low-power-consumption-product-design-with-the-texas-instruments-msp430/" type="link" id="https://static.dmcinfo.com/our-work/low-power-consumption-product-design-with-the-texas-instruments-msp430/">about that project</a>). After launching that product, CDI approached us again to revitalize their EMS device, which connects multiple indicators to a single device to show data, log measurements, and provide an easy interface to a PC or measurement system.</p>



<p class="wp-block-paragraph">DMC suggested designing a PCB that could interface with an expansion board to double the channel count without any additional hardware designs. Sure, we could have designed and managed two separate boards, but with Altium&#8217;s Design Variants functionality, this was a breeze. Let&#8217;s take a look!</p>



<p class="wp-block-paragraph"><strong>Variant Management</strong></p>



<p class="wp-block-paragraph">Below is an excerpt of the schematic that shows the device interface channels. Rather than copy-pasting each individual channel, we&#8217;re using the multi-channel functionality of Altium, which you can see above the sheet symbol for a device channel: REPEAT(MTI,1,4) will create four copies of the sheet, MTIA, MTIB, MTIB, and MTIC</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/MultiChannel-Design_1.png" alt=""/></figure>



<p class="wp-block-paragraph">In the upper-right hand corner (by default) of the schematic editor, you&#8217;ll find the Design Variants button, which launches the Assembly Variants Management window.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Design-Variants-Button.png" alt=""/></figure>



<p class="wp-block-paragraph"><strong>Adding a New Variant</strong></p>



<p class="wp-block-paragraph"><span>Launching the Variant Management window will show you a screen like the following:</span></p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Assembly-Variant-Management-Window.png" alt=""/></figure>



<p class="wp-block-paragraph">For the Basic version of this PCB, we only want to populate two of the four channels (MTIA and MTIB). First, let&#8217;s add an assembly variant called &#8220;Basic&#8221;. Find the &#8220;Add Variant&#8230;&#8221; button on the bottom left of this window and click it. You will see the &#8220;Edit Design Variant&#8221; window below:</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Edit-Project-Variant_1.png" alt=""/></figure>



<p class="wp-block-paragraph"><span style="line-height: 1.6;">I selected &#8220;Allow variation of fabrication outputs.&#8221; This isn&#8217;t critical, but sometimes you&#8217;ll want to omit certain footprints for components that are not installed. </span></p>



<p class="wp-block-paragraph">After clicking OK, you should see the Variant Management window again with a new column for the variant you created. Let&#8217;s find the components that will not be fitted for the &#8220;Basic&#8221; variant of this design. In my case, I am de-populating channels MTIC and MTID, so I&#8217;ll highlight any components with either of those prefixes in the &#8220;Designator&#8221; field.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Select-Unused-Channels.png" alt=""/></figure>



<p class="wp-block-paragraph">To bulk-edit these parts, right-click on the highlighted &#8220;Component Variation&#8221; field, hover over &#8220;Set Selected As&#8221; and then click &#8220;Not Fitted&#8221;.</p>



<p class="wp-block-paragraph">After this action, all of the highlighted parts should now show &#8220;Not Fitted&#8221; in the Component Variation field.</p>



<p class="wp-block-paragraph"><b>Design Variants and the Schematic</b></p>



<p class="wp-block-paragraph">Now that your design variant has been created and configured, it&#8217;s time to take a look at the schematic to check our work. Find the Design Variants button again (in the upper-right hand corner of the schematic editor by default). Next to it is a drop-down menu that shows the selected Design Variant. This field will probably show &#8220;[No Variations].&#8221; Click on the drop-down and find the variant you just created.</p>



<p class="wp-block-paragraph">The default view of the Schematic Editor is the &#8220;Editor&#8221; view (so creative). If you look on the bottom toolbar, however, you will see one or more tabs next to &#8220;Editor.&#8221; In the case of multi-channel schematics, each of the individual channels will be accessible here. If the schematic is only used once, there will only be a single tab.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/channel-tabs.png" alt=""/></figure>



<p class="wp-block-paragraph">If I click on channels MTIC or MTID, the two channels that will not be installed on my Basic variant, the schematic editor will show red x-marks over all of the components that are marked as Not Fitted.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Unpopulated-Channel.png" alt=""/></figure>



<p class="wp-block-paragraph">Nice! I would encourage you to double-check all sheets of your schematic when creating design variants, as this is an easy way to spot mistakes (such as a component that has been marked Not Fitted by accident).</p>



<p class="wp-block-paragraph"><strong>Generating Outputs &#8211; BOM</strong></p>



<p class="wp-block-paragraph">Now comes the most powerful part of creating design variants &#8211; generating design outputs! The first document we&#8217;ll generate is the Bill of Materials, or BOM. The BOM lists all of the manufacturer part numbers in your design and links each one to a schematic component. This document is very important to the PCB assembly house, who typically purchases the components in the BOM and loads them into a pick-and-place machine.</p>



<p class="wp-block-paragraph">When managing design variants manually, it&#8217;s necessary to indicate which components and designators will not be populated. One way to do this is to label the unused components with DNI (Do Not Install), DNP (Do Not Populate), Not Fitted, or something similar. Unsurprisingly, this is not a fool-proof solution, as some manufacturers may not recognize or understand these directives.</p>



<p class="wp-block-paragraph">A better way is to eliminate the unused components and designators from the BOM entirely. Sure, you can delete them by hand, but this is inherently error-prone and can be quite time-consuming. Instead, let&#8217;s let Altium handle this for us. In your Output Job file (if this is a new project, you may have to add one using File -&gt; Add New to Project -&gt; Output Job File), select the appropriate design variant from the top of the window:</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Select-Variant-Choice.png" alt=""/></figure>



<p class="wp-block-paragraph">Then, simply generate your BOM. I selected the basic version of my PCB, which omits two of the four device channels. Let&#8217;s see what happened. The first image below is the default BOM, which does not omit any channels. Notice that you can see components with MTIA, MTIB, MTIC, and MTID prefixes.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/BOM-Filtered-All-Variants.png" alt=""/></figure>



<p class="wp-block-paragraph">The second image shows the BOM generated for the Basic variant, which shows only MTIA and MTIB components.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/BOM-Filtered-Fitted-Only.png" alt=""/></figure>



<p class="wp-block-paragraph">Nice!</p>



<p class="wp-block-paragraph"><strong>Generating Outputs &#8211; Pick-and-Place</strong></p>



<p class="wp-block-paragraph">The second document of importance is the Pick-and-Place file, which contains the location and orientation of each component in the assembly. This is the file used by pick-and-place machines to mount components on a PCB prior to soldering.</p>



<p class="wp-block-paragraph">Components that are not populated on the PCB are almost always marked as such on the BOM (or removed entirely as discussed above). The pick-and-place file is often neglected, which sometimes leads to confusion during the assembly process. I have seen situations where the &#8220;DNP&#8221; designator on the BOM was missed, and DNP components were installed anyway. Had those parts&#8217; entries on the pick-and-place files been omitted as well, the assembly house would not have loaded the components in the pick-and-place machine in the first place.</p>



<p class="wp-block-paragraph">Generating a pick-and-place file for your assembly variant is very simple. From the PCB Editor, make sure the proper variant is selected by choosing it from the drop-down menu on the toolbar (just as you did from the Schematic Editor earlier). Then, click File -&gt; Assembly Outputs -&gt; Generates Pick and Place Files. Voila!</p>



<p class="wp-block-paragraph">Below is a WinMerge comparison between the default and variant pick-and-place files, which clearly shows that the DNP parts are completely omitted from the variant version. Even though it&#8217;s not essential to generate the pick-and-place file this way, it&#8217;s an additional way to validate the design during the hand-off to the manufacturer.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Winmerge-Diff-Pick-and-Place.png" alt=""/></figure>



<p class="wp-block-paragraph"><strong>Summary</strong></p>



<p class="wp-block-paragraph">Design Variants in Altium are a powerful tool for handling situations where a base design can be assembled into multiple versions or &#8220;flavors.&#8221; This article covered the case where parts are not populated to create a &#8220;Basic&#8221; version (where the base design is the &#8220;Deluxe&#8221; version with more functionality). Design Variants can be used to change part parameters (like a resistor value or a part number) as well. If you find yourself managing a lot of design outputs manually, it might be time to let Altium shoulder the brunt of the work for you!</p>



<p class="wp-block-paragraph"><strong>Learn more about DMC&#8217;s <a href="/services/embedded-development-and-embedded-programming">embedded design</a> and <a href="/services/embedded-development-and-embedded-programming/circuit-design">circuit design</a> services.</strong></p>
<p>The post <a href="https://static.dmcinfo.com/blog/25943/exploring-altium-using-design-variants/">Exploring Altium: Using Design Variants</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Repairing an NI USB-6351 X-Series DAQ</title>
		<link>https://static.dmcinfo.com/blog/27281/repairing-an-ni-usb-6351-x-series-daq/</link>
		
		<dc:creator><![CDATA[DMC]]></dc:creator>
		<pubDate>Tue, 09 Sep 2014 16:19:32 +0000</pubDate>
				<category><![CDATA[Circuit Design]]></category>
		<category><![CDATA[Embedded Development & Programming]]></category>
		<category><![CDATA[LabVIEW]]></category>
		<category><![CDATA[Test and Measurement Automation]]></category>
		<category><![CDATA[DAQ Hardware]]></category>
		<category><![CDATA[Hardware]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/27281/repairing-an-ni-usb-6351-x-series-daq/</guid>

					<description><![CDATA[<p>Recently, I’ve needed to do some proof of concept testing for a LabVIEW-based project. The only special I/O requirement for my prototype was a +/- 10V analog output that is capable of sourcing at least 1mA of current. The good news was that DMC owned just the piece of hardware: an NI USB-6351 X-Series DAQ. [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/27281/repairing-an-ni-usb-6351-x-series-daq/">Repairing an NI USB-6351 X-Series DAQ</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Recently, I’ve needed to do some proof of concept testing for a LabVIEW-based project. The only special I/O requirement for my prototype was a +/- 10V analog output that is capable of sourcing at least 1mA of current. The good news was that DMC owned just the piece of hardware: an NI USB-6351 X-Series DAQ. The bad news was that it was handed to me with the caveat that it doesn’t turn on and may or may not smell bad when plugged in. Undeterred, I resolved to resurrect our $1500 out-of-warranty brick.</p>



<p class="wp-block-paragraph">Since the unit showed no signs of powering on, the first order of business was to verify the main power source. Finding nothing wrong with the 12V external power adapter, I set off to get my hands dirty and investigate the internal circuitry.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/pcb-1_edited.jpg" alt="pcb"/></figure>



<p class="wp-block-paragraph">Thankfully, NI made the DAQ very easy to disassemble. The entire PCB assembly slides out in one piece after the removal of a couple screws. Nothing seemed charred or obviously damaged and nothing dramatic happened when I tried giving it power again. So, I started the highly technical operation of poking around at various chips to see if anything was hot.</p>



<p class="wp-block-paragraph">Nothing felt scalding hot, but there was a section of circuitry warm enough to raise suspicion. Especially so because a nearly identical set of components nearby was cool to the touch. The hot circuits included an LM2673-ADJ adjustable switching regulator (U54) connected to a 33uH power inductor (L6) and 5A-rated BAT540C Schottky diode (D25). The circuit was regulating the 12V from the external adapter to a somewhat strange 1.2V. The neighboring circuit, on the other hand, was taking the same 12 volts and outputting a standard 3.3V.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/pcb-2_edited.jpg" alt="PCB 2 pictured here."/></figure>



<p class="wp-block-paragraph">Checking the datasheet for the LM2673-ADJ, I discovered that its output voltage is controlled by a resistive voltage divider. I found the appropriate resistors in the PCB, measured their resistances, and calculated the designed output voltages for the two regulator circuits. The circuit supplying 3.3V was designed as such while the one outputting 1.2V should have been outputting 5V.</p>



<p class="wp-block-paragraph">The most likely cause of this discrepancy was that the regulator was supplying excessive current due to a damaged component somewhere on the 5V power rail. In doing so, it would trigger its over-current and/or over-temperature protection and reduce its output voltage. I checked and found that there was indeed a very low amount of resistance between the 5V power rail and ground. Whatever component was causing this would be sinking a lot of current and therefore necessarily be quite hot.</p>



<p class="wp-block-paragraph">It didn’t seem like the sort of thing that’d be hard to find.</p>



<p class="wp-block-paragraph">My prime suspect was diode D25 that sits across the regulator’s 5V output and ground. I removed it only to find that 5V and ground were still shorted together. I verified with my multimeter that the diode was damaged and contributing to the short, but it clearly wasn’t the only offending component. Thinking that the problem was isolated to the immediate vicinity of the regulator, I removed output capacitors C125, C126, and C127. No dice. A little desperate, I removed the regulator chip itself.&nbsp;</p>



<p class="wp-block-paragraph">Using an adjustable current limit lab power supply, I can feed power directly into the shorted 5V power rail. Whatever component was causing the short would surely heat up enough for me to detect. With the power supply voltage limited to 5V, I started cranking up the current. Eventually, I found myself pouring over 3A into the circuit board at a mere 1V.</p>



<p class="wp-block-paragraph">I found two potential culprits. Just above the 3.3V regulator circuit, there was a circuit block that contained a power inductor designated L11 and a tiny 6-pin surface mount component designated Q38. Both were intensely hot. Under the assumption that inductors don’t just go off and fail, I turned my attention to Q38. I could make out the markings “A41AC” yet no amount of searching yielded any useful results. Frustrated, I decided to remove the chip altogether.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/pcb-3_edited.jpg" alt="PCB 3 is pictured here."/></figure>



<p class="wp-block-paragraph">As soon as Q38 was gone, the short-circuit I was hunting went with it! I knew the DAQ wasn’t fixed, but I couldn’t stop myself from attempting to power it on right there. All I had to do was plug in the external 12V power brick while simultaneously using the lab power supply to replace the 5V regulator I removed.</p>



<p class="wp-block-paragraph">Once connected over USB, NI MAX detected the DAQ immediately. I was ecstatic. It amazed me that the device seemed to be functioning normally. The digital I/O seemed to work, so I went to test what I needed from the DAQ in the first place: analog output. The behavior I saw was puzzling. When commanded to output +10V, I would get +2.5V. Similarly, commanding -10V would result in -2.5V and the voltages in between scaled linearly.</p>



<p class="wp-block-paragraph">Of course, the one feature I needed from this DAQ was the one that was still broken.</p>



<p class="wp-block-paragraph">When additional searching turned up nothing useful regarding the mystery chip, I started reverse engineering the schematic for the circuit block in which it lived. Very fortunately for me, just like the 5V and 3.3V regulators from before, there was a doppelganger to this circuit block as well. It too contained an A41AC mystery chip. Here is the partial schematic I came up with:</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6abf205c14357&quot;}" data-wp-interactive="core/image" data-wp-key="6abf205c14357" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="800" height="505" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/DAQ-schematic_edited.jpg" alt="DAQ schematic" class="wp-image-27273" srcset="https://static.dmcinfo.com/wp-content/uploads/2025/05/DAQ-schematic_edited.jpg 800w, https://static.dmcinfo.com/wp-content/uploads/2025/05/DAQ-schematic_edited-300x189.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2025/05/DAQ-schematic_edited-768x485.jpg 768w" sizes="(max-width: 800px) 100vw, 800px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<p class="wp-block-paragraph">Q38 and L11 were the components that I had felt getting very hot. Q39 and L13 were cool to the touch. <a href="http://en.wikipedia.org/wiki/Boost_converter" target="_blank">These two circuits look like classic voltage boost converters</a>. To get a better feel for how these circuits worked, I used an oscilloscope to probe the undamaged circuit at the points indicated on the schematic.</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/scope-trace-1_edited.jpg" alt="Scope trace one pictured here."/></figure>



<p class="wp-block-paragraph">Let’s assume the mystery chips Q38/39 are N-channel enhancement mode MOSFETs. Pins 1, 2, 5, and 6 would be the drain, pin 3 would be the gate, and pin 4 would be the source. On the undamaged circuit, the scope shows a ~1MHz square wave with ~80% duty cycle at the gate. When the gate is high, the transistor turns on and pulls the drain to ground. This forces current to increase in L11, allowing it to store energy. When the gate is low, the transistor turns off, forcing the current stored in the inductor to flow through the flyback diode, D23, to the output of the circuit. <a href="http://en.wikipedia.org/wiki/Boost_converter#Continuous_mode" target="_blank">This operation matches exactly that of a boost converter operating in continuous mode.</a>&nbsp;</p>



<p class="wp-block-paragraph">The relevant equation to be aware of here is Duty cycle = 1 – Vin/Vout. Since Vin is 3.3V and Vout is 20V, the duty cycle should be 83.5%. This result matches closely to what I saw being fed to the MOSFET gate. Out of curiosity, I checked what kind of waveform was being fed to the damaged circuit and found a ~1MHz square wave with ~75% duty cycle. With Vin being 5V in that circuit, Vout is predicted to also be 20V. At this point I speculated that the undamaged circuit was used to supply the reference for the DAQ’s +/-10V analog input and the damaged circuit supplies the reference for the analog output. With Q38 removed, the broken boost circuit would simply output the 5V that it was fed. This explains why I could only get the DAQ’s analog output to swing between -2.5V and +2.5V.</p>



<p class="wp-block-paragraph">Now it’s time to tackle the issue of actually finding a replacement part for Q38. Using calipers, I measured the dimensions of the chip to match the TSOT-23-6 package. Searching for N-channel MOSFETS in this package on DigiKey, I found several pin-compatible parts!</p>



<p class="wp-block-paragraph"><p style="text-align: center;">&nbsp;</p></p>



<p class="wp-block-paragraph">Extremely satisfied with myself, I ordered a FDC5661N_F085 which had the highest rated power rating at 1.6W. I also grabbed a BAT540C and LM2673-ADJ to repair the 5V regulator circuit before running around the office to gloat over my victory.</p>



<p class="wp-block-paragraph">The parts came in the mail the next morning and I eagerly got to work soldering them in their places. I first restored the 5V regulator circuit which fired up without a hitch. After that I dropped a new MOSFET to replace Q38. Giving myself a pat on the back, I powered up the DAQ to run a final test. This time, none of the DAQ’s status LEDs showed any activity. Not five seconds later, I detected a burning smell and saw the dreaded trail of smoke emanating from the new MOSFET.</p>



<p class="wp-block-paragraph">After cutting the power and staring at the circuit board for a while in bewilderment, I set off to find out what went wrong. I made sure that I installed the MOSFET in the correct orientation and verified that its drain and source were not shorted together. The fact that the new MOSFET was burning up so quickly and taking out the entire power rail with it could mean that electrically it was connected directly across +5V and ground.</p>



<p class="wp-block-paragraph">I decided it wouldn’t hurt too much to try to see what was going on with the oscilloscope. I hooked it up to the new MOSFET just as I had done previously with the undamaged circuit. I was able to get this trace by briefly toggling power to the board:</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/scope-trace-2_edited_1.jpg" alt="Scope trace 2 pictured here."/></figure>



<p class="wp-block-paragraph">The strange waveform didn’t reveal much more information than I already knew. At least it was interesting to see the electrical havoc being wreaked.</p>



<p class="wp-block-paragraph">I checked diode D22 to make sure nothing on the output side of the circuit could interfere with the MOSFET. That leaves us with a single remaining suspect: power inductor L11. Since inductors are simply coils of wire, I was incredulous that it could be damaged. Furthermore, a resistance measurement will reveal that they are indistinguishable from a simple wire.</p>



<p class="wp-block-paragraph">Lacking an inductance meter, I set about building an inductor test circuit. Inductors resist changes to the current flowing in them, as shown by their characteristic equation: V = L * (di/dt). Applying a voltage V across the inductor will cause current to rise linearly with a slope of (V/L). The test setup I made looked like this:</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6abf205c14778&quot;}" data-wp-interactive="core/image" data-wp-key="6abf205c14778" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="800" height="630" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Inductor-test-schematic_edited.jpg" alt="Inductor test schematic" class="wp-image-27277" srcset="https://static.dmcinfo.com/wp-content/uploads/2025/05/Inductor-test-schematic_edited.jpg 800w, https://static.dmcinfo.com/wp-content/uploads/2025/05/Inductor-test-schematic_edited-300x236.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2025/05/Inductor-test-schematic_edited-768x605.jpg 768w" sizes="(max-width: 800px) 100vw, 800px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<p class="wp-block-paragraph">The inductor under test was connected in series with a 1 ohm resistor. The oscilloscope measured the voltage across the resistor which would indicate how much current was flowing at any given time. The capacitor would be charged to 10V before being discharged through the inductor. Its purpose was to provide a low-impedance voltage source to the inductor under test.</p>



<p class="wp-block-paragraph">First, I ran my test using a known good 33uH inductor I found in the lab. Here is what the scope trace looked like:</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/scope-trace-3_edited.jpg" alt="Scope trace 3 pictured here."/></figure>



<p class="wp-block-paragraph">The current initially rose linearly for about 10us before jumping up to 10V. The discontinuity happened due to the core of the inductor reaching saturation. The slope of the linear region was slightly under 0.4V/us (which corresponds to 0.4A/us). Since V = 10V, we’d shown, experimentally, that the inductor was around 25-30uH.<br>
I removed L11 from the circuit board and ran the same test. Here is the scope trace:</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/scope-trace-4_edited.jpg" alt="Scope trace 4 pictured here."/></figure>



<p class="wp-block-paragraph">This time, the current jumped up to 10A immediately, showing that the inductor was behaving as a short. When this inductor shorted for an unknown reason, it caused a huge current to flow through Q38 whenever it was switched on. I figured that the 5V regulator would go into current limiting mode, dipping its output voltage to the 1.2V I measured at the beginning of my investigation. After several red herrings, we’d finally found the actual culprit!</p>



<p class="wp-block-paragraph">The only thing left to do was to find a suitable replacement inductor. I found and ordered a 100uH inductor (Bourns PM3316-101M-RC) that had an almost identical footprint to our shorted inductor. In the meantime, I was impatient to get the DAQ working again. Referring back to<a href="http://en.wikipedia.org/wiki/Boost_converter#Continuous_mode" target="_blank"> the Wikipedia page on boost converters</a>, we could see that as long as they were operating in continuous mode, the output voltage depended only on the switching duty cycle and was completely independent of inductance.</p>



<p class="wp-block-paragraph">Feeling adventurous, I shoehorned the 33uH power inductor I found lying around into the circuit. I also replaced Q38 with another fresh MOSFET. With the oscilloscope connected, I cautiously turned on the power. Just like that, the DAQ came to life without any drama. I measured a solid 20V output from the repaired boost converter circuit and the scope trace showed a clean waveform:</p>



<figure class="wp-block-image"><img decoding="async" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/scope-trace-5_edited.jpg" alt="Scope trace 5 pictured here."/></figure>



<p class="wp-block-paragraph">I connected the USB DAQ to my computer and was able to get accurate and precise analog voltage outputs across the entire +/-10V range. Exhausted and relieved, I finally started on the proof-of-concept project for which I need the NI USB-6351 in the first place.</p>



<p class="wp-block-paragraph">Learn more about DMC&#8217;s<a href="/services/test-and-measurement-automation/labview-programming"> LabVIEW programming services</a>.</p>
<p>The post <a href="https://static.dmcinfo.com/blog/27281/repairing-an-ni-usb-6351-x-series-daq/">Repairing an NI USB-6351 X-Series DAQ</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Pet Project: Turn A Fan Into A Clock</title>
		<link>https://static.dmcinfo.com/blog/27643/pet-project-turn-a-fan-into-a-clock/</link>
		
		<dc:creator><![CDATA[DMC]]></dc:creator>
		<pubDate>Tue, 15 Apr 2014 13:03:46 +0000</pubDate>
				<category><![CDATA[Circuit Design]]></category>
		<category><![CDATA[Culture]]></category>
		<category><![CDATA[Embedded Development & Programming]]></category>
		<category><![CDATA[Hardware]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/27643/pet-project-turn-a-fan-into-a-clock/</guid>

					<description><![CDATA[<p>For those of you with electronics hobbies, here is an interesting pet project that is not very difficult or expensive. In fact, you can find most of the parts lying around your house. The idea is to make an analog display clock. The finished product will have a rotating circuit board that flashes LEDs at [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/27643/pet-project-turn-a-fan-into-a-clock/">Pet Project: Turn A Fan Into A Clock</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">For those of you with electronics hobbies, here is an interesting pet project that is not very difficult or expensive. In fact, you can find most of the parts lying around your house. The idea is to make an analog display clock. The finished product will have a rotating circuit board that flashes LEDs at the correct time in order to make a floating image of an analog clock.</p>



<p class="wp-block-paragraph">Here is a list of basic materials that you will need:</p>



<ul class="wp-block-list">
<li>White box fan</li>



<li>Perforated board</li>



<li>PIC (or any microcontroller)</li>



<li>Darlington Chip</li>



<li>2 5 V voltage divider (power microcontroller)</li>



<li>LEDs with resistors</li>



<li>Emitter/receiver diodes</li>



<li>Toggle switch (for power)</li>



<li>Battery Pack</li>



<li>12 V power supply (old phone charger)</li>



<li>Clay (for inertial balancing)</li>
</ul>



<p class="wp-block-paragraph">Here is a list of tools that you will need:</p>



<ul class="wp-block-list">
<li>Solder Iron</li>



<li>Solder</li>



<li>High gauge wire</li>



<li>Knife (cut fan up)</li>
</ul>



<p class="wp-block-paragraph">General Process:</p>



<ol class="wp-block-list">
<li>Wire Perf Board: wire LEDs in a parallel line starting at the center of the perf board and going to the edge of the darlington chip. Wire the Darlington to the switched power rail and wire inputs to the PIC. Wire the power out of the battery box to the voltage divider and then through the switch. Mount the battery box in the middle of the perf board for inertial purposes. Wire the receiver diode at the end of the color LED line facing towards the fan body.</li>



<li>Remove fan blades and keep the center plastic part for mounting the perf board. Cut grooves in the hub to fit the perf board securely, and use duct tape if needed to mount securely.</li>



<li>Mount the emitter onto the fan body so that the receiver passes directly in front of it. Use either a breadboard or solder parts of the voltage divider from the 12 V to the emitter. This will be your control aspect of the system.</li>



<li>As far as programming goes, I approached it so that the fan speed was relatively constant, and so there were programmed delays between each LED strobe to display numbers. I treated each number as an LED number display that would flash sequentially as the fan was moving in order to show the &#8220;floating&#8221; number. Then the receiver was a callback that reset the sequence.</li>
</ol>



<p class="wp-block-paragraph">If everything is done right, you can get something like this!</p>



<p class="wp-block-paragraph"><p style="text-align: center;"><img decoding="async" alt="An analog clock is made using LED lights." src="https://static.dmcinfo.com/wp-content/uploads/2025/05/fan_to_clock.jpg"></p></p>



<p class="wp-block-paragraph"><strong><em>Please be careful if you try this project. Use your judgement with the use of PPE and managing voltage lines</em></strong>.</p>
<p>The post <a href="https://static.dmcinfo.com/blog/27643/pet-project-turn-a-fan-into-a-clock/">Pet Project: Turn A Fan Into A Clock</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Updating Your Rotary Dial Phone for the Digital Age</title>
		<link>https://static.dmcinfo.com/blog/28080/updating-your-rotary-dial-phone-for-the-digital-age/</link>
		
		<dc:creator><![CDATA[DMC]]></dc:creator>
		<pubDate>Mon, 23 Sep 2013 14:39:18 +0000</pubDate>
				<category><![CDATA[Circuit Design]]></category>
		<category><![CDATA[Embedded Development & Programming]]></category>
		<category><![CDATA[Product Development]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[How To]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/28080/updating-your-rotary-dial-phone-for-the-digital-age/</guid>

					<description><![CDATA[<p>Good-old rotary dial phones have been around since forever, and they used to be a part of everyday life, like dragons during medieval period. However, like dragons, suddenly all these marvelous ancient devices just disappeared one day. I was lucky to find one of these dinosaurs at the local flea market. I was eager to [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/28080/updating-your-rotary-dial-phone-for-the-digital-age/">Updating Your Rotary Dial Phone for the Digital Age</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Good-old <a href="http://en.wikipedia.org/wiki/Rotary_dial" re_target="_blank" target="_blank">rotary dial</a> phones have been around since forever, and they used to be a part of everyday life, like dragons during medieval period. However, like dragons, suddenly all these marvelous ancient devices just disappeared one day. I was lucky to find one of these dinosaurs at the local flea market.</p>



<p class="wp-block-paragraph">I was eager to try it out, but unfortunately I don&#8217;t have a home phone line anymore. I hooked it up to my <a href="http://en.wikipedia.org/wiki/Voice_over_IP" re_target="_blank" target="_blank">Voice Over IP</a> (VoIP) adapter that I haven&#8217;t used in years. It almost worked! Well, it rang like it is supposed to &#8211; waking up dogs and babies in a two block radius. I could even have a pleasant conversation over it, but I couldn&#8217;t dial out. I heard a dial tone, but it ignored the number I was trying to dial.</p>



<p class="wp-block-paragraph">The problem actually was not the phone &#8211; there is nothing could go wrong with it, ever. It&#8217;s probably bullet-proof and could easily survive a minor nuclear apocalypse (haven&#8217;t tried it, it is in my to-do list). The problem was in my Voice Over IP adapter. It&#8217;s not compatible with &#8220;ancient&#8221; rotary-dial phones, and is designed to work only with (well, also vintage) push-button phones.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6abf205c1601f&quot;}" data-wp-interactive="core/image" data-wp-key="6abf205c1601f" class="wp-block-image size-full is-resized wp-lightbox-container"><img decoding="async" width="1600" height="1200" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_212049.jpg" alt="" class="wp-image-36312" style="width:640px" srcset="https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_212049.jpg 1600w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_212049-300x225.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_212049-1024x768.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_212049-768x576.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_212049-1536x1152.jpg 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<p class="wp-block-paragraph"><span style="line-height: 1.5;">Ironically, rotary dial (or pulse-dial) is actually digital protocol, and is supposed to be closer relative to VoIP than &#8220;modern&#8221; push-buttons phones. The later ones use analog encoding to transmit digits. This process has a fancy name: Dual-Tone Multi-Frequency Signaling (<a href="http://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling" re_target="_blank" style="line-height: 1.5;" target="_blank">DTMF</a><span style="line-height: 1.5;">).</span></span></p>



<p class="wp-block-paragraph">The rotary dial is pure digital &#8211; transmitting numbers as a sequence of on/off pulses. One pulse corresponds to digit &#8220;1&#8221;, two pulses &#8211; digit &#8220;2&#8221;, etc; Ten pulses represent digit &#8220;0&#8221;.</p>



<p class="wp-block-paragraph">Of course I could get another VoIP adapter that supports pulse dialing, but this would be too easy. Instead, I decided to make my own pulse-to-DTMF converter.</p>



<p class="wp-block-paragraph">I had a few <a href="http://www.atmel.com/products/microcontrollers/avr/tinyavr.aspx" re_target="_blank" target="_blank"> microcontrollers lying around and decided using them to generate DTMF signals should be trivial. Obviously, it&#8217;s been done before and I found an Atmel </a><a href="http://www.atmel.com/Images/doc1982.pdf" re_target="_blank" target="_blank">application note to do exactly that. There is nothing special there, just using a PWM (the same method I used to </a><a href="http://boris0.blogspot.com/2012/09/revealing-hidden-awesomeness-of-ti.html" re_target="_blank" target="_blank">play audio on the TI Launchpad</a>) to generate an analog signal. The only difference is that I am not using any external memory here. DTMF consists of just two sinusoidal waves, so we have to store one period of the sin wave and it is small enough to easily fit to the microcontroller&#8217;s internal memory.</p>



<p class="wp-block-paragraph">As I mentioned before, reading pulses from the phone is very simple. It&#8217;s already digital, just count them up &#8211; and bam you get your digit. Here is a test setup with my adapter still on the breadboard</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6abf205c16292&quot;}" data-wp-interactive="core/image" data-wp-key="6abf205c16292" class="wp-block-image size-full is-resized wp-lightbox-container"><img decoding="async" width="1600" height="1200" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://static.dmcinfo.com/wp-content/uploads/2013/09/DSC08821.jpg" alt="" class="wp-image-36314" style="width:640px" srcset="https://static.dmcinfo.com/wp-content/uploads/2013/09/DSC08821.jpg 1600w, https://static.dmcinfo.com/wp-content/uploads/2013/09/DSC08821-300x225.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2013/09/DSC08821-1024x768.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2013/09/DSC08821-768x576.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2013/09/DSC08821-1536x1152.jpg 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<p class="wp-block-paragraph">From left to right:</p>


<div>


<ul class="wp-block-list">
<li>Wi-Fi to Ethernet converter. Just because my VoIP adapter doesn&#8217;t have a Wi-Fi and I don&#8217;t like having Ethernet cables everywhere</li>



<li>VoIP adapter. I had the old <a href="http://en.wikipedia.org/wiki/Linksys#VoIP" re_target="_blank" target="_blank">Cisco/Linksys PAP2</a></li>



<li>Phone (kinda obvious)</li>



<li>Breadboard. Schematic below:</li>
</ul>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6abf205c164d1&quot;}" data-wp-interactive="core/image" data-wp-key="6abf205c164d1" class="wp-block-image size-full is-resized wp-lightbox-container"><img decoding="async" width="1277" height="378" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://static.dmcinfo.com/wp-content/uploads/2013/09/Schematic_v1-0.jpg" alt="" class="wp-image-36315" style="width:640px" srcset="https://static.dmcinfo.com/wp-content/uploads/2013/09/Schematic_v1-0.jpg 1277w, https://static.dmcinfo.com/wp-content/uploads/2013/09/Schematic_v1-0-300x89.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2013/09/Schematic_v1-0-1024x303.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2013/09/Schematic_v1-0-768x227.jpg 768w" sizes="(max-width: 1277px) 100vw, 1277px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<p class="wp-block-paragraph">The phone line voltage is in the &#8220;on-hook&#8221; state. Confusing term? It seems to have originated because you are supposed to keep the earpiece on the hook and &#8220;off-hook&#8221; it in order to answer the call.</p>



<p class="wp-block-paragraph">Back to the voltage. So the &#8220;on-hook&#8221; voltage is quite high, around 48V DC and even higher (around 90V AC) during the ring. I decided to connect my board after the phone switch, so I am getting the power only when the phone is in the &#8220;off-hook&#8221; state (meaning the handset is not on the phone).</p>



<p class="wp-block-paragraph">In the &#8220;off-hook&#8221; state, line voltage is supposed to drop down to around 5V DC, which is perfect for my AVR, but I still added a 5.1V zener diode D1 just in case.</p>



<p class="wp-block-paragraph">The rotary dial module is disconnected from the phone circuit and connected to my adapter only. The purpose of the connection between pins F and RR is to make phone think that the dial is still connected.</p>



<p class="wp-block-paragraph">I am generating DTMF/PWM signal on the AVR pin 5 and feeding it to the emitter follower Q1 via the low-pass filter (C1, R3).</p>



<p class="wp-block-paragraph">If you are curious, you can grab an <a href="https://code.google.com/archive/p/miscellaneous-projects/source" type="link" id="https://code.google.com/archive/p/miscellaneous-projects/source" target="_blank" rel="noreferrer noopener">AVR source code</a>.</p>



<p class="wp-block-paragraph">Here is the video testing the adapter</p>


<p><iframe loading="lazy" frameborder="0" height="360" src="//www.youtube.com/embed/ZLoQ5UA1tvc?rel=0" width="640"></iframe></p>


<p class="wp-block-paragraph">During the test I ran into the interesting issue. I noticed that AVR power consumption at the power-down mode is much higher than I anticipated (~500uA instead of ~10uA). After poking around I traced the issue to the <a re_target="_blank" href="http://en.wikipedia.org/wiki/DebugWIRE" target="_blank">debugWIRE</a> interface. I was using debugWIRE to download and debug code on the AVR. Yet apparently debugWIRE draws a lot of current (~500uA). Disabling debugWIRE <a href="https://microchip.my.site.com/s/article/Unable-to-enter-programming-mode--while-using-ISP-interface" target="_blank" rel="noreferrer noopener">via fuses</a> and using <a re_target="_blank" href="http://en.wikipedia.org/wiki/Atmel_AVR#ISP" target="_blank">ISP</a> instead solved the problem.</p>



<p class="wp-block-paragraph">The last steps were to wire the adapter on the perforated board.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6abf205c167b9&quot;}" data-wp-interactive="core/image" data-wp-key="6abf205c167b9" class="wp-block-image size-full is-resized wp-lightbox-container"><img decoding="async" width="1600" height="1200" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_165119.jpg" alt="" class="wp-image-36316" style="width:640px;height:auto" srcset="https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_165119.jpg 1600w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_165119-300x225.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_165119-1024x768.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_165119-768x576.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_165119-1536x1152.jpg 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6abf205c16953&quot;}" data-wp-interactive="core/image" data-wp-key="6abf205c16953" class="wp-block-image size-full is-resized wp-lightbox-container"><img decoding="async" width="1600" height="1200" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_165336.jpg" alt="" class="wp-image-36317" style="width:640px" srcset="https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_165336.jpg 1600w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_165336-300x225.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_165336-1024x768.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_165336-768x576.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_165336-1536x1152.jpg 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<p class="wp-block-paragraph">Then mount it inside the phone (thank you again, hot glue)</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6abf205c16b12&quot;}" data-wp-interactive="core/image" data-wp-key="6abf205c16b12" class="wp-block-image size-full is-resized wp-lightbox-container"><img decoding="async" width="1600" height="1200" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_211658.jpg" alt="" class="wp-image-36318" style="width:640px" srcset="https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_211658.jpg 1600w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_211658-300x225.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_211658-1024x768.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_211658-768x576.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_211658-1536x1152.jpg 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<p class="wp-block-paragraph">Done! Just put the cover on. Obviously it looks exactly the same as before modifications.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6abf205c16c5c&quot;}" data-wp-interactive="core/image" data-wp-key="6abf205c16c5c" class="wp-block-image size-full is-resized wp-lightbox-container"><img decoding="async" width="1600" height="1200" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_212049.jpg" alt="" class="wp-image-36312" style="width:640px" srcset="https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_212049.jpg 1600w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_212049-300x225.jpg 300w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_212049-1024x768.jpg 1024w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_212049-768x576.jpg 768w, https://static.dmcinfo.com/wp-content/uploads/2013/09/20111224_212049-1536x1152.jpg 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<p class="wp-block-paragraph">Next steps. I guess there is none. Well, maybe to record how this phone rings and use it as a ringtone.</p>



<p class="wp-block-paragraph"><a href="/contact">Contact us</a> to get started on your next <a href="/services/embedded-development-and-embedded-programming">Embedded Development &amp; Programming</a> project.&nbsp;</p>


</div><p>The post <a href="https://static.dmcinfo.com/blog/28080/updating-your-rotary-dial-phone-for-the-digital-age/">Updating Your Rotary Dial Phone for the Digital Age</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Exploring Altium: Design Rules</title>
		<link>https://static.dmcinfo.com/blog/28362/exploring-altium-design-rules/</link>
		
		<dc:creator><![CDATA[DMC]]></dc:creator>
		<pubDate>Mon, 17 Jun 2013 14:33:48 +0000</pubDate>
				<category><![CDATA[Circuit Design]]></category>
		<category><![CDATA[Embedded Development & Programming]]></category>
		<guid isPermaLink="false">https://static.dmcinfo.com/blog/28362/exploring-altium-design-rules/</guid>

					<description><![CDATA[<p>Some rules are meant to be broken. Unfortunately, none of them apply to PCB design. Designing and developing printed circuit boards can be an unforgiving process: placing a critical analog line just a few millimeters closer to a noisy clock line might be the difference between a functional widget and an expensive drink coaster. Luckily, [&#8230;]</p>
<p>The post <a href="https://static.dmcinfo.com/blog/28362/exploring-altium-design-rules/">Exploring Altium: Design Rules</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><em>Some rules are meant to be broken.</em></p>



<p class="wp-block-paragraph">Unfortunately, none of them apply to PCB design.</p>



<p class="wp-block-paragraph">Designing and developing printed circuit boards can be an unforgiving process: placing a critical analog line just a few millimeters closer to a noisy clock line might be the difference between a functional widget and an expensive drink coaster. Luckily, many modern software tools provide safeguards to catch critical mistakes before they’re sent out to your favorite PCB fabricator. The most fundamental of these safeguards are the Design Rules.</p>



<p class="wp-block-paragraph">In the context of PCB design, Design Rules are a set of requirements, restrictions, and constraints that the board must meet in order to be considered a valid design. An example rule might be that the minimum distance between two copper board features (like a trace and the annular ring of a via) must not be closer than 5 mils (5 thousandths of an inch). As the designer places and routes components, Altium will check the board against this rule set. Depending on the user’s preferences, errors can either be reported in the background or prevented in real-time. Sounds great! What’s the catch?</p>



<p class="wp-block-paragraph">The range of possible applications for a printed circuit board is amazingly broad. As a result, tools like Altium are made to be as flexible as possible. The downside is that there isn’t a single set of design rules that can play nicely with every PCB design. The standard rules that have been developed cover a large chunk of the playing field, but the designer of any reasonably complex board will need to refine these default rules to match the application. Luckily this is a straightforward process in Altium, and we’ve developed some best practices that you can use to get going quickly.</p>



<p class="wp-block-paragraph"><strong>Design Rule Editor</strong></p>



<p class="wp-block-paragraph">To get an idea of the range of design rules available within the Altium PCB Editor, open an existing design or start a new PCB project. Then, open the <em>PCB Rules and Constraints Editor</em> by clicking Design -&gt; Rules…</p>



<figure class="wp-block-image"><img decoding="async" alt="" height="140" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Open-Design-Rule-Editor.png" width="439" /></figure>



<p class="wp-block-paragraph">The editor window will look like the following:</p>



<figure class="wp-block-image"><img decoding="async" alt="" height="382" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Editor-Window.png" width="747" /></figure>



<p class="wp-block-paragraph">The Design Rules are divided up into several different categories, like Electrical, Routing, Signal Integrity, etc. Expanding a category shows the individual rules that can be modified for each. Let’s go back to the example earlier in this post that defines a minimum separation between copper features. That rule is captured under Electrical -&gt; Clearance. Highlight that rule in the tree view on the left side of the editor to show the details of the constraint.</p>



<figure class="wp-block-image"><img decoding="async" alt="" height="529" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Design-Rule-View-Marked-Up.png" width="719" /></figure>



<p class="wp-block-paragraph">Altium decides how to apply design rules by evaluating one or more queries. In the case of the electrical clearance rule, two queries are executed: one to pick the first copper feature, and the next to pick the second. By default, the query is simply “All” which means that the design rule is applied to every object in the design. For anyone new to the query system in Altium, I recommend reading <a href="http://wiki.altium.com/display/ADOH/Introduction+to+the+Query+Language">this article</a> on the Altium Wiki.</p>



<p class="wp-block-paragraph">The Constraints are then evaluated for each object returned by the queries. Here, any two items that are on different nets (3.3V and Ground, for example) are required to be no less than 10 mils apart. Most of the rules have associated diagrams that illustrate what is being controlled.</p>



<p class="wp-block-paragraph"><strong>Taking Advantage of Rule Priority</strong></p>



<p class="wp-block-paragraph">There may be situations in your design where two different constraints of the same design rule might apply for different groups of components or traces. An example that has popped up on a few of my past designs applies to the Short Circuit rule (Electrical -&gt; Short-Circuit). In general, short circuits on a PCB are a bad thing. However, I will sometimes create separate nets for my Ground and Shield connections so that I can apply different rules and routing techniques to each. The tie point on the board (where the shield and ground meet) will usually be a copper region to which both nets will connect.</p>



<p class="wp-block-paragraph">The default Short-Circuit rule will prevent me from making this connection (or at least give me a warning… more on this distinction later). However, I can modify my design rules so that this connection is allowed by manipulating the rule priority.</p>



<figure class="wp-block-image"><img decoding="async" alt="" height="184" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/Design-Rule-New-Rule.png" width="822" /></figure>



<p class="wp-block-paragraph">Notice in my rule hierarchy that there are now two short circuit rules, listed in descending priority:</p>



<p class="wp-block-paragraph"><em>1. ShortCircuit_GroundShield</em></p>



<p class="wp-block-paragraph"><em>2. ShortCircuit_Default</em></p>



<p class="wp-block-paragraph">When there are multiple rules defined for a rule category, Altium applies a priority ranking system to decide which rule will be executed.&nbsp; First, the query (or queries) for each rule is evaluated. If multiple rules apply to a set of query results, the highest-priority rule will be executed.</p>



<p class="wp-block-paragraph">In this example, the ShortCircuit_GroundShield rule applies to objects where the first is in the net “GND” and the second object is in the net “SHIELD”. The ShortCircuit_Default rule applies to any two objects. Clearly, there is some overlap in the scope of these rules. If my board had three nets – 3.3V, GND, and SHIELD, no short circuits would be allowed between 3.3V and GND or 3.3V and SHIELD, but would be allowed between GND and SHIELD.</p>



<p class="wp-block-paragraph">Editing rule priority can also be useful if a small number of components have requirements that differ from the majority of the board. For example if the minimum trace spacing for the board is 5mils, but a noisy net needs to be 10mils from any other, a new clearance rule (with a higher priority than the default rule) can be added that applies only to the noisy net.</p>



<p class="wp-block-paragraph"><strong>Automating Rule Creation</strong></p>



<p class="wp-block-paragraph">Altium has a built-in tool called the <em>Design Rules Wizard</em> that provides a friendlier interface for adding design rules to the project. I haven’t used it often (I prefer the query system, which is immensely powerful), but I do know that it is very quick to add a new rule without needing to dig far into the Rule Editor window. You can access this tool in Design -&gt; Rule Wizard…</p>



<p class="wp-block-paragraph"><strong>Importing and Exporting Design Rules</strong></p>



<p class="wp-block-paragraph"><em>“But Ryan, I’m a rebel and can’t be trusted creating rules! What can I do?” </em></p>



<p class="wp-block-paragraph">Despite <a href="//www.youtube.com/watch?v=LB5YkmjalDg">my thoughts on the matter</a>, I understand that <a href="//www.youtube.com/watch?v=KxaCOHT0pmI">some engineers are just edgy by nature</a>. It’s okay, you’re covered. Design rules can be imported and exported within Altium, so you’re free to use rules from a more responsible source. To import or export design rules, first open the PCB Rules and Constraints editor, then right click on any item in the rule hierarchy. Select either “Import Rules…” or “Export Rules…” If you’re exporting, you can pick which rules will be included in the output file by selecting the relevant items.</p>



<p class="wp-block-paragraph"><em>A handy tip: if you know what manufacturer will be fabricating your design, see if they have design rules available that match their capabilities. Sunstone Circuits (an Oregon-based PCB manufacturer) has a compatible set of design rules for Altium available on their <a href="http://www.sunstone.com/pcb-resources/Downloads.aspx" target="_blank">Downloads page</a>.</em></p>



<p class="wp-block-paragraph"><strong>Design Rule Check</strong></p>



<p class="wp-block-paragraph"><em>“Okay, my design rules are set up. Now what?”</em></p>



<p class="wp-block-paragraph">At any time, you can check your design against the current rule set by clicking Tools -&gt; Design Rule Check… &nbsp;This will open the <em>Design Rule Checker</em>, which allows you to select which rules will be enabled, as well as how the results will be reported.</p>



<figure class="wp-block-image"><img decoding="async" alt="" height="680" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/dr-checker.png" width="712" /></figure>



<p class="wp-block-paragraph">Clicking “Run Design Rule Check” will perform the DRC, and will display the results in an HTML report (this is also saved to the project directory for access later). An example report might look like the following:</p>



<figure class="wp-block-image"><img decoding="async" alt="" height="380" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/dr-output.png" width="720" /></figure>



<p class="wp-block-paragraph">Each of these violations are linked to the coordinates on the PCB that they were observed (clicking on the violation will take you there), which makes it easy to identify the cause and (hopefully) the remedy.</p>



<p class="wp-block-paragraph"><strong>Online DRC</strong></p>



<p class="wp-block-paragraph">Seeing the mistakes you’ve made is one thing, but it’s more efficient to avoid mistakes instead of going back to fix them. Altium has a feature called the <em>Online DRC</em> that will prevent you from making mistakes in real-time, or at least warn you if you’re violating a rule. Enable this functionality in the Preferences window (Tools -&gt; Preferences…), under the PCB Editor -&gt; General -&gt; Online DRC.</p>



<figure class="wp-block-image"><img decoding="async" alt="" height="245" src="https://static.dmcinfo.com/wp-content/uploads/2025/05/dr-options.png" width="410" /></figure>



<p class="wp-block-paragraph">The default settings for the DRC are acceptable for most designs, but you can change which violations are checked and how they are displayed in real-time by navigating to the DRC Violations Display tab within the preferences window.</p>



<p class="wp-block-paragraph"><strong>Final Thoughts</strong></p>



<p class="wp-block-paragraph">Congratulations, your safety net is now installed! Altium’s Design Rule functionality is one of the most powerful and important features of the PCB editor, and I recommend that careful attention is paid to setting them up before the design is started. Nothing is more frustrating than getting halfway through a design and then realizing that a critical requirement has been blatantly violated all over the place.</p>



<p class="wp-block-paragraph">No safety net is perfect and you should always take steps to verify your design beyond the design rule check (whether that is a peer review or a prototype run). That said, I hope you found this tutorial informative and useful. Leave any comments or questions below and don’t forget to check out the other articles in the Exploring Altium series!</p>



<p class="wp-block-paragraph"><a href="https://static.dmcinfo.com/blog/29284/exploring-altium-pin-swapping/">Pin Swapping</a></p>



<p class="wp-block-paragraph"><a href="https://static.dmcinfo.com/blog/29156/exploring-altium-document-management/">Document Management</a></p>
<p>The post <a href="https://static.dmcinfo.com/blog/28362/exploring-altium-design-rules/">Exploring Altium: Design Rules</a> appeared first on <a href="https://static.dmcinfo.com/">DMC, Inc.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
