Program.rar

  • PUDN用户
    了解作者
  • C/C++
    开发工具
  • 7KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 15
    下载次数
  • 2009-11-24 21:17
    上传日期
USB压力测量模块测试程序 USB串口通信通过。 AD7715测试
Program.rar
  • Program.doc
    43KB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/622bab0a15da9b288b549651/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/622bab0a15da9b288b549651/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">/</div><div class="t m0 x1 h3 y3 ff1 fs0 fc0 sc0 ls0 ws0">*********************************************************************</div><div class="t m0 x1 h3 y4 ff1 fs0 fc0 sc0 ls0 ws0">*************************************</div><div class="t m0 x1 h4 y5 ff1 fs0 fc0 sc0 ls0 ws0">* Program: USB<span class="ff2">&#21387;&#21147;&#27979;&#37327;&#27169;&#22359;&#27979;&#35797;&#31243;&#24207;</span></div><div class="t m0 x1 h4 y6 ff1 fs0 fc0 sc0 ls0 ws0">* Description: USB<span class="ff2">&#20018;&#21475;&#36890;&#20449;&#36890;&#36807;&#12290;</span></div><div class="t m0 x1 h4 y7 ff1 fs0 fc0 sc0 ls0 ws0"> AD7715<span class="ff2">&#27979;&#35797;&#65292;&#35835;&#25968;&#36824;&#26377;&#38382;&#39064;&#12290;</span></div><div class="t m0 x1 h3 y8 ff1 fs0 fc0 sc0 ls0 ws0">* V<span class="_ _0"></span>ersion: 0.1.2</div><div class="t m0 x1 h3 y9 ff1 fs0 fc0 sc0 ls0 ws0">* <span class="_ _1"></span>Author: Peter <span class="_ _2"></span>W<span class="_ _1"></span>u</div><div class="t m0 x1 h3 ya ff1 fs0 fc0 sc0 ls0 ws0">* Date: 20 May<span class="_ _1"></span>, 2009</div><div class="t m0 x1 h3 yb ff1 fs0 fc0 sc0 ls0 ws0">*********************************************************************</div><div class="t m0 x1 h3 yc ff1 fs0 fc0 sc0 ls0 ws0">*************************************/</div><div class="t m0 x1 h3 yd ff1 fs0 fc1 sc0 ls0 ws0">#include<span class="fc2"> <span class="fc3">"usb_pmm.h"</span></span></div><div class="t m0 x1 h3 ye ff1 fs0 fc1 sc0 ls0 ws0">void<span class="fc2"> InitIo(</span>void<span class="fc2">)</span></div><div class="t m0 x1 h3 yf ff1 fs0 fc2 sc0 ls0 ws0">{</div><div class="t m0 x1 h3 y10 ff1 fs0 fc2 sc0 ls0 ws0"> DDRB = 0x2E; <span class="fc0">//</span></div><div class="t m0 x1 h3 y11 ff1 fs0 fc2 sc0 ls0 ws0"> DDRC = 0x01;</div><div class="t m0 x1 h3 y12 ff1 fs0 fc2 sc0 ls0 ws0"> DDRD = 0x82; <span class="fc0">// output: <span class="_ _1"></span>AD7715_RST<span class="_ _3"></span>, TXD</span></div><div class="t m0 x1 h3 y13 ff1 fs0 fc2 sc0 ls0 ws0"> POR<span class="_ _1"></span>TB = 0x2E;</div><div class="t m0 x1 h3 y14 ff1 fs0 fc2 sc0 ls0 ws0"> POR<span class="_ _1"></span>TC = 0x01;</div><div class="t m0 x1 h3 y15 ff1 fs0 fc2 sc0 ls0 ws0"> POR<span class="_ _1"></span>TD = 0x02; <span class="fc0">// reset <span class="_ _1"></span>AD7715</span></div><div class="t m0 x1 h3 y16 ff1 fs0 fc2 sc0 ls0 ws0">}</div><div class="t m0 x1 h3 y17 ff1 fs0 fc1 sc0 ls0 ws0">void<span class="fc2"> InitCPU(</span>void<span class="fc2">)</span></div><div class="t m0 x1 h3 y18 ff1 fs0 fc2 sc0 ls0 ws0">{</div><div class="t m0 x1 h3 y19 ff1 fs0 fc2 sc0 ls0 ws0"> __disable_interrupt();</div><div class="t m0 x1 h3 y1a ff1 fs0 fc0 sc0 ls0 ws0">// initialize USAR<span class="_ _1"></span>T</div><div class="t m0 x1 h3 y1b ff1 fs0 fc2 sc0 ls0 ws0"> UBRRH = 0x00;</div><div class="t m0 x1 h3 y1c ff1 fs0 fc2 sc0 ls0 ws0"> UBRRL<span class="_ _1"></span> = 0x26; <span class="_ _4"></span><span class="fc0">// 9600bps</span></div><div class="t m0 x1 h3 y1d ff1 fs0 fc2 sc0 ls0 ws0"> UCSRA<span class="_ _1"></span> = 0x00;</div><div class="t m0 x1 h3 y1e ff1 fs0 fc2 sc0 ls0 ws0"> UCSRB = (1&lt;&lt;RXCIE)|(1&lt;&lt;TXCIE)|(1&lt;&lt;RXEN)|(1&lt;&lt;TXEN);</div><div class="t m0 x1 h3 y1f ff1 fs0 fc2 sc0 ls0 ws0"> <span class="_ _5"> </span> UCSRC<span class="_ _6"> </span> <span class="_ _6"> </span>=<span class="_ _6"> </span> <span class="_ _6"> </span>(1&lt;&lt;URSEL)|(1&lt;&lt;UPM1)|(1&lt;&lt;UPM0)|(1&lt;&lt;UCSZ1)|(1&lt;&lt;UCSZ0);<span class="_ _6"> </span> <span class="_ _7"> </span> <span class="_ _4"></span><span class="fc0">//</span></div><div class="t m0 x1 h3 y20 ff1 fs0 fc0 sc0 ls0 ws0">Asynchronous USAR<span class="_ _3"></span>T<span class="_ _1"></span>, odd parity<span class="_ _3"></span>, 1 stop bit, 8-bit character<span class="_ _4"></span> size</div><div class="t m0 x1 h3 y21 ff1 fs0 fc0 sc0 ls0 ws0">// initialize SPI</div><div class="t m0 x1 h3 y22 ff1 fs0 fc2 sc0 ls0 ws0"> <span class="_ _8"></span> SPCR <span class="_ _9"></span>= <span class="_ _9"></span>(1&lt;&lt;SPE)|(1&lt;&lt;MSTR)|(1&lt;&lt;CPOL)|(1&lt;&lt;CPHA)|(1&lt;&lt;SPR1)|(1&lt;&lt;SPR0);<span class="_ _4"></span> <span class="_ _a"></span> <span class="_ _4"></span><span class="fc0">//</span></div><div class="t m0 x1 h3 y23 ff1 fs0 fc0 sc0 ls0 ws0">fosc/128</div><div class="t m0 x1 h3 y24 ff1 fs0 fc0 sc0 ls0 ws0">// initialize PWM (1MHz as <span class="_ _1"></span>AD7715's clock)</div><div class="t m0 x1 h3 y25 ff1 fs0 fc2 sc0 ls0 ws0"> TCCR1A<span class="_ _1"></span> = 0x40; <span class="fc0">//</span></div><div class="t m0 x1 h3 y26 ff1 fs0 fc2 sc0 ls0 ws0"> TCCR1B = 0x09; <span class="fc0">// T<span class="_ _2"></span>OP<span class="_ _1"></span> is OCR1A, no prescaling</span></div><div class="t m0 x1 h3 y27 ff1 fs0 fc2 sc0 ls0 ws0"> TCNT1 = 0x00;</div><div class="t m0 x1 h3 y28 ff1 fs0 fc2 sc0 ls0 ws0"> OCR1A<span class="_ _1"></span> = 2;</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐
    • AD7715.rar
      AD7715是美国ADI公司生产的16位模数转换器。它具有0.0015%的非线性、片内 程增益放大器、差动输入、三线串行接口、缓冲输入、输出更新速度可编程等特点。 于单通道低速小信号的采样应用
    • ad7715-5.zip
      AD 16 bit adc manual ad7715
    • AD7715.rar
      STM32F10X 通过SPI与AD7715通信
    • ad7715.rar
      Library of AD7715 including souce code
    • 12353002ad7715.rar
      ad7715和单片机的程序,金克拉速度将疯狂拉升的借口垃圾
    • ad7715.rar
      AD7715 的驱动,平台是LPC2136
    • dsPIC30f控制AD7715.zip
      使用dsPIC30f6015与AD7715进行通讯
    • 16 b ad7715.rar
      16 BIT ADC AD7715 INTER FACING WITH microcontroller
    • ad7715.zip
      his program has read and write routines for the 68HC11 to interfaceto the AD7715 and the sample program sets the various registers and then reads 1000 samples the part.
    • AD7715_VER_3.0.rar
      initialize and do continious conversion mode for Analog device AD7715.its 16 bit 1ksps. code tested ok. i used it for proccess control.code stability was excellent.