Trouble disabling BODS for sleep attiny85

 noInterrupts();

MCUCR |= _BV(BODS) | _BV(BODSE);
  MCUCR = (MCUCR | _BV(BODS) ) & ~(_BV(BODSE));
  interrupts();              
    sleep_mode();

vs

    noInterrupts();
      MCUCR = bit(BODS) | bit(BODSE);  // turn on brown-out enable select
  MCUCR = bit(BODS); 
  interrupts();                // this must be done within 4 clock cycles of above
    sleep_mode();

The first works properly
The second keeps waking or resetting the MCU

What is the operational difference?
Does the "bit" macro uses more clock cycles?
BV is also a macro.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.