Launchpad SPI Ninja

Using his previous experience on his Atmel based BusNinja, [J]oby came up with the Launchpad SPI Explorer. The serial parser is  based off his previously covered RPN Calculator. If you ever want to debug any SPI based device or sensors, you can talk to it  using the Launchpad without writing any code. The interactive shell allows you to send SPI packets serially with the Launchpad acting as a gateway.

[sourcecode language="plain"]
Controlling a Microchip MCP23S17 SPI 16-bit I/O expander:
[ b111:4 0x20 10:2 r:64 ]
Which translates to:
Assert CS
Write 7 7 7 7
Write 32
Write 10 10
Read 64 bytes
Deassert CS

More on his Launchpad SPI Explorer here. Debug away!

Join the best MSP430 blog on the net and stay up-to-date with our latest news, projects and design resources. We will not share your info with anyone.


  1. These are the kind of great projects I like to find; Making a tool that helps you make even better stuff!
    NJC’s oscilloscope project is another example. I have a USBTeensy laying around that I just found out I can turn into a BusPirate; another great tool.
    Man, I love brilliant people who share!

    • +1 for sharing!

  2. This is great. You know what would be even greater? An i2c version of this please please pretty please with sugar on top.

    • The BusNinja project of his does do I2C. Its a matter of porting the hardware layer.

      • In fact, the Bus Ninja (AVR) code has a bit banging i2c implementation in hw_i2c. It’s just delay loops, DDR registers and PORT writes so will be easy to port.

        The code is all available and open source, so feel free to have a go.

        Note: Bus Ninja has an abstraction layer (bus_X) to allow runtime switching between i2c/spi/etc. It’s just an array of function pointers, so would be easy to add back.

        If you’re interested in a Bus Pirate-a-like for MSP430, check out GoodFet (

        Send me mail ( if you have any questions.

      • Hopefully it can do both the read/write, but also i2c spy options, of just listening and listing all i2c traffic. But the read/write part is incredibly useful by itself.

        • I never implemented a sniffer, just read/write and address detection.

  3. Very cool project. Wished I’d had this six months ago. :)

  4. Update: I did it. i2c nearly ground up from scratch, with Joby’s menu system, and NJM’s uart. Tested with a standard i2c 8bit port extender.

    Comes in at 1920 bytes on standard IAR. I even added in a bruteforce slave scanner. Have enough room to add like one or two more things.

    Will be immediately doing a MSP430G2231 -> i2c port expander -> character lcd.

    Hopefully, I can use the usi for a i2c sniffer as well. Should be simple enough.

    • Great stuff. Is the code available?

      • Not yet. Need to properly test it with multiple i2c devices for the scanning mode, and with proper pull-ups. Which means actually soldering in the female headers first. Should be soon.

    • Very cool! So it becomes pretty easy to turn the 430 into a cheap multi-channel I2C ADC… ? that could come in handy for me…

      • Posted to the 43oh boards. Under Projects -> i2c Explorer

  5. Am I the only one here that in no possible way can get this to work? i am not getting a console and when i try to make it send a char just after reset i get garbage?
    seems like a clock problem to me, but it seems the clock should be correctly configured, any suggestions?
    I have tried with and without external 32kHz crystal.

  6. Can someone post the CCS project for this?


Submit a Comment

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

eight × 8 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>