Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

slightly OT, but related - processor current measurement

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
ecoology

Bascom Member



Joined: 07 Nov 2006
Posts: 340
Location: USA - California

usa.gif
PostPosted: Wed Apr 16, 2008 1:13 am    Post subject: slightly OT, but related - processor current measurement Reply with quote

I am using a mega168, driving a TI CC2500 transceiver [a very complex single chip radio]. When both chips are asleep, the current should be less than a couple microamps. When the processor is running, and the radio is in receive mode, the circuit will draw as much as 35 ma.

Is anyone aware of a way to measure the current draw, so I can verify that the chips are asleep? [obviously if awake, I can verify that they are running]. Seems trivial, but there is a 35,000:1 ratio of current, and a simple resistor in series with the power source won't work - same for a microamp meter, or multimeter.

This circuit will be running on a single coin cell, so current draw is critical - I have to know for sure that it is working as expected.

Any thoughts gratefully appreciated,
George
Back to top
View user's profile Visit poster's website
DToolan

Bascom Member



Joined: 14 Aug 2004
Posts: 1384
Location: Dallas / Fort Worth, Texas (USA)

blank.gif
PostPosted: Wed Apr 16, 2008 1:17 am    Post subject: Reply with quote

Um... I am at a loss as to why you can't measure current with a multimeter. Measuring current is done by breaking the power source (seperating it from the object being powered) and placing the multimeter in series. There is no way it "can't" measure the current flowing through it (unless it has a seperate fuse for current measurements and it's internally blown).
Back to top
View user's profile Yahoo Messenger
ecoology

Bascom Member



Joined: 07 Nov 2006
Posts: 340
Location: USA - California

usa.gif
PostPosted: Wed Apr 16, 2008 1:32 am    Post subject: Reply with quote

Hi:
If I set the multimeter for its lowest current - 200ua, I can measure the "sleep" current, correct. BUT if I then bring the chips to an awake state, the current will jump up enough that the protective circuitry in the multimeter will interrupt the current flow, resetting the processor and/or the radio. Effectively, the multimeter puts a large resistance in series with the circuit to measure very small currents. The drop across that large R then "eats" up all of the power source voltage.

I want to be able to see current flow, uninterrupted, as the circuit goes from one state to another.
Actually, the multimeter I have just prevented the power supply from supplying enough voltage when in the 200ua setting.
By putting anything in series with the power, I will be interrupting what I want to measure - The Heisenberg Uncertainty principle on a macro scale.
Back to top
View user's profile Visit poster's website
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2472
Location: Queensland

australia.gif
PostPosted: Wed Apr 16, 2008 2:06 am    Post subject: Reply with quote

Not many multimeters will measure 1 microamp successfully. Probably the best way is to pick a resistor which will drop say 100 mV at the expected current ( eg 100 K for 1 uA ) and measure the voltage drop across this resistor, when in series with the load. You need to keep the drop across the resistor so that the supply voltage is still more than the lowest supply voltage you can work at.

You will need a high impedance meter, at least 10 times the sense resistor, but most digital meters have around 100 M impedance these days, which is fine.

You will probably need to start up the system with that resistor shorted out, put it to sleep, and then open the short to do the measurement.

Just saw your post. Maybe you put a couple of different resistors in series, and short them in and out, so you can measure the current in the different states.

_________________
Adrian Jansen
Computer language is a framework for creativity
Back to top
View user's profile Visit poster's website
ecoology

Bascom Member



Joined: 07 Nov 2006
Posts: 340
Location: USA - California

usa.gif
PostPosted: Wed Apr 16, 2008 2:12 am    Post subject: Reply with quote

Hi Adrian:
I was hoping for an "elegant" way to do this, where I can see the current change [on a scope preferably] without interrupting the current, thereby resetting either chip. Ideally, I need a current trace so I can see the actual time required to go to sleep, wake up, transmit, etc. Then I can accurately calculate the required battery capacity. By having to use a large R, then short it out, etc, I lose the ability to measure the time required to change state. Theory is great, but measuring actual times in various states allows for much better battery calculations.
a 10k resistor in series, at 1 ua is 100mv. that same resistor, with 35 ma flowing, drops 350 volts! A bit more than my on-board regulator can handle.
Back to top
View user's profile Visit poster's website
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2472
Location: Queensland

australia.gif
PostPosted: Wed Apr 16, 2008 2:18 am    Post subject: Reply with quote

So a 2.7 ohm resistor would drop 100 mV at 35 mA. That is enough to see that the voltage across it falls drastically as you put the system to sleep, and you can watch it with an oscilloscope. Then switch up to a much higher resistor to verify that the final current draw is what you expect. Do your switching or resistors in parallel, then you dont interrupt the supply voltage as you change sense values.
_________________
Adrian Jansen
Computer language is a framework for creativity
Back to top
View user's profile Visit poster's website
ecoology

Bascom Member



Joined: 07 Nov 2006
Posts: 340
Location: USA - California

usa.gif
PostPosted: Wed Apr 16, 2008 2:27 am    Post subject: Reply with quote

That gives me an idea.
I could use the processor to do the resistor switching. When it is asleep, doesn't I/O pins become high Z? [have to look that one up, not sure]. If not, I configure the I/O pin to be low during sleep, and high during any wake state.

Anyway, upon waking, the processor could cause a resistor to switch into the circuit, dropping the voltage across the sense resistor. With a 2 channel scope, I can have one channel show the resistor switch, and the other channel show the actual current.
With a large cap across the power supply input, the uP will have time to switch before losing voltage.
Neat, let the processor do the switching for me.
Thanks for thoughts - led to my elegant solution!
George
Back to top
View user's profile Visit poster's website
ecoology

Bascom Member



Joined: 07 Nov 2006
Posts: 340
Location: USA - California

usa.gif
PostPosted: Wed Apr 16, 2008 2:47 am    Post subject: Reply with quote

That gives me an idea.
I could use the processor to do the resistor switching. When it is asleep, doesn't I/O pins become high Z? [have to look that one up, not sure]. If not, I configure the I/O pin to be low during sleep, and high during any wake state.

Anyway, upon waking, the processor could cause a resistor to switch into the circuit, dropping the voltage across the sense resistor. With a 2 channel scope, I can have one channel show the resistor switch, and the other channel show the actual current.
With a large cap across the power supply input, the uP will have time to switch before losing voltage.
Neat, let the processor do the switching for me.
Thanks for thoughts - led to my elegant solution!
George
Back to top
View user's profile Visit poster's website
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2472
Location: Queensland

australia.gif
PostPosted: Wed Apr 16, 2008 3:46 am    Post subject: Reply with quote

AFAIK, the processor port lines are maintained in whatever state they were in when running, when you enter sleep mode. Only a Reset switches back to Hi-Z input state.

But if you are only doing this for a test, just switch the resistors manually. Once you determine what the currents are at each stage on the bench, they are not likely to change in the field. At most you might have to check each unit in production test.

Beware leakage on bypass caps, I have seen the ordinary 100 nF ceramic bypass caps pass as much as several hundred uA DC current after soldering.

_________________
Adrian Jansen
Computer language is a framework for creativity
Back to top
View user's profile Visit poster's website
Arera

Bascom Member



Joined: 23 Sep 2007
Posts: 375
Location: Wuppertal, Germany

germany.gif
PostPosted: Thu Apr 17, 2008 11:31 am    Post subject: Reply with quote

Take care for the IN-Pins!
A pin, switched to "input with pull-up", which is connected to GND will draw current thoug the internal pull-up(30k-50K, I guess).
In my application I set the inputs to "high-Z" and use external pull-ups 220K.
I don't connect unused Pins, but switch then to "input with pull-up".

Maybe that helps to save a few ľA.
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum