Hi
I am trying to figuring out volume control for the TAS 2560. I am not sure how it works.
I tried changing DAC gain from this register but see no difference :-
SPK_CTRL (book=0x00 page=0x00 address=0x04) [reset=5Fh]
I saw a document which gives this example :Example
On this example, a gain of -23dB will be written to the device:
1. Gain = -23dB, calculate Ratio:
a. = 10
20 ∗ 231 = 10
−23
20 ∗ 231 = 152030199.6
2. Round Ratio to next integer value:
a. ≅ 152030200
3. Convert decimal to hex:
a. 152030200 = 908
4. Complete the 8 bits
a. 908 = 0908
5. Write hex value into device registers
a. w 98 00 00
w 98 7f 00
w 98 00 32
w 98 0c 09 0F CB F8
I have tried to make a table based on these calculations :// Volume control table
const VolumeEntry volume_table[] = {
{0, -23, 0x090FCBF7},
{1, -30, 0x040C3713},
{2, -40, 0x0147AE14},
{3, -50, 0x00679F1B},
{4, -60, 0x0020C49B},
{5, -80, 0x000346DC},
{6, -90, 0x00010945},
{7, -100, 0x000053E2},
{8, -110, 0x00001A86}
};
When I used this table to configure 0x0c register , I can see the volume change, however I can get no where close to the volume I need.
Thanking you,
Nadeem