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.

使用DAC8831输出波形不对

Other Parts Discussed in Thread: DAC8831

按照DAC8831开发板设计了PCB,生成正弦波,单极性输出,直接测得DAC8831的输出引脚,结果输出波形如图所示,这个是什么问题

  • 从波形看,数据的最高位出了问题, 检查实际通信时序里的时间关系,特别是数据的首位。

  • 输入的码型对吗?偏移二进制或者二进制补码

  • 一开始直接用SPI就是这个现象,后来猜想是时序问题,就用IO口模拟,代码如下

    SET_LDAC();
    delay(10);
    // SPI start
    SET_SYNC();
    delay(10);
    CLR_SYNC(); //bring CS low
    delay(1);

    //Write out the ControlWord
    for(i=0; i<16; i++)
    {
    SET_SCLK();
    delay(5);
    if(0x8000 == (ValueToWrite & 0x8000))
    {
    SET_SDIN(); //Send one to SDI pin
    }
    else
    {
    CLR_SDIN(); //Send zero to SDI pin
    }

    delay(5);
    CLR_SCLK();
    delay(5);

    ValueToWrite <<= 1; //Rotate data
    delay(50);
    }

    // SPI ends
    SET_SYNC();
    delay(1);
    CLR_LDAC();
    delay(1);
    SET_LDAC();
    delay(1);