PDA

View Full Version : Routines efficiency per second



RodSTAR
- 26th November 2009, 16:52
One thing is just program your ideas into the code. But if your application involves realtime response having complex computations, you may find some interesting problems.

We all know real MIPS in a PIC18 or PIC16 is it's MHz divided by 4.
Example: a PIC18 running at 40 Mhz runs at 10 MIPS (Million Instructions Per Second).
Why I say this.

I want to know how many microprocessor instructions takes a PBP statement to run.
So, my question is if, is there any list or table that provides this information.
Example: to know how many CPU instructions do statements take to run as SIN, COS, SQR, DIV32, LCDOUT, UART commands, HPWM, variable assigning, worst case 8-bit, 16-bit, 32-bit math operations, array accessing, reading writing, blabla, comparing, etc... and every statement we use to create our routines.

My aim is to calculate to get how many times per second a given piece of code will be executed, considering best and worst cases

Thanx in advance.

Darrel Taylor
- 26th November 2009, 17:10
No tables, but you can measure the time fairly easily.
http://www.picbasic.co.uk/forum/showpost.php?p=1272&postcount=2

Or some people prefer to simply toggle a pin and read it on a scope.
<br>