Using Sleep with PIC12F629

2006-10-03
2013-03-12
  • 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,

    Richard

     
    • 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
      or
      #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...

      HTH,
      Raphael

       

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

Sign up for the SourceForge newsletter:





No, thanks