Menu

Timer0 on interrupt dumb idea?

bed
2017-08-02
2017-08-02
  • bed

    bed - 2017-08-02

    The "wait" Basic command will be used normally in an application quite often for short delays.
    Does this do a Timer0Overflow regulary especially for "wait 1 s" or greater?
    If, one could use it as cheap trigger for on interrupt to do some background processing.
    Does the "wait" permit interrupting?

    Else, one could use a own timer event.

    I didn't find explanation about restrictions to use timer0 in the help file.
    Or has the wait been implemented without using timers?

    (Sorry for these questions, I do not have the source here laying around to study myself, and I fear it's beyond me horizon, anyway ;-)

     
  • Chris Roper

    Chris Roper - 2017-08-02

    None of the Timers are used. The “wait command” is a cycle counting delay, that is it sits in a tight loop throwing away instruction cycles, the number of cycles being dependent on the clock speed and the delay required.

    As far as I am aware, the “wait” does not disable interrupts, so yes interrupts are permitted.
    Just remember that the accuracy of your “wait” will be compromised, but you shouldn't be using wait for timing critical functions anyway.

    You can indeed use your own timer event.

    The wait is implemented without timers.

     
  • bed

    bed - 2017-08-02

    Fine!
    Thank you

     

Log in to post a comment.