Quote Originally Posted by SteveB View Post
Thanks for mentioning that Charlie! (I forgot too)

It would certainly simplify the code. I went with the non-LONG method in the case that Pxidr84 might not have PBP3, and so no LONG variables. But yes, I would definitely use them if available. Either way, hopefully the methodology of the example is instructive in learning to scale integers to fit into the given variable space.

Also, there is a correction I need to make to the code. I forgot an ENDIF:

Code:
     IF mSec_Ticks > (cacc * cacc_div) THEN
        IF freq < ref THEN freq = freq + 1
        mSec_Ticks = mSec_Ticks - (cacc * cacc_div)
        IF freq >= ref THEN
           GOSUB StopTimer
           GOSUB ResetTime
        ENDIF
     ENDIF
Sorry about that.
I think that my PBP 2.6 support LONGs... I can't exceed 65s, but right now it's not important.

I've maybe find an another way (only for make a timer without PAUSE):

-Use a "fixed" frequency low priority interrupt
-Increment a value at each interrupt execution (for exemple, incr=incr+1)
-And execute the ramp code if "incr" as reached a certain calculated value (actually it's "cacc" and "cdec"), and then reset "incr" to zero.

Really, I don't need a nanosec precision for this ramp.