PDA

View Full Version : Is "PAUSE 0" a valid command



keithdoxey
- 18th July 2006, 11:40
Hi All,

Subject says it all really.

I am just wondering if ZERO is a valid value for the PAUSE command or whether ONE is the minimum allowable delay.

I want to have an adjustable delay whilst I develop some code so that I can slow things down to observe what is happening but I want to be able to run the code at as close to real speed as possible.

I realise that if ZERO is a valid value it would still take a few microseconds to complete but that is still much faster than a 1mS delay.

If ZERO isnt a valid value then I will use a GOSUB and have something like this...


Gosub WasteSomeTime


WasteSomeTime:
If DebugDelay = 0 then
return
Else
PAUSE DebugDelay
Endif
return


Thanks

BobEdge
- 18th July 2006, 11:47
Hi

Pause 0 will work, I just looked on the scope with this code

start:
high pin
pause 0
low pin
pause 0
goto start

the pin starts to go high but does not have time to get there before going low again, with a 20MHz osc it takes just a few micro seconds..

Regards
Bob...

keithdoxey
- 18th July 2006, 11:53
Excellent, thanks Bob

Brock
- 18th July 2006, 15:13
I use a math equation for a PAUSE value on one of my designs and it works
fine. The equation depends on a continously changing variable. Sometimes
the result is 0.

Christopher4187
- 18th July 2006, 16:23
If you need something quicker, you can use a PAUSEUS.

Acetronics2
- 19th July 2006, 12:31
Hi,

Made some trails this morning ( 16F628 @4Mhz, internal Clock )

While m_a



outp = 1
Pause 0
outp = 0
Pauseus 100


Wend

Result is a beautiful 18.2 ... µS High pulse. ( @ 4Mhz !!! ) ( The bypass .1µF cap effect clearly shown ...)

as expected, it's not so far from Pauseus minimum duration ...

Keep in mind this "Ghost" pulses can easily trigger an unwanted event ... an a special test on the 0 value might be added.


Alain

PS for Bob : you might give a cup of strong coffee to your scope ... reading a 2 or 3 µS pulse is not that difficult for my Hameg 203-4 ( a basic 20Mhz scope aged ... 20 years these days !!! )

BobEdge
- 19th July 2006, 16:39
Hi,

Your right about the scope, it's a Fluke scopemeter 190C, and it has trouble keeping up with anything more than around 2 or 3V/uS voltage swing. Being a colour screen, it does make pretty red, & blue patterns when you try to make it work too fast, lol. But I wasnt far out saying a few uS at 20MHz oscilator.

Regards
Bob...