10F222 wake/sleep


Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305

    Default 10F222 wake/sleep

    Ladies and Gents,

    I've been playing around with the 10F222 and its sleep/wake on pin change. Not trying to show my ineptness here but what do they mean by reading the input pins? This code works:
    Code:
    CLEAR
    DEFINE OSC 4
    adcon0 = 0         ' Turn off ADC
    option_reg = %00001000       ' enable wake on pin, weak pull ups, prescaler to wdt         
    osccal = %00000000            ' oscillator calibration
    trisio = %1101      ' GP1 only is output
    gpio = 0 ' turn everything off
    
    LED VAR gpio.1
    i VAR BYTE
    
    start_here:
    
    IF gpio.0 = 0 THEN GOSUB Light_LED
    IF gpio.3 = 0 THEN GOSUB Light_LED
    SLEEP 5
    
    GOTO start_here
    
    Light_LED:
    i = 0
        FOR i = 0 TO 3
        TOGGLE LED
        PAUSE 8000
        NEXT i
    RETURN
    
    END
    I'd like to know if I did it right or is there something more subtle, or bodacious, I should be doing.

    I've, I think, attached the page and my code. Constructive help greatly appreciated.
    Attached Images Attached Images
    Attached Files Attached Files

Similar Threads

  1. Cannot wake from SLEEP
    By BrianT in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 21st May 2013, 07:47
  2. Replies: 1
    Last Post: - 11th November 2011, 07:01
  3. 16F690... How to wake from sleep?
    By Heckler in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th July 2011, 22:07
  4. 16F181: can't wake up from sleep
    By Navaidstech in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th January 2010, 04:33
  5. wake up from sleep
    By savnik in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 31st August 2007, 17:09

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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