Jump to content
43oh

Turning MSP430 into an amperemeter - possible?


Recommended Posts

Wow, thank you. A fascinating project.

 

Question. If the ammeter at the link above only worked with very low voltages (say, 3.3 and less), would that allow to increase its precision?  I am trying to trace energy efficiency of my code, so got to have precision.

 

Alternatively, maybe someone has used built-in current sensing capabilities of EFM32? All it would take (I think) is to use EFM32 as a power source for MSP430, install Silicon Labs' proprietary IDE (eclipse-based Simplicity Studio), and watch graphs being plotted.

Link to post
Share on other sites

measuring currents at the range used by these processors is not easy. Several things make it tough: the low end is very, very low when sleeping, and can be the dominant usage in systems where the processor sleeps most of the time; The active current can be orders of magnitude larger than the sleep current; and many applications have very short active bursts.

 

If you are trying to tune code by power usage, you will have an..... interesting time. If you are running on a launchpad rather than a bare processor, the power used by the processor will likely be buried under all of the other draws on the LP board and, for practical purposes, unmeasurable without much more expensive gear than you likely have. Just the power LED on the LP uses 2000 or more times the standby power (1mA vs 0.5uA). The active power for the core is 230uA, or 500 times he standby, not counting peripheral usage and I/O. (at the datasheet spec 2.2V and 1MHz... the difference in core usage is a larger factor at higher speed and supply voltage) The INA219 doesn't really have the resolution for this.

 

If it were me, and it has been on occasion, I would just use a small shunt resistor to provide a signal that can be used to detect active time and try to minimize that. Next would be to measure charge consumption, using a cap to power the device and measuring voltage drop, which directly reflects charge loss, which is integrated current. By monitoring the cap at no load, and in your application, you can use the difference to get pretty accurate charge used by your circuit.

Link to post
Share on other sites

I thought the launchpad has a jumper that turns of a lot of peripherals? How does one turn off the rest? There has to be a programmatic way, no?

If you remove the jumpers, then put a current meter across where the Vcc jumper goes you can measure the consumption of just the mcu and any connected loads such as LEDs etc.

 

 

Sent from my iPad using Tapatalk

Link to post
Share on other sites

Olimex makes a JTAG/SBW flash programmer/debugger that monitors power usage and identifies current usage of your functions

 

https://www.olimex.com/Products/MSP430/JTAG/MSP430-JTAG-ISO-MK2

http://mspdebug.sourceforge.net/power.html

 

I noticed that the new Wolverine launchpad has an EnergyTrace feature.

It is reported in the change log

New device support:
   ..
   MSP430FR5969 revF Family (full EnergyTrace and ULP feature support)

New features:
   ..
   Added EnergyTrace

I wonder if this will be a similar kind of thing. I havent found any other documentation on it.

(But the source is freely available, Hmmm)

Link to post
Share on other sites

I noticed that the new Wolverine launchpad has an EnergyTrace feature.

Very interesting. From the MSP430_EnergyTrace header in the source release (which is BSD-3-Clause):

 

Record format
-------------

The default record format for operation mode 1 for the MSP430FR5859 is 22bytes for each record consisting of:
[8byte header][8byte device State][4byte current I in nA][2byte voltage V in mV][4byte energy E in uWsec=uJ]

Where the header consists of:
[1byte eventID][7byte timestamp in usec]

The eventID defines the number of arguments following the header.
  eventID = 1 : I value,                32 bits current
  eventID = 2 : V value,                16 bits voltage
  eventID = 3 : I & V values,           32 bits current, 16 bits voltage
  eventID = 4 : S value,                64 bits state (default type for ET_PROFILING_DSTATE)
  eventID = 5 : S & I values,           64 bits state, 32 bits current
  eventID = 6 : S & V values,           64 bits state, 16 bits voltage
  eventID = 7 : S & I & V & E values,   64 bits state, 32 bits current, 16 bits voltage, 32 bits energy (default type for ET_PROFILING_ANALOG_DSTATE)
  eventID = 8 : I & V & E values,       32 bits current, 16 bits voltage, 32 bits energy (default type for ET_PROFILING_ANALOG)
  eventID = 9 : S & I & V values,       64 bits state, 32 bits current, 16 bits voltage
Sampling frequencies from 100 Hz to 100 kHz.

 

It's probably the same general solution as Energy Micro uses for the energyAware Profiler.

 

Might be a capability that could be added to mspdebug when using the tilib driver.

 

Tempting project, but I really need to focus on BSPACM for now.

 

*EDIT* See http://forum.43oh.com/topic/5364-msp-debug-stack-no-longer-open-source/ for licensing restrictions related to this feature.

Edited by pabigot
Link to post
Share on other sites
  • 3 weeks later...
  • 1 month later...

Looks like TI finally released the media blitz on EnergyTrace-

 

http://e2e.ti.com/blogs_/b/msp430blog/archive/2014/06/24/here-we-grow-again-msp430-expands-it-39-s-portfolio-of-fram-based-mcus-with-the-msp430fr5x-6x-series.aspx?DCMP=fr59x69x&HQS=ep-mcu-msp-fr59x69x-fb-mspblog-20140624-en&hootPostID=840f29cb63ce1b4b3a9af1c45677a9e6

 

http://www.ti.com/tool/energytrace?DCMP=ep-mcu-msp&HQS=energytrace

 

Wolverine LaunchPad (presumably a new version?) and MSP-FET units coming out with EnergyTrace built in, and the FRAM chips have the EnergyTrace++ built in to analyze power at the peripheral level.

Also looks like they're expanding the Wolverine series chips finally (we saw glimpses of that with the CCSv6 headers for msp430-elf-gcc) so some TSSOP's are hopefully due to become available soon!

Link to post
Share on other sites

Finally, but it looks to be tethered into CCS. Does anyone know if it requires the code to be written in CCS?

ie does it try to link up code and energy consumption?

 

Edit:

Looks like these is a new wolverine board, reading ([Tipdf]slaa603[/Tipdf]) shows this v2.0 board, it's wider than the 1.0 and specifically says ezFET with energyTrace. I'm downloading CCS now and will report if the v1.0 boards are supported.

 

@@spirilis They shouldn't need new wolverine boards, The wolverine launchpad I have has all the hardware for it, (the MSPG series, that acts as a DC/DC converter) and the MSP-FETs just need to have firmware that support it. Unfortunately the MSP430UIF FETs will not work.

 

It's actually really smart how they're doing it, the slave Value line part acts as a DC/DC converter, and it reports back any changes it has to make to the duty cycle of it's output pulses. It also has some resistors so that it can calibrate these figures.

Link to post
Share on other sites

Finally, but it looks to be tethered into CCS. Does anyone know if it requires the code to be written in CCS?

ie does it try to link up code and energy consumption?

 

Edit:

Looks like these is a new wolverine board, reading ([Tipdf]slaa603[/Tipdf]) shows this v2.0 board, it's wider than the 1.0 and specifically says ezFET with energyTrace. I'm downloading CCS now and will report if the v1.0 boards are supported.

 

@@spirilis They shouldn't need new wolverine boards, The wolverine launchpad I have has all the hardware for it, (the MSPG series, that acts as a DC/DC converter) and the MSP-FETs just need to have firmware that support it. Unfortunately the MSP430UIF FETs will not work.

 

It's actually really smart how they're doing it, the slave Value line part acts as a DC/DC converter, and it reports back any changes it has to make to the duty cycle of it's output pulses. It also has some resistors so that it can calibrate these figures.

 

EnergyTrace++ Utility | Questions, Answers, Discussion

TI Official EnergyTrace announce

EnergyTrace++ Tool Page

43oh Blog Page

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...