Best TV driver.
Kye
Posts: 2,200
Hey guys,
Whats the best TV driver aviable for the prop currently? And anyone have a link to it so that I can download it.
I'm looking for something that runs a tile driver and can use the propeller chips internal rom·font and has a pretty good selection of color to use.
It doesn't need to be able to do sprites but I need it to be able to make a basic·GUI using tiles (16 x 16 (4 color)·tiles prefered).
I know that TV drivers are not as flexible as vga drivers but I have a project right now where I must use tv drivers. I plan on running the clock at 100Mhz so I believe I should be able to get something nice.
It would also be good if it could handle the max NTSC resoltuion.
Thanks for your help!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Whats the best TV driver aviable for the prop currently? And anyone have a link to it so that I can download it.
I'm looking for something that runs a tile driver and can use the propeller chips internal rom·font and has a pretty good selection of color to use.
It doesn't need to be able to do sprites but I need it to be able to make a basic·GUI using tiles (16 x 16 (4 color)·tiles prefered).
I know that TV drivers are not as flexible as vga drivers but I have a project right now where I must use tv drivers. I plan on running the clock at 100Mhz so I believe I should be able to get something nice.
It would also be good if it could handle the max NTSC resoltuion.
Thanks for your help!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Comments
The setup for it is a little more complex because it uses both tiles and color palettes. But, you can do a ton with it, making very good use of the Propeller RAM.
Take graphics_demo.spin and put it through it's paces, changing the parameters there to get your resolution where you want it. I've run this one at 640 pixels before. Sticking with this driver means being able to use graphics.spin, if you want to. Nice bonus, if you need it.
The tricky part about this driver is both the colors and the tiles.
The colors array contains up to 64 sets of 4 colors.
The screen array contains all the tile addresses, and the colors. Tiles are 64 byte aligned, with the lower bits used to call out a set of colors from the colors array, and that is what aligns the tiles. Look at the assembly language TV driver to see this in action. This caused me no end of confusion at first. To get a grip on this, run the graphics_demo.spin, then point one of the tiles at one of the characters in the Propeller ROM. When you get that right, you know you've got the addressing and colors down.
That also means you can save on RAM by pointing to the Propeller ROM for characters. Printing out text is a PITA this way, but it's memory cheap. Basically, any of the tiles can point to any 64 byte aligned portion of the Propeller address space.
Build from there.
BTW: That driver does full interlaced color horizontally, and an interlaced signal, if you want, vertically. With no tricks, you get 89 colors to work with. Palette.spin, also with the Propeller tool, will show you most of the colors. A 640x400 screen will work nicely, just don't put colors that are opposites on the color wheel close together and it will work out fine.
Does your TV display have S-video? If so, you can eliminate the color dot crawl, for a very nice looking 640x400 screen running that way. This appears to be only a VCFG bit change and a small reproduction of the TV circuit, with the aural resistor not connected to the others, and a cable away.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/19/2009 5:03:29 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propeller Tools
- Propalyzer: Propeller PC Logic Analyzer
- BMA: An on-chip PASM Debugger
- SPUD: Spin Source Level Debugger
Post Edited (jazzed) : 9/19/2009 4:52:26 AM GMT-Phil
@Phil: Agreed. A more flexible driver has yet to be written. If you don't need high color density, that driver is the way to go. IMHO, it's a bit tough for newbies to get in and tinker with, but it's really great otherwise. It will do the max resolution at 80Mhz too.
Edit: Phil, I think the most useful additions would be a setcolor command, that just does the tile at X,Y. Maybe setcolor (x,y,color,index). That way, a given pixel could be set, and all pixels in the tile would change because of how the hardware works. Another would be tileaddress(x,y,address 64 bit aligned). Those two would eliminate most of the new user questions we've had over the years.
Kye, one thing I would do is reserve a color in all the palette entries for your mouse pointer. This leaves you two active colors per tile, plus whatever background color you want. That way, you can do a software mouse pointer, draw it during your VBLANK for smooth motion, and not have it change attributes as it moves across the screen.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/19/2009 3:42:25 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/19/2009 5:20:23 AM GMT
So we will see on all of that.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Frame buffer composed of (X) number of words which contain the address information for a (16x16 pixel tile (16 longs))
And the color buffer with the same size of the frame buffer that supports 4 color per tile of information.
Can tv.spin do this? I don't really understand how the protcool works so I'm not really sure if 4 unique colors per tile is possible. I really don't want the row color stuff.
I'm thinking about using Erics TV driver framework to get everything working. However its kinda confusing.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Frankly, that's not unlike the stuff I just wrote. I'm operating on bytes, because that makes the most sense for text. Small, fast, etc...
You get 4 colors per tile in TV mode. At the pixels and color level, it all works the same where feeding the waitvid is concerned.
What you are asking for could be done in one COG. Baggars has modified Chip's TV driver multiple times. That's one way to go. At that tile and color size, one COG will do the max resolution. If you go and look at the driver I'm writing, I've nicely commented Eric's template. What you want to do is code in the blanking area to update your counters and such that keep track of which tile and your screen pointers, and put a loop in the active scan area that will fetch your data from the buffers. IMHO, you don't need an additional COG to generate graphics because the number of fetches from the HUB for your scheme will fit into your active video waitvid loop. This is true especially at 100Mhz. No problem.
The parent SPIN program, in the stuff I did, has the computation done for adjusting the timing in the active scan area. Just set for 80 characters and take those values and plug them directly into the TV driver, or move them into your own parent SPIN program, which is what I think I would do. From there, you can code up your waitvid loop. See the "Seriously Improved NTSC" thread. 80 percent of the work you require is done there.
Once that's done, you should then be able to just plug that TV driver into your framework and go.
I've set the timing for the active video area to be 2560 PLLA. This is an easy number to work with, and the pixel / waitvid calculations are done for you, leaving just your active loop to read your buffers. The TV driver is already operating in the mode you want to use on TV.
Edit: One other thing: What vertical resolution do you want? The way it's running right now, the driver does a full interlaced display. That's 400 lines. Either double up your tile logic like I did to get 200, or run the driver non-interlaced. Right now, Chips driver runs non-interlaced perfectly. Mine doesn't do the color quite right. This isn't really noticeable at 320 pixels or less, but it will be at 640. Look at the text cog to see the VBLANK section where each frame is dealt with. It's just a matter of adding or subtracting from your scan / tile counters.
The other TV drivers out there mostly do lower resolution video, or won't do PAL.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/19/2009 4:20:07 PM GMT
That's the thread, if you want to mod that driver work. For an example of modding the Parallax driver, here's Baggars mod to do 16 color fat pixel bitmap.
http://forums.parallax.com/forums/default.aspx?f=25&m=382977
I'm not sure which is easiest, so there you go.
One thing about TV drivers is how they build signals. The simple ones build nice easy NTSC signals to work with. They however won't do PAL, and they break down color wise over about 256 pixel resolution. Artifacting begins, and that's fun for lots of colors, but not so fun for a GUI. The two I linked have the core signal timing you need. The trick for you is to just deal with the active pixel area, leaving the rest alone for the easiest mod.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/19/2009 4:32:34 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 9/19/2009 6:35:20 PM GMT
However, a few things which still confuse me are:
Broadcast Mode? What is this?
Baseband Mode - S video vs Composite Mode. What's going on here? Is the 560K ohm resistor needed or not needed? What exactly does the video config register mean when in modes %10 and %11? It says its outputing baseband and broadcast at the same time...
Aural Sub Carrier? What is this also? Audio for broadcast mode?
There's very little information I can find on these topics so a full explination would be nice.
Also, when ouputing color information. The 3 bit luma value has what constriants on it and what are the reconemend values for it and why?
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
You will probably get answers to most of your questions here; but, since you seem to be looking for documentation, it would be advantageous to acquire Andr
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
For example... Just turing on ctrb when the vcfg is in broadcast mode makes it modulate the video signal... is it that simple?
The aural sub signal I get now is just fm audio. Not to hard to make with the prop chip, but there doesn't seem to be any parallax reference drivers that acutally use this setting.
I'm guess however it would let you do full tv stuff. However, why does this setting exist since it must be in another cog anyway? I'm not really sure what it does...
Is going into and out of s-video mode as simple as just turning off the vcfg bit that enables chroma in the baseband? And if so then why does this setting exist for broad cast mode?
Also, why dos the video streaming unit do broad cast and baseband at the same time when only one is used. Seems odd...
....
I think I may just be asking stupid questions because it seems like all the ... questionably usefull? modes·of the video driver in tv mode are just different ways it can be configured. Not necessarily used...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 9/20/2009 3:21:11 AM GMT
The broadcast mode is for RF signal generation. I used it once to put the Parallax driver on a TV. Depending on your xtal, it may or may not look good. Nobody uses the FM capability that I know of.
Going from baseband to S-video is just setting the bit in VCFG, and wiring the resistor to not be part of the 3 resistor DAC. If you are just doing baseband, the fourth resistor is not needed.
Don't know the answer to the broadcast mode question. That mode has not seen any real use.
The key thing to note is your PLLA per pixel. Chroma is modulated for you by the propeller. A pixel clock of 16 PLLA or greater gives you the full color resolution available. Below that there can be significant color clash, particularly with colors that are opposites on the color wheel.
propeller.wikispaces.com has some good info on color possibilities with the TV driver. Most of that info is NTSC, and most of it will apply to PAL, but for the hi-color artifacting. That's done differently in PAL and is something I probably need to revisit. PAL appears to be capable of higher color sets, with out the resolution loss seen in NTSC. (another day)
Basically, 00, 01 are sync values. 02 is your black. On a monochrome pixel, 02 through 07 can be used for intensity. On a color pixel, to keep the signal in spec, 02 through 06 are acceptable for intensity. If you do use 07, then you get an out of spec, high saturation color. I've not had a display fail to display it, but just so you know...
At 16 PLLA or above, you can use essentially any colors in combination. On baseband there will be some artifacts between very aggressive color transitions. On S-video, these probably won't be there as the chroma has it's own channel. Below 16 PLLA, keep transitions to sequential low degree deltas on the color wheel, and or make detail info monochrome.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/20/2009 3:32:44 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,