网站公告列表

  没有公告

加入收藏
设为首页
联系站长
您现在的位置: 61IC中国电子在线 >> EDA >> HDL >> 文章正文
  DAC0832 接口电路程序           ★★★ 【字体:
DAC0832 接口电路程序
作者:Free    文章来源:Free    点击数:    更新时间:2008-1-3    
--文件名:DAC0832.VHD
--功能:产生频率为762.9Hz的锯齿波。
--最后修改日期:2004.3.18。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity DAC0832 is
port(clk:in std_logic; --系统时钟
rst:in std_logic; --复位信号
ile:out std_logic; --数据锁存允许信号
cont:out std_logic; --控制信号(WR1、WR2、CS、Xfer)
data_out:out std_logic_vector(7 downto 0)); --波形数据输出
end DAC0832;
architecture behav of DAC0832 is
signal q:integer range 0 to 63; --计数器
signal data:std_logic_vector(7 downto 0); --波形数据
begin
process(clk)
begin
if rst='1' then q<=0; --复位,对计数器q清零
elsif clk'event and clk='1' then
if q=63 then q<=0; --此IF语句对系统时钟进行64分频
if data="11111111" then data<="00000000"; --此IF语句产生锯齿波波形数据
else data<=data+1;
end if;
else q<=q+1;
end if;
end if;
end process;
ile<='1';cont<='0';data_out<=data; --ile、cont赋值;波形数据输出;
end behav;
               欢迎点击进入:TI德州中文网   (国内唯一针对TI应用的中文技术网站)    文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    没有相关文章
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    站长:61IC 湘ICP备05002478号