SLEEP mode 16F628A


Results 1 to 8 of 8

Threaded View

  1. #3
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Hi Mike,
    Well, at a glance your code looks like it should let the Pic go to sleep, but I'm certainly not a pro!

    On your two questions...
    (1) If you're using the PORTB.0 interrupt, do you have to enable the PORTB pullups? If so, does it set the whole port or can you assign the pullups individually? (I'll have to use an external 10k...if I need to)

    (2) When you come out of sleep and you see a high pulse on PORTB.0 and go to a routine.....at some point you need to reset the B.0 flag, right?
    INTCON.1 = 0
    1) You don't have to use the built-in pullups if you don't want to - but be sure to use an external pullup / pulldown as needed otherwise. The entire port has its pullups enabled as a group (other Pic models allow setting individual pin pullups). When a pin is switched to output mode, the individual port pin pullup is automatically disabled.

    2) The interrupt flag(s) should be cleared before exiting your interrupt service routine and resuming the 'normal' program.


    You might consider putting some 'debugging' blinky LED outputs throughout your code for a visual indication of where the code is.

    Arch
    Last edited by Archilochus; - 24th April 2006 at 14:51.

Similar Threads

  1. High Power Consumption in Sleep Mode
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 18th September 2014, 13:29
  2. 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
  3. Need help with SLEEP mode
    By aggie007 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 28th November 2007, 09:56
  4. Replies: 3
    Last Post: - 27th November 2007, 08:56
  5. 16F628A current high during sleep
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th October 2006, 10:21

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