;
文章:行业新闻EDA文摘电源技术无线通信测量仪表嵌入式类电子技术制造技术半导体网络/协议展会实验家电维修  
  下载:EDA教程电源技术电子书籍电子元件无线通信通信网络电路图纸嵌入式类单片机传感/控制电子教材模拟数字
.... 音视频类
消费电子机械电子行业软件C/C++FPGA/ASIC规则标准家电维修DSPIC资料ARM软件电路图电子技术论坛
 
位置:电子发烧友 > 行业新闻 > 嵌入式类 > FPGA/ASIC技术 >ADC0809 VHDL控制程序 退出登录 用户管理
栏目导航


· 单片机类 · 接口/总线/驱动
· ARM · DSP
· FPGA/ASIC技术 · 设计应用
· 嵌入式操作系统 · 电视卡
热门文章
· [组图] 电子元器件基础知识...
· [图文] USB接口定义
· [图文] 三极管开关电路图
· [组图] RS232 RS485接口原理...
· [组图] [组图]电动车充电器...
· [组图] 电子捕鱼器电路图
· [组图] 高品质音调电路的制...
· [组图] JRC4558电路
· [图文] M51134P低音炮电路图...
· [图文] TL494脉宽调制控制电...
相关文章

· MAX19506 双通道、8...
· 步进电机控制程序(c...
· [图文] MAX1377, MAX1379, ...
· [图文] AD7980 采用MSOP/QF...
· [图文] AD9272 八通道LNA/V...
· [图文] AD9273 八通道LNA/V...
· [图文] Understanding the ...
· MAX1400 +5V、18位、...
· MAX1401 +3V、18位、...
· MAX1402 低功耗、+5...

ADC0809 VHDL控制程序
作者:本站  来源:www.elecfans.com  发布时间:2008-6-27 11:19:28 减小字体 增大字体

ADC0809 VHDL控制程序
--文件名:ADC0809.vhd
--功能:基于VHDL语言,实现对ADC0809简单控制
--说明:ADC0809没有内部时钟,需外接10KHz~1290Hz的时钟信号,这里由FPGA的系
--统时钟(50MHz)经256分频得到clk1(195KHz)作为ADC0809转换工作时钟。
--最后修改日期:2004.3.20
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity ADC0809 is
  port (   d       : in std_logic_vector(7 downto 0);          --ADC0809输出的采样数据
         clk,eoc   : in std_logic;        --clk为系统时钟,eoc为ADC0809转换结束信号
clk1,start, ale,en: out std_logic;                                --ADC0809控制信号
        abc_in    :in std_logic_vector(2 downto 0);                     --模拟选通信号
abc_out     :out std_logic_vector(2 downto 0);        --ADC0809模拟信号选通信号
        q        : out std_logic_vector(7 downto 0));          --送至8个并排数码管信号
 end ADC0809;
architecture behav of ADC0809 is
type states is ( st0,st1, st2, st3, st4,st5,st6);                         --定义各状态的子类型
signal current_state, next_state:states:=st0;
signal regl :std_logic_vector(7 downto 0);                            --中间数据寄存信号
signal qq:std_logic_vector(7 downto 0);
begin
com:process(current_state,eoc)                             --规定各种状态的转换方式
begin
  case current_state is
  when st0=>next_state<=st1;ale<='0';start<='0';en<='0';
  when st1=>next_state<=st2;ale<='1';start<='0';en<='0';
  when st2=>next_state<=st3;ale<='0';start<='1';en<='0';
  when st3=>             ale<='0';start<='0';en<='0';
        if eoc='1' then next_state<=st3;                            --检测EOC的下降沿
        else next_state<=st4;
        end if;   
  when st4=>              ale<='0';start<='0';en<='0';
        if eoc='0' then next_state<=st4;                            --检测EOC的上升沿
else next_state<=st5;
end if;
  when st5=>next_state<=st6;ale<='0';start<='0';en<='1';
  when st6=>next_state<=st0;ale<='0';start<='0';en<='1';regl<=d;
  when others=> next_state<=st0;ale<='0';start<='0';en<='0';
  end case;
end process;
clock:process(clk)                 --对系统时钟进行分频,得到ADC0809转换工作时钟
begin
 if clk'event and clk='1' then qq<=qq+1;              --在clk1的上升沿,转换至下一状态
if QQ="01111111" THEN clk1<='1'; current_state <=next_state;   
  elsif qq<="01111111" then clk1<='0'; 
    end if; 
end if;
end process;
q<=regl;  abc_out<=abc_in; 
end behav; 

 

[] [返回上一页] [打 印] [收 藏]
 

上一篇文章:TLC5510 VHDL控制程序
∷相关文章评论∷    (评论内容只代表网友观点,与本站立场无关!) [更多评论...]
 
关于本站- 意见反馈 - 网站导航 - 帮助 - 隐私政策 - 联系我们 - 使用条款 - 安全承诺 - 友情连接
站长QQ:39550527 Powered by: 飓风网络(电路图
Copyright 2006-2008 Elecfans.Com.电子发烧友: 粤ICP备07065979号All Rights Reserved