Another small board, this time for a INA219. The INA219 is a high-side current shunt and power monitor with an I2C interface.
For testing I used Rei VILO library with a MSP430G2553 and Energia, and I measured the power consumption for this simple circuit:
Nothing fancy, just a led and a resitor. The INA219 should measure around 9.6 mA and got this:
The current measurement is slightly off. I need to play a litlle more with the calibration routines.
I have a few MSP430G2955 around but non of my Launchpads are capable of programming this MCU. Texas Instruments released a while back all the informtation needed to build the new ez-FET lite. The eZ-FET lite is a low cost USB-based on-board emulation solution for MSP430 microcontrollers. This debuger supports all MSP430 devices compatible with SBW programming and I could use it to program the MSP430G2955.
The hardware is based on an MSP430F5528 and I used a QFN version with an adapter board:
it ain’t pretty…
In order to program the MSP430F5528, I tried first using the FET-Pro430 from Elpotronic. I was able to flash the BSL firmware:
despite an error dialog about code size:
…then, I programmed the ez-FET firmware:
After reseting the programmer all the drivers were installed:
But every time I tried to program a device with CCS I would get this error message:
ok, fail…let’s start over.
According to this post the error might be caused by the the custom BSL portion of the ezFET firmware being not properly flashed. I did read this other post in 43oh about flashing the firmware with MSP430Flasher, I just wanted to see if the Elpotronic software would work.
I tried to re-program the MSP430F5528 using MSP430Flasher but I get this “BSL memory segments are protected” error.
According to this post I have to add options to unlock BSL memory as well as the INFO A memory. I added for that -b and -u:
Success!! At least the BSL. Then I attemped a firmware update with MSP430Flasher:
More success!!! I should have tried this in first place…
Anyway, I tested the programmer with the old and beloved “blink” and It’s working. I still need to test the UART interface but this should work as well.
A while back I bought an HC-SR04. It sat in a box until yesterday when I tried to use it with an MSP430G2553 but unfortunately it wasn’t working. I used Energia to program the Launchpad but I wasn’t getting any response from the device. I hooked up my Logic analyzer to see what was going on and….
…the trigger pulse (channel 1) is there but the device will produce essentially the same echo (channel 0), regardless of whether I put an object in front of the module or not. It wasn’t working.
A quick visual inspection and a comparision with other boards photos showed that two components where missing, a capacitor and a SOT-23 device.
The capacitor was easy to replace. The device near it is a MAX232 used to drive the piezo tranducer and the capacitor is connected between GND and the VCC pin. Acording to the datasheet a 1uF decoupling cap is used.
For the SOT device I made a search looking for a module similar to the one I have but I needed a photo in which the device markings were readable. Eventually I found one with the marking J3Y which turned out to be a S8050LT1 NPN transistor and I replaced it with a PMBS3904.
A quick test with the Launchpad and….It’s working!!!!… now the module responds (now is channel 1) to the trigger (channel 0) with a longer pulse proportional to the distance being measure and the MSP430 is sending data. The Analyzer is showing an echo of 7,206 mS and that translate to 124,24 cm, quite a difference with the value calculated with the Launchpad. The MSP430 is using the internal oscilator as the main clock and is not as accurate as the crystal used for the clock in the Logic analyzer. The error quoted in the datasheets for the MSP430 give the calibrated DCO frequencies a tolerance over temperature and any other changes of ±3%. The difference in this case is close to 10% and I don’t think it can be entirely explained by the clock source.