Measure current while connected to a debugger

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a battery powered device and I am monitoring its current consumption.

Right now I have to disconnect my debugger in order to measure the current properly.

 

I am guessing that some optocouplers here and there could allow me to measure the current while I am debugging.

Has anyone done this already?

 

The micro is an ATXMEGA256A3U, the debugger is a JTAGICE3.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PDI data is bi-directional; PDI is sensitive to slew and setup/hold mismatches between PDI data and PDI clock.

There are I2C isolators but I'd be surprised if these would work with PDI.

The level translator inside the JTAGICE3 may be the extra load.

Could try carefully supplying the target's voltage to JTAGICE3 not from the XMEGA but from a somewhat similar (voltage, impedance) external power.

A tracking power supply likely would be it.

Or, strong op amp on second power supply as an XMEGA voltage follower.

Who needs a debugger? wink

It's ROM monitor time!

Can one shoehorn a GDB monitor?  (that'd be COOL!)

Spare port on the XMEGA?  If yes, logic analyzer and macros.

Spare RAM and SPI?  If yes DMA and SPI to an FTDI SPI-to-USB.

P.S.

Jack Ganssle has evaluated current meters from an embedded systems POV; another review :

The Ampere current sensor

April 06, 2015

http://www.embedded.com/electronics-blogs/break-points/4439122/The-Ampere-current-sensor

"Dare to be naïve." - Buckminster Fuller

Last Edited: Tue. Apr 21, 2015 - 02:39 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The specifications page for The Ampere current sensor states:

 

Noise level (ACrms)                   100uA

 

Which isn't going to be much use with microcontroller standby currents being on the order of 1uA and  below these days!

 

sad

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ganzziani wrote:
Right now I have to disconnect my debugger in order to measure the current properly.

 

I am guessing that some optocouplers here and there could allow me to measure the current while I am debugging.

What kind of current levels are you looking at?

 

Even optocouplers are going to take some current...

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

The specifications page for The Ampere current sensor states:

 

Noise level (ACrms)                   100uA

 

Which isn't going to be much use with microcontroller standby currents being on the order of 1uA and  below these days!

 

sad

 

 

 

I guess Dave's uCurrent is the way to go.

 

http://www.eevblog.com/projects/...

 

Cheers,

 

Ross

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dave uses batteries; The Ampere is USB-powered - that could be significant...

 

Dave's bandwidth is only 2kHz; The Ampere does 800 kHz - that may or may not be significant, depending on the application...

 

If you're feeling really flush, these are great:

 

DC Power Analyzer Image

http://www.keysight.com/en/pc-11...

 

For a little (!) less, perhaps one of these:

http://www.keysight.com/en/pd-25...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

Dave's bandwidth is only 2kHz; The Ampere does 800 kHz - that may or may not be significant, depending on the application...

 

The current model of µCurrent is rated for >300 kHz bandwidth.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yep... that is why I have one.

 

 

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jmaja1 wrote:
The current model of µCurrent is rated for >300 kHz bandwidth.

 

Ah yes - I was looking at the old specs!

 

blush

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I've had the same problem, in the end I just used relays for isolation when doing ATE but for development there is basically no solution. There is probably a pull-up or something in the JTAGICE3 for the PDI data lines.

 

The good news is that the amount of current it consumes is consistent. At 2.7V it is about 30uA on mine, so for ballpark measurements I can just subtract that until I am ready to do a proper idle current test. I use an Agilent 34410A for that, which can sample current at 10kHz, pretty nice for developing low power devices.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mojo-chan wrote:
Agilent 34410A

They now go by the name of "Keysight"

 

http://www.keysight.com/en/pd-69...

 

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, not sure I like the Keyshite Keysight name. That meter is good though, 10k samples/sec. The ones with nicer displays tend to be slower. Also, the software they provide is hopeless, you have to write your own to get 10k samples/sec out of the thing.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mojo-chan wrote:
Yeah, not sure I like the Keyshite Keysight name.

I expect many here still haven't got used to calling them "Agilent"...

 

Quote:
That meter is good though, 10k samples/sec.

The 34465A I showed claims up to 50k...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

That meter is good though, 10k samples/sec.

 

The 34465A I showed claims up to 50k...

 

 

Look at the price though :-)

 

For our needs 10k was enough. We use it to profile firmware for current consumption when doing different things over fairly long periods of time. The sample memory is only 10k or something so you have to stream the readings to a PC in real-time, which the Agilent software can't do at that speed. I wrote a little app in C that takes care of it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I remember when HP spun off Agilent they sent letters asking for people's opinion of the new name. At the time I thought it was shitenot very good too!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

... and KeyShite is no better.

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Agilent has sort of grown on me over the years, but Keyshite just sounds stupid.

Last Edited: Wed. Apr 22, 2015 - 08:20 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Yes, I am using a uCurrent.

The device draws about 2uA during sleep, and about 1.5mA when it is active.

Oscilloscope Watch urrent measurements

Last Edited: Wed. Apr 22, 2015 - 03:06 AM