Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16F877A with a 20MHz oscillator

Status
Not open for further replies.

josh1245

Newbie level 5
Joined
Oct 20, 2012
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,355
Helloo!

Can you please tell me how long does a PIC16F877A micro controller take to execute one line of coding when used with a 20 MHz oscillator??
 

fosc = 20MHz
tosc = 1/fosc
tcy = 4 * tosc = 4/fosc

So, tcy = [4/(20 * \[{ 10}^{ 6}\])] s = [4/(20 * \[{ 10}^{ 6}\])] * \[{10 }^{6 }\] µs = 0.2µs = 200ns

Hope this helps.
Tahmid.
 

Note: Tahmid's figures are for one machine instruction (a single non-branching assember instruction).

One line of code may be considerably longer if it is written in a high level language.

Brian.
 

Yea, the time calculated is that for one instruction cycle.

In assembly, there are a few 2 instruction-cycle instructions.

In high-level language, one line could be 1 instruction cycle or very long, depending on the line of code.
 

thank you soo much Tahmid, & Brain... since Im new to micro controllers, I am using MicroC, but not assembly.., can you please tell me how it works with microC if you do not mind.??
 

It depends on the instruction / line of code. You can use the stopwatch option in the debugger to check the time.
 

It depends on the instruction / line of code. You can use the stopwatch option in the debugger to check the time.

stopwatch.JPG

Hi Tahmid,

Can you guide me to fill this stop watch of MicroC.
 

Stopwatch runs between breakpoints or single steps in debugging. Nothing to fill out.
 

Stopwatch runs between breakpoints or single steps in debugging. Nothing to fill out.

Sorry Im new of this, it's quiet shame for me to ask but, it that mean I need to click F9 (start Debugger) ? Where i can check the time.. ?

Thanks FvM.
 

that mean I need to click F9 (start Debugger) ?
I'm sure you'll also find out which hotkeys are available to access
- breakpoints
- single stepping
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top