8.7.2 sleep_bod_disable Macro

Disable brown out detection prior to sleep.

Include

<avr/sleep.h>

Prototype

void sleep_bod_disable(void);

Remarks

This macro can be used to disable brown out detection prior to putting the device to sleep. This macro generates inlined assembly code that will correctly implement the timed sequence for disabling the brown out detector (BOD). However, there is a limited number of cycles after the BOD has been disabled that the device can be put into sleep mode, otherwise the BOD will not truly be disabled.

Not all devices have this feature.

Example

#include <xc.h>
#include <avr/sleep.h>
int main(void)
{
  initSystem();
  sleep_enable();
  sleep_bod_disable();
  sei();
  sleep_cpu();
  sleep_disable();
}