Power hungry code.

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

I just wanted to ask... I'm writing in ASM and want a feature that will drain the batteries as quick as possible... what are the software options... and hardware options.

When a user activates this battery conditioning mode the AVR should turn on all LEDs and run some power hungry loops and modules.

Thanks

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

Which AVR? Some of the more modern ones have easily scalable clocks. You could attach a fast crystal as the clock source but usually pre-scale the clock to run the AVR much slower then, when you want to draw more power, scale the clock up to full speed. However this does not draw a LOT of current. For example a Mega 48/88/168 operating at 5V will consume about 1ma at 1MHz but just 13mA at 24MHz. Sure the relative increase in consumption is pretty big but 13mA will still take a long time to drain something like a 2000mAh battery.

Cliff

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

A npn transistor and a resistor both suitably rated so that a big load is put on the supply....making sure of course that you don't have meltdowns or explosions.

Quote:
run some power hungry loops

??? how can you have such a thing? When the processor is running it's... well...running regardles of what it does. The only thing you can do is to turn on as many of the internal peripherals as possible and speed up the clock as explained by Cliff or use an external load.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Ok this is a Mega88

Quote:

??? how can you have such a thing? When the processor is running it's... well...running regardles of what it does. The only thing you can do is to turn on as many of the internal peripherals as possible and speed up the clock as explained by Cliff or use an external load.

So the processer does not use less power when idle ??

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

Quote:
So the processer does not use less power when idle ??

When idle as in one of the sleep modes, it uses less power. But normally there's no such thing as idle. Doing nothing useful, it would still run some endless loop. And then it's all the same.

The Dark Boxes are coming.

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

Quote:
So the processer does not use less power when idle ??

That depends on what you mean by idle. I would guess that an infinite loop or a long string of NOPs does not use significantly more power than a series of MUL instructions. So it's hard to imagine what a "power hungry loop" would look like. I guess if you come from a desktop PC background this might seem odd, but as far as I know no AVR has an IDLE instruction.
Most people who post questions relating to power consumption are looking to minimize it.
Just out of interest, what sort of battery chemistry are you using?

Four legs good, two legs bad, three legs stable.

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

My digicam has a battery discharge function but I think it does nothing special, it only displays a message and the auto power off function is disabled.

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

Hemn.
I think that running all timers should give some increase.
Generaly the more HW blocks in the AVR you are using the more power is consumed.
As somone pointed out higher clock rates also use more power. Mayby overclock to cosume more power? :twisted:
ofcorse nothing beats a copper wire between the batterypoles. :D

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

Quote:

Generaly the more HW blocks in the AVR you are using the more power is consumed.

Yes, but each subsystem doesn't turn an AVR into a space heater.

If you want to suck power, use some external resistors and drive them to ground for a few mA each. Or switch the current to a suitable power resistor.

Lee

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'd still like to know what battery chemistry is involved. As far as I'm aware, the discharge cycle should only be of benefit to NiCds, and even then there's some debate about it.
I hope you're not intending to build a lot of these devices - it's already way too hot for me to work today without people building global warming accelerators.

Four legs good, two legs bad, three legs stable.

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

But we have lots of accelerators already the more efficent at this are called 4X4's over here SUV's over there.

Yes I am getting grumpy!