The Rusty Spike

A Railroad Fan's Website

By

CMRI Emulation on a MPS430

lp4mrr - CMRI Emulation on a MPS430

I was browsing other people’s blogs, as I’m apt to do in-between software compiles at work, when I ran across Hoffy’s blog post about CMRI Emulation on an Arduino. Computer controlled model railroading is an aspect of the hobby that has fascinated me for many years. Being a certified bit-junkie who loves serial and network communications, this article immediately grabbed my interest.

logo-jmri - CMRI Emulation on a MPS430

I was a impressed at what Hoffy accomplished. But when I read that the project was done in Energia and not CCS5, I felt the familiar spark of a challenge form. So I dove in and attacked the challenge of getting CMRI Emulation working with 100% native c through CCS5. I decided to do a total rewrite rather than try to glue several people’s code together and end up with FrankenProject. (Done that, it’s not pretty)

It’s still a work in progress, but the baseline protocol over the Launchpad’s built in USB->Serial interface is established and outputs are working. Here’s a quick, low quality video of the Launchpad (loaded with an MSP430G2553) loaded with the CCS5 code I wrote, being controlled via JMRI. (I used bits 0 and 6 on port 1, since the Launchpad has two onboard LEDs at that address.)

Launchpad, CMRI, and JMRI Initial Research from claymore1977 on Vimeo.

TODO List for CMRI on Launchpad

  1. Get inputs working correctly
  2. Test chaining multiple launchpads together, with different addresses, via Pins 1.1 and 1.2
  3. Test multiple launchpads sharing the same address, but handling different ranges of IO bits.
  4. Clean up, consolidate and minify code.
  5. Put all Configuration variables at very top of file.
  6. Experiment with using Shift registers to increase a single Launchpad’s capability from 12 IO pins.
  7. Determine which of the MSP430G2 chips can be used besides the ‘top of the line’ 2553
  8. Develop more advanced CMRI nodes other than simple On/Off command and sensing.

Cheers!

-Dave L

Leave a Reply

Your email address will not be published. Required fields are marked *