I’m using a dsk6711 to implement a delta sigma modulator. I need to write to both McBSP0 and McBSP1 synchronously. What is the easiest way to implement this?
I am useing the following routine to initialize the McBSP ports but it seems that usually McBSP0 starts one clock cycle sooner than McBSP1 (I mean the FSX0 is one bit ahead of FSX1). However it seems it is random and as I reset the CPU and reload it again, the situation might change and the ports might become synchronized.
Thanks,
Mohammad
void McBSPInit(void)
{
Uint32 Temp=0,Data=0;
MCBSP_enableSrgr(hMcbsp1); // Enable the sample rate generator
MCBSP_enableSrgr(hMcbsp0); // Enable the sample rate generator
for (Temp=0;Temp<150;Temp++) //Should have a two clock cycle delay here
Data++;
init_HWI(); // Enabling Interrupts
MCBSP_enableXmt(hMcbsp0); // Enable the transmitter0
MCBSP_enableRcv(hMcbsp0); // Enable the receiver0
MCBSP_enableXmt(hMcbsp1); // Enable the transmitter1
MCBSP_enableRcv(hMcbsp1); // Enable the receiver1
MCBSP_enableFsync(hMcbsp0); // Enable the frame sync generator0
MCBSP_enableFsync(hMcbsp1); // Enable the frame sync generator1
MCBSP_write(hMcbsp0, 0xF0F0);
MCBSP_write(hMcbsp1, 0xF0F0);
}
MCBSP_Config mcbspCfg = {
0x02000080, /* Serial Port Control Reg. (SPCR) */
0x00000040, /* Receiver Control Reg. (RCR) */
0x00040040, /* Transmitter Control Reg. (XCR) */
0x500F0000, /* Sample-Rate Generator Reg. (SRGR) */
0x00000000, /* Multichannel Control Reg. (MCR) */
0x00000000, /* Receiver Channel Enable(RCER) */
0x00000000, /* Transmitter Channel Enable(XCER) */
0x00000F03 /* Pin Control Reg. (PCR) */
};