新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > 一種基于FPGA的驅動接口電路的設計

        一種基于FPGA的驅動接口電路的設計

        作者: 時間:2011-10-17 來源:網絡 收藏

         結合AD7862的轉換速度, FPGA選擇10MH z的處理時鐘。對于整個轉換過程的控制用一個狀態機來完成, 狀態機分為12 個狀態( idle, convert1, busy1, reada1, w ait1, reada2,sw apchna,l convert2, busy2, readb1, w ait2, readb2), 其中idle狀態為空閑等待轉換狀態; convert1指示第一次轉換啟動狀態;busy1指示第一次轉換狀態; reada1狀態下讀取VA1; wait1狀態為讀取VA1和VA2之間的等待狀態; reada2狀態下讀取VA2; sw apchnal狀態指示交換到另一個通道進行轉換;convert2指示第二次轉換啟動狀態; 剩余狀態和前面的類似,只不過是針對VB1 和VB2 而言。設計代碼如下( 只描述VA1和VA2的部分, 剩下的類似):

          process( clkdiv4, nrst)

          beg in

          if nrst = ‘0’ then

          adc_state = id le;

          e lsif( r ising _edge( clkd iv4) ) then

          case adc_state is

          when idle= >

          ada0 = '0' ;

          adconv = '1';

          adncs = '1';

          adnrd = '1';

          clkcnt = 0;

          if( start= ‘1’) then

          adc_state = convert1;

          end if;

          w hen convert1= >

          ada0 = '0';

          adconv = '0' ;

          if( adbusy= '1') then

          adc_state = busy1;

          end if;

          w hen busy1= >

          adconv = '1';

          if( adbusy= '0') then

          adc_state = reada1;

          end if;

          when reada1= >

          if ( c lkcnt= 2) then

          addataa1 = 0000 adda tain;

          end if;

          if( c lkcnt= 4) then

          adc_state = w a it1;

          adncs = '1';

          adnrd = '1';

          clkcnt = 0;

          else

          clkcnt = c lkcnt+ 1;

          adncs = '0';

          adnrd = '0';

          end if;

          when wait1= >

          adc_state = reada2;

          when reada2= >

          if ( c lkcnt= 2) then

          addataa2 = 0001 adda tain;

          end if;

          3設計電路的仿真驗證

          最終設計用Quartus 2 軟件編譯綜合后在板上測試,FPGA 接口電路接受到的轉換數據傳給DSP芯片, 然后將DSP受到的數據用實時監控軟件顯示。圖3是給AD 輸入端加50 H z的正弦波信號(同時對其中三個輸入端加信號), 監控軟件顯示的波形。


        圖3 軟件顯示波形圖。

          從圖3波形圖可以看出, 接口驅動電路成功的控制了AD7862芯片的采樣過程, 從而驗證了驅動電路設計的正確性。


        上一頁 1 2 下一頁

        關鍵詞: ad7862

        評論


        技術專區

        關閉
        主站蜘蛛池模板: 西华县| 额敏县| 闽清县| 潞西市| 广南县| 樟树市| 尉犁县| 芒康县| 茂名市| 新竹市| 宁安市| 神农架林区| 镇平县| 泸溪县| 汕尾市| 韶山市| 宜都市| 孟津县| 宝丰县| 富锦市| 彰化县| 山阳县| 天峨县| 威信县| 临邑县| 迁西县| 同仁县| 仪征市| 武威市| 龙川县| 黄陵县| 庆元县| 凤凰县| 黔西| 怀化市| 金秀| 涿州市| 固镇县| 宿州市| 通城县| 遂宁市|