Archive for August, 2008

Protobots gears.

August 25, 2008

Eagle to Protel

August 15, 2008

http://www.dutchforce.com/~eforum/index.php?s=fce0f1b0b1b3c7f0649e9962019f19cc&showtopic=14670

Untested.

Thesis seminar

August 15, 2008

Note to self: Force team project students to come to half time thesis seminar. Their feedback on the proposed features of the Atmel simulator will be very helpful.

C++ bottlenecks.

August 15, 2008

While trying to do some speed testing of C++ for my thesis:


int answer = 0;

for (int i = 0; i != 1000000000; ) {
    answer = ((answer + i++) * 10);
    //answer += i
    //answer *= 2;
    //answer = answer % 65535;
}


Beware memory allocation:

  • delete takes longer than new.
  • BUT memory leaks slow your program execution exponentially as your memory becomes fragmented

Beware non-trivial operators:

  • Using modulo slowed execution by an ENTIRE ORDER OF MAGNITUDE.

Beware data types:

  • I used long long for answer instead of int because some of my code demands the use of large integers. This also slowed execution by an order of magnitude, presumably because it was compiled in 32 bit mode and had to do multiple register copies for every operation.
  • I’ll be reviewing my requirements to try and remove dependency on long long in time critical code!

How to wire up a MAX232

August 13, 2008

This is how you wire up a MAX232 to a picaxe cable.

MAX232 Schematic