• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Data Converters » Audio Converters » Audio Converters Forum » TLV320aic3204
Share
Audio Converters
  • Forum
  • E2E Wiki
Options
  • Subscribe via RSS
Check out
Analog Wire blog
  • $core_v2_blog.Current.Name

    RS-485 - Who says you can't teach an old dog new tricks?

    Posted 1 day ago
    by Neel Seshan
    Would you agree that RS-485 has turned out to be one of the most...
  • $core_v2_blog.Current.Name

    Filter for thought

    Posted 2 days ago
    by Soufiane Bendaoud
    Have you ever wondered how engineers designed active filters...
  • $core_v2_blog.Current.Name

    Let’s take this driver out for a spin

    Posted 8 days ago
    by Soufiane Bendaoud
    Before I suggest a suitable op amp to drive an ADC, I look at...

Forums

TLV320aic3204

This question is answered
ouassim tazarine
Posted by ouassim tazarine
on Jun 02 2010 13:01 PM
Prodigy30 points

Hi Everyone,

I connected the TLV320aic3204 with a microcontroller made by Atmel (atmega64) using the circuit recommended in the data sheet, the codec runs on a MCLK of 4 MHz and I randomly connected the two pins  for Bclk and Wclk to the UC.  My target  is playback  Fs=8 khz. All registers have successfully been allocated using  l2C.

 

    CODEC_ByteWrite(0x00,0x00);   //software reset
    CODEC_ByteWrite(0x01,0x01);                               
    CODEC_ByteWrite(0x00,0x00);       //clock and interface settings
    CODEC_ByteWrite(0x04,0x03); 
    CODEC_ByteWrite(0x05,0x93); 
    CODEC_ByteWrite(0x06,0x09);     // P=1, R=3, J=9
    CODEC_ByteWrite(0x0b,0x82);     //NDAC=2      
    CODEC_ByteWrite(0x0c,0x87);     //MDAC=7       
    CODEC_ByteWrite(0x12,0x07);     //NADC=7
    CODEC_ByteWrite(0x13,0x02);     //MADC=2
    CODEC_ByteWrite(0x1d,0x00);  //BCLK frequency is generated from DAC_CLK
    CODEC_ByteWrite(0x1e,0x84);  //and N = 4
    CODEC_ByteWrite(0x1b,0x06);  // Set BCLK and WCLK as outputs        
    CODEC_ByteWrite(0x00,0x2c);   //High-pass first order butterworth Filter
    CODEC_ByteWrite(0x0c,0x7c);  //Fc=40 Hz              
    CODEC_ByteWrite(0x0d,0x73);         
    CODEC_ByteWrite(0x0e,0xe4);       
    CODEC_ByteWrite(0x0f,0x00);         
    CODEC_ByteWrite(0x10,0xc1);         
    CODEC_ByteWrite(0x11,0xc6);         
    CODEC_ByteWrite(0x12,0x0f);         
    CODEC_ByteWrite(0x13,0x00);         
    CODEC_ByteWrite(0x14,0x00);         
    CODEC_ByteWrite(0x15,0x00);         
    CODEC_ByteWrite(0x16,0x00);         
    CODEC_ByteWrite(0x17,0x00);         
    CODEC_ByteWrite(0x18,0x3c); 
    CODEC_ByteWrite(0x19,0x73);         
    CODEC_ByteWrite(0x1a,0xe6);        
    CODEC_ByteWrite(0x1b,0x00);         
    CODEC_ByteWrite(0x1c,0x00);         
    CODEC_ByteWrite(0x1d,0x00);         
     CODEC_ByteWrite(0x1e,0x00);        
    CODEC_ByteWrite(0x1f,0x00);
 CODEC_ByteWrite(0x00,0x2d);  
 CODEC_ByteWrite(0x14,0x7c); 
 CODEC_ByteWrite(0x15,0x73);         
 CODEC_ByteWrite(0x16,0xe4);       
 CODEC_ByteWrite(0x17,0x00);         
 CODEC_ByteWrite(0x18,0xc1);         
 CODEC_ByteWrite(0x19,0xc6);         
 CODEC_ByteWrite(0x1a,0x0f);         
 CODEC_ByteWrite(0x1b,0x00);         
 CODEC_ByteWrite(0x1c,0x00);         
 CODEC_ByteWrite(0x1d,0x00);         
 CODEC_ByteWrite(0x1e,0x00);         
 CODEC_ByteWrite(0x1f,0x00);         
 CODEC_ByteWrite(0x20,0x3c); 
 CODEC_ByteWrite(0x21,0x73);         
 CODEC_ByteWrite(0x22,0xe6);        
 CODEC_ByteWrite(0x23,0x00);         
 CODEC_ByteWrite(0x24,0x00);         
 CODEC_ByteWrite(0x25,0x00);         
 CODEC_ByteWrite(0x26,0x00);        
    CODEC_ByteWrite(0x27,0x00);
    CODEC_ByteWrite(0x00,0x2c);        
    CODEC_ByteWrite(0x01,0x05);
    CODEC_ByteWrite(0x00,0x01); //configure power supplies       
 CODEC_ByteWrite(0x02,0x09);         
 CODEC_ByteWrite(0x01,0x08);         
 CODEC_ByteWrite(0x02,0x01);         
 CODEC_ByteWrite(0x0a,0x3b);         
 CODEC_ByteWrite(0x3d,0x00);         
 CODEC_ByteWrite(0x03,0x00);         
 CODEC_ByteWrite(0x04,0x00);         
 CODEC_ByteWrite(0x47,0x32);         
 CODEC_ByteWrite(0x7b,0x01);
 CODEC_ByteWrite(0x00,0x01); //config ADC channel        
 CODEC_ByteWrite(0x34,0x80);         
 CODEC_ByteWrite(0x36,0x80);         
 CODEC_ByteWrite(0x37,0x80);         
 CODEC_ByteWrite(0x39,0x80);         
 CODEC_ByteWrite(0x3b,0x0c);                 
    CODEC_ByteWrite(0x3c,0x0c);        
 CODEC_ByteWrite(0x00,0x00);         
 CODEC_ByteWrite(0x51,0xc0);         
 CODEC_ByteWrite(0x52,0x00); 
    CODEC_ByteWrite(0x00,0x01); //config DAC channel        
 CODEC_ByteWrite(0x14,0x25);         
 CODEC_ByteWrite(0x0c,0x08);         
 CODEC_ByteWrite(0x0d,0x08);         
 CODEC_ByteWrite(0x0e,0x08);         
 CODEC_ByteWrite(0x0f,0x08);                 
    CODEC_ByteWrite(0x09,0x3c);        
 CODEC_ByteWrite(0x10,0x00);         
 CODEC_ByteWrite(0x11,0x00);         
 CODEC_ByteWrite(0x12,0x00);         
 CODEC_ByteWrite(0x13,0x00);         
 CODEC_ByteWrite(0x00,0x00);         
 CODEC_ByteWrite(0x41,0x00);         
 CODEC_ByteWrite(0x42,0x00);         
 CODEC_ByteWrite(0x3f,0xd6);         
 CODEC_ByteWrite(0x40,0x00);

Now I’m wondering why it doesn’t work.  The outputs of HPL and HPR is only noise, no matter what input signal is applied. I’ve started out by trying to hear or measure an audio output signal using a microphone as input.

Is it possible, providing playback works, to use I2s even though I’m using a microcontroller instead of DSP? How can I generate BClk and WCLK when the dataflow direction is from the UC to the Codec? Where can I find an example code in C for I2S?

 

Thanks a lot, Ouassim.

I2S TLV320aic3204 C code
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • J Arbona
    Posted by J Arbona
    on Jun 02 2010 19:00 PM
    Verified Answer
    Verified by J Arbona
    Mastermind21070 points

    Ouassim,

    To send data from ADC to DAC you can use the ADC to DAC loopback found in Page 0 / Register 29. For this to work, BCLK, MCLK and WCLK must be present. This can be accomplished by providing BCLK/WCLK externally, or configuring them as outputs (as in your code). This would be a good starting point to determine if the whole signal path is working.

    For communicating with a uC without an I2S bus, I would recommend setting the AIC in master mode (BCLK/WCLK are outputs) and setting interrupts in the uC based on WCLK edges. Then, the uC can count BCLK cycles and store the data in a buffer, or clock the data with the edges.

    Regards,

    J-

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • bo li75605
    Posted by bo li75605
    on Nov 03 2011 20:27 PM
    Prodigy100 points

    Hello J

    I use 3204 in mono, data sheet shows, using right ADC and left DAC in mono gets lower power cost,  how to set register to route left ADC output to right DAC input , I have not find that. Or it must works left ADC to right DAC and right ADC to right DAC? 

    thanks

    Bo Li

    AIC3254 AIC3204
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J Arbona
    Posted by J Arbona
    on Nov 03 2011 20:33 PM
    Verified Answer
    Verified by J Arbona
    Mastermind21070 points

    Bo,

    You can select LDAC input as right channel data by programming Page 0 / Register 63.

    Regards,

    J-

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Gajanan Choukidar
    Posted by Gajanan Choukidar
    on Mar 09 2012 02:23 AM
    Intellectual310 points
    I haven't seen the register settings in detail given above.but, yes it is possible to have playback using I2S of microcontroller instead of DSP.You can find good example for this on microchip website. Regards, Gajanan.
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • bo li75605
    Posted by bo li75605
    on Mar 09 2012 04:37 AM
    Prodigy100 points

    Hi Gajanan

    Thank you for reply and give me information.

    I use aic3204 since analog mic or digit mic is part of the system as well.

    "SLOS602A–SEPTEMBER2008–REVISEDOCTOBER2008" . this is TI aic3204 data sheet. I don't understand "Table5-20.DACGain vs.PowerTuneModes", it is in cheapt 5.13.1 PowerTuneModes.

    Can you explain for me?

    Best regard

    Bo Li

    AIC3254 TLV320AIC3254 AIC3204 TLV320aic3204 AIC_codec
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use