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.

TLV320AIC3120EVM-U: Configuring DAC Filters From Command Window in CodecControl

Part Number: TLV320AIC3120EVM-U
Other Parts Discussed in Thread: TLV320AIC3120

Hello,

I'm using the TLV320AIC3120 as a microphone amplifier.  I have D5 of register 29 on page 0 set so that the ADC data is looped back into the DAC, allowing the mic signal to get passed through all the digital processing before being routed out to the Class D amp.

Because of the close physical proximity of the microphone and the speaker in our application, some heavy filtering by the DAC Biquad filters is required.  From CodecControl, I was able to manually set the filter parameters how I wanted them.  My question for this post is - how do I properly set the registers to implement these filter settings so I can include it in my init file?  It seems like there are some restrictions I'm unaware of.

For example, I clicked "record" in the command window as I manipulated the DAC filter settings.  This allowed me to see exactly which commands were being sent...or so I thought.  When I looked a little closer, I noticed the commands are basically identical even though I was adjusting two very different things.

The first adjustment I made was to set Fc on filter 3 to 1800Hz

The next adjustment was to set the gain to -12.

Here is what was recorded in the command window for both of those adjustments:

The only difference I see between those two commands is the very last line in both of them.  It's either w 30 1 05 or w 30 1 07, which is the DAC Coefficient RAM Control register according to the datasheet.

Writing 0x05 sets bits D2 and D0, writing 0x07 sets bits D2, D1, and D0.  Neither of those commands have anything to do with setting Fc to 1800Hz or setting the gain to -12.  I thought those would be done in registers 22 through 31 on page 8.

The data in those registers matches the exported coefficients from the DAC filter window.

When I try to manually write to those registers through the command window, the output shows something different than what I entered.

The first command I entered was to change the current page to page 8, but the output in the command window shows me setting the page to page 0.

I tried writing my DAC Filter coefficients to registers 22 through 31 anyway, but CodecControl crashed.

I'd love some help getting my DAC Filter coefficients written to their correct registers.  Thanks!

  • Hi Scott,

    The first thing I noticed is that your filter isn't enabled. That explains why your writes appear to be identical. It's setting the filters to be all-passed even though you make changes to the filter. Enabling the filter will actually put the filter into effect.

    Second is I would refrain using the "execute" line. I'm not sure exactly how the record function interacts with it but I recommend using the command buffer and then hitting "run." The record function is really intended to just log whatever changes you make in the gui in order to create a script for end-design use. On that point, any changes you make in the gui should automatically reflect on the EVM. So setting the filter parameters and enabling it should automatically write the correct registers on the EVM without the need for writing them manually. Double check 7.3.12.1.3.2 for the coefficient locations.

    Best regards,
    Jeff McPherson

  • Thanks for the response, Jeff.  The screenshots don't represent my actual settings, but that does raise a question - does the filter have to be enabled first and then the rest of the settings can be configured?  I might have been doing it in the opposite order before - setting Fc, gain, and bandwidth, and then enabling the filter.

  • Hi Scott,

    The calculator/GUI update in real time so the order should not matter.

  • If I'm understanding this correctly, I should be able to open the command window, check the "record" box, change my settings, then click "save", right?  Then I can use that script as my init script?

  • Hi Scott,

    Yes that's correct.