AnsweredAssumed Answered

ADV7171 video output SYNC issues

Question asked by Dr.Lightning on Mar 6, 2011
Latest reply on Mar 7, 2011 by Dr.Lightning

My custom DM6467T board, generally derived from the EVM reference design, has instead an ADV7171 chip for video output, using the ADV7170 driver than came with my git download.  I had to modify the driver's default values for the ADV7171 mode registers, but now I have video output.


However, I have a sync issue.  While I'm an expert digital electronics designer and programmer, I'm new at video.  I'll call this a "frame" or "field" sync issue, as opposed to a line sync.  I believe one would also call this a vertical sync issue.


I'm displaying a synthesized image, where I'm filling my buffer, for example, with all green.  When I do this, things display fantastically.  This particular shade of green is YUV=(95,82,82).  I used U=V because is allows me to do a memset() into the YUV422 semi-planar buffer that has U & V interlaced.


I next modify the bottom half of the buffer (actually bottom half of the Y half (aka 2nd quarter) plus bottom half of the UV half (aka 4th quarter)).  I vary the values I put in.  My objective is to make the bottom half of the screen magenta.  When I put in YUV=(100,190,190), things look great.


When I put in YUV=(100,191,191), things go bezerk.  My display shows a small black bar across the center.  I'm confident this is the vertical blank between fields, and what I'm seeing is my monitor synced incorrectly.  There's also a flashing gray bar at top.  When I look at the scope, configured for video triggering, I should see a vertical blank very 16.7ms.  I see this.  However, periodically I also see AN EXTRA vertical sync that's offset about half as much from the others, at close to 8.4ms.  This extra vertical sync that I see on the scope seems consistent with what I'm seeing on the monitor.


I had the ADV7171 configured for "Mode 0 (CCIR-656): Slave Option".  The ADV7171 datasheet mentions "The ADV7170/ADV7171 are controlled by the SAV (start active video) and EAV (end active video) time codes in the pixel data."  I chose this on purpose, because it was the datasheet default recommendation, plus I assumed perhaps the DM6467T used this method.  However, seeing the sync problem caused by YUV=(100,191,191), I thought this particular pixel data might be appearing to be a time code in the pixel data.


So I reconfigured the ADV7171 for "Mode 0 (CCIR-656): Master Option".  Lo and behold, the vertical sync problem went away.  This suggested that time codes embedded in the pixel data was indeed the cause of the problem.  HOWEVER, another problem arose, that I'll call a line sync or horizontal sync problem.  Now, I see a thin vertical line all the way up the left side of the monitor.  This might be one pixel wide, and I think this means that all my line sync is wrong.  There's the possibility relativistic confusion when describing this...  The line is on the left and presumably everything to the right is my proper image shifted, rather than just overwritten at one column (I can't see the difference because the image is so simple).  I believe this means the ADV7171 is thinking "oh, new line" one pixel too EARLY, and thus it outputs one junk pixel followed by all the correct ones.


Meanwhile, when I try to pass through video rather than synthesize the frames, I get related problems.  With the ADV7171 in slave mode, I get the same black bar in the middle with flashing gray bar at top, yet between is my pass-through image (which has other issues to be addressed elsewhere).  With the ADV7171 in master mode, the vertical sync problem goes away, but my substantially blue (DVD player idle with logo) screen becomes magenta!  I believe this is due to an odd-count shift in the interlaced UV data, which causes U and V to get crossed, changing blue to (pinkish) magenta.


So what should I do to get over this difficulty?  Please suggest.  My only guess is to run the ADV7171 in master mode, but then do something to correct the line sync problem.  This would be either to better inform the ADV7171of what to expect, or reconfigure the DM6467T as to what it sends.  More specifically, tell the ADV7171 to wait one more byte before syncing, or tell the DM6467T to send out one less byte.


Otherwise, I'm probably totally wrong.  What should I do here?


Thanks in advance,