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

********* delay routines *************************

I am now urgant.

Thank you. But I must need ready and tested routines for slow frequence (31kHz, 125kHz, 250kHz etc.).

Please for me.

Parents Reply Children
  • A delay for 250kHz is no fun at all. 4us delays do not produce 250kHz - every single interrupt will consume time. And with a 4us delay you have to subtract the time needed to actually do something - you never delay without doing something.

    Are you going to produce a frequency output on a port pin? Then you do not use a delay. You do not want to let the processor manually toggle a poin every 4us (or possibly 2us if you want real 250kHz square wave.

    There are many easier methods of producing a square wave than using a microcontroller - especially when producing a square wave that will not leave any processing capacity left for doing other things.

    So please start by telling why you need your delays - maybe you just need to configure the timer(s) in your unknown processor and can then let a timer compare-match handle everything.