For those who are interested -
Taking the SQR of a LONG in PBPL takes about 650- 760 processor cycles, depending on the number.
For those who are interested -
Taking the SQR of a LONG in PBPL takes about 650- 760 processor cycles, depending on the number.
Charles Linquist
If it is very time sensitive, you might consider Proton. It does the sqrt in about 380 cycles. It is by far the most efficient sqrt routine I've found, and I tested about a half dozen last year, most of them in asm. I don't know of any other compilers that use the routine, but it sure is tight. It's not original, though--I saw the asm code in a couple places. You'll have to search, though, because I don't have my notes on it.
Thanks! I'm at the point where a hundred cycles makes the difference whether my ISR gets messed up or not.
Charles Linquist
Hi, Charles
Did you see that one ???
http://www.piclist.com/techref/micro...qrt/sqrt32.htm
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
No, I missed that one. I'll give it a try.
I'm calculating the RMS currents of several non-sinusoidal waveforms simultaneously, along with checking limits and times, and sending the results on to another PIC for display and data collection. I have to sample frequently to get enough accuracy, and I have to do everything on a cycle-by-cycle basis.
Charles Linquist
I see that the 'movfp' instruction is used in the example. I'm not familiar with the 16F or 17F parts. Is that instruction equivalent to the 18F instruction 'movf' ?
Charles Linquist
Hi, Charles
it's just a particular Movf for PIC 17 ...
from f : Register file address (00h to FFh)
to p : Peripheral register file address (00h to 1Fh)
I do not see any warning to use a simple " Movf " with a 18F Device ... ( banking may be ??? )
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks