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