楼主,你好,最近我也在做codec这个实验,我按照你的方法,自己想直接实现音频实时回放,但是程序下载进去,始终都会一点击运行,就报错:C55xx: Trouble Reading Memory Block at 0x14187 on Page 0 of Length 0x501: Error 0x00000002/-1146 Error during: Memory, Invalid data was scanned by the emulation controller. Verify the board setup to make sure the scan chain is properly defined. If the setup is correct, then RESET EMULATOR. This will disconnect each target from the emulator. The targets should then be power cycled or hard reset followed by an emureset and reconnect to each target.
后来修改后,耳机里面听到的全是噪音,而且程序无法停止下来,只有关闭电源重启。
我的想法是,语音通过话筒,从AIC23的A/D采集进来,在经过MCBSP传给AIC23的D/A,最后送给耳机。我看了开发板的例程中是直接给aic23data赋值,通过循环,产生警报音的效果。例程代码如下:
/*回放音频*/
while(TRUE)
{
while(!MCBSP_rrdy(hMcbsp)){};
//aic23data = MCBSP_read16(hMcbsp);
aic23data = 5000;
for(temp=30000;temp>0;temp-=100)
{
for(i=0;i<2;i++)
{
aic23data = 5000;
MCBSP_write16(hMcbsp,aic23data);
delay(temp);
aic23data = 0;
MCBSP_write16(hMcbsp,aic23data);
delay(temp);
}
}
//MCBSP_write16(hMcbsp,aic23data);
};
我现在改的部分如下:
/*回放音频*/
while(TRUE)
{
while(!MCBSP_rrdy(hMcbsp)){};
aic23data = MCBSP_read16(hMcbsp);
//for(temp=300;temp>0;temp--);
delay(3000);
while(!MCBSP_xrdy(hMcbsp)){};
MCBSP_write16(hMcbsp,aic23data);
};
我不知道是我理解有问题,还是代码没写对。望楼主和路过的牛人们给小弟指点一二。 |