This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS7844输出问题

Other Parts Discussed in Thread: ADS7844, TLV5610

8通道AD芯片ADS7844,采用24-clocks方式,输出有一些问题,以第一通道AD1为例,程序如下,时序图参考附件,电路图参考附件,实际DA TLV5610输出为0.131V,具体问题如下.

1.在写control Byte的时候,尚未写完8个bits,ADS7844 Dout就开始拉高,与datasheet时序图不符合,为什么?

2.写完control Byte之后,读取ADS7844 Dout,一直为0,示波器抓取波形也显示如此,为什么?

3.写control Byte的时候,量测AD1电压为0.131V(实际DA TLV5610输出),一直到写完8个bit,0.131v电压不变,接下来读取ADS7844 Dout的时候,在第12个CLOCK结束后(实际是CLOCK=0步序),AD1从0.131v下降为0,之后一直为0,为什么?

  • 程式代码如下.

    /* init */
    void adc_ads7844_init()
    {
        ADCS   = 1;
        _nop_();
        ADCLK  = 0;
        _nop_();
        ADDIN   = 0;
        _nop_();
    }

    u_int adc_ads7844_write(u_char AD_ch)
    {
        u_char i;
        ADCS=0;
        _nop_();
        _nop_();

        for (i=0;i<8;i++)
        {
            ADDIN=(bit)(AD_ch&0x80);
            _nop_();
            _nop_();

            ADCLK=1;
            AD_ch<<=1;
            _nop_();
            _nop_();
            ADCLK=0;
            _nop_();
            _nop_();
        }
        ADDIN=0;
    }

    u_int adc_ads7844_read()
    {
        u_char i;
        u_int data_out=0;


        for (i=0;i<16;i++)
        {
            ADCLK=1;
            data_out<<=1;
            data_out=data_out|ADDOUT;
            _nop_();
            _nop_();
            ADCLK=0;
            _nop_();
            _nop_();
        }
        _nop_();
        _nop_();

        ADCS=1;
        data_out>>=4;
        _nop_();
        _nop_();
        return(data_out);
    }

    main()
    {
        u_char i;
        u_int AD_channal1,AD_channal2;

        dac_5610_init();
        adc_ads7844_init();
        delay(100);

        for(i=1;i<=8;i++)
        {
         dac_5610(0x0000,i);
         delay(100);
        }

        dac_5610(0x01ff,1);    //2583.35mv
        delay(100);

        adc_ads7844_write(0x8f);
        delay(100);
        AD_channal1=adc_ads7844_read();
        delay(100);

    }