View previous topic :: View next topic |
Author |
Message |
ELCouz
Joined: 18 Jul 2007 Posts: 427 Location: Montreal,Quebec
|
PIC18, PIC24, dsPIC30 and dsPIC33 math benchmark |
Posted: Sun Dec 27, 2009 7:36 pm |
|
|
Dear CCS members,
I'm wondering if such documentation (comparison) exist about these micro controllers.
Benchmark of popular math operations and conversions.
Example: Let say I want to know how much time (cycles) a dsPIC30 take to multiply a double, float , int32 etc.
I've searched trough google for a while nothing interesting came out in the results.
This is very important so I could know which to avoid to save cycles.
Float and double and 32 bit integers are usually the one to avoid in the PIC16 or less architecture because they are slow. In newer arch. especially dspic I have no clue since they have a more powerful ALU.
Best Regards,
Laurent |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Dec 27, 2009 8:21 pm |
|
|
To measure the time required for a block of code, you can use the
MPLAB Simulator's Stopwatch feature. This thread has instructions on
how to use it:
http://www.ccsinfo.com/forum/viewtopic.php?t=38351
You can also set an i/o pin high at the start of a routine and low at the
end, and use an oscilloscope or a logic analyzer to see the pulse length,
and thus find the length of the routine. |
|
|
Rohit de Sa
Joined: 09 Nov 2007 Posts: 282 Location: India
|
|
Posted: Sun Dec 27, 2009 9:39 pm |
|
|
The two methods described by PCM are the best. If you'd like a rough comparision, search the compiler help for "How much time do math operations take". This will give you a table with time taken for common operations. Since a lot of manual checking and tallying will be involved, it may be a bit tedious to calculate the time taken for the entire routine. However, I keep a printed copy of the table on my desk to serve as a ready reckoner as to which type of variable I could use.
Rohit |
|
|
ELCouz
Joined: 18 Jul 2007 Posts: 427 Location: Montreal,Quebec
|
|
Posted: Tue Dec 29, 2009 1:12 pm |
|
|
Sorry for the late reply I've been away from my computer last 2 days...
I will try the simulation tool in MPLAB I've never though that it was compatible with CCS C code.
Thank you !
Best Regards,
Laurent |
|
|
Rohit de Sa
Joined: 09 Nov 2007 Posts: 282 Location: India
|
|
Posted: Tue Dec 29, 2009 9:49 pm |
|
|
CCS code is compiled by MPLAB only if you've installed the CCS-MPLAB plugin. You can download it off the CCS site.
Rohit |
|
|
|