Short Wait?

hippy

Technical Support
Staff member
Not easily due to the nature of the PICAXE as a program Interpreter. It takes some time to fetch, decode and execute each command, around 250us at 4MHz. That time can be reduced by using a PICAXE which can run at faster speeds.
 

hippy

Technical Support
Staff member
To change the PICAXE operating frequency you need to select a "BASIC" flowchart symbol from the 'common' command list and place this immediately after the "START" flowchart symbol or wherever is appropriate. Within the "BASIC" symbol enter "SETFREQ M8" or whatever is appropriate ( see PICAXE Manual 2 for the SETFREQ command ).

When the program runs the PICAXE operating frequency will change, speed will be increased, WAIT and so on will correspondingly decrecrease and be shorter.

Which PICAXE type are you using ?
 

Cristian C.

New Member
I'll use the right picaxe, if that way will be possible to get short Wait (ie in the microseconds range).But how to convince the Wait screen to go uSec?

As I understand, the Wait screen is for a definied (unknown by me but 4MHz, I suppose) operating frequency (speed) and if I'll set double that speed, all the timing (including the Wait) will become half as displayed.
Is that right?
 

hippy

Technical Support
Staff member
Yes that's correct, WAIT delays for "1" = 1 second at normal operating frequency ( 4MHz, 8MHz on X2's ) and multiples or fractions of that time. Double the frequency and halve those wait times.

The Logicator for PIC and PICAXE ( and Programming Editor Flowchart tool ) offer a comprehensive but limited subset of the PICAXE programming abilities available to Basic language programmers, however, the full range can be accessed via the BASIC flowchart block.

By using the BASIC flowcharting block you can use PAUSE and PAUSEUS commands to create delays which are shorter / other than the WAIT flowcharting block offers. PAUSEUS offers delays down to 10us on X1 and X2 PICAXE's at standard operating frequencies. Doubling operating frequency will halve those times.
 

vk6bgn

New Member
......so using "PAUSEUS 1" with a 20X2 running at 64Mhz. would be a pause of approximately
1.25 uS. ???
 

hippy

Technical Support
Staff member
It's not quite that simple.

A program consisting of "HIGH C.0 : LOW C.0" gives a nearly 35us high pulse at 64MHz. Adding a "PAUSEUS 1" extends that time to nearly 62us. That's the overhead of having to read and decode the PAUSEUS command and the 1 value, before waiting for 1.25us at 64MHz ( 10us at 8MHz ). This will all vary depending exactly where the commands are in program memory.

The real purpose of PAUSEUS isn't in creating accurate and short delays in itself, but for tweaking the timing of a loop or interval with more resolution than there is with PAUSE.
 
Last edited:
Top