jes notes Index Gallery . 4th axis Blog ideas Micro-machining CNC milling machine Paint colours CNC Router Shaft passers Software ideas Stepper motor clock Toy ideas Watchmaking

2023-11-04

Last modified: 2023-11-05 09:12:25

< 2023-11-03 2023-11-05 >

Stepper motor clock

I'm printing the electrics cover that I designed yesterday, using "Organic" supports.

Lol, great, I forgot to put a hole in it for the cable.

Great success, clock is done, video of assembly and explanation here: https://www.youtube.com/watch?v=yroDFrE3mJQ

Update: I have observed the clock stall for a few seconds and then resume, so it is definitely losing time. May need to solve this at some point.

SCAMP

I had a look at the assembly for eval_function but couldn't see anything obviously wrong.

However I did notice a few places where instructions like ld r0, 0 are still being generated, which should preferably be zero r0 instead, saving one word each time. These are not output directly by the compiler, but created by the peephole optimiser. I added another step to the peephole optimiser that fixes these up, and it has shaved enough off the kernel that I can move the start address up by another 256 words! Now starting at 0xd500. Very good. And the library blob is down to 9380 words.

So this was both much easier and much more effective than the thing that optimises constant initialisation of globals.

I'd like to compare the state of the system from the end of last year's Advent of Code to now, measuring:

So: it boots 5% faster, the interpreter is nearly 10% faster, and there's 1K words more free memory.

The program for testing vzmalloc was:

var i = 0;
while (1) {
    i++;
    vfree(vzmalloc([i,i]), [i,i]);
    printf("%d\n", [i]);
};

I've deleted strtok from the library, because it is never used and removing it saves memory. Now down to 9226 words for the library.

Socket cover

Lucy keeps slobbering all over one of the sockets in the living room, and she gets very upset when pulled away. So the plan is to design a box that can go over it using the existing mounting screws.

Great success:

It still has the original sockets underneath, so to change it back I just need to take out the screws, discard the cover, and put the screws back in.

< 2023-11-03 2023-11-05 >