DIY编程器网

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 94|回复: 0
打印 上一主题 下一主题

ADC0809 VHDL控制程序

[复制链接]
跳转到指定楼层
楼主
发表于 2011-4-26 09:30:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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 ut 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_statenext_statenext_state ale alenext_statenext_state 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;
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 分享分享 支持支持 反对反对
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|文字版|手机版|DIY编程器网 ( 桂ICP备14005565号-1 )

GMT+8, 2025-8-17 22:23 , 耗时 0.084096 秒, 18 个查询请求 , Gzip 开启.

各位嘉宾言论仅代表个人观点,非属DIY编程器网立场。

桂公网安备 45031202000115号

DIY编程器群(超员):41210778 DIY编程器

DIY编程器群1(满员):3044634 DIY编程器1

diy编程器群2:551025008 diy编程器群2

QQ:28000622;Email:libyoufer@sina.com

本站由桂林市临桂区技兴电子商务经营部独家赞助。旨在技术交流,请自觉遵守国家法律法规,一旦发现将做封号删号处理。

快速回复 返回顶部 返回列表