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.

请教关于TLV320ADC3101 读取、设置PAGE4寄存器值

如题,通过csl库提供的程序,可以正确设置和读写PAGE0页的数据,但是读取PAGE4页上的寄存器值都为0,很奇怪,数据手册好像也没有说读取PAGE4与读取其他页面上的寄存器有什么不同,不知道有没有谁遇到同样问题,在线等!!!

  • 你好,

    page4都是存放滤波器系数的寄存器,不使用时reset值是为0的,详见datasheet描述:

    谢谢!

  • 谢谢您的回复,芯片默认选择的是PRB_R1模块,是不是说明默认使能了FILTER A 和 First IIR滤波器?还是需要其他操作才能使能滤波器First IIR滤波器。谢谢

  • 你好,

    是的,但是你要使用时还需要写入对应寄存器里面相应的系数值,才能得到你想要的滤波器参数。建议你下载ADC3101的评估软件GUI,用其生成你想要的滤波器参数再写入到对应的寄存器里面去。

    软件下载地址:http://www.ti.com/tool/tlv320adc3101evm-k

    谢谢!

  • 谢谢您的回复,我下载了GUI软件,但是该软件是针对双二阶滤波器的系数计算工具,并不是我想要的IIR滤波器系数计算工具,目前我遇到的问题是无法读取PAGE4页面上的寄存器值,所以不确定是否正确写入了滤波器系数。但是我是用同样的读写接口函数能正确读写PAGE0页的寄存器,请问这两者读写是否存在差异,datasheet好像并没有说明,或者如何验证已经正确写入了PAGE4的寄存器,谢谢!

  • 你把读取Page4寄存器的代码发上来帮你看看。

  • 您好:

    PAGE0,PAGE1  可以正确读写,但是PAGE4好像只能读取register0,指示当前处于第4页,读取其他寄存器一直为0,下面是读写函数,底层I2C读写驱动是通过csl库

    /*
    *
    * ADC3101_rget( addr, regnum, *regval )
    *
    * Return value of codec register regnum

    */
    Int16 ADC3101_rget( Uint16 addr, Uint16 regnum, Uint16* regval )
    {
    Int16 retcode = 0;
    Uint16 cmd[2];

    cmd[0] = regnum & 0x007F; // 7-bit Device Register
    cmd[1] = 0;

    retcode |= EZDSP5535_I2C_write( addr, cmd, 1 );
    retcode |= EZDSP5535_I2C_read( addr, cmd, 1 );

    *regval = cmd[0];
    EZDSP5535_wait( 10 );
    return retcode;
    }


    /*
    *
    * ADC3101_rset( addr, regnum, regval )
    *
    * Set codec register regnum to value regval
    *
    */
    Int16 ADC3101_rset( Uint16 addr, Uint16 regnum, Uint16 regval )
    {
    Uint16 cmd[2];
    cmd[0] = regnum & 0x007F; // 7-bit Device Register
    cmd[1] = regval; // 8-bit Register Data

    EZDSP5535_waitusec( 300 );

    return EZDSP5535_I2C_write( addr, cmd, 2 );
    }

    ==========================================================

    底层I2C驱动

    ==========================================================

    *
    * EZDSP5535_I2C_read( i2c_addr, data, len )
    *
    * I2C read in Master mode: Reads from I2c device with address
    * "i2c_addr" and stores to the location of "data" for length "len".
    *
    * Uint16 i2c_addr <- I2C slave address
    * Uint16* data <- I2C data ptr
    * Uint16 len <- # of bytes to write
    */
    Int16 EZDSP5535_I2C_read( Uint16 i2c_addr, Uint16* data, Uint16 len )
    {
    Uint16 startStop = ((CSL_I2C_START) | (CSL_I2C_STOP));
    CSL_Status status;

    /* I2C Read */
    status = I2C_read(data, len, i2c_addr,
    TRUE, startStop, CSL_I2C_MAX_TIMEOUT, FALSE);
    return status;
    }

    /*
    * EZDSP5535_I2C_write( i2c_addr, data, len )
    *
    * I2C write in Master mode: Writes to I2c device with address
    * "i2c_addr" from the location of "data" for length "len".
    *
    * Uint16 i2c_addr <- I2C slave address
    * Uint16* data <- I2C data ptr
    * Uint16 len <- # of bytes to write
    */
    Int16 EZDSP5535_I2C_write( Uint16 i2c_addr, Uint16* data, Uint16 len )
    {
    Uint16 startStop = ((CSL_I2C_START) | (CSL_I2C_STOP));
    CSL_Status status;

    /* I2C Write */
    status = I2C_write(data, len, i2c_addr,
    TRUE, startStop, CSL_I2C_MAX_TIMEOUT);

    return status;
    }

  • 你好,

    Page4上电后默认寄存器值如附件表所示:

    你在操作Page4时都做了哪些设置?

  • 您好,

    我并没有做什么操作,只是先设置当前页为PAGE4,之后就读取reg8到reg13这几个寄存器的值,但都为零。

    你刚才发的手册和datasheet上的默认值相同

  • 你设置0x00寄存器为0x04,选择Page4后,再回读一下该寄存器,看看是否是写入的值?

  • 您好,是该寄存器的值,所以确认当前状态是在第4页,之后的读写操作就无法验证,因为读取的都是0.

  • 在配置完页寄存器后,即写0x00寄存器为0x04,读其他寄存器时加一点延时10~100ms看看有没有正确数据返回。

  •  再次谢谢您的回答,我刚才先写reg0为0x04,设置为第4页,然后读取reg0=0x04,再写入reg0=0x01切换到第一页,再次读取reg0=0x01,说明在第4页读写reg0也起作用了。datasheet上关于PAGE4的寄存器介绍如下图,所谓的滤波器系数需要连续编程2个寄存器具体是什么意思?因为我之前试了连续写入(reg1,val1,reg2,val2)4个值再发送stop信号也没有写入。

  • datasheet上关于PAGE4的寄存器介绍如下图,所谓的滤波器系数需要连续编程2个寄存器具体是什么意思?

    每个系数,例如C1,是由两个字节组成的,高八位和低八位。写入时,这连个系数不能断开写,要先写高八位,紧接着写低八位。

  • 您好,我在读取时也碰到了这个问题,请问大神这个问题你解决了吗?