Shop OBEX P1 Docs P2 Docs Learn Events
Best TV driver. — Parallax Forums

Best TV driver.

KyeKye Posts: 2,200
edited 2009-09-20 15:03 in Propeller 1
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,

Comments

  • potatoheadpotatohead Posts: 10,261
    edited 2009-09-19 04:42
    At 100 Mhz, you can get the max, which is 640 pixels in the safe area. The Parallax driver that comes with the Propeller Tool will easily do this. It's a tile mode driver with a lot of nice configuration options.

    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
  • jazzedjazzed Posts: 11,803
    edited 2009-09-19 04:47
    I like ericball's graphic version where the Propeller hat breaks into hundreds of pieces. Vividly bright colors and there is no startup color blooming. Can't find the link. Doug I'm sorry that haven't had time to try your offering yet.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Steve

    Propeller Tools Post Edited (jazzed) : 9/19/2009 4:52:26 AM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-19 04:53
    I agree with potatohead: Chip's TV.spin has everything you need. It even autoscales to fill the screen when the tile count is below maximum. Granted, there's a certain amount of trickiness and opacity to the code, but think of it as an opportunity for developing more user-friendly front-end interfaces, rather than a hindrance. smile.gif

    -Phil
  • potatoheadpotatohead Posts: 10,261
    edited 2009-09-19 04:54
    (Eric Ball Driver) That one is in his signature. Great driver, but it's going to require a tile cog be written to meet the spec given. I also am not sure it can do the very high resolutions. That one is timed for specific pixel clocks and that timing is part of the whole vibrant color scheme. Eric does the color manually using VGA mode. 224 pixels x up to 400 pixels, interlaced is the resolution, I believe.

    @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
  • potatoheadpotatohead Posts: 10,261
    edited 2009-09-19 05:03
    Here's a graphics demo that contains S-video info.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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
  • potatoheadpotatohead Posts: 10,261
    edited 2009-09-19 05:27
    @Jazzzed: No worries. I'm coding the colors portion right now. So, now is a good time to wait actually! [noparse]:)[/noparse] Really, all you are gonna see is two color text! Getting the 80 Columns was the big deal. Newer TV displays can do that. Once the color stuff is done, then I'm hoping people pick up and use it. 80 seems to be that magic number where it's past cool and kind of useful, to just works.

    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!
  • KyeKye Posts: 2,200
    edited 2009-09-19 15:43
    Ah thanks, I already have a whole awsome vga library that I wrote. I would rather not have to mod it much to get it to work with another display. That said, the video library I worte works on a:

    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,
  • potatoheadpotatohead Posts: 10,261
    edited 2009-09-19 16:05
    Ok, you are looking to just replace your VGA driver. I've not tried it. (VGA is a PITA for me because I travel)

    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
  • potatoheadpotatohead Posts: 10,261
    edited 2009-09-19 16:27
    http://forums.parallax.com/forums/default.aspx?f=25&m=385414

    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
  • KyeKye Posts: 2,200
    edited 2009-09-19 18:24
    Okay thanks, this is really helpful since tc/vga drivers are rather unforgiving and complicated if haven't already written one.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,

    Post Edited (Kye) : 9/19/2009 6:35:20 PM GMT
  • KyeKye Posts: 2,200
    edited 2009-09-20 01:32
    Need more help. I'm almost ready to attempt this and roll my own driver.

    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,
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-20 01:55
    Kye,

    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
  • KyeKye Posts: 2,200
    edited 2009-09-20 02:19
    Already consulted. The things I'm asking about are less used but I would like to know what they are for reference.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • KyeKye Posts: 2,200
    edited 2009-09-20 03:09
    Okay, I reconsulted all the info and I have a sketchy picture of what's going on. The thing that is bothering me still is all the stuff the the prop chip does in the background for me.

    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
  • potatoheadpotatohead Posts: 10,261
    edited 2009-09-20 03:20
    Yes, it's that simple.

    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
  • KyeKye Posts: 2,200
    edited 2009-09-20 15:03
    Thanks,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
Sign In or Register to comment.