Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:15 24 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Rudimentary Speed Test

Author Message
crackerjack

Senior Member

Joined: 11/07/2011
Location: Australia
Posts: 164
Posted: 01:41pm 13 Sep 2011
Copy link to clipboard 
Print this post

I ran a very basic speed test against v2.5 and v2.6 as follows:

[code]
10 SETPIN 12, 9
20 PIN(12) = NOT PIN(12)
30 GOTO 20
[/code]

Not having the most sophisticated test lab, I then measured the output of pin 12 (which had a 1k pull-up) with the freq. meter mode of my mulitimeter.

The results? 4.64 kHz under V2.5; 5.97 kHz under V2.6 - about a 29% improvement in speed - pretty much what Geoff has stated for this version.

The value of the pull-up resistor will certainly affect the frequency, but I kept the value constant between tests.

If anybody knows of a better/easier/more reliable way of veryifing basic processing speed of the Maximite, I'd like to know about it. Also, using a method such as the above - what are your results? It may (or may not) be interesting.

Cheers, Lance.
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 11:13pm 13 Sep 2011
Copy link to clipboard 
Print this post

  crackerjack said   I ran a very basic speed test against v2.5 and v2.6 as follows:

[code]
10 SETPIN 12, 9
20 PIN(12) = NOT PIN(12)
30 GOTO 20
[/code]

Not having the most sophisticated test lab, I then measured the output of pin 12 (which had a 1k pull-up) with the freq. meter mode of my mulitimeter.

The results? 4.64 kHz under V2.5; 5.97 kHz under V2.6 - about a 29% improvement in speed - pretty much what Geoff has stated for this version.

The value of the pull-up resistor will certainly affect the frequency, but I kept the value constant between tests.



Gday Lance,

What happens if you set as digital output? ie SETPIN 12, 8? Use 8 instead of 9.

Then you wont need the pullup..

regards,

mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
trippyben

Regular Member

Joined: 26/06/2011
Location: Australia
Posts: 91
Posted: 08:16am 14 Sep 2011
Copy link to clipboard 
Print this post

Can't see how your pull up resistor will have any effect on the frequency output by the pin? Sounds like a reasonable comparison to me.
 
crackerjack

Senior Member

Joined: 11/07/2011
Location: Australia
Posts: 164
Posted: 11:20am 14 Sep 2011
Copy link to clipboard 
Print this post

Mick - Good suggestion - the only reason I used Open Collector was because I was trying to minimise the number of lines of code per "cycle". It turns out, as per your suggestion (and the following code):

[code]
10 SETPIN 12, 8
20 PIN(12) = 1 : PIN(12) = 0
30 GOTO 20
[/code]

...that the overall cycle speed increases quite substantially:

v2.5 = 8.20 kHz
v2.6 = 10.58 kHz

Again, 29% faster.

Trippyben - I'm not a hardware guru (much to learn in that space), but I was under the impression that rise times are slower with higher value pull-ups - maybe this only really applies in a bus situation with many devices, stray capacitance, etc. (see here). Under the section Different Voltage Interfacing, it states "Smaller values offer faster switching times at the price of higher current consumption."

I have not experimented with resistor values like 100k vs 1k, but I'll give it a go.

Thanks for your interest and comments.

Cheers, Lance.
 
trippyben

Regular Member

Joined: 26/06/2011
Location: Australia
Posts: 91
Posted: 11:24am 14 Sep 2011
Copy link to clipboard 
Print this post

Lance, while it is true that the pullup resistor will affect the rise/fall times, it won't affect the overall frequency of the output.

The change in rise/fall times will only serve to 'round off' the shape of the square wave as they increase, the base frequency will remain the same. If you've got a CRO, have a look with a couple of different pull-up values. You should see the shape of the wave change, but the overall period (The time for a compete cycle) should stay the same.

Ben.
 
crackerjack

Senior Member

Joined: 11/07/2011
Location: Australia
Posts: 164
Posted: 11:38am 14 Sep 2011
Copy link to clipboard 
Print this post

Thanks Ben - that makes sense. I have my eye on a 'scope and will be getting an early Chrissy present I think. I know these are simple experiments, but it is certainly teaching me some things. As an example the following minor mods to the code have had quite a big impact:

[code]
10 SETPIN 12, 8
15 DO
20 PIN(12) = 1 : PIN(12) = 0
30 LOOP
[/code]

This increases the frequency to 12.83 KHz (v2.6). That shows me that using a LOOP over a GOTO for the main loop of a program may potentially make a big difference to execution speeds. In this case, another 21%. Overall, changing the firmware and the code structure (yet still achieving the same thing), the code execution speed has increased of 2.75 times.

Pretty interesting I think - especially the DO...LOOP over the GOTO.

Cheers.
 
VK6MRG

Guru

Joined: 08/06/2011
Location: Australia
Posts: 347
Posted: 11:43am 14 Sep 2011
Copy link to clipboard 
Print this post

This is the speed test we used before.
http://www.thebackshed.com/forum/forum_posts.asp?TID=3667&PN =11


Its easier to ask forgiveness than to seek permission!

............VK6MRG.............VK3MGR............
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 11:54pm 14 Sep 2011
Copy link to clipboard 
Print this post

  crackerjack said  
[code]
10 SETPIN 12, 8
15 DO
20 PIN(12) = 1 : PIN(12) = 0
30 LOOP
[/code]



Cheers.


Gday Lance,

What happens if you combine it all on one line?

ie.:

[code]
10 SETPIN 12, 8
15 DO : PIN(12) = 1 : PIN(12) = 0 : LOOP
[/code]

Not knowing much about do:loop I am not sure the 1 line will even be in syntax.

Regards,

Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024