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 CCS Technical Support

Clock Question

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







Clock Question
PostPosted: Sat May 23, 2009 5:29 pm     Reply with quote

Ok, so I understand the basics.

Finstruction=Fosc/4

So it seems the max instruction speed will be approx 10mhz.

The instruction cycle speed is how fast the program executes. What's the point in using an HS xtal (besides for the 10mhz)? Why do you need the extra 30 mhz?

Do the other competitors have approx the same instruction cycle speed?

I guess with computers at 3ghz now, 10mhz seems really slow.
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

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

PostPosted: Sat May 23, 2009 9:50 pm     Reply with quote

A "basic" that you missed is that PICs and other microcontrollers are designed to do different jobs than those performed by your typical desktop computer.

Generally, PICs are designed to perform a single job or task. Desktop computers are designed to be able to do different jobs, frequently at the same time.

To do one job you don't need fast instruction processing. In fact, PICs are often used in low power battery run devices, where the slower the speed you go, the better. Running a PIC from a 32kHz crystal (8 KIPS?) is not uncommon! I haven't done that, but have just finished a project where the PIC was operating at 500kHz.

It's all a matter of using the right tool for the job. If you need speed, the PIC32 is one cycle per instruction (I believe) and runs up to 80MHz. To go faster you'd probably be best using a single board computer (SBC) that takes a standard desktop or laptop CPU and runs an embedded Windows or Linux.

Usually, though, the goal is cheap and the smaller, slower PICs win there.
_________________
Andrew
Rohit de Sa



Joined: 09 Nov 2007
Posts: 282
Location: India

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

PostPosted: Sun May 24, 2009 3:39 am     Reply with quote

Quote:
What's the point in using an HS xtal (besides for the 10mhz)? Why do you need the extra 30 mhz?

PICmicros are quadrature clocked. This means that an instruction is executed every four clocks. That's how you get Finstruction=Fosc/4.

PICs have a 'fetch' cycle, and an 'execute' cycle.

The first part of the quadrature clock is used to increment the program counter; the next part is used to 'pre-fetch' the instruction at PC; the third and fourth quadratures are used to decode and latch the instruction to the instruction register, and execute the previous instruction.

Have a look at section 4.2 and 4.3 in this document:
http://ww1.microchip.com/downloads/en/DeviceDoc/31004a.pdf

Rohit
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

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

PostPosted: Sun May 24, 2009 7:28 am     Reply with quote

Here is some further reading:

http://en.wikibooks.org/wiki/Microprocessor_Design/Multi_Cycle_Processors
_________________
Andrew
Confused
Guest







PostPosted: Mon May 25, 2009 9:21 am     Reply with quote

Thanks for the info Very Happy Makes a little more sense now.
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