Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

OCDEN Fuse (minor rant)

OCDEN Fuse (minor rant)

2011-10-13 by Phillip Vogel

I've been scratching my head for a while, trying to figure out why a Mega644PA was drawing something over 1.6mA while in SLEEP_MODE_PWR_DOWN. I had all the fuses set, all the peripherals disabled, all the ports set to draw the least current. The chip looked like it was going to sleep - it obediently sat and waited for a pin-change interrupt, and then continued execution when I pressed the appropriate button. But this was something like 1000  times the expected current.

I tried shorting the crystal to ground, just to see what would happen, and the current went down a bit. This indicated to me that, even though it was supposed to be stopped, the clock was actually running. WTF?

Then, I reconnected the JTAGICE MKII (for the hundredth time today), and this time I exited debug mode before disconnecting it. That fixed the problem and the chip now sleeps at sub-2uA consumption. So, it appears that activation the JTAG debugger also activates the OCDEN fuse, and unless you exit debug mode methodically, OCDEN remains programmed (and the clock continues to run in all sleep modes).

Now that I'm aware of this, I can live with it. But, WHERE IN THE DOCUMENTATION AM I WARNED ABOUT THIS? I really don't recall seeing it anywhere.

But I'm feeling MUCH better now that I know my battery won't die after a couple of days of idle time...




[Non-text portions of this message have been removed]

Re: [AVR-Chat] OCDEN Fuse (minor rant)

2011-10-13 by Clark Martin

On Oct 13, 2011, at 8:56 AM, Phillip Vogel wrote:

> 
> I've been scratching my head for a while, trying to figure out why a Mega644PA was drawing something over 1.6mA while in SLEEP_MODE_PWR_DOWN. I had all the fuses set, all the peripherals disabled, all the ports set to draw the least current. The chip looked like it was going to sleep - it obediently sat and waited for a pin-change interrupt, and then continued execution when I pressed the appropriate button. But this was something like 1000 times the expected current.
> 
> I tried shorting the crystal to ground, just to see what would happen, and the current went down a bit. This indicated to me that, even though it was supposed to be stopped, the clock was actually running. WTF?
> 
> Then, I reconnected the JTAGICE MKII (for the hundredth time today), and this time I exited debug mode before disconnecting it. That fixed the problem and the chip now sleeps at sub-2uA consumption. So, it appears that activation the JTAG debugger also activates the OCDEN fuse, and unless you exit debug mode methodically, OCDEN remains programmed (and the clock continues to run in all sleep modes).
> 
> Now that I'm aware of this, I can live with it. But, WHERE IN THE DOCUMENTATION AM I WARNED ABOUT THIS? I really don't recall seeing it anywhere.

I ran across this the other day while checking fuse settings...

In doc 8272 (AT Mega 644 data sheet), page 299 it says:

"Never ship a product with the OCDEN Fuse programmed regardless of the setting of Lock bits and JTAGEN Fuse. A programmed OCDEN Fuse enables some parts of the clock system to be running in all sleep modes. This may increase the power consumption."

Clark Martin
Redwood City, CA, USA
Macintosh / Internet Consulting

"I'm a designated driver on the Information Super Highway"



[Non-text portions of this message have been removed]

RE: [AVR-Chat] OCDEN Fuse (minor rant)

2011-10-13 by Phillip Vogel

> -----Original Message-----
> From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On
> Behalf Of Clark Martin
> Sent: Thursday, October 13, 2011 12:41 PM
> To: AVR-Chat@yahoogroups.com
> Subject: Re: [AVR-Chat] OCDEN Fuse (minor rant)
> 
> 
> On Oct 13, 2011, at 8:56 AM, Phillip Vogel wrote:
> 
> >
> > I've been scratching my head for a while, trying to figure out why a
> Mega644PA was drawing something over 1.6mA while in
> SLEEP_MODE_PWR_DOWN. I had all the fuses set, all the peripherals
> disabled, all the ports set to draw the least current. The chip looked
> like it was going to sleep - it obediently sat and waited for a pin-
> change interrupt, and then continued execution when I pressed the
> appropriate button. But this was something like 1000 times the expected
> current.
> >
> > I tried shorting the crystal to ground, just to see what would
> happen, and the current went down a bit. This indicated to me that,
> even though it was supposed to be stopped, the clock was actually
> running. WTF?
> >
> > Then, I reconnected the JTAGICE MKII (for the hundredth time today),
> and this time I exited debug mode before disconnecting it. That fixed
> the problem and the chip now sleeps at sub-2uA consumption. So, it
> appears that activation the JTAG debugger also activates the OCDEN
> fuse, and unless you exit debug mode methodically, OCDEN remains
> programmed (and the clock continues to run in all sleep modes).
> >
> > Now that I'm aware of this, I can live with it. But, WHERE IN THE
> DOCUMENTATION AM I WARNED ABOUT THIS? I really don't recall seeing it
> anywhere.
> 
> I ran across this the other day while checking fuse settings...
> 
> In doc 8272 (AT Mega 644 data sheet), page 299 it says:
> 
> "Never ship a product with the OCDEN Fuse programmed regardless of the
> setting of Lock bits and JTAGEN Fuse. A programmed OCDEN Fuse enables
> some parts of the clock system to be running in all sleep modes. This
> may increase the power consumption."
> 
> Clark Martin
> Redwood City, CA, USA
> Macintosh / Internet Consulting
> 
> "I'm a designated driver on the Information Super Highway"

Right. I had read that as well, but the point is that I DID disable OCDEN, and the JTAG debugger re-enabled it and left it that way. Turning off OCDEN has to be the last thing you do before disconnecting the JTAGICE.

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.