Shop OBEX P1 Docs P2 Docs Learn Events
About TV-object — Parallax Forums

About TV-object

caskazcaskaz Posts: 957
edited 2010-07-04 14:28 in Propeller 1
Hi.
I'm going to learn tv-object(TV-driver v1.1 by Chip Gracey).
I don't understand constats of fntsc=3579545,etc.
And I also don't understand VCFG.
What is broadcast and baseband for VMode(page317)?
Althoug there are 3 type for VPins(page319) on Propeller manual, there are 16-type on tv_pins's group mode on TV-driver v1.1.

What does comments(+119, +18, +1=140, etc) for TV-driver mean?

Comments

  • potatoheadpotatohead Posts: 10,261
    edited 2010-07-04 07:31
    The constant is the colorburst frequency for NTSC, and PAL. The other constants are related to how many cycles of PLLA there are per scan line. This is important because this driver outputs the entire signal, meaning time constants and math is required to get the right waveforms at the right time. Another edit: Most everything in the driver is related to the base color frequency. On a Propeller, unless one is doing tricks, the period of the color frequency is divided into 16 clocks, and there is one of those for each HUE shown on the screen. One clock, is a tick of PLLA. All the other timings build from there.

    Also something to know is since the entire signal is output, the color values 00 and 01 are sync values, not intended for display. You will find some other values farther into the driver that are constants that describe the waveform in terms of "colors", time and bits. The VSCL and "color value" and "pixels" are literally chosen to get the sync pulses done. Be sure and differentiate doing this from the active graphics, which begin at the start of the back porch (left border), extend through the active (visible) graphics, to the front porch (right border).

    You should take a look at both the Propeller Manual and the Datasheet for some detail on VCFG. What I'll say right now is that register controls how the video generator works. You can specify mode, pins, color mode and output, etc... with it. It is related to VSCL, the both of them impact what the product of the waitvid instruction is, and how it operates on the bit-streams fed to it.

    Broadcast is actually a broadcast signal! How well it works depends on your xtal, and the channel output chosen. It's not used much. I used it once in a hotel that made it difficult to just do composite long ago. It actually worked well enough to advance the project I was working on at the time, but I do not recommend it otherwise. Baseband is simply a video signal, composite video, carried on one cable to the TV.

    Vpins should make some better sense once you've looked the Datasheet and Prop Manual over. Give those a careful read, then go back and parse out the bit-fields present in this driver. Most of the parameters will then be clear. (well, more clear [noparse]:)[/noparse] Edit: Chip broke down the bit fields into a variety of parameters. The various driver authors have all taken different approaches to this. Most simply load up a few longs, and write them to the registers. Where it's broken down, it's often to isolate something, like video mode, or pins, etc... so that it can be changed without having to understand and or deal with all the bits in the register impacted.

    The comments, are long offsets into the cog. This driver does things during blanking periods, breaking them up into tasks. Each one completes, and sets the pointer for the next one.

    This is actually a pretty great piece of video code. Have a lot of fun. If you get confused, there are other, simpler ones to look at, then return to this one. AiGeneric is one such driver, another is the driver for spudview, and a really simple one is SimpleNTSC by Cardboard Guru. All three of those output a simpler signal. Eric Ball wrote up some nice templates that I find easy to read as well.

    A visit to http://www.ntsc.com will yield a nice description of the video frame, and all it's timing details. Use this while parsing and charting out the driver.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    8x8 color 80 Column NTSC Text Object
    Wondering how to set tile colors in the graphics_demo.spin?
    Safety Tip: Life is as good as YOU think it is!

    Post Edited (potatohead) : 7/4/2010 2:19:32 PM GMT
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-07-04 07:34
    In the early monochrome days of television they did not have the 3579545 (3.58MHz) NTSC subcarier, or the 4.43MHz PAL equivalent. These were added to enable the colour information to be added to the existing system with the least impact to those that still had monochrome, hence their rather strange frequencies. They were worked out mathamatically to give the least apparant patterning. These subcariers carry the colour, by phase, and saturation, by amplitude. The television locks onto this frequency and decodes the colour information, hence it is defined so accurately. It should be within a few Hertz, but most TVs are quite forgiving as long as it is very close. Tweeking the FREQ constant athe start of the object code can be used to alter the subcarrier's frequency, My home made demo-board give a better PAL output if I write 4_999_500 intstead of 5_000_000 for the crystal's frequency.

    The broadcast and baseband modes allow the Prop to provide an additional signal onto the video so that a high frequency, around 50MHz or so, or an extra sound subcarrier (6MHz for PAL).

    I do not have access to the Prop manual at pressent but I think that the Vpin modes state which type of video generation ie composite or VGA you are using, these have to me started in predefined places and be on adjacent pins from that place. Other parameters state how many pins are used. Clusso has video on just one pin working, and I often restrict the VGA to only 4 pins (2 syncs and two signals).

    When I get onto one of my computers I will look into Chip's object with a bit more detail. I saw the PropBasic VGA demo, and because it was written from a different view point, some of the mysteries of the Spin/PASM objects unravelled, for me. Perhaps there are equivalents for composite that will hold some clues for you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Why did I think a new, more challenging, job was a good idea ??
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-07-04 07:34
    Take a look at my 1pin TV driver. It has quite a writeup as to how TV video works, compiled from various sources. However, there is no color in this version. See OBEX under Tools - Debug 1pin TV

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • potatoheadpotatohead Posts: 10,261
    edited 2010-07-04 07:49
    Nice timing diagram in there [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    8x8 color 80 Column NTSC Text Object
    Wondering how to set tile colors in the graphics_demo.spin?
    Safety Tip: Life is as good as YOU think it is!
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-07-04 11:59
    Thanks. I just had to do it to understand what was happening in my own mind. I figured I would forget it later, so where best to put it but into the code. I just love the spin font!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • caskazcaskaz Posts: 957
    edited 2010-07-04 13:52
    Hi, everyone.
    Thanks for your advises.
    Many informations are very usefull for me.
  • RinksCustomsRinksCustoms Posts: 531
    edited 2010-07-04 14:28
    For me, the "Game Programming for the Propeller Powered HYDRA" book was very usefull to me and most of us to better understand how tv.spin actually worked, how it processed the bits of our programs output, even gave me a better understanding of how the parameters within the constant declarations up top of the tv.spin file sets the DAC on different pin groups, all the options for baseband, broadcast, aural subcarrier and even s-video output.. Since i have been away from the prop for several months now (new girlfirend, AEES degree, life in general) i have gained the knowledge through my schooling of exactly how tv's opperate on the incomming signals, disect them from the broadcast/baseband separate the roughly 8-9 different signal waveforms needed to make the tv circuitry work correctly and produce the picture/audio.

    Just thinking out loud..., there might even be a way to squeeze more colors out of the rev A prop, but you'd have to rewrite a new tv object using two cogs and PWM'ing an RC "output DAC" for a more precise chroma level.. as you probably know COLOR is luminance, hue, & saturation, while CHROMA is the quality of hue & saturation. To generate more colors you need more precision in the phase of the broadcast "tv line" also better presicion with the CHROMA levels as well. this might be achieved by PWM'ing two RC DAC's with time constants faster than 3.58MHz.. . weather or not the prop can PWM signals at the required speeds needed is beyond me ATM, also to consider the bit lengths needed to obtain the greater precision. Seems to me that if it could have been done it would hvae been so At This Moment. A recurring theme when most were trying to push more colors with the standard tv.spin was the memory requirements, the prop just keeps coming up short with required RAM. Also , it has occured to me that any micro can achieve more with the same equiptment in two ways.. (1). More RAM/info per clock, (2). More speed to crunch numbers faster to make up for the lack in RAM/info per clock. Im not sure of the logistics of what would be needed to obtain more colors via PWM'ing at least two RC networks with time constants slightly faster than the fastest speed needed (up in the tens of MHz?) Come to think of it, up in the tens of MHz, i guess the output gate capacitances, & the other stray capacitances form an RC DAC with the resistors in the video DAC.. hmm.
    My question is this, (1)Can the prop PWM fast enough to generate a video signal & (2) is there enough RAM left to alow for the greater information needed for a higher bit resolution being output? Truely, if this method were possible @ all there are many brilliant minds in the forum and @ parallax that could have made this happen already.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quicker answers in the #propeller chat channel on freenode.net. Don't know squat about IRC? Download Pigin! So easy a caveman could do it...
    http://folding.stanford.edu/ - Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
Sign In or Register to comment.