Nov 29, 2012 #1 J 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??
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??
Nov 29, 2012 #2 Tahmid Advanced Member level 6 Joined Jun 17, 2008 Messages 4,756 Helped 1,798 Reputation 3,588 Reaction score 1,656 Trophy points 1,413 Location Berkeley, California Activity points 30,584 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.
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.
Nov 29, 2012 #3 betwixt Super Moderator Staff member Joined Jul 4, 2009 Messages 16,240 Helped 5,140 Reputation 10,309 Reaction score 5,122 Trophy points 1,393 Location Aberdyfi, West Wales, UK Activity points 137,443 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.
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.
Nov 29, 2012 #4 Tahmid Advanced Member level 6 Joined Jun 17, 2008 Messages 4,756 Helped 1,798 Reputation 3,588 Reaction score 1,656 Trophy points 1,413 Location Berkeley, California Activity points 30,584 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.
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.
Nov 29, 2012 #5 J 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 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.??
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.??
Nov 29, 2012 #6 Tahmid Advanced Member level 6 Joined Jun 17, 2008 Messages 4,756 Helped 1,798 Reputation 3,588 Reaction score 1,656 Trophy points 1,413 Location Berkeley, California Activity points 30,584 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.
May 3, 2013 #7 I Ishah Member level 1 Joined Mar 13, 2013 Messages 33 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,286 Activity points 1,502 Tahmid said: It depends on the instruction / line of code. You can use the stopwatch option in the debugger to check the time. Click to expand... Hi Tahmid, Can you guide me to fill this stop watch of MicroC.
Tahmid said: It depends on the instruction / line of code. You can use the stopwatch option in the debugger to check the time. Click to expand... Hi Tahmid, Can you guide me to fill this stop watch of MicroC.
May 3, 2013 #8 FvM Super Moderator Staff member Joined Jan 22, 2008 Messages 52,422 Helped 14,749 Reputation 29,780 Reaction score 14,101 Trophy points 1,393 Location Bochum, Germany Activity points 298,107 Stopwatch runs between breakpoints or single steps in debugging. Nothing to fill out.
May 3, 2013 #9 I Ishah Member level 1 Joined Mar 13, 2013 Messages 33 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,286 Activity points 1,502 FvM said: Stopwatch runs between breakpoints or single steps in debugging. Nothing to fill out. Click to expand... 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.
FvM said: Stopwatch runs between breakpoints or single steps in debugging. Nothing to fill out. Click to expand... 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.
May 3, 2013 #10 FvM Super Moderator Staff member Joined Jan 22, 2008 Messages 52,422 Helped 14,749 Reputation 29,780 Reaction score 14,101 Trophy points 1,393 Location Bochum, Germany Activity points 298,107 that mean I need to click F9 (start Debugger) ? Click to expand... I'm sure you'll also find out which hotkeys are available to access - breakpoints - single stepping
that mean I need to click F9 (start Debugger) ? Click to expand... I'm sure you'll also find out which hotkeys are available to access - breakpoints - single stepping