cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
chaitusvk
Adventurer
Adventurer
225 Views
Registered: ‎02-15-2019

Video Timing Detector Reg update stopping the program

Jump to solution

Hi ,

i am newbie to video processing , i am learning about Video timing Detector 

Initially i connected Video Timing generator to Video TIming Detector  ,  i am able to read timing details from it

 

when i connected real video (Working with Zybo Z7)  my program stops at  XVtc_RegUpdateEnable(&vtcDet) further it won't move 

 

#include <stdio.h>
#include "platform.h"
#include "xil_printf.h"
#include "xparameters.h"
#include "xgpio.h"
#include "sleep.h"

#include "xvtc.h"

#define LED 0x01

void configVtcDet(void);
void detectHdmi(void);
XGpio hpdGpio;
XVtc_Config *vtcConfigDet;
XVtc vtcDet;
XVtc_Timing TimingPtr;


int main()
{
	int Status;
    init_platform();

    print("Hello World\n\r");
    print("Initilizing\n\r HPD");

    Status = XGpio_Initialize(&hpdGpio, XPAR_AXI_GPIO_0_DEVICE_ID);
    	if (Status != XST_SUCCESS) {
    		xil_printf("hdmi hpd initialization failed\n\r");
    	}

    	vtcConfigDet = XVtc_LookupConfig(XPAR_V_TC_0_DEVICE_ID);

    Status = XVtc_CfgInitialize(&vtcDet, vtcConfigDet,vtcConfigDet->BaseAddress);

    if (Status != (XST_SUCCESS)){
    	xil_printf("VTC initialization failed\n\r");
        		return 0;
        }



    detectHdmi();
    usleep(3000000);
    configVtcDet();

    xil_printf("Horizantal:%d \n\r",TimingPtr.HActiveVideo);
    xil_printf("Verital:%d \n\r",TimingPtr.VActiveVideo);
    while(1){

     usleep(10000);

    }
    cleanup_platform();
    return 0;
}

void detectHdmi() {
	/*for hdmi hpd*/

	XGpio_SetDataDirection(&hpdGpio, 1, ~LED);
	print("In gpio function\n\r");
	XGpio_DiscreteWrite(&hpdGpio, 1, LED);
}

void configVtcDet() {

	XVtc_RegUpdateEnable(&vtcDet);
	XVtc_IntrDisable(&vtcDet, 0x100);
	XVtc_EnableDetector(&vtcDet);
	usleep(3000000);
	if (XVtc_GetDetectionStatus(&vtcDet)) {

		u16 vidMode = XVtc_GetDetectorVideoMode(&vtcDet);

		XVtc_ConvVideoMode2Timing(&vtcDet, vidMode, &TimingPtr);
	}

}

 

 

In ILA , all signals VSYNC,HSYNC,VACTIVE are good ,

I  added delay also ... i used debugger also but program is hanging on   XVtc_RegUpdateEnable(&vtcDet)

.Screenshot from 2021-06-21 15-56-45.pngScreenshot from 2021-06-21 16-01-39.pngScreenshot from 2021-06-21 15-25-48.png

Is any thing wrong my configuration ..

Please help me ...

 

0 Kudos
1 Solution

Accepted Solutions
chaitusvk
Adventurer
Adventurer
163 Views
Registered: ‎02-15-2019

I solved the problem , problem is  XVtc_RegUpdateEnable(&vtcDet) this command will update Register for Genrator but in my detector module their No genrator ... so it is problem in my program ..

 

After removing it my program working fine ...  i ask xilinx to includue  trival Timing Detector example in documents  

Thank you ....

View solution in original post

1 Reply
chaitusvk
Adventurer
Adventurer
164 Views
Registered: ‎02-15-2019

I solved the problem , problem is  XVtc_RegUpdateEnable(&vtcDet) this command will update Register for Genrator but in my detector module their No genrator ... so it is problem in my program ..

 

After removing it my program working fine ...  i ask xilinx to includue  trival Timing Detector example in documents  

Thank you ....

View solution in original post