搜索
bottom↓
回复: 6

FPGA做AD采样时,如何看AD芯片的时序图?

[复制链接]

出0入0汤圆

发表于 2013-7-21 13:21:29 | 显示全部楼层 |阅读模式
AD芯片的时序图提供的时间参数很多,比如转换时间、延时时间、各种最大、最小时间间隔等等,要用verilog来实现AD采样,应该关注AD芯片的哪些参数比较呢?
难道所有的时间参数都需要去管?

阿莫论坛20周年了!感谢大家的支持与爱护!!

曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……

出0入0汤圆

发表于 2013-7-21 15:25:53 来自手机 | 显示全部楼层
都要考虑的 ,当然根据具体需求 ,有的可以不管

出0入17汤圆

发表于 2013-7-21 15:27:34 | 显示全部楼层
我用fpga采样的ADCS7476,SPI的,没有考虑那些东西

出0入0汤圆

 楼主| 发表于 2013-7-21 15:35:50 | 显示全部楼层
流氓马 发表于 2013-7-21 15:27
我用fpga采样的ADCS7476,SPI的,没有考虑那些东西

你考虑了哪几个时间参数呢?

出0入17汤圆

发表于 2013-7-21 16:16:22 | 显示全部楼层
一个都没考虑,选型的时候,只考虑了速度,精度,通信方式,电压

出0入0汤圆

 楼主| 发表于 2013-7-21 16:18:20 | 显示全部楼层
流氓马 发表于 2013-7-21 16:16
一个都没考虑,选型的时候,只考虑了速度,精度,通信方式,电压

你用的SPI接口是自己写的还是直接用的SPI核?

出0入17汤圆

发表于 2013-7-21 16:27:27 | 显示全部楼层
  1. //
  2. // File:   adc_driver.v
  3. // Date:   07-Nov-05
  4. // Author: I. Chuang <ichuang@mit.edu>
  5. //
  6. // Sample code for the MIT 6.111 labkit, demonstrating FPGA control of an
  7. // analog to digital converter (National Semiconductor ADCS7476).
  8. //
  9. // This specific demo is made to drive the Digilent ADC peripheral module,
  10. // which has two ADCS7476 chips.  See http://www.digilentinc.com
  11. //
  12. // These ADC chips can be clocked up to 20 Mhz, and produce data serially.
  13. // The maximum conversion rate is 1 megasamples per second.  The input
  14. // voltage should be between 0 and 3.3V.
  15. //
  16. // The four signals which interface to the Digilent module are:
  17. //
  18. // CS  = chip select (negative logic)
  19. // CLK = serial clock
  20. // D0  = serial data for first ADC  
  21. // D1  = serial data for second ADC

  22. module aa(clk,adc_cs_b,adc_clk,adc_data0,adc_data1,v0,v1,rdy,sss,ccs);

  23.    input clk;//晶振时钟50M
  24.    output adc_cs_b;
  25.    output adc_clk;
  26.    input adc_data0;
  27.    input adc_data1;
  28.    output sss,ccs;
  29.    output [11:0] v0,v1;                // ADC results - voltages (12 bits)
  30.    output          rdy;                // high for one clk cycle on conversion finish
  31.    
  32.    // drive the digilent ADC board, doing continuous conversions
  33.    // rdy goes high for one clk cycle for each new conversion
  34.    //
  35.    // we use a counter to clock out the bits
  36.    // note that the ADCS7476 serial data is valid on falling edges
  37.    // of the adc clock.  

  38.    reg [6:0]         count;
  39.    wire         adc_cs_b = count<32 ? 0 : 1;
  40.    wire         ccs = count<32 ? 0 : 1;
  41.    wire         adc_clk = count[0];
  42.    wire         sss = count[0];
  43.    wire         rdy = count==32 ? 1 : 0;
  44.    wire         adc_clk2 = adc_clk;
  45.    reg [11:0]         tmp0, tmp1;
  46.    reg [11:0]         v0,v1;
  47.    reg [31:0]         delay;
  48.    
  49.    always @(posedge clk)
  50.      begin
  51.         delay <= (delay == 0) ? 0 : delay + 1;
  52.         if(delay==0) begin
  53.            count <= count==42 ? 0 : count + 1;
  54.            tmp0 <= (~adc_clk|adc_cs_b) ? tmp0 : {tmp0[10:0],adc_data0};
  55.            tmp1 <= (~adc_clk|adc_cs_b) ? tmp1 : {tmp1[10:0],adc_data1};
  56.            v0 <= rdy ? tmp0 : v0;
  57.            v1 <= rdy ? tmp1 : v1;
  58.         end
  59.      end

  60. endmodule // adc_driver
复制代码
网上下的,我自己稍微改了一点点
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-8-27 03:19

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

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