Part Number: TMDSLCDK138
Other Parts Discussed in Thread: TLV320AIC3106
Tool/software: Code Composer Studio
Hi,
I'm new to DSP development, and I'm using the StarterWare McASP Loopback example. I want to configure TDM time division to have the TLV320AIC3106 codec transmitting on different time slots (In a future, we will have 8 codecs connected to the same bus). In the given example, I'm changing the following code (8Khz, 160 samples):
/* Sampling Rate which will be used by both transmit and receive sections */
#define SAMPLING_RATE (8000u)
/* Number of samples to be used per audio buffer */
#define NUM_SAMPLES_PER_AUDIO_BUF (160u)
With this changes it's ok, audio loopback is working. To activate TDM on audio codec, I've change the file aic31.c to use 256-clock transmissions (function AIC31DataConfig):
Original code:
/* Write the data type and slot width */
CodecRegWrite(baseAddr, AIC31_P0_REG9, (dataType | slot));
Modified code (added 256-clock bit activation on P0 REG9):
/* Write the data type and slot width */
CodecRegWrite(baseAddr, AIC31_P0_REG9, (dataType | slot | 0x08));
On main file, I've changed the following code:
On AIC31I2SConfigure function (we will have 8 codecs, sampling R&L channels, so 16 slots per TMD frame, and I want the codec to transmit on slots 2&3, not 0&1 as originally, so I've changed the offset to start on bit 32):
/* Configure the data format and sampling rate */
//Original code: AIC31DataConfig(SOC_I2C_0_REGS, AIC31_DATATYPE_I2S, SLOT_SIZE, 0);
AIC31DataConfig(SOC_I2C_0_REGS, AIC31_DATATYPE_I2S, SLOT_SIZE, 32);
On "" function, I've changed the McASP configuration to use 16 slots and to be active on slot 2&3 (not 0&1 as originally):
/* Configure the frame sync. I2S shall work in TDM format with 2 slots */
//Original code: McASPRxFrameSyncCfg(SOC_MCASP_0_CTRL_REGS, 2, MCASP_RX_FS_WIDTH_WORD,
// MCASP_RX_FS_EXT_BEGIN_ON_FALL_EDGE);
//McASPTxFrameSyncCfg(SOC_MCASP_0_CTRL_REGS, 2, MCASP_TX_FS_WIDTH_WORD,
// MCASP_TX_FS_EXT_BEGIN_ON_RIS_EDGE);
// Configure 16 slots
McASPRxFrameSyncCfg(SOC_MCASP_0_CTRL_REGS, 16, MCASP_RX_FS_WIDTH_WORD,
MCASP_RX_FS_EXT_BEGIN_ON_FALL_EDGE);
McASPTxFrameSyncCfg(SOC_MCASP_0_CTRL_REGS, 16, MCASP_TX_FS_WIDTH_WORD,
MCASP_TX_FS_EXT_BEGIN_ON_RIS_EDGE);
/* Enable the transmitter/receiver slots. I2S uses 2 slots */
//Original code: McASPRxTimeSlotSet(SOC_MCASP_0_CTRL_REGS, I2S_SLOTS);
//McASPTxTimeSlotSet(SOC_MCASP_0_CTRL_REGS, I2S_SLOTS);
//Set slots 2&3 as active on McASP serializers
McASPRxTimeSlotSet(SOC_MCASP_0_CTRL_REGS, 0x000000C);
McASPTxTimeSlotSet(SOC_MCASP_0_CTRL_REGS, 0x0000000C);
I don't know what I'm missing on the configuration because it's not working, so any help will be welcome (I've tried with other transmissions formats such as left-justified or DSP and the result is the same).
Regards,
Eloy

