微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 硬件电路设计 > TI模拟硬件电路设计 > TAS5711 Slave 模式如何設定2.1聲道程序

TAS5711 Slave 模式如何設定2.1聲道程序

时间:10-02 整理:3721RD 点击:

請問一下,我目前用了一個DSP+5711的方案,以DSP為Matser,5711為slave模式,看了Design Guide內容的部分,依照參數下去,聲音都沒有輸出,附上我的程式碼檔案,能否告知是哪個環節出了問題,謝謝

你好:

1.你的原理图连接是否正确?可以对照我们的EVM板检查连接。

2.没有声音输出的时候,看一下电感前面是不是50%占空比的PWM波形,开关频率是不是384Khz。

3. 2.1的软件设置主要是0x05寄存器改成0x84或0x8C.

 

 

兄弟 你的问题解决了吗  我用的tas5508 也是没出声 可以讨论下吗Q273203365

我是依照你們EVB板的原理圖去製作的,我現在遇到的問題是2.1模式程式不知道修改什麼地方,我附件中的程序在2.0 BD模式是有聲音輸出的,如你所說,我是只要去修改0x05這邊就好了嗎?還是還有什麼地方也需要修改,煩請告知

我的5508在 2.0也是出声了 现在研究 怎么 分频 让左右声道各输出高低音 初涉音频 感觉好难

Hi Flora;

              現在聲音都出來了,不過我有發現另一個問題,就是我在線路上預留的2.0與2.1的切換,可是目前我的軟件寫的是2.1模式,但是怎麼我的4個輸出接口都會有聲音輸出,另外下列是我的代碼,現在發現2.1模式狀態下,低音的效果都沒出來,是不是我哪邊有沒寫到或是寫錯,麻煩請幫我確認下

#include "define.h"
#include "tas57xx.h"
#include "i2c.h"
#include "tim4.h"
#include "vm20xx.h"
#define I2cmWrite1Byte i2cm_wr
#define I2cmRead1Byte  i2cm_rd
#define TAS57XX_GAIN_TBL_NO 31

unsigned char const tas57xx_dgain_tbl[]={
255,   //0,dgain=-120.0
106+8, //1+8,dgain=-29.0
103+8, //2+8,dgain=-27.7
101+8, //3+8,dgain=-26.3
98+8,  //4+8,dgain=-25.0
95+8,  //5+8,dgain=-23.6
93+8,  //6+8,dgain=-22.3
90+8,  //7+8,dgain=-20.9
87+8,  //8+8,dgain=-19.6
84+8,  //9+8,dgain=-18.2
82+8,  //10+8,dgain=-16.9
79+8,  //11+8,dgain=-15.6
76+8,  //12+8,dgain=-14.2
74+8,  //13+8,dgain=-12.9
71+8,  //14+8,dgain=-11.5
68+8,  //15+8,dgain=-10.2
66+8,  //16+8,dgain=-8.8
63+8,  //17+8,dgain=-7.5
60+8,  //18+8,dgain=-6.1
58+8,  //19+8,dgain=+8.8
55+8,  //20+8,dgain=-3.4
52+8,  //21+8,dgain=-2.1
50+8,  //22+8,dgain=-0.8
47+8,  //23+8,dgain=0.6
44+8,  //24+8,dgain=1.9
41+8,  //25+8,dgain=3.3
39+8,  //26+8,dgain=4.6
36+8,  //27+8,dgain=6.0
33+8,  //28+8,dgain=7.3
31+8,  //29+8,dgain=8.7
28+8,  //30+8,dgain=10.0
};

unsigned char const sta57xx_BQ1a[]={
0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
unsigned char const sta57xx_BQ1b[]={
0x00,0x80,0x3E,0x83,0x0F,0x00,0xD8,0x83,0x00,0x7E,0xEB,0xB7,0x00,0xFF,0x27,0x7D,0x0F,0x80,0xD5,0xC5
};	//Type:eq;fc:60hz   ;Gain4db  ;BW:50hz
//0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
//};	//Type:eq;fc:60hz   ;Gain4db  ;BW:50hz
unsigned char const sta57xx_BQ1[][20]={
{0x00,0x7F,0xEF,0x61,0x0F,0x00,0xA2,0x1B,0x00,0x7F,0x6F,0x04,0x00,0xFF,0x5D,0xE5,0x0F,0x80,0xA1,0x9A}, //Type:eq;fc:30hz   ;Gain-2db  ;BW:30hz
{0x00,0x81,0x3E,0xA0,0x0F,0x00,0xD7,0xC9,0x00,0x7D,0xEB,0x9A,0x00,0xFF,0x28,0x37,0x0F,0x80,0xD5,0xC5}, //Type:eq;fc:60hz  ;Gain12db ;BW:50hz
{0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, //Type:eq;fc:125hz ;Gain:-6db  ;BW:100hz
{0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, //Type:eq;fc:250hz ;Gain:-4db  ;BW:1500hz
{0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}  //Type:eq;fc:5000hz ;Gain:5db  ;BW:15000hz
};
unsigned char const sta57xx_BQ1d[][20]={
{0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
};
unsigned char const sta57xx_bass[][20]={
{0x00,0x80,0x00,0x00,0x0F,0x03,0x54,0x5F,0x00,0x7C,0xB1,0x2C,0x00,0xFC,0xAB,0xA1,0x0F,0x83,0x4E,0xD4}, //Type:eq;fc:100hz   ;Gain 0 db  ;BW:200hz
{0x00,0x80,0x6D,0xA1,0x0F,0x03,0x54,0x5F,0x00,0x7C,0x43,0x8A,0x00,0xFC,0xAB,0xA1,0x0F,0x83,0x4E,0xD4}, //Type:eq;fc:100hz   ;Gain 2 db  ;BW:200hz
{0x00,0x80,0xF7,0xA6,0x0F,0x03,0x54,0x5F,0x00,0x7B,0xB9,0x85,0x00,0xFC,0xAB,0xA1,0x0F,0x83,0x4E,0xD4}, //Type:eq;fc:100hz   ;Gain 4 db  ;BW:200hz
{0x00,0x81,0xA5,0x68,0x0F,0x03,0x54,0x5F,0x00,0x7B,0x0B,0xC3,0x00,0xFC,0xAB,0xA1,0x0F,0x83,0x4E,0xD4}, //Type:eq;fc:100hz   ;Gain 6 db  ;BW:200hz
{0x00,0x82,0x80,0x27,0x0F,0x03,0x54,0x5F,0x00,0x7A,0x31,0x04,0x00,0xFC,0xAB,0xA1,0x0F,0x83,0x4E,0xD4}, //Type:eq;fc:100hz   ;Gain 8 db  ;BW:200hz
{0x00,0x83,0x93,0x89,0x0F,0x03,0x54,0x5F,0x00,0x79,0x1D,0xA2,0x00,0xFC,0xAB,0xA1,0x0F,0x83,0x4E,0xD4}, //Type:eq;fc:100hz   ;Gain 10 db  ;BW:200hz
{0x00,0x84,0xEE,0x3A,0x0F,0x03,0x54,0x5F,0x00,0x77,0xC2,0xF2,0x00,0xFC,0xAB,0xA1,0x0F,0x83,0x4E,0xD4}, //Type:eq;fc:100hz   ;Gain 12 db  ;BW:200hz
{0x00,0x86,0xA2,0xAE,0x0F,0x03,0x54,0x5F,0x00,0x76,0x0E,0x7D,0x00,0xFC,0xAB,0xA1,0x0F,0x83,0x4E,0xD4}, //Type:eq;fc:100hz   ;Gain 14 db  ;BW:200hz
};

#define DRC  //turn on compressor
#define EQ_ON //turn on eq

//---------------------------------------------------------------------
// initialize sta339
//---------------------------------------------------------------------
#ifdef PAMP_TAS5711
void tas57xx_init(void)
{ unsigned long tmp;//becaue STM8 's long is 32bit, int is 16 bits
  unsigned char i;
  //unsigned char *rdats;
  //time delay for BD mode,according to spec
//---------------------------------------------------------------------
// 2.0 Both BD Mode
//---------------------------------------------------------------------
//  i2cm_wr(TAS57XX_ID,0x1b,0x00); 
//  i2cm_wr32(TAS57XX_ID,0x20,0x00897772);//both bd mode
//	i2cm_wr32(TAS57XX_ID,0x25,0x01021345);//both bd mode
//	i2cm_wr(TAS57XX_ID,0x11,0xb8);
//  i2cm_wr(TAS57XX_ID,0x12,0x60);
//  i2cm_wr(TAS57XX_ID,0x13,0xa0);
//  i2cm_wr(TAS57XX_ID,0x14,0x48);
//---------------------------------------------------------------------
// 2.1 BD Mode Output For David Add
//---------------------------------------------------------------------
	i2cm_wr(TAS57XX_ID,0x1b,0x00);  // Oscillator Trim
	i2cm_wr(TAS57XX_ID,0x03,0xa0);  // System Control Register 1
	i2cm_wr(TAS57XX_ID,0x04,0x05);  // Serial Data Interface Register
	i2cm_wr(TAS57XX_ID,0x06,0x00);  // Soft Mute Register
	i2cm_wr(TAS57XX_ID,0x07,0x2a);  // Master Volume Register (0xFF = Mute)
	i2cm_wr(TAS57XX_ID,0x08,0x30);  // Channel 1 Volume
	i2cm_wr(TAS57XX_ID,0x09,0x30);  // Channel 2 Volume
	i2cm_wr(TAS57XX_ID,0x0a,0x30);  // SubChannel Volume
	i2cm_wr(TAS57XX_ID,0x0e,0x91);  // Micro Register
	i2cm_wr(TAS57XX_ID,0x10,0x02);  // Modulation Limit
	i2cm_wr(TAS57XX_ID,0x19,0x30);  // Shutdown Group Resister
	i2cm_wr(TAS57XX_ID,0x1a,0x95);  // Split Capacitor Charge Period 
	i2cm_wr(TAS57XX_ID,0x1c,0x02);  // Back-end Error Register
	i2cm_wr32(TAS57XX_ID,0x20,0x00897772); // 2.1 output mode
	i2cm_wr32(TAS57XX_ID,0x21,0x00004203);
	i2cm_wr32(TAS57XX_ID,0x25,0x01013245); //PWM Output MUX Register, OUT_A=PWM1(L+),OUT_B=PWM3(R-),OUT_C=PWM2(SUB+),OUT_D=PWM4(SUB-) 
	i2cm_wr(TAS57XX_ID,0x11,0xac);  // Inter-Channel Delay Channel 1
	i2cm_wr(TAS57XX_ID,0x12,0x54);  // Inter-Channel Delay Channel 2
	i2cm_wr(TAS57XX_ID,0x13,0xac);  // Inter-Channel Delay Channel 3
	i2cm_wr(TAS57XX_ID,0x14,0x54);  // Inter-Channel Delay Channel 4
	i2cm_wr(TAS57XX_ID,0x17,0x00);  // Offset Register (Absolute Delay)
	i2cm_wr(TAS57XX_ID,0x05,0x84);  // System Control Register 2 (active)
 
//woofer
  //i2cm_wr_eq(TAS57XX_ID,0x29, (unsigned long *)sta57xx_s_lpf1);   #ifdef DRC
   #ifdef DRC
  // //------------------------------------------------------
  // i2cm_wr64(TAS57XX_ID,0x3a,0x000006d3,0x007FF92c);//energe filter=100ms
  // i2cm_wr64(TAS57XX_ID,0x3b,0x00000DA6,0x007FF259);//attack filter=50ms
  // i2cm_wr64(TAS57XX_ID,0x3c,0x0000015D,0x007FFEA2);//decay filter=500ms
  // i2cm_wr32(TAS57XX_ID,0x40,0xFC98537A);//thresh hold=-17db
  // i2cm_wr32(TAS57XX_ID,0x41,0x0FAAAAAB);//ratio=3
  // i2cm_wr32(TAS57XX_ID,0x42,0x00107A1C);//offset(makeup gain)=6
  // i2cm_wr32(TAS57XX_ID,0x46,0x1);//enable drc
   ////------------------------------------------------------
   //i2cm_wr64(TAS57XX_ID,0x3a,0x0000883f,0x007F77c0);//energe filter=5ms
   //i2cm_wr64(TAS57XX_ID,0x3b,0x00004432,0x007Fbbcd);//attack filter=10ms
   //i2cm_wr64(TAS57XX_ID,0x3c,0x000006d3,0x007FF92c);//decay filter=100ms
   //i2cm_wr32(TAS57XX_ID,0x40,0xFC98537A);//thresh hold=-17db
   //i2cm_wr32(TAS57XX_ID,0x41,0x0FAAAAAB);//ratio=3
   //i2cm_wr32(TAS57XX_ID,0x42,0x00107A1C);//offset(makeup gain)=6
   //i2cm_wr32(TAS57XX_ID,0x46,0x1);//enable drc
   //------------------------------------------------------
   //i2cm_wr64(TAS57XX_ID,0x3a,0x00000DA6,0x007FF259);//attack filter=50ms 0707 change
   //i2cm_wr64(TAS57XX_ID,0x3b,0x00004432,0x007Fbbcd);//attack filter=10ms 0707 change
   //i2cm_wr64(TAS57XX_ID,0x3c,0x000006d3,0x007FF92c);//decay filter=100ms 0707 change
   //i2cm_wr32(TAS57XX_ID,0x40,0xFC98537A);//thresh hold=-17db 0707 change
   //i2cm_wr32(TAS57XX_ID,0x41,0x0FAAAAAB);//ratio=3 0707 change
   //i2cm_wr32(TAS57XX_ID,0x42,0x00107A1C);//offset(makeup gain)=6 0707 change
   //i2cm_wr32(TAS57XX_ID,0x46,0x1);//enable drc 0707 change
  // //------------------------------------------------------
   i2cm_wr64(TAS57XX_ID,0x3a,0x0000883f,0x007F77c0); //energe filter=5ms
   i2cm_wr64(TAS57XX_ID,0x3b,0x0002A39A,0x007D5C65); //attack filter=1ms
   i2cm_wr64(TAS57XX_ID,0x3c,0x00004432,0x007FBBCD); //decay filter=10ms
   i2cm_wr32(TAS57XX_ID,0x40,0xFC98537A);            //thresh hold=-17db
   i2cm_wr32(TAS57XX_ID,0x41,0x0FAAAAAB);            //ratio=3
   i2cm_wr32(TAS57XX_ID,0x42,0x00107A1C);            //offset(makeup gain)=6
   i2cm_wr32(TAS57XX_ID,0x46,0x1);                   //enable drc
   //------------------------------------------------------
   //i2cm_wr64(TAS57XX_ID,0x3a,0x0000883f,0x007F77c0);//energe filter=5ms
   //i2cm_wr64(TAS57XX_ID,0x3b,0x0002A39A,0x007D5C65);//attack filter=1ms
   //i2cm_wr64(TAS57XX_ID,0x3c,0x00004432,0x007FBBCD);//decay filter=10ms
   //i2cm_wr32(TAS57XX_ID,0x40,0xFC588B89);//thresh hold=-20db
   //i2cm_wr32(TAS57XX_ID,0x41,0x0FC00000);//ratio=2
   //i2cm_wr32(TAS57XX_ID,0x42,0x000BAA32);//offset(makeup gain)=3
   //i2cm_wr32(TAS57XX_ID,0x46,0x1);//enable drc
   //-----------------------------------------------------
   #endif
   //i2cm_wr32(TAS57XX_ID,0x46,0x1);//enable drc
   
   //filter
   //-----------------------------------L---------------------------------------
   #ifdef EQ_ON
   i2cm_wr32(TAS57XX_ID,0x50,0x10101090);//eq control,all 48K,EQ ON,wr L--> copt to  R,no auto bank switch

   i2cm_wrN(TAS57XX_ID,0x29,sta57xx_BQ1a,20);
   i2cm_wrN(TAS57XX_ID,0x2a,sta57xx_BQ1b,20);
   for(i=0;i<5;i++)
     i2cm_wrN(TAS57XX_ID,0x2b+i,sta57xx_BQ1[i],20);//0x2b~2f
   for(i=0;i<2;i++)
     i2cm_wrN(TAS57XX_ID,0x58+i,sta57xx_BQ1d[i],20);
   #endif   
  //-----------------------------------R---------------------------------------
   //i2cm_wrN(TAS57XX_ID,0x30,sta57xx_BQ2a,20);//BQ2a
   //i2cm_wrN(TAS57XX_ID,0x31,sta57xx_BQ2b,20);//BQ2b
   //for(i=0;i<5;i++)
   //  i2cm_wrN(TAS57XX_ID,0x32+i,sta57xx_BQ2[i],20);//BQ2,*GUI adr is wrong. act0x32~0x36.important
   //for(i=0;i<5;i++)
   //  i2cm_wrN(TAS57XX_ID,0x5c+i,sta57xx_BQ2d[i],20);//BQ2d
	//---------------------------------------------------------------------------
   //enable
   i2cm_wrN(TAS57XX_ID,0x29,sta57xx_bass[2],20);
   i2cm_wr(TAS57XX_ID,0x05,0x00);//sub-ch class-bd
}
#endif

void tas57xx_vol(signed char inc) //not complete. gain table for S
{
  STATE_VOL+=inc;
  if(STATE_VOL>=(TAS57XX_GAIN_TBL_NO-1))
    STATE_VOL=(TAS57XX_GAIN_TBL_NO-1);
  else if(STATE_VOL<=0)
    STATE_VOL=0;
  STATE_TVOL=tas57xx_dgain_tbl[STATE_VOL];//STATE_TVOL is tmp
  i2cm_wr(TAS57XX_ID,0x07,STATE_TVOL);//tas57xx_dgain_tbl[STATE_VOL]);
  //vm20xx_mbass(STATE_TVOL);
}

void tas57xx_mute(unsigned char tas57xx_mute) //
{ 
  if(tas57xx_mute)
  {
    STATE_TVOL=tas57xx_dgain_tbl[0];   //STATE_TVOL is tmp
    i2cm_wr(TAS57XX_ID,0x07,STATE_TVOL);//tas57xx_dgain_tbl[STATE_VOL]);
  }
  else
  {
    STATE_TVOL=tas57xx_dgain_tbl[STATE_VOL];//STATE_TVOL is tmp
    i2cm_wr(TAS57XX_ID,0x07,STATE_TVOL);//tas57xx_dgain_tbl[STATE_VOL]);
  }
}

void tas57xx_pwm_off(void) //
{
  i2cm_wr(TAS57XX_ID,0x05,0x40);//all ch pwdn
  
}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top