<font face="微软雅黑"><font style="font-size:18px">1、<a href="http://www.hqchip.com/app/870" target="_blank" class="relatedlink">继电器</a>控制的设备上电时,4094的STROBE脚会有尖峰出现,当尖峰很大时<a href="http://www.elecfans.com/tags/继电保护/" target="_blank" class="relatedlink">继电</a>器控制就出错</font></font><br>
<font face="微软雅黑"><font style="font-size:18px">2、串行数据输出代码如下</font></font><br><p><br></p><pre style="max-width: 100%;"><code class="cpp hljs" codemark="1"><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">Con_OUT_1</span><span class="hljs-params">(UINT8 dat)</span>
</span>{
UINT8 i;
Con_Dat_1 = <span class="hljs-number">0</span>;
Con_Clk_1 = <span class="hljs-number">0</span>;
<span class="hljs-keyword">for</span> (i = <span class="hljs-number">0</span>; i < <span class="hljs-number">8</span>; i ++)
{
IF ((dat & <span class="hljs-number">0x80</span>) == <span class="hljs-number">0x80</span>)
Con_Dat_1 = <span class="hljs-number">1</span>;
<span class="hljs-keyword">else</span>
Con_Dat_1 = <span class="hljs-number">0</span>;
Con_Clk_1 = <span class="hljs-number">0</span>;
_nop_();
_nop_();
Con_Clk_1 = <span class="hljs-number">1</span>;
dat = (dat << <span class="hljs-number">1</span>);
}
Con_Cs = <span class="hljs-number">0</span>;
_nop_();
_nop_();
Con_Cs = <span class="hljs-number">1</span>;
_nop_();
_nop_();
Con_Cs = <span class="hljs-number">0</span>;
}</code></pre>
<p><br></p>
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>