多通道AD高速采集

技术交流
zhy44th
Member
Posts: 11
Joined: Mon Dec 18, 2017 9:58 am

多通道AD高速采集

Post by zhy44th »

我准备用XL216系列芯片做AD采集的工作,AD型号为AD7768,时钟频率为8M ,(125ns);32位数据模式,我在DRDY信号为高时采样,采用1位port 32位缓存AD数据。每32个时钟取一次数。由于DRDY信号时间只有40ns左右,而采样语句执行每步大约10ns,,导致后面几个通道数据错位。我想知道能否8通道同时采样。


I am going to use XL216 series chip to do the work of AD acquisition, AD model is AD7768, the AD data clock frequency is 8M, (125ns); 32 data patterns, I sample while DRDY signal is high, adopt 1 port 32 bit to buffer AD data. Taken every 32 clocks.
Since the DRDY signal time is only about 40 ns, and the sampling statement executes about 10 ns per step, the data in the following several channels is misaligned. I would like to know if eight channels can be sampled at the same time.

Code: Select all

//port config:
           on tile[0] : clock clk = XS1_CLKBLK_1;
           on tile[0] : in port p_clk_in = XS1_PORT_1I;//using  external AD CLK
           on tile[0] : in port p_rd = XS1_PORT_1J;// DATA READY SIGNAL
           on tile[0] : in buffered port:32 chan_1 = XS1_PORT_1L;//DATA CHANNEL
           on tile[0] : in buffered port:32 chan_2 = XS1_PORT_1K;
           on tile[0] : in buffered port:32 chan_3 = XS1_PORT_1M;
           on tile[0] : in buffered port:32 chan_4 = XS1_PORT_1N;
           on tile[0] : in buffered port:32 chan_5 = XS1_PORT_1O;

...
          //wait for data ready signal which last about 40ns. it's not enough.

            select
            {
                case p_rd  when  pinsneq(0):> cmd:
                //delay_ticks(1);
                chan_1:> valdata1[k];
                clearbuf(chan_1);
                chan_2:> valdata2[k];
                clearbuf(chan_2);
                chan_3:> valdata3[k];
                clearbuf(chan_3);

               //here time is not enough for me to capture all data ,so the next channel is wrong.

                chan_4:> valdata4[k];
                clearbuf(chan_4);
                chan_5:> valdata5[k];

                clearbuf(chan_5);
                k++;
                break;//
         }

Here is some result : Channel 3 is right ,and the chan-4 is wrong .because I clearbuf one bit after sampling.
=============Channel 3==================

00010011010000111011010000001110

the channel : 3 , the volt is 2.166507
=============Channel 4==================


00000010000110111111111111101101
the channel : 4 , the volt is 2.166013
00101100100001110101110100001110
the channel : 4 , the volt is 4.213932