The datasheet of my PIC16 refers to the "SLEEP instruction". I'm programming the PIC16 in C using MPLAB X and the XC8 compiler.
How can I execute a SLEEP instruction on my PIC16 using C?
The datasheet of my PIC16 refers to the "SLEEP instruction". I'm programming the PIC16 in C using MPLAB X and the XC8 compiler.
How can I execute a SLEEP instruction on my PIC16 using C?
You can use this macro:
SLEEP();
This macro is used to put the device into a low-power standby mode.
If you search for the definition of SLEEP() in the header files, you'll find:
#define SLEEP() asm("sleep")
asm(); is a statement which allows you to inline assembly instructions into your C code.