Max 20 X2 toggle speed is??

Odessa

Senior Member
A number of weeks ago I queried re 08M or 14M parts max output toggle speed when running at 4 MHz, 5V, & room temp. The consensus is about 250 uSec. We also noted performance while polling for interrupts and doing background chores.

Has anyone done any testing to date to see what max toggle speed would be for the new 20 X2 running at 64 MHz?

Is the BASIC engine in that part so much different from the M parts that it could not be automatically considered to have similar results regarding interrupts and background tasks?

Thanks, Odessa.
 

womai

Senior Member
From my experience the all -M, -X, and -X1 series Picaxes perform very similarly with regards to execution speed of the same commands. Of course speed scales linearly with clock frequency, so at 8MHz execution is twice as fast as at 4 MHz (some commands like readadc may differ very slightly because they depend on the internal RC oscillator, but given the rather low Picaxe speed this is hardly noticeable).

The -X2 series chips are different (actually I only tested the 28X2 but the 40X2 is just a different package with more pins, but same basic CPU). The -X2 seem to be roughly 30% slower at same clock speed (probably because it has a more extensive command set), on the other hand you can run it up to 40 MHz (64 MHz on the 20X2) which more than makes up for that drawback.

Wolfgang
 

hippy

Ex-Staff (retired)
The X2 is slightly slower than the others at 4MHz for the reason womai noted; the command set is different and the X2 does a lot more to 'keep things ticking along'. This is one of the reasons the X2's operate at a default 8MHz rather than 4MHz, so when no SETFREQ is used the X2's will be quicker, and there's greater scope for increasing the speed further beyond just doubling it.
 

westaust55

Moderator
Has anyone done any testing to date to see what max toggle speed would be for the new 20 X2 running at 64 MHz?

Thanks, Odessa.

Odessa, other than Rev Ed, who do you think has a 20X2 yet?

from Technicals announcment 3 days ago:
PICAXE-20X2 will be released on Monday 7th September.
By my calculation that is tomorrow.
 

Texy

Senior Member
Odessa, other than Rev Ed, who do you think has a 20X2 yet?

from Technicals announcment 3 days ago:
PICAXE-20X2 will be released on Monday 7th September.
By my calculation that is tomorrow.
...actually I ordered mine on Friday, and they arrived yesterday:D

Not that I,ve had a chance to play yet.

Texy
 

hippy

Ex-Staff (retired)
For those lucky enough to get their hands on a PICAXE-20X2 already, or who will shortly, who have scopes - ballpark instruction timing can be determined using ...

Do
Toggle B.0
Toggle B.0
Loop

Measure the length of the shortest edge-to-edge transition ( should be the high pulse ).

For those with frequency meters, use just one TOGGLE statement, double the reported frequency, then t=1/f.
 

Odessa

Senior Member
Hi WestAust:

Gee, I thought the 20X2 would be generally available already. Sorry if this thread is somewhat premature.

Looking forward to any avialable answers, though!

Thanks, Odessa.
 

Dave E

Senior Member
Fast, Fast, Fast

Got my 20X2 chips today.

A program that I run at 8MHz takes 33.75 minutes but takes just over 4 minutes at 64 MHz.

Dave E
 

MartinM57

Moderator
OK, here you go...

Code:
setfreq m64
Do
Toggle B.0
Toggle B.0
Loop


EDIT...or with the measurement you probably want (31.78uS)
 
Last edited:

hippy

Ex-Staff (retired)
Thanks MartinM57.

You might want to do an actual comparison with an 08M but by my 'guesstimate calculations', call the above 32us and take the 'rule of thumb' time for the same on 08M at 4MHz as 256us, the speed gain is approximately 8 fold.

That's short of the 16 fold increase in raw clock speed and arises because the X2 firmware has to process more complicated command tokens, check more things like interrupts and similar between commands, and perform the mapping of port data to actual I/O pins.

An 8 fold increase in speed is about the same as I was seeing in testing and as Dave E reports for his own program above. Some programs may gain more than this but it seems to me to be a fair figure to use when promoting the 20X2 as faster.

It would be possible to get a higher increase by choosing the right test-suite to compare, tilted in favour of the 20X2, but most users probably want a more realistic figure. What's good to see on the 20X2 is this 8 fold increase seems to apply across the board, from a single command test to more complicated programs with multiple paths and varying commands. So there's no 'putting a positive spin on things', no attempt to mislead by quoting speed increases which are only achieved in particular cases and rarely matched in practice.
 

Dippy

Moderator
Are there any differences bewtween Toggling and High/Lows or PortX.pin =1 / PortX.pin=0 ?

Good chance to show us that v.expensive 'scope of yours Martin :)
(I'm jealous).
 

hippy

Ex-Staff (retired)
@ MartinM57 : You threw me for a minute with that 125us pulse, until I realised you were running at 8MHz. So just to clarify ...

20X2 at 64MHz = 8 x faster than 08M at 4MHz
20X2 at 64MHz = 4 x faster than 08M at 8MHz

@ Dippy : Probably some difference, but I suspect minimal. Would be nice to see. And I agree, I've got Scope Envy too.

@ MartinM57 : What is the scope / software you are using ?
 

Dave E

Senior Member
Ran a program on an 08M that was mainly a number cruncher and ran the same program in a 20X2.

08M @ 4MHz = 59 min 54 sec
20X2 @ 64MHz = 5 min 31 sec

59.9 / 5.516 = 10.86 times faster! zoom zoom

My previous post may have been a bit misleading:
I ran some code at 8MHz and at 64MHz both on a 20X2 and, of course, the results was 8 times faster.

Dave E

PS
I get a 33.4 uS toggle speed
 

MartinM57

Moderator
Some differences...I triple checked the middle one (pinB.0=x) and it's definitely slower...






EDIT:^^^^^of course, the =1 in the code is there in error...

Tektronix DPO2014, plus a few options that you haven't seen yet ;)

No software other than the "Save to USB port" button on the scope which saves it as a .png file on a memory stick (hence the other post about attaching .png files) . The code overlay is called the "screen annotation" and you can plug a keyboard into the USB port on the scope to enter/edit it (and use the Multipurpose dials to move it around the display)

Anyway, to recoup the cost, it's GBP0.50 a test from now on...
 
Last edited:

MartinM57

Moderator
...but the middle one being slower might just be the code/word boundary effect...chuck GBP0.50 in the pot with the code that would show whether pinB.0 = X is slower or not....
 

Dippy

Moderator
Bargain... put all my requests onto Stan's account :)

Martin, like Ibenson said ... too many slashes.
Can you redo your links... it's quite a hassle fiddling with Properties.
Nice pics by the way.
 

Mycroft2152

Senior Member
I should have added the 2K was for the base model, the add-ons make the price skyrocket.

Definitely within a hobbyist's budget. I'll take 2.

Myc
 

Dippy

Moderator
Good images.

Martin has the coffee-making add-on which nearly doubles the price.

I'm sure there must be identical quality clones on Ebay for a fiver :)
 

hippy

Ex-Staff (retired)
Roughly, 35us for pinX.Y=Z against 32us for Toggle X.Y is about 50 MPASM instructions which seems likely as it's doing more work, and code alignment could come into it.
 

Dippy

Moderator
Aha. I'm glad you explained that.
I keep confusing between PICAXE and 'other things' where the Port.pin commands would be fastest of the three testd options.
 
Top