Using Sleep with PIC12F629

  • Richard Latter

    Richard Latter - 2006-10-03

    Hello All,

    I would like to find out how to call the sleep functionality using the SDCC.  I have read through the newsgroup and manual and cannot find any reference to this. 

    The only way I can see this being done is by invoking some asm code.

    Can anyone help?

    Many thanks in advance,


    • Raphael Neider

      Raphael Neider - 2006-10-11

      What's the problem with using

      __asm sleep __endasm;

      somewhere in your code? You can even define a macro
      #define sleep __asm sleep endasm
      #define sleep() __asm sleep __endasm
      if you prefer function look-and-feel.

      Or you can use a true function:
      void sleep(void) {
        __asm sleep __endasm;
      More costly in terms of code space/runtime, but still works...



Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks