View previous topic :: View next topic |
Author |
Message |
Confused Guest
|
Clock Question |
Posted: Sat May 23, 2009 5:29 pm |
|
|
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
|
|
Posted: Sat May 23, 2009 9:50 pm |
|
|
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
|
|
Posted: Sun May 24, 2009 3:39 am |
|
|
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
|
|
|
Confused Guest
|
|
Posted: Mon May 25, 2009 9:21 am |
|
|
Thanks for the info Makes a little more sense now. |
|
|
|