Saturday, March 17, 2018

Why sometime ...

... simple things does not work or just make you crazy losing hours and hours if not days  ?

Who work in the magical world of the software development, especially embedded or firmware, sometime find himself in weird situation, when something incredibly simple and trivial, simply does not work.
Why ?

Well, many of us attribute the fault to Murphy :), or the fate, or the BluBugEater.
The truth is ... nobody knows, every time is a challenge.

So, let see an example.
Here a simple task I wanted to do : writing a simple sketch for Energia, using a MSP430 to drive an Adafruit Ring LED.

I did grab the first Launchpad board I had around, with a MSP430G2452 and I connected with the Adafruit Neopixel ring.
Then I wrote a simple sketch to turn on some LEDs.


Then I started to cut code and put simple I/O manipulation and I had weird behavior.
So I changed Launchpad, same chip, the same.
Then I loaded some example sketch to see if the board was OK ... it was.

I started to scratch my head.
So usual things then, update everything that can be updated, check libraries version, install older versions. Nothing.

Again, is important to remember that my goal was to do a quick test !
Not spending weeks on it !!!!
So I decided to see if somebody else did something on the issue.
After a brief google search I found exactly what I wanted on : LED Hat with MSP430

So I followed the instructions, connected everything and ... nothing !!!

Time to put hand on some instrumentation.
Fired up my oscilloscope and I discovered the signal generated by the MSP430 was totally out of timing.
Instead of a period of 1.2 uSec, I had something around milliseconds !
No wonder the ring was dead.

So back again, replace Launchpad with a new one. The ones I was using had the crystal soldered, I though that maybe something was wrong with that (should not).
But as you can guess .. no luck.

Ok, at this point I decided to change chip.
I had around a MSP430G2231 but it was too small for the sketch.
So after more digging in my "rufo box" (rufo is an "Italian/dialect word to indicate junk :) ) I did found an MSP430G2553, installed it on one of the boards, recompiled the code and ... voila' !
It worked immediately.

In the end I spent almost two days  for a stupid damaged chip to do a test that would have required 5 minutes to be done.

1 comment:

  1. Hi Steve, I remember something similar to your issue.
    Xtal is not enough, you must recalibrate oscillator constant on flash loading the appropriate code.
    I am no more using TI part after they got arrogant when I debugged the TIVA and compiler. MSP430 was a great processor, I loved but it is time to move away to avoid obsolescence. 2553 part was found defective on PWM generation, no answer from TI. They ask teach for free to screaming crowded forum so answer from me is just one: NO MORE TI PART on my project.