Shop OBEX P1 Docs P2 Docs Learn Events
WAITVID causes hang — Parallax Forums

WAITVID causes hang

BeanBean Posts: 8,129
edited 2009-05-16 22:55 in Propeller 1
In the datasheet in section 4.10 is says "Failure to properly initialize the video generator by first starting PLLA will cause the cog to indefinitely hang when the WAITVID instruction is executed."

Is there any further information about this ?

I think this may be the cause of my video overlay board to hang with SOME propeller chips. The failure would occur as soon as they were tested. Changing the prop chip would fix the problem. So I'm thinking some of the PLL locked sooner than others.

Execpt it wouldn't hang indefinitely, it would hang until the CNT would wrap-around (50 seconds).

Could this be caused by this WAITVID situation ?

Bean.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...

·

Comments

  • potatoheadpotatohead Posts: 10,261
    edited 2009-05-16 16:23
    I've experienced the hang when jumping right into a WAITVID after init code. Never waited the full cycle though. Might not be the same thing you are seeing.

    Do you have the WAITVID starting right after firing up PLLA?

    A small time delay to let the PLL do it's thing would resolve this. Seems to me a quick test would be to get one of the known failed chips, insert the delay into the code and run them through.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-05-16 17:38
    Given the 50-second info, I suspect it's got more to do with the order in which the various registers are set. For example, if the video starts up while VSCL is still zero, you could wait awhile for the first WAITVID to come around.

    -Phil
  • ericballericball Posts: 774
    edited 2009-05-16 22:55
    WAITVID halts the cog until the VSCL counter expires, VSCL counts based on the PLL output of CTRA when VCFG mode != 0. Therefore, WAITVID will cause the cog to halt forever if: VSCL mode is 0 or CTRA is not in PLLA internal mode* or the frequency of CTRA is not between 4 and 8MHZ**.

    Now, even if all of the above is true it will take 4096 PLLA cycles for VSCL cycle through it's initial 0 setting. This is also enough time for the PLL to stabilize, but this means it will take more time than just 4096 / PLL frequency seconds.


    * I don't know if the PLL & VSCL are active for the other counter modes. Obviously, if CTRA is still 0 then the counter is disabled and WAITVID will halt forever.
    ** Other CTRA frequencies might work, but will be outside the PLL capture frequency. Again, if FRQA is still 0 then WAITVID will halt forever.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Composite NTSC sprite driver: http://forums.parallax.com/showthread.php?p=800114
    NTSC color bars (template): http://forums.parallax.com/showthread.php?p=803904
Sign In or Register to comment.