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

instruction time?

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



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

instruction time?
PostPosted: Fri Oct 05, 2012 6:15 am     Reply with quote

What is the formula calculating the time needed for one instruction?
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Fri Oct 05, 2012 6:19 am     Reply with quote

I'm assuming you mean assembler instructions not 'C'.

By and large, instructions take one instuction cycle, except jumps which take two. One instruction cycle being four oscillator clock cycles.

Mike
temtronic



Joined: 01 Jul 2010
Posts: 9186
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Oct 05, 2012 6:31 am     Reply with quote

ie: if using a 4MHz xtal each instruction will take 1usec, except jumps as Mike noted.
if you refer to the datasheet for your PIC there's an entire section that details the 'instruction set'.
hth
jay
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Oct 05, 2012 9:01 am     Reply with quote

The MPLAB IDE has a Stopwatch function which I often use when I want to time a sequence of instructions. This also works in the Simulator, so no actual hardware is needed.
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