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.
I had a problem tuning the TAS5822MEVM:I controlled the I2C of my power amplifier TAS5822M for tuning through the I2C of TAS5822MEVM. I adjusted the EQ and related parameters and saved them. Then my power amplifier TAS5822M was powered off and powered on again.After listening to the speaker, I found that the sound was not as good as I heard online before. Later, I turned on and off the EQ, DRC and DBE/DDE/DEQ switches of PPC3 tool, and then turned on and off all the switches of L/R1 and L/R2 of EQ interface in turn before the sound would be normal. Why is this so, and did you debug it in this way?
Hi Kecheng
Let's make clear some of the details about your problem.
Then my power amplifier TAS5822M was powered off and powered on again.
For this behavior, may I ask is it by your controlled to power on and off TAS5822M? I think the I2C won't able to do that, and may I ask why need this procedure?
And another question is, if you use the EVM to connect to your speaker directly, will the sound listened normally?
First of all my machine is controlled by TAS588MEVM.
Use TAS5822M EVM to control online playback. If the playback is abnormal after the EQ parameter is imported, I need to turn on the switch of each function once to play normally.
Now the problem is very strange, I control my machine through TAS5822MEVM to listen to OK online, then I save the EQ file, and finally export the header file to the software engineer in the "end system integration" tool.However, I turned off the power of TAS5822mevm and the machine again, powered it on again, and imported the EQ parameter. After turning off the switch of each function and turning on the switch again, the sound was normal. I exported the header file again for comparison, and found that there were differences between the two problems.
Hi Kecheng
If you re-powered the amplifier and still want to use PPC3 to control, it's also suggested to restart the PPC3 software. There's quite a lot of initial codes need to be written when you power up the EVM, and PPC3 only program it when you start a new PPC3.
And if you are using EVM to control your own board, could you please make sure the device I2C address is different from EVM? Otherwise you can't make sure if the codes are correctly written into your own board. What is the I2C address of TAS5822 on your own board?
1 Yes, my PPCS will turn off and back on whenever TAS5822mevm restarts after power failure, but the problem remains.
2 The address of TAS5822 on my machine is 0X5C, which is different from the address code of TAS5822mevm.
Hello, I give you the EQ file BS1 5822 0X5C 08021_03.PPC3 that I debug online and the header file BS1 5822 0X5C 08021_03.h that I export online to help me confirm whether there is any problem. In addition, you can also confirm whether there is any problem after importing EQ parameters online.Bass enhancement function: whether DBE/DDE/DEQ is effectively controlled, whether DRC is effectively controlled, and whether each EQ point in Equalizer is effectively controlled, thank you!BS1 5822 0X5C 08021_03.h
Hi Kecheng
I tried with your PPC3 file, and dump the codes, there's small difference from your .h file. Maybe you could try with below. And are you using the newest PPC3 and TAS5822 APP? Your dumped file seems comes from the old version.
Can you capture your screen of writing the dumped codes? We need to make sure the codes are successfully programmed.
typedef unsigned char cfg_u8; typedef union { struct { cfg_u8 offset; cfg_u8 value; }; struct { cfg_u8 command; cfg_u8 param; }; } cfg_reg; #define CFG_META_SWITCH (255) #define CFG_META_DELAY (254) #define CFG_META_BURST (253) /* Example C code */ /* // Externally implemented function that can write n-bytes to the device // PCM51xx and TAS5766 targets require the high bit (0x80) of the I2C register to be set on multiple writes. // Refer to the device data sheet for more information. extern int i2c_write(unsigned char *data, int n); // Externally implemented function that delays execution by n milliseconds extern int delay(int n); // Example implementation. Call like: // transmit_registers(registers, sizeof(registers)/sizeof(registers[0])); void transmit_registers(cfg_reg *r, int n) { int i = 0; while (i < n) { switch (r[i].command) { case CFG_META_SWITCH: // Used in legacy applications. Ignored here. break; case CFG_META_DELAY: delay(r[i].param); break; case CFG_META_BURST: i2c_write((unsigned char *)&r[i+1], r[i].param); i += (r[i].param / 2) + 1; break; default: i2c_write((unsigned char *)&r[i], 2); break; } i++; } } */ cfg_reg registers[] = { //RESET { 0x00, 0x00 }, { 0x7f, 0x00 }, { 0x01, 0x11 }, { 0x46, 0x01 }, { 0x03, 0x02 }, { CFG_META_DELAY, 5 }, { 0x66, 0x04 }, { 0x7f, 0x8c }, { 0x00, 0x29 }, { 0x18, 0x00 }, { 0x19, 0x80 }, { 0x1a, 0x00 }, { 0x1b, 0x00 }, { 0x1c, 0x00 }, { 0x1d, 0x00 }, { 0x1e, 0x00 }, { 0x1f, 0x00 }, { 0x20, 0x00 }, { 0x21, 0x00 }, { 0x22, 0x00 }, { 0x23, 0x00 }, { 0x24, 0x00 }, { 0x25, 0x80 }, { 0x26, 0x00 }, { 0x27, 0x00 }, { 0x00, 0x2a }, { 0x24, 0x00 }, { 0x25, 0x80 }, { 0x26, 0x00 }, { 0x27, 0x00 }, { 0x28, 0x00 }, { 0x29, 0x80 }, { 0x2a, 0x00 }, { 0x2b, 0x00 }, { 0x30, 0x00 }, { 0x31, 0x71 }, { 0x32, 0x94 }, { 0x33, 0x9a }, { 0x00, 0x2c }, { 0x0c, 0x00 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 }, { 0x10, 0x00 }, { 0x11, 0x00 }, { 0x12, 0x00 }, { 0x13, 0x00 }, { 0x14, 0x00 }, { 0x15, 0x80 }, { 0x16, 0x00 }, { 0x17, 0x00 }, { 0x18, 0x00 }, { 0x19, 0x00 }, { 0x1a, 0x00 }, { 0x1b, 0x00 }, { 0x1c, 0x00 }, { 0x1d, 0x80 }, { 0x1e, 0x00 }, { 0x1f, 0x00 }, { 0x20, 0x00 }, { 0x21, 0x00 }, { 0x22, 0x00 }, { 0x23, 0x00 }, { 0x28, 0x00 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x00 }, { 0x2c, 0x00 }, { 0x2d, 0x80 }, { 0x2e, 0x00 }, { 0x2f, 0x00 }, { 0x34, 0x00 }, { 0x35, 0x80 }, { 0x36, 0x00 }, { 0x37, 0x00 }, { 0x38, 0x00 }, { 0x39, 0x00 }, { 0x3a, 0x00 }, { 0x3b, 0x00 }, { 0x48, 0x00 }, { 0x49, 0x00 }, { 0x4a, 0x00 }, { 0x4b, 0x00 }, { 0x4c, 0x00 }, { 0x4d, 0x80 }, { 0x4e, 0x00 }, { 0x4f, 0x00 }, { 0x5c, 0x00 }, { 0x5d, 0x00 }, { 0x5e, 0x57 }, { 0x5f, 0x62 }, { 0x60, 0x00 }, { 0x61, 0x89 }, { 0x62, 0x37 }, { 0x63, 0x4c }, { 0x64, 0x08 }, { 0x65, 0x00 }, { 0x66, 0x00 }, { 0x67, 0x00 }, { 0x68, 0x40 }, { 0x69, 0x00 }, { 0x6a, 0x00 }, { 0x6b, 0x00 }, { 0x6c, 0x02 }, { 0x6d, 0x66 }, { 0x6e, 0xc4 }, { 0x6f, 0x1b }, { 0x00, 0x2d }, { 0x18, 0x7d }, { 0x19, 0x99 }, { 0x1a, 0x3b }, { 0x1b, 0xe5 }, { 0x1c, 0x00 }, { 0x1d, 0x00 }, { 0x1e, 0x57 }, { 0x1f, 0x62 }, { 0x20, 0x00 }, { 0x21, 0x00 }, { 0x22, 0x00 }, { 0x23, 0x00 }, { 0x24, 0x00 }, { 0x25, 0x00 }, { 0x26, 0x00 }, { 0x27, 0x00 }, { 0x28, 0x00 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x00 }, { 0x2c, 0x00 }, { 0x2d, 0x80 }, { 0x2e, 0x00 }, { 0x2f, 0x00 }, //Biquad { 0x00, 0x00 }, { 0x7f, 0xaa }, { 0x00, 0x24 }, { 0x18, 0x07 }, { 0x19, 0xfb }, { 0x1a, 0xf1 }, { 0x1b, 0x45 }, { 0x1c, 0xf0 }, { 0x1d, 0x08 }, { 0x1e, 0x1d }, { 0x1f, 0x77 }, { 0x20, 0x07 }, { 0x21, 0xfb }, { 0x22, 0xf1 }, { 0x23, 0x45 }, { 0x24, 0x0f }, { 0x25, 0xf7 }, { 0x26, 0xe1 }, { 0x27, 0x2a }, { 0x28, 0xf8 }, { 0x29, 0x08 }, { 0x2a, 0x1c }, { 0x2b, 0x17 }, { 0x2c, 0x08 }, { 0x2d, 0x02 }, { 0x2e, 0x54 }, { 0x2f, 0xfa }, { 0x30, 0xf0 }, { 0x31, 0x04 }, { 0x32, 0xba }, { 0x33, 0xa1 }, { 0x34, 0x07 }, { 0x35, 0xf8 }, { 0x36, 0xfb }, { 0x37, 0x63 }, { 0x38, 0x0f }, { 0x39, 0xfb }, { 0x3a, 0x45 }, { 0x3b, 0x5f }, { 0x3c, 0xf8 }, { 0x3d, 0x04 }, { 0x3e, 0xaf }, { 0x3f, 0xa3 }, { 0x40, 0x08 }, { 0x41, 0x00 }, { 0x42, 0x00 }, { 0x43, 0x00 }, { 0x44, 0xf0 }, { 0x45, 0x06 }, { 0x46, 0xc7 }, { 0x47, 0x59 }, { 0x48, 0x07 }, { 0x49, 0xf9 }, { 0x4a, 0x4f }, { 0x4b, 0x13 }, { 0x4c, 0x0f }, { 0x4d, 0xf9 }, { 0x4e, 0x38 }, { 0x4f, 0xa7 }, { 0x50, 0xf8 }, { 0x51, 0x06 }, { 0x52, 0xb0 }, { 0x53, 0xed }, { 0x54, 0x08 }, { 0x55, 0x05 }, { 0x56, 0x32 }, { 0x57, 0xf6 }, { 0x58, 0xf0 }, { 0x59, 0x0d }, { 0x5a, 0xb5 }, { 0x5b, 0xce }, { 0x5c, 0x07 }, { 0x5d, 0xed }, { 0x5e, 0x70 }, { 0x5f, 0xc6 }, { 0x60, 0x0f }, { 0x61, 0xf2 }, { 0x62, 0x4a }, { 0x63, 0x32 }, { 0x64, 0xf8 }, { 0x65, 0x0d }, { 0x66, 0x5c }, { 0x67, 0x44 }, { 0x68, 0x08 }, { 0x69, 0x00 }, { 0x6a, 0x00 }, { 0x6b, 0x00 }, { 0x6c, 0xf0 }, { 0x6d, 0x04 }, { 0x6e, 0x36 }, { 0x6f, 0xe9 }, { 0x70, 0x07 }, { 0x71, 0xfb }, { 0x72, 0xfb }, { 0x73, 0x93 }, { 0x74, 0x0f }, { 0x75, 0xfb }, { 0x76, 0xc9 }, { 0x77, 0x17 }, { 0x78, 0xf8 }, { 0x79, 0x04 }, { 0x7a, 0x04 }, { 0x7b, 0x6d }, { 0x7c, 0x08 }, { 0x7d, 0x1e }, { 0x7e, 0xb1 }, { 0x7f, 0x9d }, { 0x00, 0x25 }, { 0x08, 0xf0 }, { 0x09, 0x51 }, { 0x0a, 0xf9 }, { 0x0b, 0x1d }, { 0x0c, 0x07 }, { 0x0d, 0x92 }, { 0x0e, 0x6e }, { 0x0f, 0x1f }, { 0x10, 0x0f }, { 0x11, 0xae }, { 0x12, 0x06 }, { 0x13, 0xe3 }, { 0x14, 0xf8 }, { 0x15, 0x4e }, { 0x16, 0xe0 }, { 0x17, 0x45 }, { 0x18, 0x08 }, { 0x19, 0x00 }, { 0x1a, 0x00 }, { 0x1b, 0x00 }, { 0x1c, 0xf2 }, { 0x1d, 0xcd }, { 0x1e, 0xad }, { 0x1f, 0x18 }, { 0x20, 0x07 }, { 0x21, 0x3c }, { 0x22, 0xf3 }, { 0x23, 0xcf }, { 0x24, 0x0d }, { 0x25, 0x32 }, { 0x26, 0x52 }, { 0x27, 0xe8 }, { 0x28, 0xf8 }, { 0x29, 0xc3 }, { 0x2a, 0x0c }, { 0x2b, 0x31 }, { 0x2c, 0x06 }, { 0x2d, 0x74 }, { 0x2e, 0xdf }, { 0x2f, 0x25 }, { 0x30, 0xf4 }, { 0x31, 0xf9 }, { 0x32, 0x68 }, { 0x33, 0x4e }, { 0x34, 0x04 }, { 0x35, 0xcf }, { 0x36, 0xd7 }, { 0x37, 0x22 }, { 0x38, 0x0d }, { 0x39, 0xe9 }, { 0x3a, 0x79 }, { 0x3b, 0xc4 }, { 0x3c, 0xf9 }, { 0x3d, 0xd8 }, { 0x3e, 0x67 }, { 0x3f, 0xa6 }, { 0x40, 0x0a }, { 0x41, 0xf5 }, { 0x42, 0x26 }, { 0x43, 0x2d }, { 0x44, 0xf8 }, { 0x45, 0x99 }, { 0x46, 0x59 }, { 0x47, 0x72 }, { 0x48, 0x00 }, { 0x49, 0x44 }, { 0x4a, 0x61 }, { 0x4b, 0xbf }, { 0x4c, 0x07 }, { 0x4d, 0x66 }, { 0x4e, 0xa6 }, { 0x4f, 0x8e }, { 0x50, 0xfc }, { 0x51, 0xc6 }, { 0x52, 0x78 }, { 0x53, 0x13 }, { 0x54, 0x08 }, { 0x55, 0x00 }, { 0x56, 0x00 }, { 0x57, 0x00 }, { 0x58, 0xf0 }, { 0x59, 0x79 }, { 0x5a, 0xbf }, { 0x5b, 0x22 }, { 0x5c, 0x07 }, { 0x5d, 0xa8 }, { 0x5e, 0x8c }, { 0x5f, 0x0d }, { 0x60, 0x0f }, { 0x61, 0x86 }, { 0x62, 0x40 }, { 0x63, 0xde }, { 0x64, 0xf8 }, { 0x65, 0x57 }, { 0x66, 0x73 }, { 0x67, 0xf3 }, { 0x68, 0x07 }, { 0x69, 0xbb }, { 0x6a, 0x8b }, { 0x6b, 0x1d }, { 0x6c, 0xf4 }, { 0x6d, 0xc6 }, { 0x6e, 0xd3 }, { 0x6f, 0xe4 }, { 0x70, 0x07 }, { 0x71, 0x31 }, { 0x72, 0xfa }, { 0x73, 0x7f }, { 0x74, 0x0b }, { 0x75, 0x39 }, { 0x76, 0x2c }, { 0x77, 0x1c }, { 0x78, 0xf9 }, { 0x79, 0x12 }, { 0x7a, 0x7a }, { 0x7b, 0x64 }, { 0x7c, 0x08 }, { 0x7d, 0x00 }, { 0x7e, 0x00 }, { 0x7f, 0x00 }, { 0x00, 0x26 }, { 0x08, 0xf7 }, { 0x09, 0x59 }, { 0x0a, 0xa3 }, { 0x0b, 0x12 }, { 0x0c, 0x02 }, { 0x0d, 0xe7 }, { 0x0e, 0x24 }, { 0x0f, 0xbb }, { 0x10, 0x08 }, { 0x11, 0xa6 }, { 0x12, 0x5c }, { 0x13, 0xee }, { 0x14, 0xfd }, { 0x15, 0x18 }, { 0x16, 0xdb }, { 0x17, 0x45 }, { 0x18, 0x08 }, { 0x19, 0x00 }, { 0x1a, 0x00 }, { 0x1b, 0x00 }, { 0x1c, 0x00 }, { 0x1d, 0x00 }, { 0x1e, 0x00 }, { 0x1f, 0x00 }, { 0x20, 0x00 }, { 0x21, 0x00 }, { 0x22, 0x00 }, { 0x23, 0x00 }, { 0x24, 0x00 }, { 0x25, 0x00 }, { 0x26, 0x00 }, { 0x27, 0x00 }, { 0x28, 0x00 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x00 }, { 0x2c, 0x08 }, { 0x2d, 0x00 }, { 0x2e, 0x00 }, { 0x2f, 0x00 }, { 0x30, 0x00 }, { 0x31, 0x00 }, { 0x32, 0x00 }, { 0x33, 0x00 }, { 0x34, 0x00 }, { 0x35, 0x00 }, { 0x36, 0x00 }, { 0x37, 0x00 }, { 0x38, 0x00 }, { 0x39, 0x00 }, { 0x3a, 0x00 }, { 0x3b, 0x00 }, { 0x3c, 0x00 }, { 0x3d, 0x00 }, { 0x3e, 0x00 }, { 0x3f, 0x00 }, { 0x54, 0x08 }, { 0x55, 0x00 }, { 0x56, 0x00 }, { 0x57, 0x00 }, { 0x58, 0x00 }, { 0x59, 0x00 }, { 0x5a, 0x00 }, { 0x5b, 0x00 }, { 0x5c, 0x00 }, { 0x5d, 0x00 }, { 0x5e, 0x00 }, { 0x5f, 0x00 }, { 0x60, 0x00 }, { 0x61, 0x00 }, { 0x62, 0x00 }, { 0x63, 0x00 }, { 0x64, 0x00 }, { 0x65, 0x00 }, { 0x66, 0x00 }, { 0x67, 0x00 }, { 0x68, 0x08 }, { 0x69, 0x00 }, { 0x6a, 0x00 }, { 0x6b, 0x00 }, { 0x6c, 0x00 }, { 0x6d, 0x00 }, { 0x6e, 0x00 }, { 0x6f, 0x00 }, { 0x70, 0x00 }, { 0x71, 0x00 }, { 0x72, 0x00 }, { 0x73, 0x00 }, { 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x00 }, { 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x00 }, { 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x08 }, { 0x7d, 0x00 }, { 0x7e, 0x00 }, { 0x7f, 0x00 }, { 0x00, 0x27 }, { 0x08, 0x00 }, { 0x09, 0x00 }, { 0x0a, 0x00 }, { 0x0b, 0x00 }, { 0x0c, 0x00 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 }, { 0x10, 0x00 }, { 0x11, 0x00 }, { 0x12, 0x00 }, { 0x13, 0x00 }, { 0x14, 0x00 }, { 0x15, 0x00 }, { 0x16, 0x00 }, { 0x17, 0x00 }, { 0x18, 0x08 }, { 0x19, 0x00 }, { 0x1a, 0x00 }, { 0x1b, 0x00 }, { 0x1c, 0x00 }, { 0x1d, 0x00 }, { 0x1e, 0x00 }, { 0x1f, 0x00 }, { 0x20, 0x00 }, { 0x21, 0x00 }, { 0x22, 0x00 }, { 0x23, 0x00 }, { 0x24, 0x00 }, { 0x25, 0x00 }, { 0x26, 0x00 }, { 0x27, 0x00 }, { 0x28, 0x00 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x00 }, { 0x2c, 0x08 }, { 0x2d, 0x00 }, { 0x2e, 0x00 }, { 0x2f, 0x00 }, { 0x30, 0x00 }, { 0x31, 0x00 }, { 0x32, 0x00 }, { 0x33, 0x00 }, { 0x34, 0x00 }, { 0x35, 0x00 }, { 0x36, 0x00 }, { 0x37, 0x00 }, { 0x38, 0x00 }, { 0x39, 0x00 }, { 0x3a, 0x00 }, { 0x3b, 0x00 }, { 0x3c, 0x00 }, { 0x3d, 0x00 }, { 0x3e, 0x00 }, { 0x3f, 0x00 }, { 0x40, 0x08 }, { 0x41, 0x00 }, { 0x42, 0x00 }, { 0x43, 0x00 }, { 0x44, 0x00 }, { 0x45, 0x00 }, { 0x46, 0x00 }, { 0x47, 0x00 }, { 0x48, 0x00 }, { 0x49, 0x00 }, { 0x4a, 0x00 }, { 0x4b, 0x00 }, { 0x4c, 0x00 }, { 0x4d, 0x00 }, { 0x4e, 0x00 }, { 0x4f, 0x00 }, { 0x50, 0x00 }, { 0x51, 0x00 }, { 0x52, 0x00 }, { 0x53, 0x00 }, { 0x54, 0x08 }, { 0x55, 0x00 }, { 0x56, 0x00 }, { 0x57, 0x00 }, { 0x58, 0x00 }, { 0x59, 0x00 }, { 0x5a, 0x00 }, { 0x5b, 0x00 }, { 0x5c, 0x00 }, { 0x5d, 0x00 }, { 0x5e, 0x00 }, { 0x5f, 0x00 }, { 0x60, 0x00 }, { 0x61, 0x00 }, { 0x62, 0x00 }, { 0x63, 0x00 }, { 0x64, 0x00 }, { 0x65, 0x00 }, { 0x66, 0x00 }, { 0x67, 0x00 }, { 0x68, 0x08 }, { 0x69, 0x00 }, { 0x6a, 0x00 }, { 0x6b, 0x00 }, { 0x6c, 0x00 }, { 0x6d, 0x00 }, { 0x6e, 0x00 }, { 0x6f, 0x00 }, { 0x70, 0x00 }, { 0x71, 0x00 }, { 0x72, 0x00 }, { 0x73, 0x00 }, { 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x00 }, { 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x00 }, { 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x08 }, { 0x7d, 0x00 }, { 0x7e, 0x00 }, { 0x7f, 0x00 }, { 0x00, 0x28 }, { 0x08, 0x00 }, { 0x09, 0x00 }, { 0x0a, 0x00 }, { 0x0b, 0x00 }, { 0x0c, 0x00 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 }, { 0x10, 0x00 }, { 0x11, 0x00 }, { 0x12, 0x00 }, { 0x13, 0x00 }, { 0x14, 0x00 }, { 0x15, 0x00 }, { 0x16, 0x00 }, { 0x17, 0x00 }, { 0x18, 0x08 }, { 0x19, 0x00 }, { 0x1a, 0x00 }, { 0x1b, 0x00 }, { 0x1c, 0x00 }, { 0x1d, 0x00 }, { 0x1e, 0x00 }, { 0x1f, 0x00 }, { 0x20, 0x00 }, { 0x21, 0x00 }, { 0x22, 0x00 }, { 0x23, 0x00 }, { 0x24, 0x00 }, { 0x25, 0x00 }, { 0x26, 0x00 }, { 0x27, 0x00 }, { 0x28, 0x00 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x00 }, { 0x2c, 0x08 }, { 0x2d, 0x00 }, { 0x2e, 0x00 }, { 0x2f, 0x00 }, { 0x30, 0x00 }, { 0x31, 0x00 }, { 0x32, 0x00 }, { 0x33, 0x00 }, { 0x34, 0x00 }, { 0x35, 0x00 }, { 0x36, 0x00 }, { 0x37, 0x00 }, { 0x38, 0x00 }, { 0x39, 0x00 }, { 0x3a, 0x00 }, { 0x3b, 0x00 }, { 0x3c, 0x00 }, { 0x3d, 0x00 }, { 0x3e, 0x00 }, { 0x3f, 0x00 }, { 0x40, 0x08 }, { 0x41, 0x00 }, { 0x42, 0x00 }, { 0x43, 0x00 }, { 0x44, 0x00 }, { 0x45, 0x00 }, { 0x46, 0x00 }, { 0x47, 0x00 }, { 0x48, 0x00 }, { 0x49, 0x00 }, { 0x4a, 0x00 }, { 0x4b, 0x00 }, { 0x4c, 0x00 }, { 0x4d, 0x00 }, { 0x4e, 0x00 }, { 0x4f, 0x00 }, { 0x50, 0x00 }, { 0x51, 0x00 }, { 0x52, 0x00 }, { 0x53, 0x00 }, { 0x54, 0x08 }, { 0x55, 0x00 }, { 0x56, 0x00 }, { 0x57, 0x00 }, { 0x58, 0x00 }, { 0x59, 0x00 }, { 0x5a, 0x00 }, { 0x5b, 0x00 }, { 0x5c, 0x00 }, { 0x5d, 0x00 }, { 0x5e, 0x00 }, { 0x5f, 0x00 }, { 0x60, 0x00 }, { 0x61, 0x00 }, { 0x62, 0x00 }, { 0x63, 0x00 }, { 0x64, 0x00 }, { 0x65, 0x00 }, { 0x66, 0x00 }, { 0x67, 0x00 }, { 0x68, 0x08 }, { 0x69, 0x00 }, { 0x6a, 0x00 }, { 0x6b, 0x00 }, { 0x6c, 0x00 }, { 0x6d, 0x00 }, { 0x6e, 0x00 }, { 0x6f, 0x00 }, { 0x70, 0x00 }, { 0x71, 0x00 }, { 0x72, 0x00 }, { 0x73, 0x00 }, { 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x00 }, { 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x00 }, { 0x7a, 0x00 }, { 0x7b, 0x00 }, //postEq { 0x00, 0x26 }, { 0x40, 0x08 }, { 0x41, 0x00 }, { 0x42, 0x00 }, { 0x43, 0x00 }, { 0x44, 0x00 }, { 0x45, 0x00 }, { 0x46, 0x00 }, { 0x47, 0x00 }, { 0x48, 0x00 }, { 0x49, 0x00 }, { 0x4a, 0x00 }, { 0x4b, 0x00 }, { 0x4c, 0x00 }, { 0x4d, 0x00 }, { 0x4e, 0x00 }, { 0x4f, 0x00 }, { 0x50, 0x00 }, { 0x51, 0x00 }, { 0x52, 0x00 }, { 0x53, 0x00 }, { 0x00, 0x28 }, { 0x7c, 0x08 }, { 0x7d, 0x00 }, { 0x7e, 0x00 }, { 0x7f, 0x00 }, { 0x00, 0x29 }, { 0x08, 0x00 }, { 0x09, 0x00 }, { 0x0a, 0x00 }, { 0x0b, 0x00 }, { 0x0c, 0x00 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 }, { 0x10, 0x00 }, { 0x11, 0x00 }, { 0x12, 0x00 }, { 0x13, 0x00 }, { 0x14, 0x00 }, { 0x15, 0x00 }, { 0x16, 0x00 }, { 0x17, 0x00 }, { 0x00, 0x2e }, { 0x7c, 0x08 }, { 0x7d, 0x00 }, { 0x7e, 0x00 }, { 0x7f, 0x00 }, { 0x00, 0x2f }, { 0x08, 0x00 }, { 0x09, 0x00 }, { 0x0a, 0x00 }, { 0x0b, 0x00 }, { 0x0c, 0x00 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 }, { 0x10, 0x00 }, { 0x11, 0x00 }, { 0x12, 0x00 }, { 0x13, 0x00 }, { 0x14, 0x00 }, { 0x15, 0x00 }, { 0x16, 0x00 }, { 0x17, 0x00 }, { 0x1c, 0x08 }, { 0x1d, 0x00 }, { 0x1e, 0x00 }, { 0x1f, 0x00 }, { 0x20, 0x00 }, { 0x21, 0x00 }, { 0x22, 0x00 }, { 0x23, 0x00 }, { 0x24, 0x00 }, { 0x25, 0x00 }, { 0x26, 0x00 }, { 0x27, 0x00 }, { 0x28, 0x00 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x00 }, { 0x2c, 0x00 }, { 0x2d, 0x00 }, { 0x2e, 0x00 }, { 0x2f, 0x00 }, //drc { 0x00, 0x00 }, { 0x7f, 0x8c }, { 0x00, 0x2b }, { 0x34, 0x00 }, { 0x35, 0x0d }, { 0x36, 0xa6 }, { 0x37, 0x86 }, { 0x38, 0x00 }, { 0x39, 0x0d }, { 0x3a, 0xa6 }, { 0x3b, 0x86 }, { 0x3c, 0x00 }, { 0x3d, 0x06 }, { 0x3e, 0xd3 }, { 0x3f, 0x72 }, { 0x40, 0x00 }, { 0x41, 0x00 }, { 0x42, 0x00 }, { 0x43, 0x00 }, { 0x44, 0x00 }, { 0x45, 0x00 }, { 0x46, 0x00 }, { 0x47, 0x00 }, { 0x48, 0xff }, { 0x49, 0x81 }, { 0x4a, 0x47 }, { 0x4b, 0xae }, { 0x4c, 0xf9 }, { 0x4d, 0xda }, { 0x4e, 0xbc }, { 0x4f, 0x21 }, { 0x50, 0xfd }, { 0x51, 0x2d }, { 0x52, 0x26 }, { 0x53, 0x01 }, { 0x54, 0x00 }, { 0x55, 0x00 }, { 0x56, 0x00 }, { 0x57, 0x00 }, { 0x58, 0x00 }, { 0x59, 0x00 }, { 0x5a, 0x00 }, { 0x5b, 0x00 }, { 0x00, 0x2d }, { 0x58, 0x01 }, { 0x59, 0x53 }, { 0x5a, 0x8f }, { 0x5b, 0xcc }, { 0x5c, 0x01 }, { 0x5d, 0x53 }, { 0x5e, 0x8f }, { 0x5f, 0xcc }, { 0x60, 0x00 }, { 0x61, 0x03 }, { 0x62, 0x69 }, { 0x63, 0xc5 }, { 0x64, 0x00 }, { 0x65, 0x00 }, { 0x66, 0x00 }, { 0x67, 0x00 }, { 0x68, 0x00 }, { 0x69, 0x00 }, { 0x6a, 0x00 }, { 0x6b, 0x00 }, { 0x6c, 0xff }, { 0x6d, 0x81 }, { 0x6e, 0x47 }, { 0x6f, 0xae }, { 0x70, 0xf9 }, { 0x71, 0xda }, { 0x72, 0xbc }, { 0x73, 0x21 }, { 0x74, 0xfd }, { 0x75, 0x2d }, { 0x76, 0x26 }, { 0x77, 0x01 }, { 0x78, 0x00 }, { 0x79, 0x00 }, { 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x00 }, { 0x7d, 0x00 }, { 0x7e, 0x00 }, { 0x7f, 0x00 }, //dpeq { 0x00, 0x00 }, { 0x7f, 0xaa }, { 0x00, 0x2e }, { 0x40, 0x07 }, { 0x41, 0xfa }, { 0x42, 0xa6 }, { 0x43, 0x1b }, { 0x44, 0xf0 }, { 0x45, 0x0a }, { 0x46, 0xb3 }, { 0x47, 0xc9 }, { 0x48, 0x07 }, { 0x49, 0xfa }, { 0x4a, 0xa6 }, { 0x4b, 0x1b }, { 0x4c, 0x0f }, { 0x4d, 0xf5 }, { 0x4e, 0x4a }, { 0x4f, 0x6c }, { 0x50, 0xf8 }, { 0x51, 0x0a }, { 0x52, 0xb1 }, { 0x53, 0xff }, { 0x00, 0x00 }, { 0x7f, 0x8c }, { 0x00, 0x2d }, { 0x30, 0x00 }, { 0x31, 0x03 }, { 0x32, 0x69 }, { 0x33, 0xc5 }, { 0x34, 0x04 }, { 0x35, 0x0c }, { 0x36, 0x37 }, { 0x37, 0x14 }, { 0x38, 0x1c }, { 0x39, 0x1b }, { 0x3a, 0xf0 }, { 0x3b, 0x41 }, { 0x00, 0x00 }, { 0x7f, 0xaa }, { 0x00, 0x2a }, { 0x5c, 0x08 }, { 0x5d, 0x00 }, { 0x5e, 0x00 }, { 0x5f, 0x00 }, { 0x60, 0xf0 }, { 0x61, 0xbc }, { 0x62, 0xdb }, { 0x63, 0x13 }, { 0x64, 0x07 }, { 0x65, 0x4b }, { 0x66, 0x87 }, { 0x67, 0x16 }, { 0x68, 0x0f }, { 0x69, 0x43 }, { 0x6a, 0x24 }, { 0x6b, 0xed }, { 0x6c, 0xf8 }, { 0x6d, 0xb4 }, { 0x6e, 0x78 }, { 0x6f, 0xea }, { 0x70, 0x08 }, { 0x71, 0x05 }, { 0x72, 0xad }, { 0x73, 0xb6 }, { 0x74, 0xf0 }, { 0x75, 0x06 }, { 0x76, 0x49 }, { 0x77, 0xe5 }, { 0x78, 0x07 }, { 0x79, 0xf4 }, { 0x7a, 0x13 }, { 0x7b, 0x62 }, { 0x7c, 0x0f }, { 0x7d, 0xf9 }, { 0x7e, 0xb6 }, { 0x7f, 0x1b }, { 0x00, 0x2b }, { 0x08, 0xf8 }, { 0x09, 0x06 }, { 0x0a, 0x3e }, { 0x0b, 0xe8 }, { 0x00, 0x2a }, { 0x34, 0x00 }, { 0x35, 0x00 }, { 0x36, 0xc8 }, { 0x37, 0xbc }, { 0x38, 0x00 }, { 0x39, 0x00 }, { 0x3a, 0xc8 }, { 0x3b, 0xbc }, { 0x3c, 0x00 }, { 0x3d, 0x00 }, { 0x3e, 0xc8 }, { 0x3f, 0xbc }, { 0x40, 0x7f }, { 0x41, 0x1c }, { 0x42, 0x87 }, { 0x43, 0x2b }, { 0x44, 0x81 }, { 0x45, 0xc3 }, { 0x46, 0xce }, { 0x47, 0xba }, { 0x48, 0x00 }, { 0x49, 0x00 }, { 0x4a, 0xc8 }, { 0x4b, 0xbc }, { 0x4c, 0x00 }, { 0x4d, 0x00 }, { 0x4e, 0xc8 }, { 0x4f, 0xbc }, { 0x50, 0x00 }, { 0x51, 0x00 }, { 0x52, 0xc8 }, { 0x53, 0xbc }, { 0x54, 0x7f }, { 0x55, 0x1c }, { 0x56, 0x87 }, { 0x57, 0x2b }, { 0x58, 0x81 }, { 0x59, 0xc3 }, { 0x5a, 0xce }, { 0x5b, 0xba }, { 0x00, 0x2b }, { 0x0c, 0x7f }, { 0x0d, 0x1d }, { 0x0e, 0x4f }, { 0x0f, 0xe7 }, { 0x10, 0x80 }, { 0x11, 0xe2 }, { 0x12, 0xb0 }, { 0x13, 0x19 }, { 0x14, 0x7f }, { 0x15, 0x1d }, { 0x16, 0x4f }, { 0x17, 0xe7 }, { 0x18, 0x7f }, { 0x19, 0x1c }, { 0x1a, 0x87 }, { 0x1b, 0x2b }, { 0x1c, 0x81 }, { 0x1d, 0xc3 }, { 0x1e, 0xce }, { 0x1f, 0xba }, { 0x20, 0x7f }, { 0x21, 0x1d }, { 0x22, 0x4f }, { 0x23, 0xe7 }, { 0x24, 0x80 }, { 0x25, 0xe2 }, { 0x26, 0xb0 }, { 0x27, 0x19 }, { 0x28, 0x7f }, { 0x29, 0x1d }, { 0x2a, 0x4f }, { 0x2b, 0xe7 }, { 0x2c, 0x7f }, { 0x2d, 0x1c }, { 0x2e, 0x87 }, { 0x2f, 0x2b }, { 0x30, 0x81 }, { 0x31, 0xc3 }, { 0x32, 0xce }, { 0x33, 0xba }, //drc mixer gain { 0x00, 0x00 }, { 0x7f, 0x8c }, { 0x00, 0x2e }, { 0x10, 0x00 }, { 0x11, 0x80 }, { 0x12, 0x00 }, { 0x13, 0x00 }, { 0x08, 0x00 }, { 0x09, 0x80 }, { 0x0a, 0x00 }, { 0x0b, 0x00 }, { 0x18, 0x00 }, { 0x19, 0x80 }, { 0x1a, 0x00 }, { 0x1b, 0x00 }, { 0x1c, 0x40 }, { 0x1d, 0x00 }, { 0x1e, 0x00 }, { 0x1f, 0x00 }, { 0x20, 0x40 }, { 0x21, 0x00 }, { 0x22, 0x00 }, { 0x23, 0x00 }, //Register Tuning { 0x00, 0x00 }, { 0x7f, 0x00 }, { 0x02, 0x31 }, { 0x30, 0x01 }, { 0x4c, 0x30 }, { 0x53, 0x41 }, { 0x54, 0x00 }, { 0x60, 0x01 }, { 0x61, 0x0b }, { 0x03, 0x03 }, { 0x78, 0x80 }, };
Sorry, I can't compile the code, I will give it to the software engineer to deal with, tomorrow we will test to see if it is feasible, thank you!
Hello, I sent the header file you gave me to the software engineer yesterday, he generated the firmware for me to upgrade my machine, but the test was still the same, the bass enhancement function and DRC did not start, why?
I don't know if your tool also has this problem. For example, after importing the EQ parameter, I can control my machine to play music through the tool setting 0X5C, but you will find that the switch of DBE/DDE/DEQ can be turned off and on again (see the attached figure), and the bass enhancement will be effective, and then the bass will be much better.You need to play it at a medium volume to make it sound better.There is also DRC, which requires you to enter the DRC control interface and turn each switch off and on again (see the attached figure).
The last Equalizer is the same with this function, which requires you to enter the interface and operate the spicture.rarwitch of each EQ parameter point to return the correct sound (see the attached picture).
Hi Kecheng
switch of DBE/DDE/DEQ can be turned off and on again (see the attached figure), and the bass enhancement will be effective, and then the bass will be much better.You need to play it at a medium volume to make it sound better.There is also DRC, which requires you to enter the DRC control interface and turn each switch off and on again (see the attached figure).
I won't doubt that. Switch off and on again, PPC3 will write the correct I2C codes into TAS5822.
he generated the firmware for me to upgrade my machine, but the test was still the same, the bass enhancement function and DRC did not start, why?
We may need to find out what happens during this process. You mentioned the software team's help, can you give more details about what they do? And can we make sure the I2C script is still totally the same after they made some changes? And how do you finally used these codes? Are they successfully been written?
switch of DBE/DDE/DEQ can be turned off and on again (see the attached figure), and the bass enhancement will be effective, and then the bass will be much better.You need to play it at a medium volume to make it sound better.There is also DRC, which requires you to enter the DRC control interface and turn each switch off and on again (see the attached figure).
I won't doubt that. Switch off and on again, PPC3 will write the correct I2C codes into TAS5822.
Hello, thank you for your reply.Can I understand it this way, after our PPC3 tool imports my EQ file BS1 5822 0XC5 08021_03.PPC3, it must change the DBE/DDE/DEQ and DRC (DRC can only change the LOW and HIGN switches,It is useless to change the DRC main switch) The two functions can be turned off and then turned on to start the control, is that right?If this is the case, then we also understand at this moment, we exported the file BS1 5822 0X5C 08021_03.h to the software engineer, whether this switch should also be operated like this last time, close and open, because we operate in this way, the bass enhancement function is realized,However, since the LOW and hign switches of DRC were turned on and off, the program was confused and the sound was uncontrollable. Is there something wrong with the initialization file of our engineer?
This is the code written by our software engineer, please check whether it is correct, mainly DRC can not control, thank you!
#include <stdlib.h> #include <ps.h> #include <vmtypes.h> #include <bdaddr.h> #include <byte_utils.h> #include "sink_private_data.h" #include "sink_dut.h" #include "sink_malloc_debug.h" #include "sink_configmanager.h" #include <local_device.h> #include "sink_audio_routing.h" #include "sink_volume.h" #include "sink_a2dp.h" #include "sink_wired.h" #include "vmal.h" #include "sink_main_task.h" #include "rtime.h" #include "sink_audio_indication.h" #include "sink_pio.h" #include "sink_i2c.h" #include "driver_tpa5828.h" #include "sink_user.h" #define BIT(x) (1 << (x)) #define TAS5828_DEVICE_CTRL_2 0x03 #define TSA5828_VOL_MAX 32 static const uint32_t TAS5828_VOL_TABLE[TSA5828_VOL_MAX + 1] = { 0x0000001b, // Volume = 0, -110db 0x0000679f, // Volume = 1 -50db 0x0000b845, // Volume = 2 -45db 0x000147ae, // Volume = 3 -40db 0x00019c86, // Volume = 4 -38db 0x00020756, // Volume = 5 -36db 0x00028dcf, // Volume = 6 -34db 0x00033718, // Volume = 7 -32db 0x00040c37, // Volume = 8 -30db 0x00066a4a, // Volume = 9 -26db 0x00081385, // Volume = 10 -24db 0x00090fcc, // Volume = 11 -23db 0x000a2adb, // Volume = 12 -22db 0x000b6873, // Volume = 13 -21db 0x000ccccd, // Volume = 14 -20db 0x000e5ca1, // Volume = 15 -19db 0x00101d3f, // Volume = 16 -18db 0x0012149a, // Volume = 17 -17db 0x00144961, // Volume = 18 -16db 0x0016c311, // Volume = 19 -15db 0x00198a13, // Volume = 20 -14db 0x001ca7d7, // Volume = 21 -13db 0x002026f3, // Volume = 22 -12db 0x00241347, // Volume = 23 -11db 0x00287a27, // Volume = 24 -10db 0x002d6a86, // Volume = 25 -09db 0x0032f52d, // Volume = 26 -08db 0x00392cee, // Volume = 27 -07db 0x004026e7, // Volume = 28 -06db 0x0047facd, // Volume = 29 -05db 0x0050c336, // Volume = 30 -04db 0x00721483, // Volume = 31 -01db 0x00800000, // Volume = 32 +00db }; static uint8_t bsp_tas5828_sfr_write(uint8_t addr, uint8_t dat) { return user_i2c_write_byte(addr, dat); } static uint8_t bsp_tas5828_sfr_read(uint8_t addr) { uint8_t dat; user_i2c_read(addr, &dat, 1); return dat; } static void bsp_tas5828_write_buffer(uint8_t addr, uint8_t *buffer, uint8_t len) { uint8_t sBuf[21]; sBuf[0] = addr; memcpy(&sBuf[1], buffer, len); user_i2c_write_buffer(sBuf, len + 1); } static rtime_t SystemClockGetTimerTime(void) { return (rtime_t)VmGetTimerTime(); } static void tas5828_delay(uint16_t v_msec_16) { uint32_t v_delay = SystemClockGetTimerTime() + (v_msec_16 * 1000) + 1; while (((int32_t)(SystemClockGetTimerTime() - v_delay)) < 0) ; } uint8_t TAS5828_SendInitCmd( uint8_t DevAddr , const tas5828_cmd_t *cmd, uint32_t cmd_size) { uint32_t i; uint8_t ret = 0xff , error = 0; init_start: user_i2c_change_device_addr(DevAddr); for (i = 0; i < cmd_size; i++) { if (cmd[i].cmd == CFG_META_DELAY) { tas5828_delay(cmd[i].parm); } else if (cmd[i].cmd == CFG_META_BURST) { user_i2c_write_buffer((unsigned char *)&cmd[i+1], cmd[i].parm); i += (cmd[i].parm / 2) + 1; } else { ret = user_i2c_write_buffer((unsigned char *)&cmd[i], 2); //ret = bsp_tas5828_sfr_write(cmd[i].cmd, cmd[i].parm); if (ret != 0) { break; } } } if (ret == 0) { printf("******** TAS5828 0x%x DriverInit Success**********\n", DevAddr); if(DevAddr == TAS_SPEAKER) { MessageCancelAll(&theSink.task, EventTas5828InitSuccess); MessageSend(&theSink.task, EventTas5828InitSuccess, NULL); } } else { if(++error < 3) { printf("******** TAS5828 0x%x DriverInit Error**********%d\n", DevAddr, ret); goto init_start; } if(DevAddr == TAS_SPEAKER) { MessageCancelAll(&theSink.task, EventTas5828Init); MessageSendLater(&theSink.task, EventTas5828Init, NULL, 2000); } } return ret; } /*uint8_t TAS5828_SendInitCmd( uint8_t DevAddr , const tas5828_cmd_t *cmd, uint32_t cmd_size) { uint32_t i; uint8_t ret = 0xff , error = 0; init_start: user_i2c_change_device_addr(DevAddr); for (i = 0; i < cmd_size; i++) { if (cmd[i].cmd == CFG_META_DELAY) { tas5828_delay(cmd[i].parm); } else { ret = bsp_tas5828_sfr_write(cmd[i].cmd, cmd[i].parm); if (ret != 0) { break; } } } if (ret == 0) { printf("******** TAS5828 0x%x DriverInit Success**********\n", DevAddr); if(DevAddr == TAS_SPEAKER) { MessageCancelAll(&theSink.task, EventTas5828InitSuccess); MessageSend(&theSink.task, EventTas5828InitSuccess, NULL); } } else { if(++error < 3) { printf("******** TAS5828 0x%x DriverInit Error**********%d\n", DevAddr, ret); goto init_start; } if(DevAddr == TAS_SPEAKER) { MessageCancelAll(&theSink.task, EventTas5828Init); MessageSendLater(&theSink.task, EventTas5828Init, NULL, 2000); } } return ret; }*/ static void bsp_tas5828_play(void) { uint8_t rdat; rdat = bsp_tas5828_sfr_read(TAS5828_DEVICE_CTRL_2); rdat |= BIT(0) | BIT(1); bsp_tas5828_sfr_write(TAS5828_DEVICE_CTRL_2, rdat); } static void bsp_tas5828_sleep(void) { uint8_t rdat; rdat = bsp_tas5828_sfr_read(TAS5828_DEVICE_CTRL_2); rdat &= ~(BIT(0) | BIT(1)); bsp_tas5828_sfr_write(TAS5828_DEVICE_CTRL_2, rdat); } static void bsp_tas5828_Hiz(void) { uint8_t rdat; rdat = bsp_tas5828_sfr_read(TAS5828_DEVICE_CTRL_2); rdat &= ~(BIT(0) | BIT(1)); rdat |= BIT(1); bsp_tas5828_sfr_write(TAS5828_DEVICE_CTRL_2, rdat); } static void bsp_tas5828_set_vol(uint8_t vol) { uint32_t vol_value; if (vol > TSA5828_VOL_MAX) vol = TSA5828_VOL_MAX; vol_value = TAS5828_VOL_TABLE[vol]; bsp_tas5828_sfr_write(0x00, 0x00); // page 0 bsp_tas5828_sfr_write(0x7F, 0x8C); // book 8c bsp_tas5828_sfr_write(0x00, 0x2A); // page 2A uint8_t buf[4]; buf[0] = (vol_value >> 24) & 0xff; buf[1] = (vol_value >> 16) & 0xff; buf[2] = (vol_value >> 8) & 0xff; buf[3] = (vol_value >> 0) & 0xff; bsp_tas5828_write_buffer(0x24, buf, 4); bsp_tas5828_write_buffer(0x28, buf, 4); bsp_tas5828_sfr_write(0x00, 0x00); // page 0 bsp_tas5828_sfr_write(0x7F, 0x00); // book 0 } static void bsp_tas5828_mute(void) { uint8_t rdat; bsp_tas5828_sfr_write(0x00, 0x00); bsp_tas5828_sfr_write(0x7F, 0x00); bsp_tas5828_sfr_write(0x00, 0x00); rdat = bsp_tas5828_sfr_read(TAS5828_DEVICE_CTRL_2); rdat |= BIT(3); bsp_tas5828_sfr_write(0x00, 0x00); bsp_tas5828_sfr_write(0x7F, 0x00); bsp_tas5828_sfr_write(0x00, 0x00); bsp_tas5828_sfr_write(TAS5828_DEVICE_CTRL_2, rdat); } static void bsp_tas5828_unmute(void) { uint8_t rdat; bsp_tas5828_sfr_write(0x00, 0x00); bsp_tas5828_sfr_write(0x7F, 0x00); bsp_tas5828_sfr_write(0x00, 0x00); rdat = bsp_tas5828_sfr_read(TAS5828_DEVICE_CTRL_2); rdat &= ~BIT(3); bsp_tas5828_sfr_write(0x00, 0x00); bsp_tas5828_sfr_write(0x7F, 0x00); bsp_tas5828_sfr_write(0x00, 0x00); bsp_tas5828_sfr_write(TAS5828_DEVICE_CTRL_2, rdat); } static void bsp_tas5828_clear_fault(void) { bsp_tas5828_sfr_write(0x78, 0x80); } void TAS5828_SendVolume(uint8_t DevAddr, uint8_t vol) { user_i2c_change_device_addr(DevAddr); bsp_tas5828_set_vol(vol); } uint8_t bass_buf[16][20] = { 0x07,0xf8,0xca,0x9c,0xf0,0x15,0x2c,0x06,0x07,0xf2,0x1f,0xb6,0x0f,0xea,0xd3,0xfa,0xf8,0x15,0x15,0xae,//-10 0x07,0xfa,0xf4,0x51,0xf0,0x10,0xda,0x71,0x07,0xf4,0x47,0x9c,0x0f,0xef,0x25,0x8f,0xf8,0x10,0xc4,0x13,//-8 0x07,0xfb,0xdd,0x39,0xf0,0x0f,0x09,0x65,0x07,0xf5,0x2f,0xc2,0x0f,0xf0,0xf6,0x9b,0xf8,0x0e,0xf3,0x05,//-7 0x07,0xfc,0xac,0xfa,0xf0,0x0d,0x6a,0x93,0x07,0xf5,0xfe,0xd5,0x0f,0xf2,0x95,0x6d,0xf8,0x0d,0x54,0x30,//-6 0x07,0xfd,0x66,0x47,0xf0,0x0b,0xf8,0x96,0x07,0xf6,0xb7,0x87,0x0f,0xf4,0x07,0x6a,0xf8,0x0b,0xe2,0x31,//-5 0x07,0xfe,0x9e,0xea,0xf0,0x09,0x88,0x5a,0x07,0xf7,0xef,0x24,0x0f,0xf6,0x77,0xa6,0xf8,0x09,0x71,0xf1,//-3 0x07,0xff,0x22,0x55,0xf0,0x08,0x81,0xf2,0x07,0xf8,0x72,0x22,0x0f,0xf7,0x7e,0x0e,0xf8,0x08,0x6b,0x89,//-2 0x07,0xff,0x97,0x84,0xf0,0x07,0x97,0xf8,0x07,0xf8,0xe6,0xef,0x0f,0xf8,0x68,0x08,0xf8,0x07,0x81,0x8d,//-1 0x08,0x00,0x00,0x00,0xf0,0x06,0xc7,0x59,0x07,0xf9,0x4f,0x13,0x0f,0xf9,0x38,0xa7,0xf8,0x06,0xb0,0xed,//0 0x08,0x00,0x68,0x81,0xf0,0x06,0xc7,0x59,0x07,0xf8,0xe6,0x92,0x0f,0xf9,0x38,0xa7,0xf8,0x06,0xb0,0xed,//1 0x08,0x00,0xdd,0xc2,0xf0,0x06,0xc7,0x59,0x07,0xf8,0x71,0x50,0x0f,0xf9,0x38,0xa7,0xf8,0x06,0xb0,0xed,//2 0x08,0x01,0x61,0x53,0xf0,0x06,0xc7,0x59,0x07,0xf7,0xed,0xc0,0x0f,0xf9,0x38,0xa7,0xf8,0x06,0xb0,0xed,//3 0x08,0x02,0x9a,0x91,0xf0,0x06,0xc7,0x59,0x07,0xf6,0xb4,0x82,0x0f,0xf9,0x38,0xa7,0xf8,0x06,0xb0,0xed,//5 0x08,0x03,0x54,0x68,0xf0,0x06,0xc7,0x59,0x07,0xf5,0xfa,0xab,0x0f,0xf9,0x38,0xa7,0xf8,0x06,0xb0,0xed,//6 0x08,0x04,0x24,0xeb,0xf0,0x06,0xc7,0x59,0x07,0xf5,0x2a,0x28,0x0f,0xf9,0x38,0xa7,0xf8,0x06,0xb0,0xed,//7 0x08,0x05,0x0e,0xe0,0xf0,0x06,0xc7,0x59,0x07,0xf4,0x40,0x33,0x0f,0xf9,0x38,0xa7,0xf8,0x06,0xb0,0xed,//8 }; void TAS5828_bass_SendVolume(uint8_t DevAddr, uint8_t vol) { user_i2c_change_device_addr(DevAddr); bsp_tas5828_sfr_write(0x00, 0x00); bsp_tas5828_sfr_write(0x7F, 0xAA); bsp_tas5828_sfr_write(0x00, 0x24); bsp_tas5828_write_buffer(0x40, bass_buf[vol], 20); } uint8_t tre_buf_1[16][4] = { 0x03,0xcd,0x30,0x07,//-13 0x04,0x6a,0x65,0x44,//-11 0x04,0xbc,0xab,0xdc,//-10 0x05,0x10,0xcb,0x3c,//-9 0x05,0xbc,0x80,0xc4,//-7 0x06,0x69,0x1c,0x59,//-5 0x07,0x12,0x1c,0xc5,//-3 0x07,0x63,0xf1,0x37,//-2 0x07,0xb3,0x5e,0xd2,//-1 0x08,0x00,0x00,0x00,//0 0x08,0x4f,0x9b,0xb9,//1 0x08,0xa8,0xee,0x25,//2 0x09,0x0d,0x26,0xb2,//3 0x09,0x7d,0x99,0xd1,//4 0x09,0xfb,0xc5,0x80,//5 0x0a,0x89,0x56,0x57,//6 }; uint8_t tre_buf_2[16][16] = { 0xfb,0xe3,0xc2,0x2c,0x01,0x61,0x22,0x41,0x04,0x1c,0x3d,0xd4,0x02,0xd1,0xad,0xb9,//-13 0xfb,0x39,0xc7,0xbc,0x01,0x9a,0x2d,0xc3,0x04,0xc6,0x38,0x44,0x01,0xfb,0x6c,0xf9,//-11 0xfa,0xe0,0xd2,0x2f,0x01,0xb8,0x08,0x99,0x05,0x1f,0x2d,0xd1,0x01,0x8b,0x4b,0x8a,//-10 0xfa,0x85,0xdd,0x73,0x01,0xd6,0x8e,0xfd,0x05,0x7a,0x22,0x8d,0x01,0x18,0xa5,0xc7,//-9 0xf9,0xcc,0x35,0x2a,0x02,0x14,0xdd,0x8d,0x06,0x33,0xca,0xd6,0x00,0x2e,0xa1,0xaf,//-7 0xf9,0x11,0x94,0x24,0x02,0x53,0x7f,0x97,0x06,0xee,0x6b,0xdc,0xff,0x43,0x64,0x10,//-5 0xf8,0x5a,0xd9,0x44,0x02,0x90,0xd2,0xa7,0x07,0xa5,0x26,0xbc,0xfe,0x5d,0x10,0x94,//-3 0xf8,0x02,0x5f,0x23,0x02,0xae,0x84,0x11,0x07,0xfd,0xa0,0xdd,0xfd,0xed,0x8a,0xb8,//-2 0xf7,0xac,0x7d,0xcb,0x02,0xcb,0x56,0x62,0x08,0x53,0x82,0x35,0xfd,0x81,0x4a,0xcc,//-1 0xf7,0x59,0xa3,0x12,0x02,0xe7,0x24,0xbb,0x08,0xa6,0x5c,0xee,0xfd,0x18,0xdb,0x45,//0 0xf7,0x59,0xa3,0x12,0x02,0x97,0x89,0x02,0x08,0xa6,0x5c,0xee,0xfd,0x18,0xdb,0x45,//1 0xf7,0x59,0xa3,0x12,0x02,0x3e,0x36,0x96,0x08,0xa6,0x5c,0xee,0xfd,0x18,0xdb,0x45,//2 0xf7,0x59,0xa3,0x12,0x01,0xd9,0xfe,0x09,0x08,0xa6,0x5c,0xee,0xfd,0x18,0xdb,0x45,//3 0xf7,0x59,0xa3,0x12,0x01,0x69,0x8a,0xea,0x08,0xa6,0x5c,0xee,0xfd,0x18,0xdb,0x45,//4 0xf7,0x59,0xa3,0x12,0x00,0xeb,0x5f,0x3b,0x08,0xa6,0x5c,0xee,0xfd,0x18,0xdb,0x45,//5 0xf7,0x59,0xa3,0x12,0x00,0x5d,0xce,0x64,0x08,0xa6,0x5c,0xee,0xfd,0x18,0xdb,0x45,//6 }; void TAS5828_tre_SendVolume(uint8_t DevAddr, uint8_t vol) { user_i2c_change_device_addr(DevAddr); bsp_tas5828_sfr_write(0x00, 0x00); bsp_tas5828_sfr_write(0x7F, 0xAA); bsp_tas5828_sfr_write(0x00, 0x25); bsp_tas5828_write_buffer(0x7c, tre_buf_1[vol], 4); bsp_tas5828_sfr_write(0x00, 0x00); bsp_tas5828_sfr_write(0x7F, 0xAA); bsp_tas5828_sfr_write(0x00, 0x26); bsp_tas5828_write_buffer(0x08, tre_buf_2[vol], 16); } uint8_t sum_buf[16][4] = { 0x00,0x00,0x00,0x1b,//-110 0x00,0x03,0x37,0x18,//-14 0x00,0x05,0xb7,0xb1,//-13 0x00,0x0a,0x2a,0xdb,//-12 0x00,0x0c,0xcc,0xcd,//-11 0x00,0x10,0x1d,0x3f,//-10 0x00,0x14,0x49,0x61,//-9 0x00,0x19,0x8a,0x13,//-8 0x00,0x20,0x26,0xf3,//-7 0x00,0x28,0x7a,0x27,//-6 0x00,0x32,0xf5,0x2d,//-5 0x00,0x39,0x2c,0xee,//-4 0x00,0x40,0x26,0xe7,//-3 0x00,0x50,0xc3,0x36,//-2 0x00,0x65,0xac,0x8c,//-1 0x00,0x80,0x00,0x00,//0 }; void TAS5828_sum_SendVolume(uint8_t DevAddr, uint8_t vol) { user_i2c_change_device_addr(DevAddr); bsp_tas5828_sfr_write(0x00, 0x00); // page 0 bsp_tas5828_sfr_write(0x7F, 0x8C); // book 8c bsp_tas5828_sfr_write(0x00, 0x2A); // page 2A bsp_tas5828_write_buffer(0x24, sum_buf[vol], 4); bsp_tas5828_sfr_write(0x00, 0x00); // page 0 bsp_tas5828_sfr_write(0x7F, 0x8C); // book 8c bsp_tas5828_sfr_write(0x00, 0x2A); // page 2A bsp_tas5828_write_buffer(0x28, sum_buf[vol], 4); } void TAS5828_bass_open(uint8_t DevAddr) { uint8_t data_1[20] = {0x08,0x00,0x00,0x00,0xf0,0xbc,0xdb,0x13,0x07,0x4b,0x87,0x16,0x0f,0x43,0x24,0xed,0xf8,0xb4,0x78,0xea}; uint8_t data_2[16] = {0x08,0x05,0xad,0xb6,0xf0,0x06,0x49,0xe5,0x07,0xf4,0x13,0x62,0x0f,0xf9,0xb6,0x1b}; uint8_t data_3[4] = {0xF8,0x06,0x3E,0xe8}; uint8_t data_4[20] = {0x07,0xfa,0xa6,0x1b,0xf0,0x0a,0xb3,0xc9,0x07,0xfa,0xa6,0x1b,0x0f,0xf5,0x4a,0x6c,0xf8,0x0a,0xb1,0xff}; user_i2c_change_device_addr(DevAddr); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0xAA); // bsp_tas5828_sfr_write(0x00, 0x2A); // bsp_tas5828_write_buffer(0x5C, data_1, 20); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0xAA); // bsp_tas5828_sfr_write(0x00, 0x2A); // bsp_tas5828_write_buffer(0x70, data_2, 16); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0xAA); // bsp_tas5828_sfr_write(0x00, 0x2B); // bsp_tas5828_write_buffer(0x08, data_3, 4); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0xAA); // bsp_tas5828_sfr_write(0x00, 0x2E); // bsp_tas5828_write_buffer(0x40, data_4, 20); } void TAS5828_DRC_open(uint8_t DevAddr) { user_i2c_change_device_addr(DevAddr); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0x00); // bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x66, 0x04); // } void TAS5828_BASS_DRC_open(uint8_t DevAddr) { uint8_t data_1[40] = {0x00,0x0d,0xa6,0x86,0x00,0x0d,0xa6,0x86,0x00,0x06,0xd3,0x72,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x81,0x47,0xae,0xf9,0xda,0xbc,0x21,0xfd,0x2d,0x26,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; uint8_t data_2[20] = {0x00,0x00,0xc8,0xbc,0x00,0x00,0xc8,0xbc,0x00,0x00,0xc8,0xbc,0x7f,0x1c,0x87,0x2b,0x81,0xc3,0xce,0xba}; uint8_t data_3[20] = {0x00,0x00,0xc8,0xbc,0x00,0x00,0xc8,0xbc,0x00,0x00,0xc8,0xbc,0x7f,0x1c,0x87,0x2b,0x81,0xc3,0xce,0xba}; uint8_t data_4[4] = {0x00,0x80,0x00,0x00}; user_i2c_change_device_addr(DevAddr); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0x8C); // bsp_tas5828_sfr_write(0x00, 0x2B); // bsp_tas5828_write_buffer(0x34, data_1, 40); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0xAA); // bsp_tas5828_sfr_write(0x00, 0x2A); // bsp_tas5828_write_buffer(0x34, data_2, 20); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0xAA); // bsp_tas5828_sfr_write(0x00, 0x2A); // bsp_tas5828_write_buffer(0x48, data_3, 20); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0x8C); // bsp_tas5828_sfr_write(0x00, 0x2E); // bsp_tas5828_write_buffer(0x08, data_4, 4); } void TAS5828_TRE_DRC_open(uint8_t DevAddr) { uint8_t data_1[40] = {0x01,0x53,0x8f,0xcc,0x01,0x53,0x8f,0xcc,0x00,0x03,0x69,0xc5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x81,0x47,0xae,0xf9,0xda,0xbc,0x21,0xfd,0x2d,0x26,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; uint8_t data_2[20] = {0x7f,0x1d,0x4f,0xe7,0x80,0xe2,0xb0,0x19,0x7f,0x1d,0x4f,0xe7,0x7f,0x1c,0x87,0x2b,0x81,0xc3,0xce,0xba}; uint8_t data_3[20] = {0x7f,0x1d,0x4f,0xe7,0x80,0xe2,0xb0,0x19,0x7f,0x1d,0x4f,0xe7,0x7f,0x1c,0x87,0x2b,0x81,0xc3,0xce,0xba}; uint8_t data_4[4] = {0x00,0x80,0x00,0x00}; user_i2c_change_device_addr(DevAddr); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0x8C); // bsp_tas5828_sfr_write(0x00, 0x2D); // bsp_tas5828_write_buffer(0x58, data_1, 40); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0xAA); // bsp_tas5828_sfr_write(0x00, 0x2B); // bsp_tas5828_write_buffer(0x0C, data_2, 20); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0xAA); // bsp_tas5828_sfr_write(0x00, 0x2B); // bsp_tas5828_write_buffer(0x20, data_3, 20); bsp_tas5828_sfr_write(0x00, 0x00); // bsp_tas5828_sfr_write(0x7F, 0x8C); // bsp_tas5828_sfr_write(0x00, 0x2E); // bsp_tas5828_write_buffer(0x10, data_4, 4); } void TAS5828_Play(uint8_t DevAddr) { user_i2c_change_device_addr(DevAddr); bsp_tas5828_play(); } void TAS5828_Sleep(uint8_t DevAddr) { user_i2c_change_device_addr(DevAddr); bsp_tas5828_sleep(); } void TAS5828_Hiz(uint8_t DevAddr) { user_i2c_change_device_addr(DevAddr); bsp_tas5828_Hiz(); } //static bool spkeaer_mute_flag = 0; //static bool sub_mute_flag = 0; void TAS5828_Mute(uint8_t DevAddr) { if(!SinkUser.DspIsOpenSuccess) { return; } if(SinkUser.DspIsMuteFlag == TRUE && DevAddr == TAS_SPEAKER) { return ; } SinkUser.DspIsMuteFlag = TRUE; /*if(spkeaer_mute_flag && DevAddr == TAS_SPEAKER) { return ; } if(sub_mute_flag && DevAddr == TAS_SUB) { return ; }*/ printf("---TAS5828 Mute 0x%X\r\n" , DevAddr); user_i2c_change_device_addr(DevAddr); bsp_tas5828_mute(); //bsp_tas5828_sleep(); /*if(DevAddr == TAS_SPEAKER) { spkeaer_mute_flag = 1; } if(DevAddr == TAS_SUB) { sub_mute_flag = 1; }*/ } void TAS5828_Vol_Min_Mute(uint8_t DevAddr) { printf("---TAS5828 vol min Mute 0x%X\r\n" , DevAddr); user_i2c_change_device_addr(DevAddr); bsp_tas5828_mute(); } void TAS5828_Unmute(uint8_t DevAddr) { if(!SinkUser.DspIsOpenSuccess) { return; } if(SinkUser.DspIsMuteFlag == FALSE && DevAddr == TAS_SPEAKER) { return ; } SinkUser.DspIsMuteFlag = FALSE; /*if(!spkeaer_mute_flag && DevAddr == TAS_SPEAKER) { return ; } if(!sub_mute_flag && DevAddr == TAS_SUB) { return ; }*/ if(SinkUser.DspIsVolMinFlag == FALSE) { printf("---TAS5828 Unmute 0x%X\r\n" , DevAddr); user_i2c_change_device_addr(DevAddr); bsp_tas5828_unmute(); } //bsp_tas5828_play(); /*if(DevAddr == TAS_SPEAKER) { spkeaer_mute_flag = 0; } if(DevAddr == TAS_SUB) { sub_mute_flag = 0; }*/ } void TAS5828_ClearFault(uint8_t DevAddr) { user_i2c_change_device_addr(DevAddr); bsp_tas5828_clear_fault(); } void TAS5828_DriverDeInit(void) { //tas5828_delay(1000); } void TAS5828_DriverInit(void) { if (tas5828_speaker_init(TAS_SPEAKER)== 0) { //TAS5805_ClearFault(TPA5808_ADDR1); //TAS5805_Play(TPA5808_ADDR1); //TAS5805_SendVolume(TPA5808_ADDR1, TSA5805_VOL_MAX); //TAS5805_Mute(TPA5808_ADDR1); //printf("61h %02x\r\n" , bsp_tas5805_sfr_read(0x61)); } //if (tas5828_sub_init(TAS_SUB)== 0) //{ //TAS5805_ClearFault(TPA5808_ADDR2); //TAS5805_Play(TPA5808_ADDR2); //TAS5805_SendVolume(TPA5808_ADDR2, TSA5805_VOL_MAX); //TAS5805_Mute(TPA5808_ADDR2); //printf("61h %02x\r\n" , bsp_tas5805_sfr_read(0x61)); //} //spkeaer_mute_flag = 0; }
Hi
Maybe you should let software team to use more simpler codes to test the I2C function first. Use the Log in I2C Monitor, and config the DRC, you'll get the codes for DRC along.
And usually when the DRC has problem at customer side, it's because they can't make sure to write all the DRC related I2C codes together. There's maybe some Break Off in customer's system to keep interrupt, that would make DRC related codes failed to config.