[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] [RFC] Sleeping BOD API

From: Bob Paddock
Subject: Re: [avr-libc-dev] [RFC] Sleeping BOD API
Date: Thu, 12 Feb 2009 16:42:56 -0500

Issues of inline assembly/macros et.al. aside, does this
instruction sequence in fact work at all?

As I need to do this currently, before you patch is ready.  This is what
I'm doing in my Tiny88 project:

  SMCR   = (_BV(SM1)|_BV(SE));     /* Sleep in Power-Down mode */
  MCUCR |= (_BV(BODS)|_BV(BODSE)); /* Must set both bits to turn off
the Brown Out Detector, */
  //  MCUCR &= (uint8_t) ~_BV(BODSE);  /* while in Sleep, with this
instruction sequence. */
  MCUCR &= (uint8_t) ~_BV(BODS);  /* while in Sleep, with this
instruction sequence. */
  sleep_cpu();          /* Sleep must be done within three
instructions of BODS */

If I do not turn the BOD fuse on, my circuit 'off' current does not
even move my meter.
With the BOD fuse enabled I measure 17 uA.

I've tried variations (BODS vs BODSE as above; lacking faith in the
datasheet) that I could think of that would fall within what the
datasheet says for timing, to get the current back down in sleep.  The
current remains at 17 uA, with any variation, even the one that should
exactly match the datasheet.


The cycle timing for SEI is special, is there any consequence to that
verses the BOD
three cycle timing (hardware race)?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]