CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

PIC18, PIC24, dsPIC30 and dsPIC33 math benchmark

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

PIC18, PIC24, dsPIC30 and dsPIC33 math benchmark
PostPosted: Sun Dec 27, 2009 7:36 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Dec 27, 2009 8:21 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Sun Dec 27, 2009 9:39 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 29, 2009 1:12 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Tue Dec 29, 2009 9:49 pm     Reply with quote

CCS code is compiled by MPLAB only if you've installed the CCS-MPLAB plugin. You can download it off the CCS site.

Rohit
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group