PICAXE "time" variable vs clock frequency
Under the instructions "enabletime" and "disabletime" the PICAXE PDF states that:
It is inconsistent about 16MHz. In fact the last statement is false.
Instuction tests
Instructions were timed using variations of the following code, using 10000, 20000, 40000 or 50000 for n:
w3=time
for w6=1 to n
next
w4=time
for w6=1 to n
instruction under test
next
w5=time
us=microseconds. Times are +/- 100us
Symbol: | k31 | k250 | k500 | m1 | m2 | m4 | m8 | m16 | m32 |
Actual frequency: | 31kHz | 250kHz | 500kHz | 1MHz | 2MHz | 4MHz | 8MHz | 16HMz | 32MHz |
Time increments every: | untested | untested | 33.3s | 16.7s | 2s | 1s | 2s | 1s | 0.5s |
Assumed frequency: | untested | untested | 15kHz | 60kHz | 4MHz | 4MHz | 16MHz | 16MHz | 16MHz |
Under the instructions "enabletime" and "disabletime" the PICAXE PDF states that:
Effect of increased clock speed:
The time function will work correctly at 4MHz or 16 MHz.
At 2MHz or 8MHz the interval will be 2s.
At 16MHz the interval will be 0.5s
The time function will work correctly at 4MHz or 16 MHz.
At 2MHz or 8MHz the interval will be 2s.
At 16MHz the interval will be 0.5s
It is inconsistent about 16MHz. In fact the last statement is false.
Instuction tests
Instructions were timed using variations of the following code, using 10000, 20000, 40000 or 50000 for n:
w3=time
for w6=1 to n
next
w4=time
for w6=1 to n
instruction under test
next
w5=time
us=microseconds. Times are +/- 100us
Instruction Under Test (IUT) | IUT Time | Clock |