Shop OBEX P1 Docs P2 Docs Learn Events
Help with frame rate speed on video out — Parallax Forums

Help with frame rate speed on video out

Hi, im very new to the Propellor and wondering if any more experience people might have some thoughts on this.
i'm using "AiGeneric_Driver_G" driver to output a full screen of coloured text as composite video, it works great, the only problem is the speed of the output video, its a little slow to refresh the screen, it doesn't seem to mater weather i change 1 character or 100 of them the frame rate is fixed, is there anyway to speed up the process?

Ive attached all the files that came with the driver/demo so you can have a look at how it's working.

Any help would be amazing!

Thanks

Comments

  • JasonDorieJasonDorie Posts: 1,930
    edited 2016-02-18 23:12
    At the end of the PUB main function in the demo, there's this line:
        waitcnt(clkfreq / 20 + cnt)  
    

    That line says "wait for the clock to reach the current time, plus 1/20th of the clock frequency", in essence limiting the demo to 20 frames per second. (slightly less, because the code in the repeat loop doesn't take zero time).

    You could change the delay in that waitcnt to clkfreq/60 to run at (almost) 60 fps.

    I'm not sure if that's what your code is doing though - I don't see yours attached.
  • Your right, i wasn't using "waitcnt(clkfreq / 20 + cnt) " in my code so it must be my slow Smile code.
    i thought it was some kind of driver limit, but the demo can run crazy fast!!!

    I removed a bunch of If statements and the speed has almost doubled! its my dodgy code.
    im going to try stuff like

    repeat 20

    rather then

    x :=0
    if [x < 21]
    do something
    x := x +1

    Thnaks!
  • kwinnkwinn Posts: 8,697
    Might try starting with x equal to the number of loops and decrementing to zero. That may compile to slightly faster code.
Sign In or Register to comment.