We’re trying to get a TLV320AIC3254 codec running on a pair of custom boards. Both boards have a CC2652RSIPMOTR that are acting as masters and generating the clock lines and are using the SimpleLink Audio Plugin (v3.30.0.06).
In trying to get the beep generator to produce a sound on the LOL and LOR outputs of a custom board (the receiver board of the related question) all I'm managing to get is a bit of a pop noise.
I've tried it with sample rates of both 16k (as that is the intended sample rate) and 44.1k (as that was the rate used in an example I found for setting the length, sine, and cosine).
The trimmed down schematic of this board: 2148.Receiver.pdf
I have swapped back to having the MCU be the I2S master since getting clocks working in the last question because of some errors being generated by the peripheral on the MCU that don't happen when it is the master.
Here are the settings I'm using at the moment (with the 44.1k sample rate):
AudioHAL_I2CReg configRegs16Bit_m[] =
{
{TI3254_PAGE_0, TI3254_SW_RESET_REG, 0x01}, /* Reset the codec */
{TI3254_PAGE_0, TI3254_AUDIO_IF_1_REG, 0x00}, /* 16bit, I2S, WCLK, BCLK is input to the device */
};
AudioHAL_I2CReg clockRegs44p1k_m[] =
{
{TI3254_PAGE_0, TI3254_CLK_MUX_REG, 0x03}, /* Low Range, PLL Clock = MCLK, CODEC_CLKIN = PLL_Clock */
{TI3254_PAGE_0, TI3254_CLK_PLL_P_R_REG, 0x80 | 0x10 | 0x01}, /* PLL is powered up, P=1, R=1 */
{TI3254_PAGE_0, TI3254_CLK_PLL_J_REG, 0x07}, /* J=7 */
{TI3254_PAGE_0, TI3254_CLK_PLL_D_MSB_REG, 0x02}, /* Set MSB of D value D=560 */
{TI3254_PAGE_0, TI3254_CLK_PLL_D_LSB_REG, 0x30}, /* Set LSB of D value */
{TI3254_PAGE_0, TI3254_CLK_NDAC_REG, 0x80 | 0x05}, /* NDAC divider powered up, NDAC = 5 */
{TI3254_PAGE_0, TI3254_CLK_MDAC_REG, 0x80 | 0x03}, /* MDAC divider powered up, MDAC = 3 */
/* {TI3254_PAGE_0, TI3254_DAC_OSR_MSB_REG, 0x00}, (default) DOSR = 128 */
/* {TI3254_PAGE_0, TI3254_DAC_OSR_LSB_REG, 0x80}, (default) DOSR = 128 */
{TI3254_PAGE_0, TI3254_CLK_NADC_REG, 0x05}, /* NADC divider powered down, NADC = 5 same as DAC */
{TI3254_PAGE_0, TI3254_CLK_MADC_REG, 0x03}, /* MADC divider powered down, MADC = 3 same as DAC */
/* {TI3254_PAGE_0, TI3254_ADC_OSR_REG, 0x80}, (default) AOSR = 128 ((Use with PRB_R1 to PRB_R6, ADC Filter Type A) */
/* {TI3254_PAGE_0, TI3254_AUDIO_IF_3_REG, 0x00}, (default) Primary BCLK and Primary WCLK buffers are powered up */
};
AudioHAL_I2CReg openScript[] =
{
{TI3254_PAGE_0, TI3254_DAC_SIG_P_BLK_CTRL_REG, 0x19}, /* Use PRB_P25: Beep generator */
/* Set up AVdd as output controlled from LDOIN */
{TI3254_PAGE_1, TI3254_PWR_CTRL_REG, 0x08}, /* Disabled weak connection of AVdd with DVdd */
{TI3254_PAGE_1, TI3254_LDO_CTRL_REG, 0x00}, /* Analog blocks enabled, Power AVdd from LDO */
{TI3254_PAGE_1, TI3254_REF_PWR_UP_CTRL_REG, 0x01}, /* Set the REF charging time to 40ms */
/* Setup DAC */
{TI3254_PAGE_1, TI3254_COMMON_MODE_CONTROL_REG, 0x40}, /* Full Chip Common Mode = 0.9v, LOL/LOR = 1.65V from LDOIN */
{TI3254_PAGE_1, TI3254_LOL_ROUTING_SEL_REG, 0x04}, /* Right DAC Negative connected to LOL */
{TI3254_PAGE_1, TI3254_LOR_ROUTING_SEL_REG, 0x04}, /* Right DAC Positive connected to LOR */
{TI3254_PAGE_1, TI3254_LOL_DRV_GAIN_CTRL_REG, 0x00}, /* LOL not muted, 0 dB gain */
{TI3254_PAGE_1, TI3254_LOR_DRV_GAIN_CTRL_REG, 0x00}, /* LOR not muted, 0 dB gain */
{TI3254_PAGE_1, TI3254_OP_DRV_PWR_CTRL_REG, 0x08 | 0x04}, /* LOL and LOR power up */
};
AudioHAL_I2CReg startScript[] =
{
{TI3254_PAGE_0, TI3254_DAC_CHANNEL_SETUP_1_REG, 0xD4}, /* Left/Right channel DAC powered up and routed to left/right data */
{TI3254_PAGE_1, TI3254_LOL_DRV_GAIN_CTRL_REG, 0x0F}, /* LOL not muted, 15 dB gain */
{TI3254_PAGE_1, TI3254_LOR_DRV_GAIN_CTRL_REG, 0x0F}, /* LOR not muted, 15 dB gain */
{TI3254_PAGE_0, TI3254_LEFT_DAC_VOL_CTRL_REG, 0x0C}, /* 6 dB */
{TI3254_PAGE_0, TI3254_RIGHT_DAC_VOL_CTRL_REG, 0x0C}, /* 6 dB */
{TI3254_PAGE_0, TI3254_DAC_CHANNEL_SETUP_2_REG, 0x00}, /* Left DAC not muted, Right DAC not muted, */
{TI3254_PAGE_0, 0x47, 0x03}, /* Left chan beep vol */
{TI3254_PAGE_0, 0x49, 0x03}, /* Beep length [23:16] */
{TI3254_PAGE_0, 0x4B, 0xFF}, /* Beep length [7:0] */
{TI3254_PAGE_0, 0x4C, 0x10}, /* Beep sine [15:8] */
{TI3254_PAGE_0, 0x4D, 0xD8}, /* Beep sine [7:0] */
{TI3254_PAGE_0, 0x4E, 0x7E}, /* Beep cosine [15:8] */
{TI3254_PAGE_0, 0x4F, 0xE3}, /* Beep cosine [7:0] */
{TI3254_PAGE_0, 0x48, 0x03}, /* Right chan beep vol */
{TI3254_PAGE_0, 0x47, 0x83}, /* Send beep */
};