Shop OBEX P1 Docs P2 Docs Learn Events
[FYI] waitvid vs hub window — Parallax Forums

[FYI] waitvid vs hub window

kuronekokuroneko Posts: 3,623
edited 2011-04-25 17:15 in Propeller 1
Disclaimer: This is mainly for people who need/want to know how the waitvid hand-off point (WHOP) can be synchronised with the hub window. I'm aware that this solution relies on certain clock ratios to be useful. In order to keep the graphics intact I do this as kind of a slide show.

What it boils down to is simply to stretch a given frame by a number of adjustment cycles and then switch back to the normal frame size.

attachment.php?attachmentid=80590&d=1303707019

At this point the PLL is settled and the video generator is up and running (outputs are disabled). We now need a reference to a live waitvid call in order to calculate any adjustment. As the frame length comes down to two hub windows, measuring any waitvid will give us the relevant info (this detail is omitted here but can be found in the attached source).

attachment.php?attachmentid=80591&d=1303707020

And that's about it. No magic involved. The example source file works for the demoboard (ATM it displays the length of the test sequence, 19 or 35 cycles, see file for details). In case someone chokes on the NCO reference in the first picture, I'm referring to the NCO feeding the PLL.

The code sequence above (hub op followed by waitvid) is also a prime candidate for [post=993236]not using a waitvid[/post] at all.
waitvid transmitter - 4 cycles/bit

  * PLL mode 2, clkfreq/4 setup, WHOP @ 4n+3

byte_0          rdbyte  pixels, addr              +0 =
                cmp     colour, pixels            +8
                                                  -4
                - 20 cycles for house keeping     +0 =
                - address increment               +4
                - loop management                 +8
                                                  -4
byte_1          rdbyte  pixels, addr              +0 =
                cmp     colour, pixels            +8
References:
  • [post=963147]Ideas or theory on odd problem related to spin program startup[/post]
  • [thread=126874]waitvid setup timing & Co[/thread]
  • [post=982876]Full Color Tile Driver Thread[/post]
  • [thread=129769]50 column VGA text driver in one cog ...[/thread]
  • [thread=129739]64 column VGA text driver in one cog ...[/thread]
  • [thread=129781]80 column VGA text driver in one cog ...[/thread]
814 x 575 - 35K
814 x 575 - 31K

Comments

  • Bill HenningBill Henning Posts: 6,445
    edited 2011-04-25 07:32
    Nice explanation - and thanks again!
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-04-25 16:58
    kuroneko: Thanks for publishing this. Another great reference :)
  • kuronekokuroneko Posts: 3,623
    edited 2011-04-25 17:15
    Forgot to mention the most(?) important thing. Why is this happening, i.e. why isn't it more predictable? So for details see the [post=963147]first reference[/post]. That said, it can be forced to be predictable but that's more trouble than it's worth.
Sign In or Register to comment.