18F2320 and sleep function


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Posts
    18

    Default 18F2320 and sleep function

    For some reason the sleep command on the 18f2320 will not work correctly as I have it setup. If I use the sleep command to go into low power mode for say 6 seconds or any time frame the pic will not wake. I know the PIC has power managed modes and I am guessing that is where my mistake is but can't seem to get to work.

    I tried setting the OSCON register with all combinations so the watch dog timer would wake it but it still will not work.

    I have the internal oscillator working great with code that needs to the microsecond timing with no errors. The pause command works too but the ability to change modes has me stumped on getting the sleep command to work.

    Is there anything off hand that I am missing that is simple?

    Just a simple

    High led
    Sleep 2
    Low led

    Will lock it up and never wake up.

    I have the center frequency set with no adjustment and the OSCON register set as %01100000 for normal run with 4 Mhz and according to the sheet this should allow me to go into sleep mode too and wake. I tried all other combinations of the OSCON with no luck. I also made sure the watchdog timer was on.

    Any help would be appreciated. This should be simple but has me stumped.

  2. #2
    Join Date
    Jun 2004
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Got it!

    I was leaving out the

    _WDTPS_512_2H

    Setting. So the WDT I guess was set at its max. I guess if I waited long enough it would have timed out.

    It appeared I needed the 512 for a 1 second resolution.

    Thanks goes out to Bruce.

Members who have read this thread : 0

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