DSPRelated.com
Forums

Setting the codec on the TMS320VC5505 ezDsp USB Stick

Started by znll...@gmail.com April 2, 2010
I'm trying to create a simple project in which I set the aic3204's registers through the I2c interface by using the CSL. I've tried to learn from the aic3204 project in CCS and from the examples in the CSL, but I still have a problem: when the program calls the function I2C_write is generated an error. Debugging I found that the error is generated when the function waits for the codec to pull down the SDA (ACK) and during this operation the timeout value is reached. The error returned is CSL_I2C_NACK_ERR. Now, has anybody any example in which the codec is set correctly so I can try to understand where is my problem and solve it?

Thanks for your help.

Andrea
Hello Andrea,

Have you downloaded the data sheet for the AIC3204 and studied its
registers and commands? It's available from Texas Instruments at
http://focus.ti.com/lit/ds/symlink/tlv320aic3204.pdf - you might find
some clues about what controls the ACK / SDA.

Also, are you using a board from TI with the AIC3204, or did the
hardware come from somewhere else? I'm trying to eliminate possible
wiring issues, since the circuit can change the behavior of certain
chips.

Brian Willoughby
Sound Consulting
On Apr 2, 2010, at 06:23, z...@gmail.com wrote:
> I'm trying to create a simple project in which I set the aic3204's
> registers through the I2c interface by using the CSL. I've tried to
> learn from the aic3204 project in CCS and from the examples in the
> CSL, but I still have a problem: when the program calls the
> function I2C_write is generated an error. Debugging I found that
> the error is generated when the function waits for the codec to
> pull down the SDA (ACK) and during this operation the timeout value
> is reached. The error returned is CSL_I2C_NACK_ERR. Now, has
> anybody any example in which the codec is set correctly so I can
> try to understand where is my problem and solve it?
Hi Brian, I downloaded the data sheet and studied it a bit, but I can't find the problem. The setting I tried to reproduce using the CSL was the same of the aic3204 example that comes with the CCS so it should work. For this reason I would like to see an example that configures the codec using the functions in the CSL. The board I'm using is the TI's TMS320VC5505 ezDsp USB Stick.

Thanks for your help

Andrea

I'm trying to create a simple project in which I set the aic3204's registers through the I2c interface by using the CSL. I've tried to learn from the aic3204 project in CCS and from the examples in the CSL, but I still have a problem: when the program calls the function I2C_write is generated an error. Debugging I found that the error is generated when the function waits for the codec to pull down the SDA (ACK) and during this operation the timeout value is reached. The error returned is CSL_I2C_NACK_ERR. Now, has anybody any example in which the codec is set correctly so I can try to understand where is my problem and solve it?
>
>Thanks for your help.
>
>Andrea
Andrea,

I have not used the eZDSP yet, so I have no direct experience. You
say that there is an AIC3204 example that comes with CCS; does it
compile and run for you? Does it use CSL or does it use some other
API to accomplish its task? Have you paid careful attention to the
I2C_config() parameters? Have you called I2C_start()? I'm not sure
whether a separate I2C_setup() call is required as well in your
situation, but you might look into the details for yourself. I
recommend reading SPRU433J for details on the CSL and SPRU146 for the
I2C peripheral in detail. Since I'm using the C5506 and you're using
the C5505, you might want to double-check the document numbers to see
which ones are appropriate for your exact DSP.

I've had very good luck with the CSL when accessing the EMIF, DMA,
McBSP, USB, PLL and GPIO modules of the C55x. I haven't used the I2C
module yet, but I assume that it works equally well. The key is to
fully understand the generic standards (Philips I2C Specification
Revision 2.1, January 2000), the DSP registers which control the
module, and all of the details of the specific external chip. In
some cases, a logic analyzer is helpful in case your CSL settings are
off by some some detail which is specific to your connection. It
also helps to have a schematic of your hardware to confirm things
like maybe an external crystal frequency, if any. Once all of the
details are lined up, you should have a working codec.

Note that you may have already done most of the above, but I tried to
list everything potentially relevant in case it helps. Reading all
of the documentation can be tedious. Even tracking down all of the
documentation can sometimes be a chore in itself. It often requires
thorough knowledge of both hardware and software to get this sort of
thing working.

Brian Willoughby
Sound Consulting
On Apr 2, 2010, at 16:38, z...@gmail.com wrote:
> Hi Brian, I downloaded the data sheet and studied it a bit, but I
> can't find the problem. The setting I tried to reproduce using the
> CSL was the same of the aic3204 example that comes with the CCS so
> it should work. For this reason I would like to see an example that
> configures the codec using the functions in the CSL. The board I'm
> using is the TI's TMS320VC5505 ezDsp USB Stick.
Hi Brian, I tried the code with another board and it worked fine, so I think the first board had some problems. Now I only have to set the I2S interface.
Thank you again for your help.

Andrea
Andrea-

> Hi Brian, I tried the code with another board and it worked
> fine, so I think the first board had some problems. Now I
> only have to set the I2S interface.

That's a good catch! So you just swapped the stick, everything else is completely the same? USB cable?

It's kinda rare that a DSK/EVM board gets damaged, are there any jumper and/or switch settings? If so check those.

-Jeff