Ahhh, I see, you want to allow for hue-shift, desaturation and similar effects? Well that seems more useful than exactly correct coefficients, I guess.
Lol Chip. I had heard the NTSC one, but not the others.
Do you happen to know how you came up with the $50_70_00 RGB values for NTSC burst? If I saw how that was done I might be able to do one for PAL hopefully.
@potatohead the stuff you added above doesn't help me that much with the colour burst RGB as it looks like it relates to someone's custom windows palette tool I don't have, when I took a quick look at your link.
I think I just toyed around with the values until I got the phase and amplitude right by looking at everything on the screen.
Yes, to do PAL, you will have to periodically modify the colorspace coefficients.
That page seems to tell the story. I took a moment to hook up a DVD player to my PVM. It has a feature where it will delay the horizontal and vertical scans so one can see sync on screen as colors.
Chip picked pretty close. The color reference output by the DVD player looks similar.
Actually, no.
As one could figure from the formula given, the HSL colorspace is actually hexagonal, i.e. the cross-section of the color space at L=50% is a hexagon with 50% grey at the center and the three primaries and three secondaries at the corners. Whereas the luma/phase/amplitude of an NTSC color carrier is just a polar vector in the YUV (or, rather, YIQ?) colorspace (and therefore, to get the RGB values of a certain phase/amplitude, one has to convert to an UV (or IQ) vector first and then convert that back to RGB. Or in simple terms, just do the same calculation performed by the colorspace converter hardware in reverse. ).
Yes the YIQ and YUV adds another layer of complexity. I think the chip works with YIQ but the burst is in the YUV colorspace. Layers upon layers of conversions, it is not trivial unless all the equations and values are used. I can at least solve a three variable simultaneous equation problem, or used to be able to back in the day My problem right now is getting the precise set of equations to solve.
RE: NTSC - Never The Same Color (I don't know if that's true)
It's true, or was true back in the days of vacuum tube TV sets. The color burst oscillators had a tendency to drift so the colors would change over time or as the set warmed up. I was just getting into electronics at the time and made a bit of change fixing TV's and tweaking the color oscillators so they locked to the color burst a bit better. Learned a lot from magazines like Popular Electronics, Radio Electronics, Scientific American, etc.
Yes, to do PAL, you will have to periodically modify the colorspace coefficients.
Another option might be negating the subcarrier frequency. The cosine output will remain the same, the sine output will flip. But, BBC R&D 1982-06 shows the cosine being inverted... Maybe between the color space converter and modulator U and V could be swapped. And, who knows what would happen if the frequency is not always inverted at the right time.
One thing I used to see with changing TV colours was on my regular flights between AUS and USA on those older 747's with CRT TV's hanging above the aisle. You'd start off in one hemisphere and end in another and the colours would totally change on the TVs! This is due to the Earth's magnetic field however and degaussing stuff. I had first thought this was a bit of a myth but it was quite noticeable.
No more with LCDs, and I'm glad. Those hanging TV's were hard to watch and looked tiny when far away! Now just the seats are tiny, in cattle class anyway.
Gave it a go today, uncommented TV line, commented VGA line, no signal. Hints?
Plz
Yes, those crappy overhead TV's. I largely ignored them and was a podcast listener early. That or some good sci-fi.
Back when I was fixing older tube sets for date money, room orientation mattered. The answer in the user manual was usually, "leave it on, and things will be fine", or some series of orientations...
Things like convergence, purity, general alignment, were all challenging. Each set a puzzle.
Just noticed my PVM has its picture rotated a degree or so too. Have to open it and move the yoke. Some things never change.
That one does recognize PAL, NTSC, SECAM in all forms.
I think I will put my DVD player into PAL and take a photo of the colorburst.
Ok, what is the complex demo line you have enabled, which settings did you enable? Can you post the code snippet so I can see what output you are using? Also check the value of the base pin you are passing in.
I will do that later tonight. No problem. Sorry to be a PITA. I haven't processed all you did yet!
My bits of time are split on NTSC and a Goerzal (how do you remember how to spell that) project that should be pretty fun for people.
Ok Potatohead I'll try to check back in later too to see how you go after I've done a few things. Just ensure you put SVIDEO on the base of a four pin group if you use that (Y is base pin, C is base pin + 1), and the optional composite will be then be output on BASE+2 pin. Only enable one of these output setup lines in the code.
If you choose Composite (CVBS) only you should be able to put the output anywhere. You'll see below I share this same base pin for everything as I have the breakout board fixed in place there. Also I have not yet tried video output on port B, only port A but in theory I think the code should work with both.
Enabling this line would activate simultaneous SVIDEO + CVBS outputs:
vid.initDisplay(@display1, VID#SVIDEO_CVBS, SVIDEO_BASE_PIN, 0, VID#INTERLACED, @lineBuffer1, LINEBUFSIZE, 0)
Enabling this line would activate SVIDEO outputs only:
vid.initDisplay(@display1, VID#SVIDEO, SVIDEO_BASE_PIN, 0, VID#PROGRESSIVE+VID#NTSC, @lineBuffer1, LINEBUFSIZE, 0)
Enabling this line would activate CVBS output only:
vid.initDisplay(@display1, VID#CVBS, SVIDEO_BASE_PIN+2, 0, VID#INTERLACED+VID#NTSC, @lineBuffer1, LINEBUFSIZE, 0)
The flags above can be set to either of these:
VID#PROGRESSIVE (default) or VID#INTERLACED
combined with
VID#NTSC (default) or VID#PAL
VID#PROGRESSIVE selects 240p/288p, while interlaced gives you 480i/576i
VID#PAL will select the 288p/576i timing instead of 240p/480i but not the right colour burst flip (yet).
If you test this out on real TV signal monitoring equipment it might find signal issues to be fixed in the driver so that should be good.
Also be sure you have a working setup too with existing images downloading with loadp2 etc and that the VGA default works for example. If you use the breakout board for VGA and TV, remember to unplug the unused cables. I've found VGA won't sync when any TV cables are fitted to the base pin due to loading up the hsync line with 75 ohms etc. It's a common mistake I make when I am switching between output types in my tests.
Finally, though this might already be known, this driver needs a RevB board.
If you use S-VIDEO with the P2-EVAL A/V breakout board you may want to make up one of these adapters. I just got a cheap RCA 3 wire Red/White/Yellow cable, chopped it up and stripped off one wire and used the white for chroma and yellow for Luma so I'd remember which is which because that is an unusual combination. Seems to work nicely. You need to find mini-din4 (S-VHS) connector to solder to it too. I just went with one of these connectors in Australia:
I made this because it was easy enough and I couldn't find anything on eBay that would do it after looking for a while. S-Video is getting pretty ancient these days. You'll also need the usual S-Video cable. I happened to have a couple lying about even though I've never really owned any device like a camcorder perhaps that needed it.
Ok, I got going. I was over thinking it. Thanks for the nudge.
Now I'll walk through those changes, next chance I get.
Using PAL timing does work great on this display. PAL indicator didn't light up though. Needs colorburst obviously.
This PVM has a "Blue Only" mode, I've not used much. Holy moly! I know what it's for now. Shows phase error like a sore thumb. I'll have to get a photo.
Running with luma only shows your nice work off. It's pixel perfect. Great work man.
Edit: I may try NTSC 4.43, which is basically NTSC with PAL colorburst frequency. This display supports it. I've never seen an image in that format.
Those NTSC changes I talked about the other night will help the quality of the chroma significantly. With that original xzero operating resetting the XFREQ phase the picture is pretty trashy and the periodic phase slipping was annoying.
Running with luma only shows your nice work off. It's pixel perfect. Great work man.
Edit: I may try NTSC 4.43, which is basically NTSC with PAL colorburst frequency. This display supports it. I've never seen an image in that format.
Great. Have a play with those interlace/progressive combinations too if you can and see if you think the timing is all good. I think I got all the line counts done right but it was hard to check with the scope alone.
Component is worth a look too. It can do SD at 480i/576i as well as 480p/576p, then move up to HD. You'll probably be right into that. Just be wary of the speed the P2 will run at with the HD timings - it will be overclocked and depending on the resolution you may need to start removing the text regions to be able to display it (just change them to do graphics instead). I think I'm going to migrate colour to mono text if the clock ratio is 2x-5x, that way the display will still sync. For 1x clock ratio I will disable the text and non-transparent graphics mode outright but the display should continue, instead of what it attempts today which loses sync.
@potatohead in case you want that 640 pixel wide 16bpp picture in that complex demo to work when running 720 pixels wide with TV output resolutions enable this line with these numbers to fix the image. You may have already figured it out for yourself...
Edit: I may try NTSC 4.43, which is basically NTSC with PAL colorburst frequency. This display supports it. I've never seen an image in that format.
There's also PAL60, which is PAL color coding in NTSC resolution/timing. Not a real standard and more of a hack to properly display 60Hz content on PAL TVs.
Infact, there's actually quite a bunch of oddball video formats that exist in some kind of strange limbo between NTSC and PAL.
Here's a handy table with all the ones I'm aware of:
| Format | Timing | Color coding | Color freq. | Black level | Usage/ Notes |
+--------+-----------+--------------+-------------+-------------+------------------------------------------------+
| NTSC-M | 480i 60Hz | NTSC | 3.58 MHz | 7.5 IRE | USA |
| NTSC-J | 480i 60Hz | NTSC | 3.58 MHz | 0 IRE | Japan |
| NTSC50 | 576i 50Hz | NTSC | 3.58 MHz | 7.5 IRE | Rare nonstandard, sometimes also called NTSC-N.|
| PAL | 576i 50Hz | PAL | 4.43 MHz | 0 IRE | Europe and a bunch of other places |
| PAL60 | 480i 60Hz | PAL | 4.43 MHz | 0 IRE | Nonstandard. DVD players, game consoles, etc. |
| PAL-M | 480i 60Hz | PAL | 3.58 MHz | 0 IRE | Brazil |
| NTSC443| 480i 60Hz | NTSC | 4.43 MHz | 7.5 IRE (?) | Some monitors try to interpret PAL60 as this. |
(Note that this leaves out all the wacky variations of the broadcast standards)
(Also note that black level is not that important, as it needs to be calibrated with the display's brightness knob, anyways)
With any luck these specialty extra TV formats in that table should still be possible just with tweaks to the timing and colourspace modulator settings, so if we want over time we could add submode flags for each during startup instead of simple "NTSC" & "PAL" today. But we need to get basic PAL going first.
“This PVM has a "Blue Only" mode, I've not used much. Holy moly! I know what it's for now. Shows phase error like a sore thumb. I'll have to get a photo.”
Back in the day when I used to work around TV studios, we would use a standard set of color bars and Blue Only mode to quickly set up a color monitor. With blue only mode you can quickly set hue and saturation by balancing the bars.
Maybe this can be an aid to you fellows designing display software.
One thing I used to see with changing TV colours was on my regular flights between AUS and USA on those older 747's with CRT TV's hanging above the aisle. You'd start off in one hemisphere and end in another and the colours would totally change on the TVs! This is due to the Earth's magnetic field however and degaussing stuff. I had first thought this was a bit of a myth but it was quite noticeable.
No more with LCDs, and I'm glad. Those hanging TV's were hard to watch and looked tiny when far away! Now just the seats are tiny, in cattle class anyway.
That reminds me of one of the older spectrometers I looked after. It was in a room directly behind the induction furnace and had a PC and a crt color monitor. When the furnace was running it not only changed the colors, it affected the electron beams in the crt so much that it looked like the video equivalent of abstract art. Would have made a great special effect for a scifi video.
Edit: I may try NTSC 4.43, which is basically NTSC with PAL colorburst frequency. This display supports it. I've never seen an image in that format.
There's also PAL60, which is PAL color coding in NTSC resolution/timing. Not a real standard and more of a hack to properly display 60Hz content on PAL TVs.
And NTSC50... Tandy Color Computer would output it. Most US sets I tried would display it. Good for a little extra blanking time. On that machine, one needs it. Has fast 6809, but bitmap only, no sprite assist.
Comments
EDIT: actually the dynamic xor mask needed to form it would be better to send, not the flipped value itself.
I think I just toyed around with the values until I got the phase and amplitude right by looking at everything on the screen.
Yes, to do PAL, you will have to periodically modify the colorspace coefficients.
That page seems to tell the story. I took a moment to hook up a DVD player to my PVM. It has a feature where it will delay the horizontal and vertical scans so one can see sync on screen as colors.
Chip picked pretty close. The color reference output by the DVD player looks similar.
For NTSC, the spec is 180 degree phase, 20 IRE.
https://en.wikipedia.org/wiki/IRE_(unit) That gives the voltage output.
Shouldn't a calculation like this get the RGB values?
https://www.rapidtables.com/convert/color/hsl-to-rgb.html
That's it for me tonight.
Today I found this handy vector tool online too. Linked from this guy's youtube video explaining PAL stuff.
Interesting video of him sending PAL via ESP32:
Demonstrator Tool:
http://bitluni.net/esp32-color-pal/
Actually, no.
As one could figure from the formula given, the HSL colorspace is actually hexagonal, i.e. the cross-section of the color space at L=50% is a hexagon with 50% grey at the center and the three primaries and three secondaries at the corners. Whereas the luma/phase/amplitude of an NTSC color carrier is just a polar vector in the YUV (or, rather, YIQ?) colorspace (and therefore, to get the RGB values of a certain phase/amplitude, one has to convert to an UV (or IQ) vector first and then convert that back to RGB. Or in simple terms, just do the same calculation performed by the colorspace converter hardware in reverse. ).
DOH!
Of course. I saw one set of equations a while back... that's what I get for late night posting.
It's true, or was true back in the days of vacuum tube TV sets. The color burst oscillators had a tendency to drift so the colors would change over time or as the set warmed up. I was just getting into electronics at the time and made a bit of change fixing TV's and tweaking the color oscillators so they locked to the color burst a bit better. Learned a lot from magazines like Popular Electronics, Radio Electronics, Scientific American, etc.
Another option might be negating the subcarrier frequency. The cosine output will remain the same, the sine output will flip. But, BBC R&D 1982-06 shows the cosine being inverted... Maybe between the color space converter and modulator U and V could be swapped. And, who knows what would happen if the frequency is not always inverted at the right time.
No more with LCDs, and I'm glad. Those hanging TV's were hard to watch and looked tiny when far away! Now just the seats are tiny, in cattle class anyway.
Plz
Yes, those crappy overhead TV's. I largely ignored them and was a podcast listener early. That or some good sci-fi.
Back when I was fixing older tube sets for date money, room orientation mattered. The answer in the user manual was usually, "leave it on, and things will be fine", or some series of orientations...
Things like convergence, purity, general alignment, were all challenging. Each set a puzzle.
Just noticed my PVM has its picture rotated a degree or so too. Have to open it and move the yoke. Some things never change.
That one does recognize PAL, NTSC, SECAM in all forms.
I think I will put my DVD player into PAL and take a photo of the colorburst.
All we need is the angle.
My bits of time are split on NTSC and a Goerzal (how do you remember how to spell that) project that should be pretty fun for people.
"don't you feel like you could Goer (go a) Pretzel ?"
just delete the pre- out of the middle. Goer-tzel
Ok Potatohead I'll try to check back in later too to see how you go after I've done a few things. Just ensure you put SVIDEO on the base of a four pin group if you use that (Y is base pin, C is base pin + 1), and the optional composite will be then be output on BASE+2 pin. Only enable one of these output setup lines in the code.
If you choose Composite (CVBS) only you should be able to put the output anywhere. You'll see below I share this same base pin for everything as I have the breakout board fixed in place there. Also I have not yet tried video output on port B, only port A but in theory I think the code should work with both.
Enabling this line would activate simultaneous SVIDEO + CVBS outputs:
vid.initDisplay(@display1, VID#SVIDEO_CVBS, SVIDEO_BASE_PIN, 0, VID#INTERLACED, @lineBuffer1, LINEBUFSIZE, 0)
Enabling this line would activate SVIDEO outputs only:
vid.initDisplay(@display1, VID#SVIDEO, SVIDEO_BASE_PIN, 0, VID#PROGRESSIVE+VID#NTSC, @lineBuffer1, LINEBUFSIZE, 0)
Enabling this line would activate CVBS output only:
vid.initDisplay(@display1, VID#CVBS, SVIDEO_BASE_PIN+2, 0, VID#INTERLACED+VID#NTSC, @lineBuffer1, LINEBUFSIZE, 0)
The flags above can be set to either of these:
VID#PROGRESSIVE (default) or VID#INTERLACED
combined with
VID#NTSC (default) or VID#PAL
VID#PROGRESSIVE selects 240p/288p, while interlaced gives you 480i/576i
VID#PAL will select the 288p/576i timing instead of 240p/480i but not the right colour burst flip (yet).
If you test this out on real TV signal monitoring equipment it might find signal issues to be fixed in the driver so that should be good.
Also be sure you have a working setup too with existing images downloading with loadp2 etc and that the VGA default works for example. If you use the breakout board for VGA and TV, remember to unplug the unused cables. I've found VGA won't sync when any TV cables are fitted to the base pin due to loading up the hsync line with 75 ohms etc. It's a common mistake I make when I am switching between output types in my tests.
Finally, though this might already be known, this driver needs a RevB board.
https://www.altronics.com.au/p/p1114-4-pin-line-mini-din-socket/
Pinout to use is here:
https://en.wikipedia.org/wiki/S-Video
I made this because it was easy enough and I couldn't find anything on eBay that would do it after looking for a while. S-Video is getting pretty ancient these days. You'll also need the usual S-Video cable. I happened to have a couple lying about even though I've never really owned any device like a camcorder perhaps that needed it.
Now I'll walk through those changes, next chance I get.
Using PAL timing does work great on this display. PAL indicator didn't light up though. Needs colorburst obviously.
This PVM has a "Blue Only" mode, I've not used much. Holy moly! I know what it's for now. Shows phase error like a sore thumb. I'll have to get a photo.
Running with luma only shows your nice work off. It's pixel perfect. Great work man.
Edit: I may try NTSC 4.43, which is basically NTSC with PAL colorburst frequency. This display supports it. I've never seen an image in that format.
Great. Have a play with those interlace/progressive combinations too if you can and see if you think the timing is all good. I think I got all the line counts done right but it was hard to check with the scope alone.
Component is worth a look too. It can do SD at 480i/576i as well as 480p/576p, then move up to HD. You'll probably be right into that. Just be wary of the speed the P2 will run at with the HD timings - it will be overclocked and depending on the resolution you may need to start removing the text regions to be able to display it (just change them to do graphics instead). I think I'm going to migrate colour to mono text if the clock ratio is 2x-5x, that way the display will still sync. For 1x clock ratio I will disable the text and non-transparent graphics mode outright but the display should continue, instead of what it attempts today which loses sync.
vid.setSkew(@second, 1280-1440)
Here's a handy table with all the ones I'm aware of:
(Note that this leaves out all the wacky variations of the broadcast standards)
(Also note that black level is not that important, as it needs to be calibrated with the display's brightness knob, anyways)
“This PVM has a "Blue Only" mode, I've not used much. Holy moly! I know what it's for now. Shows phase error like a sore thumb. I'll have to get a photo.”
Back in the day when I used to work around TV studios, we would use a standard set of color bars and Blue Only mode to quickly set up a color monitor. With blue only mode you can quickly set hue and saturation by balancing the bars.
Maybe this can be an aid to you fellows designing display software.
Jim
That reminds me of one of the older spectrometers I looked after. It was in a room directly behind the induction furnace and had a PC and a crt color monitor. When the furnace was running it not only changed the colors, it affected the electron beams in the crt so much that it looked like the video equivalent of abstract art. Would have made a great special effect for a scifi video.
And NTSC50... Tandy Color Computer would output it. Most US sets I tried would display it. Good for a little extra blanking time. On that machine, one needs it. Has fast 6809, but bitmap only, no sprite assist.