Thursday, December 24, 2015

Bus Pirate v3 Direct IO Pins

My wife got me a Bus Pirate (among other things) for Christmas/Saturnalia/Yule/Whatever.  For the unfamiliar, a Bus Pirate is a small USB device used to communicate with various chips over standard buses such as I2C and SPI.  It also has some other neat features like pulse with modulation and frequency measurement, and can even be pressed into service as a JTAG programmer and (very low speed) logic analyzer and oscilloscope.  Essentially, it is the Swiss Army Knife of electronic tools.

I don't have any I2C or SPI stuff laying around to mess with right now, but I am planning to start working on something in the near future that will require me to bit bang a very simple protocol.  Because of this, I'm messing with writing data from the pirate in direct i/o (DIO) mode.

When writing data in DIO mode, you simply give the pirate an 8 bit value and it sets the pins appropriately.  You only have five pins (CS, MISO, CLK, MOSI, and AUX) to twiddle your bits with.  These are represented by the five least significant bits. The table below represents the bits


If you want to turn more pins on, simply do a bitwise OR of the values you wish to change. For example, entering a 5 would turn on CLK and CS. (0b100 ^ 0b001 = 0b101 = 5). More to come later.

Monday, December 21, 2015


I've been developing an interest in bushcraft lately.    While on a recent excursion the members of a group I was with I became interested in a lightweight chopping tool.  Some internetting lead to reading about tomahawks.  The Cold Steel Trail Hawk seems to be pretty popular.  I ordered mine from that online retail giant that everyone loves to hate.

As you can see, it doesn't look like much from the factory.  With that said, I am happy that it fits in my Goruck.

The first thing that I did was take it apart, sand the polyurethane off the handle, and coat the head in paint stripper.  After that, the Elder Sign was added to the handle for protection from the Great Old Ones. 

After the paint was removed, I soaked the head in vinegar for two days to put a patina on the metal.  I did the same with my Mora Compantion.

After a light coat of stain and some tung oil on the handle, she's looking great.

On the air

I got my ham license about two years ago, but never really did much with it despite intending to do otherwise.  I managed to finally reach a turning point regarding that when I picked up a gently used Kenwood TM261A (and a power supply) from a local Craigslist seller.

As a budget-minded individual, I decided to try constructing my own antenna before buying one.  The basic ground plane antenna described in the ARRL Operator's Manual seemed like a pretty easy place to start, so I went with that.  My build consists of three pieces of brazing wire connected to a SO-239 connector.

First I went about making loops so that the ground plane wires could be connected to the SO-239.  I bent small L shapes with a bench vise, then squished them into something I could connect with a screw.

I then soldered a third section of wire to the part of the SO-239 that connects to the core of the coax using a propane torch.  I neglected to take a picture, but I doubt the complexity of the operation will astound you.

After running some 50 ohm coax up to the attic, I secured my new antenna in place with zip ties.

I am now able to hit a repeater about 15 miles away and am getting reports of good audio.  As time (or money) allows, I'll probably either build or buy a J-Pole.  Regardless of this, I'm happy for the time being.

Tuesday, January 20, 2015

E36 BMW Refresh Part 2 - Leaks and Alerts

A while ago I changed the drive belts.  The tight engine compartment makes getting good photos hard, so I'll just say that it is easiest to swap them out from underneath the car with your head by the driver's side wheel.

On top of that, while changing the spark plugs I noticed that some of the spark plug holes were full of oil when I was changing the plugs (not inside the cylinder, the recess the plugs go into).  There are gaskets for these, but changing them requires that the valve cover be removed.  This means that the valve cover gasket must be swapped out too, leaking or not.  It is important to mention that the gasket is different on pre-VANOS and VANOS equipped cars.  Be sure to get the correct gasket.

Just as before I removed the decorative cover from the engine, the coils, and the spark plugs.  Next the valve cover came off.  I should mention that the rear driver's side bolt for the valve cover is a little bit hard to reach.  Be careful that you don't drop it someplace that it cannot be found, because it is a special item that they don't carry at the hardware store.  A decent auto parts store will be able to order one for you.

With the cover off, we can see the old gaskets.  They can simply be removed by pulling them off.

The old gasket is on the right, and the new one is on the left.  The old gasket has hardened significantly and doesn't even feel like it's made of rubber.  It is not surprising at all that it was leaking.  Re-installation was a simple but unphotographed process.  I did use a small amount of RTV at the corners of the gasket and inside the half moon cutouts at the back of the engine.

Another problem I was having is that the car was claiming it was low on coolant, even though it was not.  The issue in this case was a bad coolant level sensor, located at the bottom of the radiator overflow tank.

There are two hoses that connect the overflow tank to the radiator.  First I unhooked the top one from the radiator (driver's side).

After that I carefully worked the hose free from the fan shroud.

The next step was to remove the bleeder screw and the retaining clip from the tank.

At this point in time you can move the tank around freely.  I disconnected the other end of the top hose from the tank and pumped as much coolant out as I could with a hand pump.  There is a second hose on the bottom and an electrical connector for the sensor.  I removed both of those as well.

When I removed the old sensor, it came out in pieces.  Reinstallation was the same job, but in reverse order.  I am happy to say that I no longer have a stupid warning about being low on coolant when I in fact have plenty.