Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Operating speed of micro controller?

Status
Not open for further replies.

bigfarmerdave

New Member
I know this is a dumb question but I'm trying to educate myself all I can about micro controllers via the web. There are a lot of great resources out there but nevertheless I do have a question. When a micro controller such as a PIC16F876 says that it's got an operating speed of 20 MHz clock input, what exactly does that mean? Can it execute 20,000,000 clock cycles per second? Does it mean that it is capable of keeping track of time in increments as small as 50 nanoseconds? Also, does that mean that you need to use a 20MHz crystal across pins OSC1 and OSC2? Reading a lot online but you guys are a bank of knowledge here as well.
Thanks again!
 
bigfarmerdave said:
I know this is a dumb question but I'm trying to educate myself all I can about micro controllers via the web. There are a lot of great resources out there but nevertheless I do have a question. When a micro controller such as a PIC16F876 says that it's got an operating speed of 20 MHz clock input, what exactly does that mean? Can it execute 20,000,000 clock cycles per second? Does it mean that it is capable of keeping track of time in increments as small as 50 nanoseconds? Also, does that mean that you need to use a 20MHz crystal across pins OSC1 and OSC2? Reading a lot online but you guys are a bank of knowledge here as well.
Thanks again!

It means it uses a maximum clock frequency of 20MHz, but internally this is divided by four - giving 200nS per instruction cycle.

And yes, this means it uses a 20MHz crystal.
 
To get a true speed of the micro controller you must get familiar with that particular class and chip. Microchip devices generally have an instruction cycle at 1/4 the clocking speed. Yet there are some with internal multipliers which grant the instruction cycle to be equal to the clock.

MIPS, millions of instructions per second is the industry standard benchmark for measuring instruction speed. 10 MIPS for one company is 10 MIPS for another company if so stated and is 10 MIPS regardless of the clock speed. Some companies have a genuine 1:1 instruction to clock ratio, some 1:2, and 1:4. But if theirs is 10 MIPS it will be the same to any other 10 MIPS world wide.

But don't let MIPS full you. Its just an instruction cycle and not an accurate performance comparison. You have to account for that many instructions are not the same speed, some 1 cycle, 2, 4, or 6. Some chips may be slower yet have an internal math co processor which is capable of performing 32 bit math in a single cycle or two. While the fast chips either have only none to 16 bit math that will take a lot of time to perform 32 bit computations. Some chips have large communication buffers allowing main line code to consume better processing time as supposed to a small communication buffer needing constant interruption of main line code. Some chips have such a large instruction set that one of its single instructions is capable of accomplishing a task in one cycle that a smaller instruction set chip does in 5 to 10.
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top