INA219 Current Sensor DIY Breakout board

Another small board, this time for a INA219. The INA219 is a high-side current shunt and power monitor with an I2C interface.

INA219

For testing I used Rei VILO library with a MSP430G2553 and Energia, and I measured the power consumption for this simple circuit:

2 001-001

Nothing fancy, just a led and a resitor. The INA219 should measure around 9.6 mA and got this:

led_5v_330R

The current measurement is slightly off. I need to play a litlle more with the calibration routines.

 

Advertisements

DIY ez-FET lite…ghetto style

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:

DSC00857

DSC00863

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:

ez2-001

despite an error dialog about code size:

ez1-001

…then, I programmed the ez-FET firmware:

ez3-001

After reseting the programmer all the drivers were installed:

ez4-001

But every time I tried to program a device with CCS I would get this error message:

ez5_error-001

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.

Sin0-001

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:

Sin1-001

Success!! At least the BSL.  Then I attemped a firmware update with MSP430Flasher:

Sin2-001

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.

output_sBDOeU

MSP430 and a HC-SR04 Ultrasonic Ranging Module

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….

hc-sr04…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.

hc-sr04

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.

hc-sr04_2

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.

DSC09562

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.

hc-sr04_ok