Low Power I2C problems

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

Hi,

 

I have a fully working project that I am just tweaking for low power operation, and I have noticed the I2C is consuming 5.2mA in its standby state.

 

If I stop all peripherals and just run the ATmega324P it runs at 2.2mA.  

 

If I initialize the I2C using Fleury i2c_init ( ) the power consumption goes upto 7.4mA.  After initialization I have used i2c_stop() but the power consumption is still 7.4mA.

 

On initial setup I have set the the SCL and SDA pins as input, and logic low, before i2c_init ( ) is called.

 

As I say, the I2C operates correctly, it just not go into idle mode correctly.  

 

Am I missing a setup step somewhere?

 

Any tests or ideas would be greatly appreciated.

 

Thanks,

 

 

 

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

Power consumption will depend on clock speed, and VCC level, as well as external factors, tell us more about your circuit and schematic would help too.

What is the purpose of using low power?  Why do you want it and what goal are you shooting for?  Is this a battery powered project?

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

Hi,

 

Thanks for getting back.  Yes this is a battery powered project.  

 

* Vin 3.3V

 

* Micro clk speed is 4MhZ

 

* I2C speed is 100khz

 

* I2C device is an accelerometer that goes to sleep and uses micro amps.

 

I am very sure the the I2C accelerometer circuit is correct because the manufacture has confirmed this, but I cannot work out how to send the i2C bus to sleep.  I understood the power consumption should roughly be 0.2mA not 5.2mA.

 

I have tried using the below code, but this does not reduce the power consumption from 7.4mA to 2.2mA.

 

PRR0 |= (1<<PRTWI) // turn of I2C

 

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

According to the DS turning on the I2C should only increase the mpu current a few hundred uA's, and the I2C bus when idle (such as after init or stop) both lines will be high so no power should be consumed externally....   How are you measuring your mpu current?  or is this overall board current? 

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

ki0bk wrote:
tell us more about your circuit and schematic would help too.

Indeed -- what voltage is used on the pullup resistors?

 

Now, I'm wondering why you aren't investigating sleep modes between interrupts at least -- 2mA "idling" is high IME.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

I assume he is like me, in that I start with idle mode, get that working first before delving into deeper sleep modes as idle mode is "easy" and a good first step in reducing power consumption.

 

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

But if e.g. 90% of time between events is spent sleeping in IDLE, then average current should be a few hundred uA.  OP is 10x that.

 

I'd like to see schematic.  And know accelerometer model.  And know current draw with the accelerometer disconnected.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Hi,

 

The Accelerometer is a MMA8652FC.

 

I have not approached sleep modes yet, only idle because this is my first attempt at low power, and I was working through all the peripherals and there power consumption, then last of all send the micro to sleep.

 

A can understand why the I2C is gobbling power.

 

thanks

 

 

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

Tuurbo46 wrote:

 

A can understand why the I2C is gobbling power.

 

 

I can't, please explain?

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

It was a typo.  I was supposed to say.

 

I cant understand, why the I2C is gobbling up power.

 

Are you formally know as Ric?

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

theusch wrote:
I'd like to see schematic.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

We can't either, without seeing the circuit!   How do you know the mpu is drawing the power, how are you measuring it?     As asked in #4 above?

 

Jim

PS: Don't know what you are referring to "Ric"?

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

Hi, Kiobk I recognize your logo from another forum.  I thought you used to be called Ric.  OK wrong person.

 

I am measuring the current using a DVM current meter in series with the battery, so this will be micro and I2C device current.  With all other devices disconnected and only the I2C connected these are my current readings.

 

I am pretty sure it is something to do with how the I2C is initialized, but if only the one Fleury i2c_init ( ) is required it cannot be this.

 

Thanks.

 

 

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

No problem, I've been called worse! q:-)

 

Then without seeing the whole circuit, I don't have any suggestions.

 

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

ki0bk wrote:
Then without seeing the whole circuit, I don't have any suggestions.
theusch wrote:
I'd like to see schematic.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

There has been multiple requests for a schematic and nothing was posted. What expectations does the OP have? I don't think many people who post there have a crystal ball.

 

Here you go: https://en.wikipedia.org/wiki/Ma...

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

Tuurbo46 wrote:
I cant understand, why the I2C is gobbling up power.

 

Did you confirm and check the i2c pins are idling HIGH (right to Vcc) ?

Do all parts have the same Vcc ?

If you are working across voltage domains, you can get bitten by buffer currents - eg a 3v3 i2c slave on a 5V MCU, will be Hi on the slave, and work fine as i2c using open-drain, but the 3v3 level on the MCU IP pins will raise the Icc significantly.

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

The very first thing to do, as a trial, is set BOTH I2C pins as inputs with pullups off. Let it spin in a loop and check the voltages on those two pins AND the system current. 

 

What are INT1 and INT2 of the accelerometer connected to? If they are connected to the MCU, are those pins set as inputs? The could be excess current, here, if these is a connection and the MCU pins are set wrong.

 

In normal operation, that accelerometer should take less than 200uA, so your current greatly exceeds that. That indicates that something is seriously mis-connected or mis-configured.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

If you are using 3.3K external pull-up resistors on SCL and SDA, then asserting either line (pulling it to low) will cause 1.5mA to flow though the pull-up.  But these lines are asserted only for a brief period of time.

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

Hi,

 

Thanks for all your help.

 

I will work through all the above tests.  Then when I am out of options, I will post my schematic.

 

Thanks again for all your help.

 

Tuurbo46

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

Tuurbo46 wrote:
when I am out of options, I will post my schematic

???

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.