Using ADSP-SC573 Sharc core, SPORT driver from CCES 2.8.3
I'm trying to test a signal channel by transmitting known signals through the channel and receiving what comes out the other end. I'm using both HSPORTs in a SPORT, one for Tx and the other for Rx, for talking to a single audio CODEC. The CODEC is generating the clocks. Since it's a sigma-delta CODEC, there's a long round-trip delay, which is okay, but there is a one sample uncertainty in the delay, due to the fact that starting the Tx and Rx are two separate operations, and a frame sync can arrive between them. That's not okay. The SPORT is running in I2S mode at a 192K sample rate, 16-bit stereo, using DMA.
How do you do this? How do you guarantee that both Tx and Rx start on the same frame, when using an external clock? Even if I hand-coded it all in assembler, it appears that the enable bit for the two HSPORTs are in two different registers, so I don't see how to start them at the exact same instant. I could probably set up an interrupt handler on the frame sync, and start everything from there, which could work if the time to start them both was well under one frame time, but 5us isn't a very long time, and the ADI drivers do a lot of stuff. Is there an easier way?