PAL Video example
Ariba
Posts: 2,690
After a few hours of checking every detail of the PAL timing, I got a working PAL example.
I should believe it when Chip says:
What seems to be very important is the transition from V-Sync to the first (blank) line. After this was right, I finally got colors. Just not the right ones. The PAL coefficients in the Prop2_Docs seem to be wrong, and I don't know how to calculate them.
So I just tried around, made a mix from NTSC and PAL coefficients and got accetable but not perfect color hues.
Attached is the code for the ones that live in the PAL world.
Andy
I should believe it when Chip says:
PAL is a real pain! ...
What seems to be very important is the transition from V-Sync to the first (blank) line. After this was right, I finally got colors. Just not the right ones. The PAL coefficients in the Prop2_Docs seem to be wrong, and I don't know how to calculate them.
So I just tried around, made a mix from NTSC and PAL coefficients and got accetable but not perfect color hues.
Attached is the code for the ones that live in the PAL world.
Andy
Comments
Very well done - that seems to work both on my monitor (reports "PAL" rather than NTSC) and some other gear here that seems to regard it as a standard PAL signal
THANKS.
It Works correct.
Now with some fine adjustments to remove right side zigzag from colour edges
Now PAL users will have working examples too.
One strange finding: my scope (TEK TDS2022B) will trigger OK on "all fields" and on "all lines", it will not trigger on "even field" or "odd field" (understandable, there is no odd er even fields in 312 line or 262 line TV signal), but it will trigger OK on a given "line number" in the NTSC signal, and will not do that on the PAL signal. Strange.
Maybe PAL really is a pain.....
I think those numbers were correct. What probably needed changing was the reference phase.
I have set the reference burst to orange, according a document I have found on the NET.
But rereading this document (again) I see that only the V part modulation (which is R-Y) must switch between positive and negative, and not the whole burst. I don't know what exactly Bit0 of SETVID affects, but I had the idea to try it totally different.
Instead of switching the modulation direction every second line, I made a positive and a negative set of Q coefficients and switch between these two with SETVIDQ. And voila, the colors are perfectly right here with the PAL coefficients that you suggest in the Docs.
So here is another version of the PAL color bars to try.
Andy
I think PAL with no saturation is legal, (at least in classic signal flows) so perhaps a version with no Burst, or Chroma, could check if it is a Colour modulation, or Sync issue ?
A test pattern that had optional cross hatch with border, and optional colour could be useful ?
Thanks.
Now I need only fine trim to remove zigzag on right side of colour strips.
This version give even correct aspect ratio on LCD TV 7'' PAL only
http://dxr3.sourceforge.net/download/hardware/l865a.pdf
Adjusted now.
It is this 2 places I need change
This datasheet shows the timing and levels, but what I need is the math of the Y/I/Q coefficients. Wikipedia and this doc helped a lot:
http://www.deetc.isel.ipl.pt/Analisedesinai/sm/downloads/doc/ch08.pdf
@Sapieha
If you reduce the top and bottom blanks, you must increase the visible lines by the same amount otherwise the vertical timing is totally wrong.
Andy
This time without the zig-zag borders. The timing was too exact for non interlacing what caused this ziz-zag. With a lttle detune it goes away.
Attached is also another color bars code which shows all colors of Videomode 8. Looks like the colors are right now.
Andy
Both function correct.
Now I need only find H-sync timings to skip blank strips -- My LCD TV-monitor not need that ones.
Wow! I never thought of handling the phase negation by using a different set of coefficients. Makes sense!
What bit 0 of the VID configuration register does is select between phase (=0) and -phase (=1) for modulated video. It also selects the polarity of HSYNC for VGA modes.
Can one of You say me what I'm doing vrong.
I think I fond it.
Code attached.
The attached file shows the NTSC and PAL vertical sync, so you can see the differencies.
Andy
Thanks Chip
Can it be that the VID bit0 not just reverses the modulation direction but also makes a phase-jump of 180 degree? This would explain why a phase switch per VID bit0 not gives the same result as negating the Q coefficients.
Andy
Can You help now from that tile-texture driver help build ---- Tile-Char driver
Regards
I'm not sure. I suppose it would have to do with the state of the phase when bit0 is toggled. I just used the same technique that I used in Prop1, and today I don't remember any more than that.
Not sure if you call this Tile-Char driver, but I have made a Video text driver. Like the VGA version I posted once this driver uses Video mode 7 and holds the font in the stack ram (128 chars
Thanks.
Works very nice on my hardware.
At the 96 columns, my monochrome amber NTSC display is just pixel perfect. That's about what it was designed for.
I find the 64 and 72 column text readable on an ordinary NTSC TV as well.
I've attached modified code to fire off a second monitor on pins 3&5 and NTSC component output. The same kind of modification should work on PAL too, but I didn't have a device to test on.