Tanaja,

Yes, I've seen the embedded.com article by David Austin. There is also a good application note on the ATMEL site (Application note AVR446) that has rampup/down calculation:

Cn = Cn_1 - 2*Cn_1/(4n+1)

In the C language - I have yet to see if PBP is fast enough to do this.

Was the formula you used like the one above or was it the more complicated 'exact' calculation that needs square roots? If it takes 105uS that's in the ball park for my application.

Re 'context saving' - if you mean 'wsave' and so on - I don't think it's necessary on the PIC18F8722?

Regards Bill Legge