delay

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times

delay

Post by wayne millard »

Hi Team

How can i generate a delay in nano seconds my clock is 40Mhz and using a 18f4620

Thanks
Wayne

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: delay

Post by saschech@gmx.de »

Hello wayne

I think you can not do these:
http://www.sprut.de/electronic/pic/8bit ... ht8720.htm

at 20mhz =
Almost all commands of a PIC take a cycle, where a cycle is 4 external PIC bars. A 20-MHz PIC creates so 5 million instructions per second, as in a second 5 million cycles or 20 million external clocks. A cycle is here 0,2 microsecond (0.2 µs) long.
at 40mhz = 0,2ys : 2 = 0,1ys = 100ns........

1 Pikosekunde = 0,000 000 000 001 Sekunden = 10-12 Sekunden
1 Nanosekunde = 1000 Pikosekunden = 0,000 000 001 Sekunden = 10-9 Sekunden
1 Mikrosekunde = 1000 Nanosekunden = 0,000 001 Sekunden = 10-6 Sekunden
1 Millisekunde = 1000 Mikrosekunden = 0,001 Sekunden = 10-3 Sekunden
1 Sekunde = 1000 Millisekunden

Regards Wolfgang
Last edited by saschech@gmx.de on Wed Mar 09, 2011 6:48 pm, edited 1 time in total.

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: delay

Post by Jan Lichtenbelt »

Dear Wayne,

As far as I know, the minimum delay is one NOP (no-operation program step). You can put that in a C-macro as:
{
nop
}
The delay depend on the crystal frequency divided by a factor 4. Thus with a 40 Mhz crystal the delay will be 10 Mhz or 100 nsec. This is the minimum delay which is possible.

Regrads

Jan Lichtenbelt

Post Reply