Shop OBEX P1 Docs P2 Docs Learn Events
tv text flicker — Parallax Forums

tv text flicker

fkyfky Posts: 15
edited 2009-10-27 07:06 in Propeller 1
Hi, I need help on how to remove the flicker on the tv display when the text are updated?

I am using the TV_terminal_demo.spin as the starting point and using graphic and tv object. When I update hex and text display regularly about 3 time a sec, the flicker is pretty bad.

Any help will be appreciated.

Thanks,
FKY

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-26 23:11
    All of the techniques involve some kind of double buffering for the whole display or some rectangular area of the display. The details depend on your code and your screen layout.
  • fkyfky Posts: 15
    edited 2009-10-26 23:38
    How does one know when is the time to transfer from the temp buffer to the screen buffer? any way of telling when the TV just finished the last display line and during the vertical blanking?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-27 00:01
    Your flicker is probably bad because you're using CLS before each transmission of data. Instead of CLS, use HOME, then the data, then CLREOL. The flicker should go away.

    -Phil
  • fkyfky Posts: 15
    edited 2009-10-27 01:07
    cannot find any CLS instruction in the tv_terminal.spin , tv.spin and graphics.spin.

    Out of about 40 characters on the whole screen, not all of them will flicker all the time, the last 4 seem to be all the time, while the first 10 seem to be stable all the time. The nunber of characters that flicker at any one time changes slowly from all flicker to all stable.

    FKY
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-27 02:07
    Please post your code. I'm confident there's a way to solve this easily.

    -Phil
  • fkyfky Posts: 15
    edited 2009-10-27 02:44
    Phil, I added the following to the TV_terminal.spin

    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    title byte "TV Terminal Demo 9876543210 ",13,13,0

    and
    PUB main | a ,z
    'start the tv terminal
    start(12)

    repeat
    gr.textmode(2,2,6,1)
    a := $0008ff
    gr.text(10,-100,@title)
    hex(a & $ffff,5)

    z := cnt
    waitcnt(50000000+z)
    out(0)

    When run the tv text show unacceptable flicker
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-27 03:21
    The out(0) is the culprit. It's the CLS I was referring to before. When you clear the screen, you get a flash. Unfortunately, TV_terminal doesn't give you many options for correcting the problem. You could just do x := (y := 0) without clearing the screen, and simply overwrite what's already there. But you have to make sure to overwrite all of it, so there's no lingering garbage left over.

    BTW, when you post code on the forum, be sure to enclose it in a [noparse][[/noparse]code] block, in order to preserve indentation. You can also use my formatter at www.phipi.com/format or the portal at www.phipi.com/forum, which includes the formatter.

    -Phil
  • fkyfky Posts: 15
    edited 2009-10-27 04:09
    delet out(0) stop the flicker but but I am no longer able to update the text starting at a fixed position.

    I trying to out(" ") to clear the char at a fixed position say x=20 y=100 then update the char at x=20 y=100, but it seem to keep on overlaying on top of what was at x=20 y=100. any idea

    - fky
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-27 04:33
    Hmm, I guess it doesn't erase the pixels that aren't part of the character strokes. This may not be the object for you, in that case. Is there any reason that you can't use tv_text instead?

    -Phil
  • fkyfky Posts: 15
    edited 2009-10-27 06:30
    need graphic and able to enlarge text as well as color
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-27 07:04
    In that case, Mike's suggestion to double-buffer the screen will be the only way to go, assuming it doesn't use too much RAM.

    -Phil
  • VIRANDVIRAND Posts: 656
    edited 2009-10-27 07:06
    Use gr.color(0) and gr.box( ) to erase the letters you want to change before writing them.
    Lookup the 4 parameters order for gr.box since I am very forgetful of certain minor details.
Sign In or Register to comment.