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.

[参考译文] TLV320ADC3140:I2S 配置不工作

Guru**** 2492385 points
Other Parts Discussed in Thread: TLV320ADC3140

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

https://e2e.ti.com/support/audio-group/audio/f/audio-forum/895859/tlv320adc3140-i2s-configuration-not-working

器件型号:TLV320ADC3140

我有最短的时间尝试让 TLV320ADC3140在给定的原型上传输 I2S。

我最初尝试使它成为从站、但一旦我加电、中断就永远不会清除、当运行时、我没有通过 SDOUT 获取数据、而虽然 ASI_STS 大部分时间显示为0x44、但它通常显示为0xf4。

最初、我使用内部时钟(samd21g18)以3.07Mhz 和64fs 的比率运行 BCLK、但时钟似乎不够好、并且 ASI_STS 显示0x44、并且大量为0xf4和0x40。 因此、我设法将来自另一个具有12MHz 晶体的电路板的12MHz 时钟信号重新组合在一起、并输出3.00Mhz BCLK 和64fs 的比率。 看起来更好、但我仍然得到偶尔的 ASI_STS 0xf4。

现在、我正在尝试直接运行12MHz 时钟到 GPIO1、用于主时钟。 如果我移除时钟、我得到一个7.62khz 的 fs 平方、以及488.1khz 的 BCLK 平方(使用示波器的计数器)、等于时间 HI 和低电平。 如果我添加时钟(11.9997Mhz)。 仍然没有 SDOUT、但 FS 仅在每~94us 周期保持低电平6uS、真正令人愉快的是、它看起来好像我在 BCLK 上获取数据。 与此同时、中断遍布各个地方、ASI_STATUS 也是如此。 一段时间后、我以为我的接头引脚可能标记错误、但我将内容追溯到芯片上的引脚22、和

现在、我有充分的理由认为这个原型通常是一个问题、因为我知道、其中一个 ADC 引脚上有一个短路。 我已经订购了3140开发板、希望这有助于消除我看到的一些问题。 但我不确定我是否只是在配置中做一些愚蠢的事情。

如果有任何线索或帮助、我将不胜感激。

GPIO_SET_PIN_LEVEL (ADC_RESET、false);
delay_ms (300);//等待 ADC 到硬件关断
GPIO_SET_PIN_LEVEL (ADC_RESET、TRUE);
delay_ms (50);

ADCwriting[0]= 0x02;
ADCwriting[1]= 0x81;
write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//唤醒
delay_ms (20);

ADCwritE[0]= 0x07;
ADClwriting[1]= 0x70;
write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//ASI_CFG0 I2S、32位、 默认 fsync_pol、默认 BCLK_pol、默认 TX_EDGE、TX_Fill 0

ADCwritE[0]= 0x13;
ADCwriting[1]= 0x80;
write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//STM_CFG0、主模式、 48K、MCLK 12MHz

ADCwritE[0]= 0x14;
ADCwriting[1]= 0x44;
write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//STM_CFG1、48K、 64 FS_BCLK_Ratio

ADCwritE[0]= 0x16;
ADCwriting[1]= 0x88;
write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//CLK_CFG、MCLK 音频根源、指定 MCLK 频率、MCLK 与 FS 的比率256

ADCwriting[0]= 0x21;
ADCwrite[1]= 0xa0;
write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//GPIO_CFG0、GPIO 作为 MCLK 输入

ADCwriting[0]= 0x73;
ADCwrite[1]= 0xc0;
write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//输入通道1、2

ADCwriting[0]= 0x74;
ADCwrite[1]= 0xc0;
write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//输出通道1、2
printf ("写入:%d\n"、written 计数);

ADCwriting[0]= 0x36;//中断寄存器
ADCread[0]= 0xff;
write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、1);
Read_count = IO_read (I2C_0_IO、(uint8_t *) ADCread、1);
printf ("读取:%d\n"、read_count);
printf ("中断:%x\n"、ADCread[0]);

ADCwriting[0]= 0x36;//中断寄存器
ADCread[0]= 0xff;
write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、1);
Read_count = IO_read (I2C_0_IO、(uint8_t *) ADCread、1);
printf ("读取:%d\n"、read_count);
printf ("中断:%x\n"、ADCread[0]);
ADCwriting[0]= 0x15;//ASI_STS
ADCread[0]= 0x00;
write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、1);
Read_count = IO_read (I2C_0_IO、(uint8_t *) ADCread、1);
printf ("\n 读取:%d\n"、read_count);
printf ("ASI_STS:%x\n"、ADCread[0]);

ADCwriting[0]= 0x75;
ADCwrite[1]= 0xe0;
write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//为 ADC 加电、微偏置、 PLL


 

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

    英里、

    给定 ASI_STS 中更改的值和生成的中断。 极性或帧同步边沿可能存在问题。 器件似乎没有接收到足够的时钟来移出数据。 请参阅第8.3.1.2.2节。 了解时序图以及 TX_OFFSET 和 BCLK_POL 的影响。 由于您要为32位数据设置 ADC、因此每帧至少需要64个 BCLK 同步。 您是否了解了如何提高 BCLK 与 FSYNC 的比率?  

    我随附了一份尚未到达网站的应用手册、其中介绍了如何将器件配置为主模式。

    此致、

     佩德罗

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

    英里、

    经过一些测试、我在代码中看不到正在设置 ASI_CH2寄存器。 默认情况下、CH2会路由到 I2S 左侧插槽1、因为它默认为 TDM 模式。 这需要通过将寄存器0x0C 设置为0x20更改为右插槽0:

    ADCwrite[0] = 0x0C;
    ADCwrite[1] = 0x20;
    written_count = io_write(I2C_0_io, (uint8_t *)ADCwrite, 2); //ASI_CH2 routed to right slot 0
    这样、CH1被分配给左插槽0、而 CH2被分配给右插槽0。 否则、每个 I2S 帧将需要更多时钟发送四个数据时隙。  

    此致、

     佩德罗

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

    非常感谢您提交本文档! 一周多以来、我一直在努力争取从这个原型中获得一个良好的 BCLK 和 FS。 本文档为我提供了最简单的尝试。 因此、我现在忽略了所有 I2S 内容。 事实证明、我所提供的原型有一些非常错误的东西。 我只能基于外部12MHz 时钟获得稳定的12.2877Mhz BCLK 和47.9987khz FS。 当然 、它只有在我连接了逻辑分析仪和模拟探头时才会稳定... 我还在调查、但很可能一个或多个电容器太小(我已经在其他地方找到了小于指定值的电阻器)、或者存在不良的焊点。

    对于任何好奇的人来说、这是(最终)基于外部12MHz 时钟为我提供良好 BCLK 和 FS 的基本代码。

    ADCwriting[0]= 0x02;
    ADCwriting[1]= 0x81;
    write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//唤醒
    delay_ms (20);
    
    ADCwritE[0]= 0x13;
    ADCwriting[1]= 0x80;
    write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//STM_CFG0、主模式、 48K、MCLK 12MHz
    
    ADCwritE[0]= 0x14;
    ADCwriting[1]= 0x48;
    write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//STM_CFG1、48K、 256 FS_BCLK_Ratio
    
    ADCwriting[0]= 0x21;
    ADCwrite[1]= 0xa0;
    write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//GPIO_CFG0、GPIO 作为 MCLK 输入
    
    ADCwriting[0]= 0x73;
    ADCwrite[1]= 0xc0;
    write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//输入通道1、2
    
    ADCwriting[0]= 0x74;
    ADCwrite[1]= 0xc0;
    write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//输出通道1、2
    
    ADCwriting[0]= 0x75;
    ADCwrite[1]= 0xe0;
    write_count = IO_write (I2C_0_IO、(uint8_t *) ADCwrite、2);//为 ADC 加电、微偏置、 PLL
    

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

    我更改了应用手册的上一个链接、说明它现在位于外部网站上。

    将 TLV320ADCx140配置和运行为音频总线主控