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.

PurePath Volume control question

I am have trouble understanding exactly what needs to be written to the
volume component to change the volume. I am using an aic3254 as an SPI
device. The closest I come to making this work is by writing a 24 bit
coefficient to addresses 24, 25 and 26 (page 44). This changes the volume
on the first write but not after. I have attempted (among other things)
to write an index to address 27, this has no effect. Am I having this
problem because I am not setting up adaptive filtering buffers correctly?

The driver created by PurePath has the following:

typedef struct {
            u8 control_page;           //coefficient page location
            u8 control_base;           //coefficient base address within page
            u8 control_mute_flag;      //non-zero means muting required
            u8 control_string_index;   //string table index
} control;

static control VOLUME_controls[] = {
{44,24,0,0}
};

The PurePath help has this:

Component Interface 1         {Coef=4}
  DSPCoefBlockStartLength      1
  I2CPage                      44
  I2CRegister                  24

  • Hello Bruce,

    See Appendix B.1 of http://focus.ti.com/lit/an/slaa404b/slaa404b.pdf for an example on how to write coefficient memory addresses. Specifically, refer to the last code block in page 22 which applies to switching coefficients on-the-fly.

    For this case:

    1. Write Page 44 / Registers 24-26 with the gain value (0x40 00 00 is 0dB).
    2. Switch buffers by writing 0x05 to Page 44 / Register 1.
    3. Wait for Page 44 / Register 1, Bit D0 to clear to ensure buffers have been switched. This can be replaced with a delay for testing purposes.
    4. Write Page 44 / Registers 24-26 with the exact same values as in step 1.

    Regards,

    J-

     

  • Thanks,

    There seems to be two interfaces. From the volume help:

    "The volume level can be set using the Runtime Properties. If you use db values (6db to -110db) write it to the Volume property. The GDE will convert it to volume coefficient values and show it as a VolumeCoefficient property; if you directly use coefficient values (positive integer), write it to the VolumeCoefficient property."

    Do I need to use a Data to Coef component?

  • Bruce,

    What the document refers to is that there are two runtime properties than can be modified. The second property, VolumeCoefficient, derives its value from the Volume property. So if you type 6 (dB) on Volume, you will get close to 0x7FFFFF on the VolumeCoefficient. Alternatively, the coefficient value can be entered manually.

    When it comes to programming the coefficient memory, the VolumeCoefficient value is the one that is written into the registers.

    This is not related to the Data to Coef component.

    Regards,

    J-

  • Does that mean to change the volume again I would need to write to the other buffer (Buffer B in this case)? So I would write the new values to page 62 registers 24-26?

  • Hello Mort,

    If the AIC3254 is set in adaptive mode, then you need to rewrite the same data again to the location of Buffer A after switching buffers. You could also write to the Buffer B location instead, although the location of Buffer A could be used -- basically, both banks of pages point to the same buffer. See attachment below. This eliminates the need to keep track of buffer location.

    2146.DAC C-RAM Access.pdf

    The document below also has sample scripts in the Appendix section for both adaptive and non-adaptive modes:

    http://focus.ti.com/lit/an/slaa404b/slaa404b.pdf

    Regards,

    J-