simple speed test 08M2. (Slower than 08M and 08?)

lazarus

New Member
Hi all,

Just received my new M2 picaxe chips. :)
I had some 08 and 08M chips laying around so I decided to do some tests.

One of these tests is a simple speed test.

Code:
setfreq [k31, k250, k500, m1, m2, m4, m8, m16, m32]
output 4
do
toggle 4
loop

the picaxe is powered with 4.5 vDC using a regulated powersupply.
on pin4 I connect a frequency counter.

for the 08 I run without the setfreq
for the 08M I run the setfreq with m04 and m08
for the 08M2 I tried all speed settings.

these are my findings:
08 @ 4MHz : 918 Hz
----
08M @ 4 MHz : 861 Hz
08M @ 8 MHz : 1724 Hz
----
08M2 @ 31 KHz : 3,5 Hz
08M2 @ 250 KHz : 28 Hz
08M2 @ 500 KHz : 55 Hz
08M2 @ 1 MHz : 111 Hz
08M2 @ 2 MHz : 221 Hz
08M2 @ 4 MHz : 442 Hz
08M2 @ 8 MHz : 885 Hz
08M2 @ 16 MHz : 1770 Hz
08M2 @ 32 MHz : 3540 Hz

If you compare the 4MHz values of the 08, 08M and 08M2 you notice the speeds are : 918, 861 and 442

It looks like the speed of the newer picaxe chips are slower.

Anyone an idea why this is?

could it be that this is due to multitasking capabilities of the 08M2?
Or perhaps some other stuff that is happening on the background? (maybe stuff that can be disabled?)

Lazarus
 

Jamster

Senior Member
Think how many new commands are on the 08M2, the interpreter has to read a command and then check it against a list of commands to find out what to do. If you have twice as many commands the list is twice as long so takes twice as long to read through. Remember there normaly is balance, in this case speed has been sacrificed so more commands can be used.
 

lazarus

New Member
Thanks, this sound like a possible explanation.

However does the picaxe firmware really sequentially scan the list of available commands for each command? Sounds like a binary search would be much faster here. Bu then again this may not be the case given the limited program space on a pic chip.

Not that it is a problem since the M2 can go to 32 MHz and thus is still about 4 times faster then the 08M@4Mhz :)
 

Technical

Technical Support
Staff member
The two principle differences are:
1) with 08M2 parts the '2048 byte user program' is stored in 'word' values in the program memory area rather than 'byte' values in the data eeprom area. This gives you a much greater program capacity, but is a bit slower to read. If we used the same system on the 08M2 as on the 08/08M it would only have 256 bytes of user memory!
2) M2 parts have an elapsed time feature ticking in the background. You can turn this off with 'disabletime'.
 

lazarus

New Member
Thanks, Technical.

So it's the move from reading 8 bits per value to 16 (X2) that results in a slower read.

Totally clear now.

Thanks
 
Top