Mike Ziwisky's Place to Write Stuff
Electronics. Software. Helicopters. etc.

“Very puzzling problems” solved, almost accidentally

hacked board

This weekend was the big Marquette Engineering Open House; a time for the new prospects to come check out the facilities and compete with each other for a chunk of scholarship money. I was asked by the one and only Prof. Jacoby if I’d be willing to consume a laboratory for demoing my flashing lights for the students and parents. Of course I agreed to it — Jacoby’s charm is a powerful force.

A new event made for a good opportunity to take on the problems that were plaguing HeliPOV in its current state. So I finally got back to working on the blades last week.

My first idea was to replace the microcontroller on the blade that was refusing to light up. It seemed like a long shot that the AVR was a bad unit, but it was a long shot that I wanted to eliminate. So I purchased some ChipKwik SMD removal alloy off of Amazon. In spite of their website that’s straight out of the early 90’s, this stuff is pretty amazing. It’s an alloy that has a relatively low melting temperature, and it stays liquid for several seconds after breaking contact with a soldering iron. It also apparently absorbs regular solder, or otherwise gets itself between the solder and the pins of surface mount chips. So you just apply some flux followed by the ChipKwik alloy to all of the pins of the chip you want to remove. Once they’re all covered, heat them each to liquid and you’ll have a few seconds in which you can lift the chip off the board with a tweezers. It really is a painless process, and cleanup is simple with a little solder wick. Very handy stuff to have around if you need to rework SMD components but don’t have many tools beyond a regular soldering iron.

With the old chip off, a new one soon went on. Programming it worked, burning in the appropriate fuse settings worked, and the lights still did not work. At least I could be pretty sure that a bad AVR was not the culprit, but it brought me back to a rather blank slate. I’ll spare you the details of the few test programs that I burned to the blade for isolating and examining different components of the system — they were basically things I had already tried when this problem first appeared a few months ago. But then as I was playing with it, I noticed that if I applied pressure in certain spots on the circuit board I could make the lights turn on and off. This seemed odd and I first wondered if there was a bad solder joint somewhere and my pushing helped a pin contact the board. I soon figured out that it wasn’t actually the pressure that was causing the differences, but rather the set of pins that my fingers contacted on the programming header. When I noticed the lights turn on with a touch of two pins on the programming header and then off again when I removed my fingers, I pulled up my Eagle board layout to see what I was touching. Turns out one of the pins was ground, and the other was connected to the active-low ENABLE pins of all of the shift registers! All this time, I had allowed the enable pins to float, and they happened to float high enough to cause the outputs of the registers to be enabled on the one blade, but low enough to disable them on the other! I immediately popped some jumpers onto the GND and ENABLE pins of the programming header and stuck a 5k resistor across them. Upon spin-up, I saw my long-awaited reward — the Marquette Golden Eagle was painted in the ether in a bright gold hue. (I didn’t take pictures of the blades in action… sorry! Once the weather is warmer, I hope to have a night flight video on the way.)

ghetto resistor

I recalled having played with the enable pins earlier on during development, but not seeing them behave the way I was expecting, so I ended up just leaving them alone. I did, however, provide them with a connection to the microcontroller in case I needed it. So rather than jerry-rig a pull-down resistor across the programming pins, I thought I’d just be able to add a line or two to the microcontroller code and be on my merry way. Unfortunately, I made a poor choice when I was deciding which microcontroller pin to use for the enable bits of the registers. The original choice of Pin B4 also happens to be the MISO pin for the SPI module. According to AVR App Note 151: Setup and Use of the SPI — “…When the SPI is enabled, the data direction of the MOSI, MISO, SCK and SS pins are overridden according to the following table…” The table to which they refer states that MISO is an input, and it shall always be an input for ever and ever as long as you feel the need to use the SPI module. I was left with no choice but to find a more suitable microcontroller pin. I shopped around and found D5 to be a most appealing choice for the job. So I carefully cut the trace connecting B4 to the registers and soldered a small purple jumper wire to each board, one end to Pin D5 and the other to a via that was part of the ENABLE trace.

hacked board 2

A couple lines of code to pull D5 low and I had working blades! I also made the changes to the schematic and pcb layout to reflect this new connection. The updated files can be found in the SVN repository.

Oh yeah, and I also tweaked the code a little to store multiple images and rotate through them with a transition every few seconds. This is pretty simple, and also pretty messily hacked together, so I didn’t upload it. I’ll probably put it up after it’s a little cleaner.

There are still some lights on the top blade that don’t want to light up, but it seems to just be a case of a bad connection somewhere along the trace. The number of hours it would take to tear up the tape and fix these things is not worth it to me. For Open House, I decided to just do text on the top blade and avoid using those lights that don’t shine. Fortunately the bottom blade had a full set of cooperating LEDs, so it got to adorn the MU logo for the day. The next steps probably include making a better program for formatting text on the blades (and by “better program,” I mean that I currently use an excel spreadsheet with a bunch of X’s filled in to cells to form characters. It’s quite tedious.), and maybe try to fix the issue where the image tends to get clipped at the end of each rotation.

That is, once I get another good excuse to work on the thing.


No Responses to ““Very puzzling problems” solved, almost accidentally”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s