Help with PBP 'SLEEP' command


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2006
    Posts
    2

    Default Help with PBP 'SLEEP' command

    I am trying to get a battery operated pic to run for 8 hours... then sleep for 16.

    Now.. i've tried 'sleep 57600' but it isn't anywhere close to 16 hours... it is WAY OFF...

    then i read in a PBP book from amazon that the sleep command really means periods of 2.3 seconds.. so i tried 25043, which would have been off by 8 seconds.. but i would have been fine with that... but it's WRONG too...

    Does anyone have any pointers??

    Thanks...

    PS: PBP on a 12F675

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,519


    Did you find this post helpful? Yes | No

    Default

    Hi,
    The time is ~2.3s per LSB but the Sleep command uses the Watchdog Timer as it's timebase and it is driven by a RC network internal to the PIC. The value of this RC network varies from PIC to PIC and also with temperature.

    If I read the datasheet correct (it's 07.00 in the morning here) the watchdog period is 18mS typical but can vary between 7 and 33mS worst case.

    So, you just can't expect any acuarcy from the SLEEP or NAP commands.

    Datasheet DS41190A
    Section 9.6 and Table 12.4, Param.31

    /Henrik Olsson.

  3. #3
    Join Date
    Nov 2006
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Well??

    So how can i ACCURATELY go to sleep for 16 hours or so.. with a 12F675 ??

    and no extra parts??

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Nothing like wanting your cake and eating it too.

    If you want accuracy, then you can't have the PIC asleep as it needs to be awake and working to maintain it's accuracy.

    If you want to maintain accuracy and put the PIC to sleep, then you need something external to maintain that accuracy.

    Chose a micropower PIC - there's plenty of them...

    Take your choice.

    The sleep features are just that, they put the PIC to sleep and not have it continue processing.

Similar Threads

  1. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  2. Sleep Command
    By thye in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th October 2007, 15:28
  3. Can I do this???
    By noobie in forum mel PIC BASIC
    Replies: 2
    Last Post: - 10th June 2006, 18:57
  4. Sleep Mode in PBP
    By Keith in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th March 2005, 20:58
  5. SLEEP Command and Interupts 16F648A
    By ghoot in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 28th May 2004, 18:35

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