20x2 @ 64mhz Processor Overhead
My purpose here was to determine with fairly good accuracy, the processing overhead time of various BASIC commands using a Picaxe 20x2 operating at its maximum speed of 64 Mhz.
Method:
The the period of the test loop was measured with no test command added. At 64MHz, this was 148us using a value of 100 for pulsout. I then put the command to test within the loop and measured the period again. The difference is the time it takes to execute the command and should be a good indicator of processor overhead for these commands.
Measurements were taken with with a TektronixTHS730A Digital Oscilloscope using the Period Measurement feature.
The test code is as follows:
Here are the results for various BASIC commands. All measurements are in microseconds
Base Period = 148us
Command ........... Period ..... Time us
readadc10 .......... 219.4 ...... 71.4
readadc ............ 219.2 ...... 71.4
pause 0 ............ 172.8 ...... 24.8
pauseus 0 .......... 172.8 ...... 24.8
pulsout c.0 ,0 ..... 188.6 ...... 40.6
let b0 = 1 ..........181.4 ...... 33.4
inc b0 ............. 192.8 ...... 44.8
b0 = b0 + 1 ........ 192.8 ...... 44.8
w0 = w0 / 2 ........ 258.0 ...... 110.0
w0 = w0 / 22 ....... 248.0 ...... 100.0
w0 = w0 / 222 ...... 235.2 ...... 87.2
get 0,b1 ........... 188.6 ...... 40.6
get 0,b1,b2 ........ 228.8 ...... 80.8
read 0, b1 ......... 188.8 ...... 40.8
read 0, b1,b2 ...... 228.8 ...... 80.8
My purpose here was to determine with fairly good accuracy, the processing overhead time of various BASIC commands using a Picaxe 20x2 operating at its maximum speed of 64 Mhz.
Method:
The the period of the test loop was measured with no test command added. At 64MHz, this was 148us using a value of 100 for pulsout. I then put the command to test within the loop and measured the period again. The difference is the time it takes to execute the command and should be a good indicator of processor overhead for these commands.
Measurements were taken with with a TektronixTHS730A Digital Oscilloscope using the Period Measurement feature.
The test code is as follows:
Code:
#picaxe 20x2
#no_table
setfreq m64
eeprom 0,(255,255)
put 0,255,255
hsersetup b9600_64,
disconnect [COLOR=#008000]'stabilizes waveforms (no scanning serial port for download)[/COLOR]
b0 = 255
b1 = 255
TEST_LOOP:
do
pulsout C.1, 100
[COLOR=#0000ff]< TEST COMMAND > [/COLOR]
loop
Base Period = 148us
Command ........... Period ..... Time us
readadc10 .......... 219.4 ...... 71.4
readadc ............ 219.2 ...... 71.4
pause 0 ............ 172.8 ...... 24.8
pauseus 0 .......... 172.8 ...... 24.8
pulsout c.0 ,0 ..... 188.6 ...... 40.6
let b0 = 1 ..........181.4 ...... 33.4
inc b0 ............. 192.8 ...... 44.8
b0 = b0 + 1 ........ 192.8 ...... 44.8
w0 = w0 / 2 ........ 258.0 ...... 110.0
w0 = w0 / 22 ....... 248.0 ...... 100.0
w0 = w0 / 222 ...... 235.2 ...... 87.2
get 0,b1 ........... 188.6 ...... 40.6
get 0,b1,b2 ........ 228.8 ...... 80.8
read 0, b1 ......... 188.8 ...... 40.8
read 0, b1,b2 ...... 228.8 ...... 80.8