@sleep


Results 1 to 9 of 9

Thread: @sleep

Threaded View

  1. #2
    jheissjr's Avatar
    jheissjr Guest


    Did you find this post helpful? Yes | No

    Default

    Forgot to mention, the code does wake up it from sleep as it is supposed to. It just doesn't stay asleep when it hits the @ SLEEP line.

    '16F628A

    DEFINE OSC 10

    TRISB = %000000001
    TRISA.2 = %0 'Ouput Pin for Turning On/Off LED

    CMCON = 7

    OPTION_REG.7=0 ' 0=Enable PORTB Pull Ups
    OPTION_REG.6=0 ' 1=RB0 Rising-Edge Trigger, 0=Falling-Edge Trigger

    @CONFIG.2 = 0 ' 0=Watch Dog Off
    @CONFIG.6 = 0 ' 0=Brown Out Off
    @CONFIG.4 = 0 ' Set for High Speed Crystal
    @CONFIG.1 = 1 ' Set for High Speed Crystal
    @CONFIG.0 = 0 ' Set for High Speed Crystal

    top:
    INTCON=%00011000 ' Interrupt Control Register
    ' 7=0 - GIE - Global Interrupt Enable
    ' 6=0 - PEIE - Peripheral Interrupt Enable
    ' 5=0 - TOIE - TMR0 Overflow Interrupt Enable
    ' 4=1 - INTE - RB0/INT Enable
    ' 3=1 - RBIE - PORTB change interrupt Enable
    ' 2=0 - TOIF - TMR0 Overflow Flag
    ' 1-0 - INTF - RB0/Ext Interrupt Flag
    ' 0=0 - RBIF - PORTB Interrupt Flag
    @ SLEEP

    Pause 100
    PORTA.2 = 1 'Turn LED On for 1 second
    pause 1000
    PORTA.2 = 0 'Turn LED off before going back to sleep

    goto top
    Last edited by jheissjr; - 5th March 2006 at 03:27.

Similar Threads

  1. 12c508 @sleep command?
    By rtsandiego in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 14th January 2004, 06:59

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts