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. */ __interrupt_enable(); 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)? _______________________________________________ AVR-libc-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avr-libc-dev
