Question about using a PIC microcontroller

Discussion in 'Embedded Systems and Microcontrollers' started by RFBeginner, May 6, 2007.

  1. RFBeginner

    Thread Starter New Member

    Mar 16, 2007

    I will like my PIC microcontroller to wake up from sleep every 12hrs, executing instructions from where it left off before going to sleep.
    I know the PIC has some timers (watchdog, power up), but I am having a hard time understanding how exactly they work.

    Can someone please give me some information that can help.

  2. mozikluv

    AAC Fanatic!

    Jan 22, 2004
    people here are not mind readers. pls specify which PIC micro are you referring to.:(

  3. RFBeginner

    Thread Starter New Member

    Mar 16, 2007
    sorry, I am using the PIC12F683
  4. Papabravo


    Feb 24, 2006
    You probably can't get 12 hours on a single wakeup. What you can get is a wakeup every so many milliseconds or seconds. On most of the wakeups you do nothing except go back to sleep. When a suitable number of intervals have elapsed then you go and do your 12 hour tasks.

    In some designs there is a single sleep instruction that you go to whenever processing is finished. You wake up at the next instruction and not at some arbitrary place. In other designs each task terminates with a sleep instruction. Whenever you wake up you goto a common routine which determines what to do next.

    The way the sleep process works is that the main system clock is stopped, but an internal low power oscillator continues to run timing out the sleep interval.

    According to the datasheet the WDT timebase is the LFINTOSC at 31 kHz., The default for the 16 bit prescaler is divide by 512 which gives a WDT Timeout Interval of about 16.5 milliseconds.
  5. RFBeginner

    Thread Starter New Member

    Mar 16, 2007
    thanks for the info.

    I should have made it clear that I wanted the PIC to wake up once every 12hrs, for about 10mins.

    Do you think the WDT will be the most practical way to do this? Or should I wake up from sleep using an interrupt-on-change function?