I was going to say that that is prety much what PAUSEUS does but PAUSEUS defaults to 1us "ticks". A workaround solution might be to DEFINE OSC 4 but run the PIC at 40MHz, that way you get 100us resolution. If that's not an option you will have to resort to some ASM type delay loops - which shouldn't be too hard to find.PAUSE/PAUSEUS does not provide required precision, is there any way to replace "nop" with adjustable delay in above code?
Apart from that I think what you should do is look at a DDS aproach instead. IIRC I wrote code for a similar application for a user here a while back. Search around and see if you can find it or I will look into it later and post the link (then if it's suitable or not is another question).
/Henrik.
Bookmarks