tldr; if you don’t know what an MSP430 is, then skip this article. If you do know what an MSP430 is then read on- this article may change your life…
The TI supplied tools for programming their MSP430 microcontrollers are too slow and inflexible, so I made a new programmer that…
- 100x faster cycle time(!!!) than TI’s flagship MSP-FET programmer
- Based on widely available Raspberry Pi Pico (as cheap as $4)
- Supports standalone operation (no computer)
- Supports headless operation (no screen or keyboard)
- Tiny form factor
- Open source
- The high-level parts are in Python, so easy to adapt to your needs
- Rock-solid reliable
Additionally, there are lots of optional add-on features aimed at improving production flow:
- Auto target detection so programming starts instantly when a target is connected.
- Online logging to a google spreadsheet, with the device serial number.
- Color LED strip progress indicator for headless operation.
- Audio success/fail feedback.
- Button press to grab the latest firmware update from a github release.
- Target power measurement accurate to 1 microamp.
The repo with everything you need is here:
https://github.com/bigjosh/pi-pico-sbw
Hopefully everything is documented enough there, but if not then you can ask any questions in the comments below.
A FULL PROPDUCTION PROGRAMMING STATION
CASE STUDY:
I was able to shorten a factory cycle time from 15 seconds (using MSP-FET) down to 1 second.
- The operator puts the unit into the programming fixture
- Auto target detection immediately begins the cycle
- The unit serial number is read out
- Code FRAM is programmed and verified
- User FRAM is programmed and verified
- Device is power cycled and power draw is measured
- LEDs and sound tell operator the cycle is complete and if the unit is pass or fail
- The operator removes the unit
- In the background the time, serial number, firmware hash, and power usage are logged to a google spreadsheet over wifi
It looks like this:
FAQ:
Q: What additional hardware do I need?
A: To program, you only need a Pico and wires to connect it to the target. If you want power measurement, then you also need a 100k ohm resistor. If you want online logging and/or firmware updates, then you need a Pico W. If you want LEDs or sound, well then you need those too.
Q: Does this work with the MSP430xxxxx chip?
A: The code is currently only tested with MSP430FR4133 because that’s what I use, but should work with any MSP430 SBW chip – perhaps with a little adjustment.
Q: How is this so much faster than the TI tools?
A: The gains come mostly from (1) using the (poorly documented) quick read and write functions, (2) more efficiently utilizing the SBW bandwidth, and (3) avoiding overhead for things like USB setup and teardown on every pass.
Q: What if my target is self powered?
A: Do not connect the Vcc pin (only 3 wires between MSP and Pico).
Q: Why didn’t you use the awesome PIO hardware on the Pico to completely saturate the SBW interface?
A: If you look at the repo, you’ll see a PIO enabled branch. This branch works and is 2x-3x faster, but is not production ready. It was just too much complexity to be worth it for me. Once the programming cycle dropped from 10’s of seconds to milliseconds, I was satisfied. That said, if you are programming thousands or millions of these chips at a time, leave a comment below and we can save you some (more) time.
Q: What is that product you are programming in the case study?
A: That, my friends, is the AWESOME Time Since Launch by CW&T. You can (and should) buy one here…
https://cwandt.com/products/time-since-launch
Q: MSP430? Get an ARM and get a life.
A: This product has a big 12 digit LCD display and only pulls about 2 microamps. It keeps its state constantly updated in FRAM so it can be recovered in case of a failure. It can also be directly powered from 2x Energizer Ultra AA batteries from 3.6V down to 1.8V (projected run time >>>50 years!). If you know an ARM that can do all that, please do let me know.
Q: Google Sheets?
A: I had been using AirTable but that was complicated and had occasional issues. Google sheets is fine and everyone alreday has it and knows how to use it so I can give anyone a read-only to the spreadsheet and they can do whatever they need to without me having to set up security and users and passwords. It will run out of steam at about 1 million rows, but I can deal with it then.
