中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁(yè) > EDA/PCB > 設(shè)計(jì)應(yīng)用 > 基于FPGA的A/D轉(zhuǎn)換采樣控制模塊的設(shè)計(jì)

        基于FPGA的A/D轉(zhuǎn)換采樣控制模塊的設(shè)計(jì)

        作者: 時(shí)間:2009-03-13 來(lái)源:網(wǎng)絡(luò) 收藏

        2.3 A/D控制與數(shù)據(jù)的部分程序及仿真

        采用QuartusⅡ軟件平臺(tái)下的VHDL語(yǔ)言編程實(shí)現(xiàn)。

        library ieee;

        use ieee.std_logic_unsigned.all;

        use ieee.std_logic_1164.all;

        entity ad_hgq is

        port( d :in std_logic_vector(7 downto 0);---AD輸入;

        clk,eoc :in std_logic; ---eoc:結(jié)束狀態(tài)信號(hào); oe : buffer std_logic;

        addr :out std_logic_vector(2 downto 0); ---oe:輸出允許,addr:選通地址;

        ale,start:out std_logic; ---ale:允許地址鎖存;

        q :buffer std_logic_vector(7 downto 0)); ---數(shù)據(jù)輸出顯示;

        end ad_hgq;

        architecture behaviour of ad_hgq is

        type state is (st0,st1,st2,st3,st4,st5,st6,st7); ---以枚舉類型定義各狀態(tài)子類型;

        signal current_state,next_state :state:=st0; signal regl :std_logic_vector(7 downto 0);

        signal addrx :std_logic_vector(2 downto 0):=000;

        signal lock :std_logic; ---轉(zhuǎn)換后數(shù)據(jù)輸出鎖存時(shí)鐘信號(hào);

        signal hex :std_logic_vector(7 downto 0);

        begin

        process(clk)

        begin

        if(clk'event and clk='1') then current_state=next_state;

        end if; ---在時(shí)鐘上升沿,轉(zhuǎn)換至下一狀態(tài);

        end process ; ---由信號(hào)current_state將當(dāng)前狀態(tài)帶出進(jìn)程,進(jìn)入下一進(jìn)程;

        process(lock)

        begin

        if lock='1'and lock'event then regl=d;

        end if; --在lock上升沿,將轉(zhuǎn)換好的數(shù)據(jù)鎖存入8位鎖存器中;

        end process;

        process(clk)

        begin

        if clk'event and clk='1' then

        if current_state=st0 then addrx=addrx+1; ---進(jìn)入下一地址通道;

        end if;

        end if;

        addr=addrx;

        end process;

        q=regl; ---數(shù)據(jù)輸出;

        process(clk)

        begin

        if( clk'event and clk ='1') then if oe='1' then hex=q; ---將數(shù)據(jù)送給hex;

        end if;

        end if;

        end process;

        end behaviour;

        圖2顯示的是A/D控制并將所采的數(shù)據(jù)轉(zhuǎn)換為BCD碼的仿真結(jié)果。圖中Value為所采的電壓結(jié)果值。


        圖2 仿真

        3 結(jié)束語(yǔ)

        采用EP1C6T144C8芯片實(shí)現(xiàn)對(duì)A/D轉(zhuǎn)換器的采樣控制,充分利用了的高速度和高可靠性,從而解決了傳統(tǒng)中用單片機(jī)控制時(shí)速度慢的問(wèn)題。具有靈活的編程方式,簡(jiǎn)單方便的編程環(huán)境,易學(xué)易用,大大提高工作效率,縮短研制周期。本設(shè)計(jì)可用于高速應(yīng)用領(lǐng)域和實(shí)時(shí)監(jiān)控方面。


        上一頁(yè) 1 2 下一頁(yè)

        關(guān)鍵詞: FPGA 轉(zhuǎn)換 采樣 控制模塊

        評(píng)論


        相關(guān)推薦

        技術(shù)專區(qū)

        關(guān)閉