Altera_Forum
Honored Contributor
14 years agoVIP Switch module
My current project is attempting to use several switch modules to change the path of a video pipeline at run time. I have been able to get the modules themselves to run so long as I"m not switching them around but now that I am trying to switch them I have noticed some odd behavior.
The VIP user guide says to either write to the control register or use the output_switch feature. We are using the control register because data is not being supplied to all input ports of the switches at all times and so it seems that it should fail to sync the streams before switching. What I have implemented for testing is to read the status bits, turn off the switches by an IORD() macro to the MM control port and then read the status until it clears. What I have observed is that sometimes the switches are not stopping at all and I loop indefinitely USB_SWITCH_1_OFF;
USB_SWITCH_2_OFF;
USB_MIXER_SWITCH_OFF;
DelayMsec(50);
DebugPrintf("Waiting for usb mixer switch to return status = 0\n\r");
while(IORD(VID_USB_MIXER_SWITCH_BASE,1)==0x1){
counter++;
USB_MIXER_SWITCH_OFF;
DelayMsec(10);
}
DebugPrintf("counter = %i\n\r",counter);I have tried this with and without the short delays and there doesn't appear to be any difference in performance. When I try and read the various control port registers (go, status, output switch, Dout 0 source, ..etc) I am always getting the same data back so are the Dout source registers write only? There is no discussion of this in the user guide that I have found.