cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mod28
Observer
Observer
2,272 Views
Registered: ‎03-16-2017

Video timing controller does not lock

Hi, I have problems working with the timing controller as detector. The IP core version is 6.1

 

For test I connected the generator timing output to the detector input. Configuration of the generator works. I confirmed the output signals.

 

I tested with the following code:

 

   /* Run selftest example */
   Status = XVtcSelfTestExample(VTC_DEVICE_ID);

   /* Checking status */
   if (Status != (XST_SUCCESS)) {
      xil_printf("VTC Selftest Example Failed.\r\n");
      return (XST_FAILURE);
   }

   xil_printf("Successfully ran VTC driver Selftest Example.\r\n");


   /* Setup the VTC Source Select config structure. */
   /* 1=Generator registers are source */
   /* 0=Detector registers are source */
   memset((void *)&SourceSelect, 0, sizeof(SourceSelect));
   SourceSelect.VBlankPolsrc=1;
   SourceSelect.VSyncPolsrc=1;
   SourceSelect.HBlankPolsrc=1;
   SourceSelect.HSyncPolsrc=1;
   SourceSelect.ActiveVideoPolsrc=1;
   SourceSelect.ActiveChromaPolsrc=1;
   SourceSelect.VChromasrc=1;
   SourceSelect.VActivesrc=1;
   SourceSelect.VBackPorchsrc=1;
   SourceSelect.VSyncsrc=1;
   SourceSelect.VFrontPorchsrc=1;
   SourceSelect.VTotalsrc=1;
   SourceSelect.HActivesrc=1;
   SourceSelect.HBackPorchsrc=1;
   SourceSelect.HSyncsrc=1;
   SourceSelect.HFrontPorchsrc=1;
   SourceSelect.HTotalsrc=1;
   /* Setup the VTC Polarity config structure. */
   memset((void *)&Polarity, 0, sizeof(Polarity));
   Polarity.ActiveChromaPol = 1;
   Polarity.ActiveVideoPol = 1;
   Polarity.VBlankPol = 1;
   Polarity.VSyncPol = 0;
   Polarity.HBlankPol = 1;
   Polarity.HSyncPol = 1;
   /* Setup the VTC Signal config structure. */
   memset((void *)&SignalCfg, 0, sizeof(XVtc_Signal));
   SignalCfg.OriginMode = 1;//Set Frame Origin to Start of Active Video
   SignalCfg.HTotal = 7;
   SignalCfg.HActiveStart = 0;
   SignalCfg.HFrontPorchStart = 3;// Active Video Width
   SignalCfg.HSyncStart = 4;// Active Video Width + FP Width
   SignalCfg.HBackPorchStart = 5;// Active Video Width + FP Width + Sync Width
   SignalCfg.V0Total = 7;
   SignalCfg.V0ChromaStart = 0;
   SignalCfg.V0ActiveStart = 0;
   SignalCfg.V0FrontPorchStart = 3;// Active Video Height
   SignalCfg.V0SyncStart = 4;// Active Video Height + FP_Width
   SignalCfg.V0BackPorchStart = 5;// Active Video Height + FP Width + Sync Width
   /* Write VTC config to HW */
   XVtc_RegUpdate(&Vtc);
   XVtc_SetPolarity(&Vtc, &Polarity);
   XVtc_SetGenerator(&Vtc, &SignalCfg);
   XVtc_SetSource(&Vtc, &SourceSelect);
   XVtc_DisableSync(&Vtc);// not Synchronize the Generator to the Detector

      XVtc_RegUpdateEnable(&Vtc);

/* Enable VTC Generator and Detector*/
XVtc_Enable(&Vtc);

   /* Setup the VTC Timing structure. */
   memset((void *)&Timing, 0, sizeof(Timing));
   memset((void *)&DetSignal, 0, sizeof(DetSignal));
   memset((void *)&HoriOffsets, 0, sizeof(HoriOffsets));
   memset((void *)&DetPolarity, 0, sizeof(DetPolarity));

   while(1)
   {
      usleep(1000000);
      XVtc_GetDetectorPolarity(&Vtc, &DetPolarity);
      printStatus();
   }

 

void printStatus()
{
   if ((XVtc_GetDetectionStatus(&Vtc) & XVTC_STAT_LOCKED_MASK))
   {
      xil_printf("locked\n\r");
   }else
      xil_printf("not locked\n\r");
}

 

However, detector does never lock. Do I need to update the register somewhere or am I missing something?

 

many thanks

vtc_bd.PNG
0 Kudos
Reply
6 Replies
mod28
Observer
Observer
2,217 Views
Registered: ‎03-16-2017

i am providing all signals needed for the detector operating.

i am following the configuration sequence, updating the configuration with 'XVtc_RegUpdate'

fsync_in is set to '0', the IP configured for 'disabled'

both generator and detector are enabled

 

is there a minimum pulse length required? i only have 1 clock domain

do I need to call 'XVtc_RegUpdate' before reading the status? I don't think so...

0 Kudos
Reply
florentw
Moderator
Moderator
2,135 Views
Registered: ‎11-09-2015

Hi @mod28,

 

You can use the xapp1295 as example. I uses the VTC as detector.

 

You should also try 2 different instances for detector and generator. I am not sure if detecting what is outputed from the same core works.

 

Let me know if that helps,

 

Best Regards,

 

Florent


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
watari
Teacher
Teacher
2,126 Views
Registered: ‎06-16-2013

Hi @mod28

 

Generally, video timing detector requires at least "DE (active video signal)".

In this case, Xilinx's VTC requires at least "hs, vs, active_video".

Also, you are paying the care to sync polarity, too.

 

Could you confirm them ?

 

Thank you.

Best regards,

mod28
Observer
Observer
2,108 Views
Registered: ‎03-16-2017

thanks for your help. Yes, I am providing hs, vs and active video (as shown in picture). 

There was a previous version on which using only 1 core as generator and detector would not work due to a bug. I am using the IP core version 6.1 so it should work. 

 

Sync_in is set to '0' as stated in pg016. I set the polarity in Polarity config structure. I changed it occasionally with no luck. 

 

Polarity should be detected by the core without further configuration. 

 

@florentw, thanks for the link (I think you meant xapp1285) The link in the document for xapp1285.zip is no longer working. Couldn't find the sources. 

0 Kudos
Reply
florentw
Moderator
Moderator
2,105 Views
Registered: ‎11-09-2015

Hi @mod28,

 

Please use this link to download the xapp1285 (link from DocNav).

 

Best Regards,

 

Florent


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Reply
florentw
Moderator
Moderator
2,070 Views
Registered: ‎11-09-2015

Hi @mod28,

 

Do you have any updates on this?

 

Best Regards,

 

Florent


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Reply