【正文】
instantiating Xilinx primitive ponents. library UNISIM。 end case。 end if。 lcdrw=39。 end if。 lcdrw=39。 end if。 lcdrw=39。 end if。 lcdrw=39。 end if。 lcdrw=39。 end if。 lcdrw=39。039。 dataram(6)=xv3。039。 when 7=xv5=00110111。 end case。 when 3=xv4=00110011。 when 7=xv3=00110111。 end case。 when 3=xv2=00110011。 when 7=xv1=00110111。139。x2=d。 end if。 if t2500 then clk_500hz=39。039。 signal x1,x2,xv1,xv2,xv3,xv4,xv5:std_logic_vector(7 downto 0)。 接 LCD_da信號(hào)輸入端 lcdrw:out std_logic。 Unment the following lines to use the declarations that are provided for instantiating Xilinx primitive ponents. library UNISIM。 end if。 case t is when 1=cba=000。 end process。event and clk=39。 process(clk,reset) variable clk0:std_logic。 14 elsif t=50000000 then clk1:=39。 begin if reset=39。 key1:in std_logic。 end Behavioral。 signal clkz_load:std_logic。 類屬說明 Port ( clk,reset:in std_logic。0809工作狀態(tài)顯示 Q:out std_logic_vector(7 downto 0))。 dw1:out integer range 0 to 2。 發(fā)光二極管顯示狀態(tài) lcden:out std_logic。 Unment the following lines to use the declarations that are provided for instantiating Xilinx primitive ponents. library UNISIM。 VHDL 在描述數(shù)字系統(tǒng)時(shí),可以使用前后一致的語義和語法跨越多層次,并且使用跨越多個(gè)級(jí)別的混合描述模擬該系統(tǒng)。 mVV ? 9 顯示控制及驅(qū)動(dòng)模塊 電壓值的顯示可由 LCD 實(shí)現(xiàn)。 ADC0809 主要引腳功能如下 : IN0~ IN7:通道 0~ 7 的模擬量輸入 D0~ 7:數(shù)字量輸出 ADDC、 ADDB、 ADDA:通道 (0~ 7)選擇 ALE:通道地址鎖存 ,正脈沖有效 START:啟動(dòng)信號(hào) ,正脈沖有效 ,上升沿所有寄存器清 0,下降沿開始轉(zhuǎn)換 EOC:轉(zhuǎn)換結(jié)束 ,高 電平 有效 OE:允許輸出 ,高 民平 有效 ADC0809 的工作時(shí)序 ADC0809 的工作時(shí)序如圖 所示。通過外部的鍵盤可以對(duì)系統(tǒng)進(jìn)行復(fù)位控制和顯示檔位選擇,不同的檔位選擇不同的輸入電壓范圍( 0~ 5~50)。這 是目前應(yīng)用十分廣泛的集成 ADC,逐次比較型 AD 轉(zhuǎn)換內(nèi)部電路由一個(gè)比較器、 DA轉(zhuǎn)換器、時(shí)鐘、逐次比較寄存器 SAR、輸出寄存器和控制 邏輯電路等部分組成。缺點(diǎn) 是在傳統(tǒng)的單片機(jī)設(shè)計(jì)系統(tǒng)中必須使用許多分立元件組成單片機(jī)的外圍電路,因此整個(gè)系統(tǒng)顯得十分復(fù)雜 ,不易于實(shí)現(xiàn)。 采用此方案電路結(jié)構(gòu)簡(jiǎn)單,易于實(shí)現(xiàn)且易于維護(hù)。它的核心器件是一個(gè)雙積分式 A/D轉(zhuǎn)換, 雙積分式 DVM屬于 V— T變換式,其基本原理是在一個(gè)測(cè)量周期內(nèi), 首先將 被測(cè)電壓 UX加到積分器的輸入端,在確定的時(shí)間內(nèi)進(jìn)行積分,也稱定時(shí)積分;然后切斷 UX,在積分器的輸入端加與 UX極性相反的電壓 UR, 由于 UR一定,所以稱為定值積分,但積分方向相反,直到積分輸出達(dá)到起始電平為止,從而將 UX轉(zhuǎn)換成時(shí)間間隔進(jìn)行測(cè)量。 圖 單片機(jī)控制的數(shù)字電壓表原理圖 方案三 :采用 FPGA作為系統(tǒng)控制的核心。 具有 速度高、功耗低。 2 單元電路設(shè)計(jì) A/D 轉(zhuǎn)換部分 ADC 0809 工作原理 ADC 0809 是一種 8 位 ADC,采用 CMOS 工藝制成的 8 位八通道 A/D 轉(zhuǎn)換器, 片內(nèi)有8 路模擬采樣開關(guān),可控制 8 個(gè)模擬量中的一個(gè)進(jìn)入轉(zhuǎn)換器中。主要控制信號(hào)說明:, START 是轉(zhuǎn)換啟動(dòng)信號(hào),高電平有效; ALE 是 3 位通道選擇地址( ADDC、 ADDB、 ADDA)信號(hào)的鎖存信號(hào)。本系統(tǒng)選用了一塊 8 5字符型液晶顯示模塊 LMB162ABA實(shí)現(xiàn)了低功耗,而且可帶單位雙排顯示,字體美觀大方。因此,可以對(duì)高層次行為描述的子系統(tǒng)及低層次詳細(xì)實(shí)現(xiàn)子系統(tǒng)所組成的系統(tǒng)進(jìn)行模擬。 use 。 接 LCD使能端 lcdda:out std_logic。 cba:out std_logic_vector(2 downto 0))。 end ponent。 dw1:in integer range 0 to 2。 signal dw1_load:integer range 0 to 2。 按鍵: library IEEE。 clkz:out std_logic。139。039。 variable t:integer range 0 to 3125000。139。 process(clkk,reset,key1) variable t:integer range 0 to 3。dw1=1。 end if。 use 。 接 LCD讀寫信號(hào)輸入端 lcddata:inout std_logic_vector(7 downto 0))。 constant v:std_logic_vector(7 downto 0):=01010110。then t:=0。139。 end process。10 檔 when others=x1=00111111。 then case v1 is when 0=xv1=00110000。 when 8=xv1=00111000。 when 4=xv2=00110100。 case v3 is when 0=xv3=00110000。 when 8=xv3=00111000。 when 4=xv4=00110100。 case v5 is when 0=xv5=00110000。 when 8=xv5=00111000。then dataram=((00110000),(00110000),(00110000),(00110000), (00110000),(00110000),(00110000),(00110000), (00110000),(00110000))。 dataram(7)=xv4。then current_state=set_dlnf。039。 if tt=delay*3 then current_state=clear_lcd。039。 if tt=delay*3 then current_state=set_cursor。039。 if tt=delay*3 then current_state=set_dcb。039。 if tt=delay*3 then current_state=set_location。039。 if tt=delay*3 then current_state=write_data。039。 if tt=delay*3 then current_state=write_data。 end if。 use 。 architecture Behavioral of ad0809 is type state is (st0,st1,st2,st3,st4,st5,st6)。039。 if count2=50 then 22 clk0:=39。 clk500k=clk0。lock=39。oe=39。start=39。 when st3 =ale=39。x=111101111。start=39。039。oe=39。start=39。 when others =ale=39。x=111111111。event and lock=39。 ym_translate。) 。 end if。 WIDTH : Time := 0 ns)。139。 end process ONE_SHOT。X39。 v5 : out STD_LOGIC_VECTOR ( 3 downto 0 ) )。 ponent TOC generic (InstancePath: STRING := *。 signal q_5_ibuf : STD_LOGIC。 signal choice84 : STD_LOGIC。 signal v33_madd_n0000_inst_lut2_0 : STD_LOGIC。 signal v44_madd_n0000_inst_cy_0 : STD_LOGIC。 signal v33_2_rt : STD_LOGIC。 signal v44_3_rt : STD_LOGIC。 signal v44_2_rt_O : STD_LOGIC。 signal v44_2_GSR_OR : STD_LOGIC。 signal v55_3_GSR_OR : STD_LOGIC。 signal v2_3_obuf_GTS_TRI : STD_LOGIC。 signal v4_3_obuf_GTS_TRI : STD_LOGIC。 signal GND : STD_LOGIC。 signal NlwInverterSignal_v2_0_obuf_GTS_TRI_CTL : STD_LOGIC。 signal NlwInverterSignal_v3_2_obuf_GTS_TRI_CTL : STD_LOGIC。 signal NlwInverterSignal_v1_2_obuf_GTS_TRI_CTL : STD_LOGIC。 signal v4_1_obuf_GTS_TRI : STD_LOGIC。 signal v2_1_obuf_GTS_TRI : STD_LOGIC。 signal v55_1_GSR_OR : STD_LOGIC。 signal v33_3_GSR_OR : STD_LOGIC。 signal v55_3_rt_O : STD_LOGIC。 signal v55_madd_n0000_inst_lut2_01_O : STD_LOGIC。 signal v55_2_rt : STD_LOGIC。 signal n1239 : STD_LOGIC。 signal v55_madd_n0000_in