Searching \ for '[PIC]:How can i calculate instruction delay' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/time.htm?key=delay
Search entire site for: 'How can i calculate instruction delay'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:How can i calculate instruction delay'
2000\08\15@095048 by George Chatzigeorgiou

flavicon
face
i.e How can i calculate the nop delay if working with a 4MHz crystal.
I've seen many examples that calculate this delay in various ways but the
result is not the same.

Thanks in advance, for any help

George Chatzigeorgiou

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2000\08\15@130631 by Simon Nield

flavicon
face
The PIC I have a little experience with (16f877) has a 4 clock instruction cycle. I _think_ this is
true of all pics.
The databook for this chip says that a NOP takes one instruction cycle.
so the time for one NOP is:

(1*4/4000000) = 1uS

One thing worth bearing in mind though when you are doing delay loops for sampling data at specific
times is that 'movf port, W' will sample the data on the port towards the start of the instruction
cycle, and 'movwf port' will output data towards the end. I think the details for these timings are
in the datasheet (i.e. which clock of an instruction cycle things happen on).

Regards,
Simon




Please respond to pic microcontroller discussion list <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU>

To:   .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
cc:    (bcc: Simon Nield/Quantel Research)
Subject:  [PIC]:How can i calculate instruction delay





i.e How can i calculate the nop delay if working with a 4MHz crystal.
I've seen many examples that calculate this delay in various ways but the
result is not the same.

Thanks in advance, for any help

George Chatzigeorgiou

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2000\08\15@131714 by Andrew Kunz

flavicon
face
>The PIC I have a little experience with (16f877) has a 4 clock instruction
cycle. I _think_ this is
>true of all pics.

Except 18C parts, which can have 1:1 if you turn on the PLL.

Andy

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2000\08\15@131717 by Andrew Kunz

flavicon
face
Also, some instructions on all parts require 2 cycles (return, goto, call,
retlw, etc).

Andy

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2000\08\15@144525 by Bob Ammerman

picon face
> Except 18C parts, which can have 1:1 if you turn on the PLL.

Well, sorta.

In reality of course, the PIC is still running internally at 4x the
instruction rate.

But it sure is nice to get a 40Mhz CPU clock with only  a 10MHz XTAL.

btw: has anybody had any experience with overclocking 18C's? I accidently
overclocked one at 11.056 MHz (ie 44+MHz internally) when Digikey sent me
the wrong crystal. It worked fine at room temp.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
sofftware)

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2000\08\15@150607 by Olin Lathrop
flavicon
face
> i.e How can i calculate the nop delay if working with a 4MHz crystal.
> I've seen many examples that calculate this delay in various ways but the
> result is not the same.

It takes 4 clock cycles to execute each simple instruction like a NOP.  With
a 4MHz clock you can run instructions at a 1MHz rate, which means the delay
for an individual NOP is 1uS.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, olinspamKILLspamcognivis.com, http://www.cognivis.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2000\08\16@002224 by Nikolai Golovchenko

flavicon
face
George,

Did you know that there is a delay code generator at

http://www.piclist.com/codegen

It generates a delay routine with one instruction cycle resolution
using nested loops. Just enter needed time or cycles in the form and
hit the generate button!

Hope it helps.

Nikolai

---- Original Message ----
From: George Chatzigeorgiou
Sent: Tuesday, August 15, 2000 16:49:49
 To: .....PICLISTKILLspamspam.....MITVMA.MIT.EDU
Subj: [PIC]:How can i calculate instruction delay

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...