NTSC & PAL templates
ericball
Posts: 774
The purpose of this code is twofold. First, it shows the NTSC/PAL color gamut for Propeller baseband video.
Second, this code is intended to be a relatively simple template which may be used by others to develop
Propeller video drivers. Note: this code creates an 29.97 Hz 525 line (NTSC) or 25 Hz 625 line (PAL) interlaced display.
I have finally completed the PAL version. Thanks to Coley for his testing assistance and the autodetect code (which I've also added to the NTSC code).
Composite NTSC sprite driver: http://forums.parallax.com/forums/default.aspx?f=25&m=343999
NTSC color bars (template): http://forums.parallax.com/forums/default.aspx?f=25&m=347839
Post Edited (ericball) : 6/21/2009 11:32:01 PM GMT
Second, this code is intended to be a relatively simple template which may be used by others to develop
Propeller video drivers. Note: this code creates an 29.97 Hz 525 line (NTSC) or 25 Hz 625 line (PAL) interlaced display.
I have finally completed the PAL version. Thanks to Coley for his testing assistance and the autodetect code (which I've also added to the NTSC code).
Composite NTSC sprite driver: http://forums.parallax.com/forums/default.aspx?f=25&m=343999
NTSC color bars (template): http://forums.parallax.com/forums/default.aspx?f=25&m=347839
Post Edited (ericball) : 6/21/2009 11:32:01 PM GMT
Comments
I have also made a PAL version (attached), but there is at least one bug I haven't been able to puzzle out yet.· So if anyone out there has a good knowledge of PASM, PAL,·the equipment to test things out (i.e. PAL TV with 576 visible lines) and wants to help let me know!· Note: PAL colorbars.spin is not finished - in addition to the bug, it hardcodes the alternating phase colors.
I've removed the attachment as a later version is attached below.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: http://forums.parallax.com/showthread.php?p=800114
NTSC color bars (template): http://forums.parallax.com/showthread.php?p=803904
Post Edited (ericball) : 5/24/2009 10:29:02 PM GMT
Also, I would like to start with non-interlaced, which you say is 262 line frame but that odd # frame is better... Is there any easy way to make it an odd # frame?
Also, if you don't mind... Is there an easy way to reduce the number of active lines?· I guess just output the background color for top and bottom lines, right?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
I'm checking into this.· The question is whether $xA and/or $xF are valid colors.· Note: my original submission had the colorburst as color #0, which meant color $0C was yellow.· I've changed this so colorburst is color #8 so color $0C is blue, to match PAL and TV.spin. For non-interlaced, an odd number of [noparse][[/noparse]u]lines[noparse][[/noparse]/u] per frame is recommended.· The easy way is to reduce the number of active lines from 241 to 240.· Note: my original submission had the JMP for interlaced in the wrong place. Yep.· Increase the number of blank lines before the active lines and add blank lines after the active lines.· Just keep the total number of lines the same and add the same number of lines to the top and bottom.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: http://forums.parallax.com/showthread.php?p=800114
NTSC color bars (template): http://forums.parallax.com/showthread.php?p=803904
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
This is what I got on my Demoboard and Hybrid.
The flicker on demoboard is quite pronounced, phase is off somewhere...it is clearer on Hybrid but still a problem with the phase in the top 1/8th of the display.
Coley
EDIT, I should note that these are from the PAL version, NTSC is rock solid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PropGFX - The home of the Hybrid Development System and PropGFX Lite
Post Edited (Coley) : 5/15/2009 7:41:35 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
I tried to use 4.43 and 8.86 Xtals, with code changes, to try and give the counters an easy time, but the whole video driver seemed to fail (min 80MHz????) 17.74 was deemed to be just plain spitefull.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·······
······· "What do you mean, it doesn't have any tubes?"
······· "No such thing as a dumb question" unless it's on the internet
········
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: http://forums.parallax.com/showthread.php?p=800114
NTSC color bars (template): http://forums.parallax.com/showthread.php?p=803904
edit: removed attachment as the final version has been added to the first post.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: http://forums.parallax.com/showthread.php?p=800114
NTSC & PAL templates: http://forums.parallax.com/showthread.php?p=803904
Post Edited (ericball) : 6/22/2009 4:49:29 PM GMT
Tested OK on my PAL TV.
Nice and steady but I notice that there are two colours that don't seem to be quite right.
1st Purple band in from the left and second blue band in from the right are alternating between the colour and black.
I change the colour table to be white to black all the way across the line and these black lines disappeared.....
Adding in the equalisation and serration pulse make the image more stable, there is more dot crawl when left out.
I've also modified your code to auto select the hardware it's running on, Hydra, demoboard or Hybrid.
Regards,
Coley
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PropGFX - The home of the Hybrid Development System and PropGFX Lite
Programming is an art that requires discipline.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
JMH
The autodectect code is quite cool.· However, it's a little advanced for something which is supposed to be as simple as possible.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: http://forums.parallax.com/showthread.php?p=800114
NTSC color bars (template): http://forums.parallax.com/showthread.php?p=803904
Post Edited (ericball) : 6/20/2009 6:45:32 PM GMT
A big thanks to Coley for his testing assistance and the autodetect code (which I decided to use).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: http://forums.parallax.com/showthread.php?p=800114
NTSC color bars (template): http://forums.parallax.com/showthread.php?p=803904
I've been trying to increase the active video time of the PAL template as there's only 42.7uS and it should be just over 50uS. I have tried without success and really need some help.
I initially thought increasing the plla cycles for each pixel would do the job but it made no difference increasing this past 31.
I've shifted the active section so that it's in the correct start position by reducing the back porch but because I haven't been able to increase the active video section, I've had to increase the front porch to maintain the correct line length.
Really struggling to see where to go now so any help would be greatly appreciated.
Rob
I'm not sure what you're trying to accomplish, but let me see if I can explain how timing works on the Propeller.
All timings are in cycles of 16 times the colorburst clock (70,937,900Hz for PAL or 14.097ns per cycle). Each line is 64us, or 4540 cycles which the sample driver divides into:
If you want to increase the active video time, you need to decrease the overscan values (232 & 233) by equal amounts.
Eric
as it was, the overscan values meant the active video was only 42.7uS so the video only occupied the middle of the screen with large black bands either side. I just couldn't get all the info' on the screen.
I am a real novice at the video generation side of the propeller even though I've been programming in PASM for nearly 8 years, shocking I know. It's only now that I have to deal with video that I've started to look into it seriously.
The main reason for trying to understand your excellent templates is I really need to modify the TV Overlay object that Phil Pilgrim wrote because it's for NTSC and I live in the UK and need it to be PAL.
While trying to see the workings of your template I noticed (may be wrong here) that you don't do half lines for the odd/even fields. Is that correct?
That's not to say it doesn't display okay but I've used the blank lines at the start of each field to superimpose telemetry data and initially I had problems until I only used the odd field. I used an LM1881 sync separator to get the composite sync pulses and the odd/even field.
Sorry for babbling on but wanted to give you some idea what I was up to.
Thanks again
Rob
It's been a while, but I'm 99% certain the code does the correct halflines for even/odd fields. See the comments. Make sure you aren't adding lines (i.e. more than 312.5 lines per field).
I was never 110% happy with the PAL code, and being in Canada I didn't have a PAL TV to test with - only a capture card. PAL is a lot finickier when it comes to color modulation. And for some reason I was never quite able to get results as good as Chip's code.
I haven't looked at Phil's code, but I know there are some architectural differences between my NTSC and PAL code. (Doing both with the same code, like Chip's code is amazing, but also confusing.) So it may be tricky to modify Phil's code to PAL.
Eric
nailed it this morning. If you look through the code I've attached you'll see the differences. I changed the number of waitvids to 31 to reflect the size of the colour table and changed a few of the timings to get it to 64uS total for the line and 52uS for the active part of the video. It now shows a standard colour bar that fills the monitor.
It did require a little tweaking to stop the top of the image tearing due to the line time being a fraction of a uS out. I've not looked any further in to the half line issue as "it's working" so don't try and fix it!
Thanks for all your help.
Rob
Rob
Okay, I think I see what you're trying to accomplish. You want to display 124 pixels per line (31 WAITVIDs, 4 pixels per WAITVID). The maximum active part of the line is 3,689 cycles, which would mean 29.75 cycles / pixel. You want ~50us of active display, which is 3,547 cycles or 28.6 cycles / pixel. However, this needs to be an integer value.
124 pixels @ 29 cycles / pixel = 3,596 cycles = 50.7us 124 pixels @ 28 cycles / pixel = 3,472 cycles = 48.9us
Hopefully this works.
Eric
It's been very helpful and the penny has finally dropped regarding the video generator in the propeller, I now understand how it works (mostly).
I'm now going to look at making a pwm object using the video generator. I need to generate a 50Hz or 60Hz sine wave and doing it via the video generator allows me to play a lot with the pwm frequency, among other things.
Thanks again for all your help.
Rob