The Rusty Spike

A Railroad Fan's Website


HOWTO: MSP430G2 in a Standalone Environment

So it dawned on me that the TI MSP430G2 Launchpad Evaluation board isn’t very small and probably wouldn’t fit in any models smaller than G scale. I also realized that buying a bunch of the Launchpad Evaluation Boards at $10 is still cheaper than other alternatives, but not as cheap as buying the raw MSP430G2 chips by themselves (MSP430G2553 is about $2.50 for just the chip). Therefore I set out on an endeavor to figure out how to minimally power an MSP430G2 chip without the Launchpad Evaluation board.


Turns out, it’s ridiculously easy.


Read More


1:24 Model of a Whelen Liberty (44″) Lightbar

Well, the last lightbar was a1-24 Model of a Whelen Liberty lightbar technical success that met with an unfortunate fate when it shifted inside it’s resin cast. Really, it is a shame because I was very happy with it. But with every failure comes knowledge and lessons learned, so I am moving on without too much angst.

I have targeted a prototype model light bar (Liberty™ SR WeCan® Series Super-LED®) and have also figured out a better manufacturing process. Still not fool proof and does not yield a perfect ‘machine made’ look, but it is infinitely better than last time. Solder traces are much smaller and more accurate. There are 60 LEDs (1206 SMD) this time around grouped into 15 groups and include a Takedown light and left/right Alley lights. At 1:24, the lightbar measures about 44mm wide, 10mm deep and 3mm tall. Keeping the ‘tall’ measurement down in order to mimic the very low profile of the prototype is harder than it appears!

Soldering 1206 SMD LEDs by hand is a bit of a pain, but with practice, I’m getting better. I am still having trouble fathoming soldering 0805’s or 0603’s by hand… yikes.

I’m waiting on some SMD resistors to solder onto the underside of the lightbar, then I’ll have the green light to finish wire it up and test the software.

I’m having a blast!


WIP: Police Lightbar Physical Prototype

Between dealing with a terrible manager at work, switching jobs and the family being perpetually sick, all hobby dollars and time were sucked into the void. 🙁 The parts I ordered from finally arrived recently, so I finished up the initial attempt at building a light bar.

And it was a total failure. The 1206 SMD LEDs weren’t getting good connection and some where blowing out. So I scrapped it and started fresh.

I hit upon a decent manufacturing process and refined it in the build, so the current (2nd) prototype still needs improvement but is infinitely more stable than the first. Solder traces are not very tidy, wire management could be better, etc, etc. But it works and sure looks purty!


Police Lightbar Sim for Launchpad – Rev 3

Last round of modifications to this project for a while. Rev 2 was pretty good, but the memory limitations of the MSP430G2553 chip posed a challenge: 512 bytes of ram! I was only able to get three flashing sequences plus the logic loops into that little memory. So another rework was needed.

Instead of using a byte broken down into 1bit/7bit status/time chunks, for Rev 3 I went with a hardcoded 50ms time chunk constant and used every bit in each byte as a status flag. Example: 00111100 would tell the logic loop that the first two 50ms steps are ‘OFF’, the next 4 steps are ‘ON’ and the last 2 are ‘OFF’. This allows me to compress 8 steps into one byte… an initial 8x memory efficiency increase.

The trade off to this is that counters like ‘CurrentStep’ are now moved out of the flashing sequence. Which, when you think about it, the notion of which step a sequence is on is not necessarily an attribute of the sequence itself, but rather a bookkeeping value by the logic loop. This increases memory usage however, stealing the thunder of my previous 8x decrease in memory use.

The overall effect is still a large reduction in memory use. Rev 3 ups the number of LEDs controlled from 8 to 11 (3 red, 3 blue, 2 yellow, 1 white takedown light, and 2 headlights.) as well as increasing the flashing sequences from 3 to 10 (Technically 15). The LEDs are also now grouped into 3 groups which allows for changing of the flash sequence on one group without interrupting the sequence of the other groups. Rev 2 had a ‘jitter’ problem when the sequences changed. Barely noticable, I think, but the power of my OCD compelled me to fix it.

The final feature enhancement is the concept of ‘Modes’. Currently, there are only two modes installed: Demo and Random. Demo will iterate through each sequence, spending about 8 seconds on each sequence. Random will pick a sequence at random and spend 2-6 seconds on that sequence. (Note: There is some room for improvement on the random chooser)

Anyways, code and how-to are posted below, so for now here’s a video of what Rev 3 can do:

Read More


Police Lightbar Sim For Launchpad – Rev 2

Spend some time reworking the core code as well as the storage format for the flashing sequence. Turns out that I was spoiled working with the Arduino boards, which has significantly more memory. I am endeavoring to put multiple flashing sequences into one code binary and switch them with a pushbutton attached to a DI pin on the Launchpad. Installed an old copy of Adobe Premiere and started playing with that as well. Here’s the results:


Read More