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.

CC2640R2F: CC2640R2F I2S - two codec input setting

Part Number: CC2640R2F


Hi Experts,

My project need to support two codec as input. So AD0&AD1 of CC2640R2  PINs will be configured to I2S_SDx_INPUT. I have a question for SD0 & SD1 input order and format. As I know if only one pin as input eg SD0 pin, the 16bit stereo input format is  L_data16 then R_data16,  when SD1 also was configured to input how about format , is it show as  SD0 L_data16 -  SD0 R_data16 - SD1 L_data16 SD1 R_data16? Thanks! 

/* Default I2S parameters structure */
const I2S_Params I2S_defaultParams = {
....
.SD0Use = I2S_SD0_INPUT, /* SD0Use */
.SD1Use = I2S_SD1_INPUT, /* SD1Use */    // I2S_SD1_OUTPUT
.SD0Channels = I2S_CHANNELS_STEREO, /* Channels activated on SD0 */
.SD1Channels = I2S_CHANNELS_STEREO, /* Channels activated on SD1 */
...
.custom = NULL, /* customParams */
};

Best regards,

Alex

  • Hi Alex,

    Thank you for reaching out,

    We'll take your request in consideration, I'll assign this thread to the proper expert.

    regards,

  • Hi Alex,

    The answer is in the CC13X0/CC26X2 TRM, Section 22.6.1: "For any given sample, the LEFT channel is transferred first when WCLK is low, and the RIGHT channel is transferred second when WCLK is high."  So left channel data followed by right channel data is transferred for any given sample.  If not already done, please also refer to the I2S TI Driver reference and i2secho example as starting points.

    Regards,
    Ryan

  • Hi Ryan,

    I have see what your said. Thanks!

    I want to know if CC13X0/CC26X2  connect two stereo audio in with two IO pins, how to read them? which pin data will be the first? AD0 or AD1 or can switch by program.

    Thanks!

    Alex  

  • Hi Alex,

    Based on the I2S API documentation linked by Ryan, it seems to start reading you need to call a few initialization and set up functions and then call I2S_startRead(). The I2S example showcases how to do it as well. I am not exactly sure which order the data pins are read, can you clarify why you need the exact order that the pins are sampled?

    Best Regards,

    Jan

  • Hi Jan,

    The purpose is that i will choose the data from one codec then discard the others. So for question, first i need to confirm from TI experts two input from two pin is workable at same time. the other one is if it is workable, how to choose them individually. Thanks!

    Alex.

  • Hi Alex,

    It is definitely possible to enable the I2S to consider two inputs. To do so, the code snippet you have shared is correct.

    The inputs from the two lines will be interleaved, and you should expect the following in the buffer: L0_data16 then L1_data16 then R0_data16 then R1_data16, etc.

    I hope this will help,

    Best regards,