Hi all
I am using custom board with c6747 dsp. It has independent receiver and transmitter clocks. To test my board I have wrote simple examples using register polling technique. The problem is buffer underrun in transmitter section just after successful transition of the one 32b word. Receiver part seems to be ok.
I am using XDS100v2 USB emulator.
// main.c
...
// init peripheral by i2c
configure_mcasp();
while(1) {
push(111); // 111 just for example
}
// configuration code
...
// RX
mcaspRegs->RMASK = 0xffffffff; // No padding used
mcaspRegs->RFMT = 0x000080F8; // MSB 32bit, 0-delay, no pad, CFGBus
mcaspRegs->AFSRCTL = 0x00000110; // 2TDM, 1bit Rising, EXTERNAL FS, word
mcaspRegs->ACLKRCTL = 0x00000043; // Rising EXTERNAL CLK,1:1 with TX clock
mcaspRegs->AHCLKRCTL = 0x00000000; // EXTERNAL HCLK
mcaspRegs->RTDM = 0x00000003; // Slots 0,1
mcaspRegs->RINTCTL = 0x00000000; // Not used
mcaspRegs->RCLKCHK = 0x00FF0008;
// TX - mine current
mcaspRegs->XMASK = 0xffffffff;
mcaspRegs->XFMT = 0x000080F8;
mcaspRegs->AFSXCTL = 0x00000112;
mcaspRegs->ACLKXCTL = 0x00000063;
mcaspRegs->AHCLKXCTL = 0x0000C001;
mcaspRegs->XTDM = 0x00000003;
mcaspRegs->XINTCTL = 0x00000000; // not used yet
mcaspRegs->XCLKCHK = 0x00FF0008;
mcaspRegs->SRCTL2 = 0x000E; // AXR[2] --> DIN MIC
mcaspRegs->SRCTL7 = 0x000D; // AXR[7] <-- DOUT
mcaspRegs->PFUNC = 0; // All MCASPs
mcaspRegs->PDIR = 0x1c000080;
...
// push code
System_printf("Push next 1\n");
static Uint32 XDATA_BIT = 0x20;
while ( (mcaspRegs->XSTAT & XDATA_BIT ) != XDATA_BIT) {
System_printf("XSTAT = %lx\n", mcaspRegs->XSTAT);
}
mcaspRegs->XBUF7 = value;
System_printf("Push next 2\n");
And finally log file looks like this
Push next 1
Push next 2
Push next 1
XSTAT = 151
XSTAT = 159
XSTAT = 151
XSTAT = 159
XSTAT = 151
...
Similar example with polling RSTAT works OK.
So, what can be the reason of problem?
Thanks and regards.