We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am now urgant.
Thank you. But I must need ready and tested routines for slow frequence (31kHz, 125kHz, 250kHz etc.).
Please for me.
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.