Barnaby Walters

I am a British web developer and luthier working at Vísar in Reykjavík, Iceland.

I build and play the Hurdy Gurdy, cook/bake granola and pizza and help build the independent web.

  1. Fitted basic optical encode circuit to my , now figuring out optimal settings for calculating wheel speed. Notes:

    Sane gurdy speed of 14 revs every 10 seconds = 1.4 RPS
    52 markers on wheel = 52 * 1.4 = 72.8 transitions per second ≈ 73Hz minimal input signal
    
    Timer nominal input freq is Fosc / 4 = 4MHz / 4 = 1Mhz
    Max prescaling = 1:256, i.e. TMR0 increments once for every 256 Fosc/4 pulses
    Resultant timer freq = 1Mhz / 256 = 0.00390625 Mhz = 3906.25 Hz
    
    Input signal has ≈50% duty cycle so periods between pulses should be 1 / 73 = 13.69863014ms
    
    Period of 3906.25Hz wave = 0.256ms
    Num pulses @ 3906.25Hz after 13.7ms = 13.7 / 0.256 = 53.515625
    
    1.4 RPS is minimal normal gurdy trompette playing speed, so counting 54 clicks per transition gives a little space for speeding up and a lot of space for slowing down.
    
    High gurdy trompetting speed of 24 revs per 10 seconds = 2.4 RPS
    TPS = 52 * 2.4 ≈ 124.8 = 125Hz maximum input signal = wavelength of 1 / 125 = 8ms
    Num pulses @ 3906.25Hz after 8ms = 8 / 0.256 = 31.25
    

    So these values should give a just-wide-enough span of ≈20 ticks between nominal and trompetting speed, with room to halve or potentially even quarter the prescaler if this turns out to not be enough. One advantage of these values is space to track much slower wheel movements, opening this up to be used for slower performance tools as well as speed measuring.

    An external switch could always adjust the prescaler if necessary to cover both use cases.

  2. Jan B.: @BarnabyWalters @ZacharyTong but doesn't work on Debian Squeeze and depends on a specific minor version of PHP

    @bracki pity it doesn’t work on Squeeze (why is that?), as far as I can see it doesn’t depend on a particular version of PHP, just anything greater than 5.3.9 — "php": ">=5.3.9", to be exact.

  3. Black sesame seed ice cream went down well at the office, has replaced chocolate as my favourite ice cream flavour (those of you have eaten ice cream with me will get how big a deal that is)

  4. Posting this note from barnabywalters.bit — been experimenting with namecoin, got .bit domains resolving on my machine by following instructions namecoin.bitcoin-contact.org, installed namecoin wallet on my VPS and registered a name, pointed it at my web server.

    Surprisingly it was a fairly straightforward process. The most difficult part was getting hold of some namecoin to register names with — I ended up trading some of my DOGE for NMC on vircurex.com.

  5. I am inordinately proud of this tiny progress bash snippet:

    watch 'echo "$(namecoind getblockcount) / $(curl -s http://explorer.dot-bit.org/stats/block_count.txt) * 100" | bc -l'
    
  6. Prepping an old machine for demoing crypto tech at the cryptoparty tonight, windows being a complete pain. I have a feeling I’m going to be spending most of the evening apologising for other people’s bad UI decisions.

  7. Barebones PIC Programming on Mac + pickit2

    If you’ve never done any microcontroller programming, start with an arduino.cc. It’s the best way of getting started with embedded hardware programming.

    If for whatever reason you’re determined to use PICs (cost, availability of free samples, you already had a bunch of them, etc.), you should get a pickit3 and use the netbeans-derived MPLAB X to develop, program and debug your devices.

    But if like me you’re in the weird position of having a bunch of PICs, a Chinese knockoff pickit2 and a strong dislike of Java, here’s how to set up a *minimal* C development environment on a Mac.