在编写AD/DA后进行测试,发现AD已经跑通,可是DA没有反应。
第一个问题是音频信号在CODEC的输出地址是0X01D02000与LINE IN 口一个地址,该如何理解?
第二个问题是DA输出的PING-PONG PARAM已经设定好了,与AD除地址和TCC外无异(AD已经跑通),但没有反应,为何?
(附MCASP AD\DA配置程序)
mcasp_rx_i2s_activate();
mcasp_tx_i2s_activate();
/*
* McASP transmit config as i2s mode
*/
void mcasp_rx_i2s_config(void)
{
/* Set I2S format in the receiver format units */
McASPRxFmtI2SSet(SOC_MCASP_0_CTRL_REGS, WORD_SIZE, SLOT_SIZE,
MCASP_RX_MODE_DMA);
/* Configure the frame sync. I2S shall work in TDM format with 2 slots */
McASPRxFrameSyncCfg(SOC_MCASP_0_CTRL_REGS, 2, MCASP_RX_FS_WIDTH_WORD,
MCASP_RX_FS_EXT_BEGIN_ON_FALL_EDGE);
/* configure the clock for receiver */
McASPRxClkCfg(SOC_MCASP_0_CTRL_REGS, MCASP_RX_CLK_EXTERNAL, 0, 0);
McASPRxClkPolaritySet(SOC_MCASP_0_CTRL_REGS, MCASP_RX_CLK_POL_RIS_EDGE);
McASPRxClkCheckConfig(SOC_MCASP_0_CTRL_REGS, MCASP_RX_CLKCHCK_DIV32,
0x00, 0xFF);
/* Enable the receiver slots. I2S uses 2 slots */
McASPRxTimeSlotSet(SOC_MCASP_0_CTRL_REGS, I2S_SLOTS);
/*
** Set the serializers, Currently only one serializer is set as
** transmitter and one serializer as receiver.
*/
McASPSerializerRxSet(SOC_MCASP_0_CTRL_REGS, MCASP_XSER_RX);
}
/*
* McASP recieve config as i2s mode
*/
void mcasp_tx_i2s_config(void)
{
/* Set I2S format in the transmitter format units */
McASPTxFmtI2SSet(SOC_MCASP_0_CTRL_REGS, WORD_SIZE, SLOT_SIZE,
MCASP_TX_MODE_DMA);
/* Configure the frame sync. I2S shall work in TDM format with 2 slots */
McASPTxFrameSyncCfg(SOC_MCASP_0_CTRL_REGS, 2, MCASP_TX_FS_WIDTH_WORD,
MCASP_TX_FS_EXT_BEGIN_ON_RIS_EDGE);
/* configure the clock for transmitter */
McASPTxClkCfg(SOC_MCASP_0_CTRL_REGS, MCASP_TX_CLK_EXTERNAL, 0, 0);
McASPTxClkPolaritySet(SOC_MCASP_0_CTRL_REGS, MCASP_TX_CLK_POL_FALL_EDGE);
McASPTxClkCheckConfig(SOC_MCASP_0_CTRL_REGS, MCASP_TX_CLKCHCK_DIV32,
0x00, 0xFF);
/* Enable the transmit slots. I2S uses 2 slots */
McASPTxTimeSlotSet(SOC_MCASP_0_CTRL_REGS, I2S_SLOTS);
/*
** Set the serializers, Currently only one serializer is set as
** transmitter and one serializer as receiver.
*/
McASPSerializerTxSet(SOC_MCASP_0_CTRL_REGS, MCASP_XSER_TX);
}
/*
** Activates the data transmission/reception
** The DMA parameters shall be ready before calling this function.
*/
void mcasp_tx_i2s_activate(void)
{
/* Start the clocks */
McASPTxClkStart(SOC_MCASP_0_CTRL_REGS, MCASP_TX_CLK_EXTERNAL);
/* Activate the serializers */
McASPTxSerActivate(SOC_MCASP_0_CTRL_REGS);
// /* make sure that the XDATA bit is cleared to zero */
// while(McASPTxStatusGet(SOC_MCASP_0_CTRL_REGS) & MCASP_TX_STAT_DATAREADY);
/* Activate the state machines */
McASPTxEnable(SOC_MCASP_0_CTRL_REGS);
}
/*
** Activates the data recieve
** The DMA parameters shall be ready before calling this function.
*/
void mcasp_rx_i2s_activate(void)
{
/* Start the clocks */
McASPRxClkStart(SOC_MCASP_0_CTRL_REGS, MCASP_RX_CLK_EXTERNAL);
/* Activate the serializers */
McASPRxSerActivate(SOC_MCASP_0_CTRL_REGS);
/* Activate the state machines */
McASPRxEnable(SOC_MCASP_0_CTRL_REGS);
}
Yunjiang Zhao:
void aic31_adc_config(void){ /* enable the programmable PGA for left and right ADC */ codec_reg_write(AIC31_P0_REG15, 0x00); codec_reg_write(AIC31_P0_REG16, 0x00);
/* MIC3L/R is not connected to the left ADC PGA */ codec_reg_write(AIC31_P0_REG17, 0xFF);
/* MIC3L/R is not connected to the right ADC PGA */ codec_reg_write(AIC31_P0_REG18, 0xFF);
/* power on the Line L1R */ codec_reg_write(AIC31_P0_REG19, 0x04);
/* power on the Line LIL */ codec_reg_write(AIC31_P0_REG22, 0x04);}
/** * \brief Initializes the DAC section of the AIC31 Codec * * \param baseAddr Base Address of the interface connected to AIC31 * * \return None. * **/void aic31_dac_config(void){ /* power up the left and right DACs */ codec_reg_write(AIC31_P0_REG37, 0xE0);
/* select the DAC L1 R1 Paths */ codec_reg_write(AIC31_P0_REG41, 0x02); codec_reg_write(AIC31_P0_REG42, 0x6C);
/* DAC L to HPLOUT Is connected */ codec_reg_write(AIC31_P0_REG47, 0x80); codec_reg_write(AIC31_P0_REG51, 0x09);
/* DAC R to HPROUT is connected */ codec_reg_write(AIC31_P0_REG64, 0x80); codec_reg_write(AIC31_P0_REG65, 0x09);
/* DACL1 connected to LINE1 LOUT */ codec_reg_write(AIC31_P0_REG82, 0x80); codec_reg_write(AIC31_P0_REG86, 0x09);
/* DACR1 connected to LINE1 ROUT */ codec_reg_write(AIC31_P0_REG92, 0x80); codec_reg_write(AIC31_P0_REG93, 0x09);
/* unmute the DAC */ codec_reg_write(AIC31_P0_REG43, 0x00); codec_reg_write(AIC31_P0_REG44, 0x00);}
DAC部分的HPLOUT与HPROUT 好像与RIGHT_LOP/M及left_LOP/M重复了。二者选哪一个?
Yunjiang Zhao:
回复 Yunjiang Zhao:
0x01d02000处输出为此,让人不解,是DA配错了吗?
zhan shao:
回复 Yunjiang Zhao:
调DA的时候可以先用示波器看一下从DSP的 MCASP数据输出引脚上看一下有没有数据出来。
Yunjiang Zhao:
回复 zhan shao:
好的,我尝试尝试