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.

[参考译文] TLV320AIC3120:无法测试音频环回和蜂鸣发生器

Guru**** 1828310 points
Other Parts Discussed in Thread: UCC28780
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/audio-group/audio/f/audio-forum/1357040/tlv320aic3120-not-able-to-test-audio-loopback-and-beep-generator

器件型号:TLV320AIC3120

您好!

我尝试过来自论坛和互联网的不同示例代码、但 无法从扬声器获得任何输出。  

以下是我准备的命令并与数据表相关联、所有 I2C 命令都会正常执行并通过读回来确认写入。

以下是所执行的写入序列。

// Clock-gen muxing. PLL_CLKIN=MCLK, CODEC_CLKIN=PLL_CLK 12.288MHZ
// P=1, R=1, J=6, D=10000,
// NDAC=NADC=7, MDAC=MADC=3,
// DOSR=AOSR=384 => 16KHz fs

static const tlv_cmd_t init_cmd[] = {
    {0x00, 0x00}, // Page 0
    {0x01, 0x01}, // sw reset
    // PLL config
    {0x04, 0x03}, // Clock-gen Mux. PLL_CLKIN=MCLK, CODEC_CLKIN=PLL_CLK
    {0x05, 0x91}, // PLL P+R. PLL power up, P=1, R=1 (P=divider,R=multiplier)
    {0x06, 0x06}, // PLL J = 6
    {0x07, 0x27}, // PLL D fractional. D-value MSB = 0x27
    {0x08, 0x10}, // PLL D fractional. D-value LSB = 0x10
    // mode master
    {0x1B, 0x0C}, // mode is i2s master, wordlength is 16, BCLK/WCLK out
    // divider configs
    {0x0B, 0x87}, // NDAC is powered up and set to 7
    {0x0C, 0x82}, // MDAC is powered up and set to 2
    {0x0D, 0x01}, // DOSR = 384 0x180, DOSR(9:8) = 0x01
    {0x0E, 0x80}, // DOSR = 384 0x180, DOSR(7:0) = 0x80
    {0x12, 0x00}, // NADC divider is powered down and ADC_DSP_CLK = DAC_DSP_CLK.
    {0x13, 0x00}, // MADC divider is powered down and ADC_MOD_CLK = DAC_MOD_CLK.
    {0x14, 0x00}, // AOSR = 256 0x100, AOSR(7:0) = 0
    //
    {0x74, 0x00}, // DAC => volume control thru pin disable
    {0x44, 0x00}, // DAC => drc disable, th and hy
    {0x41, 0x00}, // DAC => 0 db gain left
    //
    {0x00, 0x01}, // Page 1
    {0x21, 0x4E}, // De-pop, Power on = 800 ms, Step time = 4 ms
    {0x1F, 0x84}, // HPL
    {0x23, 0x40}, // LDAC routed to HPL
    {0x28, 0x0E}, // HPL unmute and gain 1dB
    {0x24, 0x00}, // No attenuation on HP
    {0x25, 0x00},
    {0x2E, 0x0A}, // MIC BIAS = 2.5v
    {0x30, 0x40}, // MICPGA P = MIC M 10K
    {0x31, 0x10}, // MICPGA N = MIC N 10K
    //
    {0x00, 0x00}, // Page 0
    {0x3C, 0x0B}, // select DAC DSP mode 11 & enable adaptive filter
    //
    {0x00, 0x08},
    {0x01, 0x04},
    //
    {0x00, 0x00},
    {0x3F, 0x96}, // POWERUP DAC (soft step disable)
    {0x40, 0x04}, // Unmute DAC
    {0x51, 0x80}, // Powerup ADC channel
    {0x52, 0x00}, // Unmute ADC channel
    //
    {0x00, 0x01},
    {0x2A, 0x1C}, // Unmute Class-D left
    {0x20, 0xC6}, // Power-up Class-D drivers
};

static const tlv_cmd_t loop_back_cmd[] = {
    {0x00, 0x00}, // Page 0
    {0x1d, 0x1d}, // b4 = ADC-to-DAC loopback enabled
    {0x00, 0x01},
    {0x2e, 0x0a}, // MICBIAS = 2.5V
    {0x26, 0x4c},
};

static const tlv_cmd_t beep_cmd[] = {
    {0x00, 0x00}, // Page 0
    {0x40, 0x0C}, // mute DACs
    {0x0B, 0x07}, // power down NDAC divider
    {0x47, 0x80}, // enable beep generator with left channel volume = 0dB
    {0x49, 0x00}, // BeepLen HIGH
    {0x4A, 0x7D}, // BeepLen MID
    {0x4B, 0xA0}, // BeepLen LOW
    {0x4C, 0x59}, // BeepSin MSB
    {0x4D, 0x98}, // BeepSin LSB
    {0x4E, 0x59}, // BeepCos MSB
    {0x4F, 0x98}, // BeepCos LSB
    {0x0B, 0x87}, // NDAC is powered up and set to 7
    {0x40, 0x04}, // Unmute DAC
};


下面是对 UCC28780

下面是 PLL 计算

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    您正在配置路径以获取 ADC 输出并将其环回至 DAC、但 ADC 时钟配置未设置。

    下面是 PLL 配置的 ADC 和 DAC 的示例、以获得16KHz 采样。

    设置此选项后、从 MIC 发送提示音、然后查看是否听到输出。

    我注意到的另一点是、您正在为 MCLK 使用外部时钟 OSC。

    对于从机模式、不建议这样做。 在主模式下、您应该对主机使用与应用中所示相同的时钟。 请注意以下内容。

    用于音频编解码器的音频串行接口配置(修订版 A)

    我不知道您打算如何处理蜂鸣声? 我建议您首先尝试上面的回送。

    此致。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    现在、我只需要为用户通知发出不同的蜂鸣声、将来我将需要录制和播放音频的功能。

    我也尝试过这些设置、但仍然无法正常工作。 以下是我将使用的更新代码。

    static const tlv_cmd_t init_cmd[] = {
        {0x00, 0x00}, // Page 0
        {0x01, 0x01}, // sw reset
        // PLL config
        {0x04, 0x03}, // Clock-gen Mux. PLL_CLKIN=MCLK, CODEC_CLKIN=PLL_CLK
        {0x05, 0x91}, // PLL P+R. PLL power up, P=1, R=1 (P=divider,R=multiplier)
        {0x06, 0x06}, // PLL J = 6
        {0x07, 0x27}, // PLL D fractional. D-value MSB = 0x27
        {0x08, 0x10}, // PLL D fractional. D-value LSB = 0x10
        // mode master
        {0x1B, 0x0C}, // mode is i2s master, wordlength is 16, BCLK/WCLK out
        // divider configs
        {0x0B, 0x87}, // NDAC is powered up and set to 7
        {0x0C, 0x86}, // MDAC is powered up and set to 2
        {0x0D, 0x00}, // DOSR = 384 0x180, DOSR(9:8) = 0x01
        {0x0E, 0x80}, // DOSR = 384 0x180, DOSR(7:0) = 0x80
        {0x12, 0x87}, // NADC divider is powered down and ADC_DSP_CLK = DAC_DSP_CLK.
        {0x13, 0x86}, // MADC divider is powered down and ADC_MOD_CLK = DAC_MOD_CLK.
        {0x14, 0x80}, // AOSR = 256 0x100, AOSR(7:0) = 0
        //
        {0x74, 0x00}, // DAC => volume control thru pin disable
        {0x44, 0x00}, // DAC => drc disable, th and hy
        {0x41, 0x00}, // DAC => 0 db gain left
        //
        {0x00, 0x01}, // Page 1
        {0x21, 0x4E}, // De-pop, Power on = 800 ms, Step time = 4 ms
        {0x1F, 0x84}, // HPL
        {0x23, 0x40}, // LDAC routed to HPL
        {0x28, 0x0E}, // HPL unmute and gain 1dB
        {0x24, 0x00}, // No attenuation on HP
        {0x25, 0x00},
        {0x2E, 0x0A}, // MIC BIAS = 2.5v
        {0x30, 0x40}, // MICPGA P = MIC M 10K
        {0x31, 0x10}, // MICPGA N = MIC N 10K
        //
        {0x00, 0x00}, // Page 0
        {0x3C, 0x0B}, // select DAC DSP mode 11 & enable adaptive filter
        //
        {0x00, 0x08},
        {0x01, 0x04},
        //
        {0x00, 0x00},
        {0x3F, 0x96}, // POWERUP DAC (soft step disable)
        {0x40, 0x04}, // Unmute DAC
        {0x51, 0x80}, // Powerup ADC channel
        {0x52, 0x00}, // Unmute ADC channel
        //
        {0x00, 0x01},
        {0x2A, 0x1C}, // Unmute Class-D left
        {0x20, 0xC6}, // Power-up Class-D drivers
    };
    
    static const tlv_cmd_t loop_back_cmd[] = {
        {0x00, 0x00}, // Page 0
        {0x1d, 0x1d}, // b4 = ADC-to-DAC loopback enabled
        {0x00, 0x01},
        {0x2e, 0x0a}, // MICBIAS = 2.5V
        {0x26, 0x4c},
    };

    我还想知道原理图是否有问题。
    例如、我们使复位线悬空、无法通过 I2C 与主机通信、我们将其上拉至高电平、现在 I2C 通信可以正常工作。
    但我们不知道器件上是否仍然存在

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    首次斜升 AVDD、IOVDD 和 DVDD 时、RESET 引脚被拉至低电平、当电源稳定时、释放该引脚(上拉至 IOVDD)。

    不要让它保持悬空。

    请参阅第7.3.2节。

    需要检查的几个事项:

    • WCLK 和 BCLK 在整个频率范围内提供正确且稳定的频率、
    • 时钟正确后、您可以首先检查录制路径、而不需要回送。 提供麦克风的语调、必要时增加增益。
    • 录音开始后、应用回送。

    我已根据您上面发送的内容修改了设置。 这用于环回、不会对 HP/D 类输出产生额外增益。

    e2e.ti.com/.../Setting-ADC_2D00_DAC-loopback

    此致、