新聞中心

        EEPW首頁 > EDA/PCB > 設計應用 > 一種基于FPGA 的驅動接口電路的設計

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

        作者: 時間:2011-01-13 來源:網絡 收藏

        結合AD7862的轉換速度, 選擇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 軟件編譯綜合后在板上測試, 接受到的轉換數據傳給DSP芯片, 然后將DSP受到的數據用實時監控軟件顯示。圖3是給AD 輸入端加50 H z的正弦波信號(同時對其中三個輸入端加信號), 監控軟件顯示的波形。

        軟件顯示波形圖
        軟件顯示波形圖
        圖3 軟件顯示波形圖。

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

        本文引用地址:http://www.104case.com/article/191398.htm

        上一頁 1 2 3 下一頁

        關鍵詞: FPGA 驅動 接口電路

        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 哈密市| 石狮市| 上虞市| 加查县| 天全县| 娄烦县| 天峨县| 贺兰县| 牡丹江市| 措勤县| 甘孜| 庆安县| 如皋市| 高邑县| 莒南县| 文成县| 大田县| 本溪市| 临夏市| 静宁县| 阿克苏市| 思南县| 安溪县| 定西市| 翁源县| 武川县| 花莲县| 保靖县| 吉林省| 长沙县| 固阳县| 开阳县| 花莲市| 梨树县| 双桥区| 灵川县| 水城县| 扶绥县| 云阳县| 文登市| 衡阳县|