How to get PIC out of Sleep mode and turn-on LCD, vice versa ?


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2007
    Posts
    13

    Default How to get PIC out of Sleep mode and turn-on LCD, vice versa ?

    Hi,

    I have PIC18F4525 connected to a LCD (16X2).

    1. I want to set the PIC into SLEEP mode.

    2. I want the LCD screen to turn-on when a push-button, connected to the PIC, is pressed. This means that the PIC should be switched out of SLEEP mode.

    3. The LCD screen should remain ON for the next 5 mins, displaying the desired result.

    4. The LCD should then turn-off after 5 mins, i.e. the PIC should go back into the SLEEP mode.


    I would really appreciate if you guys can give me suggestions on how to write a code for this.

    Thanks !

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default

    1. I want to set the PIC into SLEEP mode
    Use the following lines of code
    @ sleep
    @ nop
    @ nop
    This will give indefinite sleep time

    2. I want the LCD screen to turn-on when a push-button, connected to the PIC, is pressed. This means that the PIC should be switched out of SLEEP mode
    Configure your PIC to generate an 'interrupt on port change'. You need not enable the interrupt. When the port change occurs, the PIC will execute the statements after sleep.

    3. The LCD screen should remain ON for the next 5 mins, displaying the desired result.
    Use some kind of timing code to achieve this; either using for loops or timer.

    4. The LCD should then turn-off after 5 mins, i.e. the PIC should go back into the SLEEP mode.
    Go back to number 1

  3. #3
    Join Date
    Nov 2007
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Thanks Jerson !!!

    I have come up with some kinda code which you can see in my new post titled - "Need help with SLEEP mode ".

    Please correct me on it. I would really appreciate everyone's suggestions and help.

    Thanks.

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Wink

    Hi, Aggie

    Some "bond" to your project ( LOL ):

    Here I use a 18F452

    LCD is powered Through a P-Mosfet ( Driven by PortB.4 ... LOW for ON )
    The "wakeup" interrupt is generated by a Low to High transition on Port B.1 ...

    see "sommeil" and "Wakeup" labels for what you look for ...

    Alain
    Attached Files Attached Files
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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. turn-off lcd and turn-on again
    By mehmetOzdemir in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th September 2009, 12:57
  3. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  4. Need help with SLEEP mode
    By aggie007 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 28th November 2007, 09:56
  5. Wierd sleep issue
    By orca in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th March 2006, 22:06

Members who have read this thread : 1

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