Waking a sleeping PIC


Closed Thread
Results 1 to 4 of 4
  1. #1
    anj's Avatar
    anj Guest

    Default Waking a sleeping PIC

    Gday all
    I am looking for ideas on the best way to waken a sleeping pic, based on data sent from a PC.
    I am planning on using a 16f88, but on reading the datasheet, i cannot use an interrupt on the usart unless i'm in synchronous mode.
    I need to operate asynch, so was wondering what the best option would be.
    Basically i will have a piece of equipment controlled by a bog std RS232 connection.
    I plan to tap into the PC Tx, and passively snoop for special commands to operate a power switch.
    On receiving a specific code, the PIC will open a MOSFET and thus supply power to the equipment.
    On receiving another code, the PIC will close the MOSFET and hence turn off power ( but stay powered itself ). After say 10mins with no serial traffic, ( and Mosfet turned off ), i will put the PIC to sleep.
    When asleep ( which may last for days ), i need to still watch/trap any serial traffic, and if detected, wake up the PIC and then act on it.
    So, what is the best way to do this.
    1) Can i waken the pic and still trap the data in one operation
    2) Do i need to say set a pin to input, and just use a std "on change" interrupt to waken the PIC, then configure the usart to send a code to the host PC saying i',m awake, then get the PC to resend the real code.
    3) anything better?
    I'm still going through the datasheets, but still cant find a way of doing it in one operation, which is the preferred method.
    Any pointers greatly appreciated.
    Andrew

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Anj, Why not just tie the rx line of the pic to say portb.0. Then setup the pic for external interrupt. When there is a change in the state of the rx pin you would wake and disable the interrupt then capture the the command? Just a thought.....

    Dave Purola,
    N8NTA

  3. #3
    anj's Avatar
    anj Guest


    Did you find this post helpful? Yes | No

    Default

    Gday Dave
    Thats sort of what i was thinking for option 2.
    If i write my own control program, its easy enough.
    However, it may end up standalone so i need the control string/mechanism to be simple as possible.
    Maybe if i send a string like "wakeup" and look for "wakeup" on the usart, then an interrupt on b.0 will do the trick
    But i would need to send "wakeup" twice. Not a real hassle i guess.
    Andrew

  4. #4
    Join Date
    Apr 2005
    Location
    Auckland/New Zealand
    Posts
    19


    Did you find this post helpful? Yes | No

    Default 16F88 in sleep mode

    Hi anj.
    You can use any of the signals for RS 233 like Tx.
    You can connect trhat to your INT 0 line as well as the normal serial connection that you are using.
    The micro is normally at sleep state,inorder to wake it up send any rubbish serial data this will wakeup the micro.
    Then pause & send the actual code you need to communicate with.
    Regards.
    Suded.

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. Replies: 67
    Last Post: - 8th December 2009, 02:27
  3. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 1

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