This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

HOW TO IMPLEMENT DEALY IN CODING

I have written code for sensing input and then output port to respond. I want to add delay between the two actions. Can any one help me out.

Parents
  • But if the register is reset, then it can't be used by other parts of the code that might need to measure time. It's quite common to busy-loop short delays, but using a free-running timer and potentially a timer interrupt to keep track of longer delays or for measuring the time between two events.

    Isn't it much better to rewrite the code so it doesn't matter if DWT_CYCCNT overflows during the delay?

Reply
  • But if the register is reset, then it can't be used by other parts of the code that might need to measure time. It's quite common to busy-loop short delays, but using a free-running timer and potentially a timer interrupt to keep track of longer delays or for measuring the time between two events.

    Isn't it much better to rewrite the code so it doesn't matter if DWT_CYCCNT overflows during the delay?

Children
No data