Wake up little PIC!


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Location
    New Zealand
    Posts
    171

    Default Wake up little PIC!

    I'm having issues getting a 12F675 to wake up after a sleep command, I put a toggle LED routine either side of the sleep command to see that it was firstly getting to the sleep command (which it is) then I put the toggle routine after the sleep command - but it never seems to wake - any clues? Here's the snippet of code that's causing me greif

    Batt: 'check battery level

    adcin 3,battlvl
    if battlvl < 26 then battflat = 0
    if battlvl > 26 then battflat = 1 'battery near flat
    if battlvl > 28 then pwrdwn 'battery flat goto power save mode
    return

    pwrdwn: 'power down mode


    led = 0
    hallpwr = 0
    sleep 5
    for b2 = 0 to 30 'toggle led routine
    toggle led
    pause 50
    next b2
    led = 1
    pause 50
    gosub batt
    if battflat = 0 then start 'if battery getting topped up then turn back on
    goto pwrdwn

  2. #2
    Join Date
    May 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Smile

    Have you tried to just use the sleep command with an led project? Maybe its a different part of your code giving you the trouble.

    But the best way to tell that, is just a lil project to test the command on its own.

    Could always have something to do with the watchdog timer. Hopefully that helps. If it works in the project then its a problem with the way your other code configures the pic or maybe a loop of death somewhere.

  3. #3
    Join Date
    Oct 2005
    Location
    New Zealand
    Posts
    171


    Did you find this post helpful? Yes | No

    Default

    Got it sorted sorry - the WDT was turned off - had to be something silly like that Thanks fro mentioning the WDT

  4. #4
    Join Date
    May 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Cool

    Quote Originally Posted by George View Post
    Got it sorted sorry - the WDT was turned off - had to be something silly like that Thanks fro mentioning the WDT
    No problem glad I could help. ^^

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 11:00
  2. Replies: 67
    Last Post: - 8th December 2009, 03: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, 15: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, 22:01
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th March 2005, 00:14

Members who have read this thread : 2

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