Need help on sleep mode

Discussion of the PSoC CY8C24x94 and other PSoC like USB parts from Cypress should be discussed here. This forum is limited to the discussion of USB portion of those parts. Other forums should still be used to discuss the non USB features of these parts.

Moderator: ericb

Need help on sleep mode

Postby ninjabee » Sun Aug 26, 2012 11:49 pm

Hi.. currently I am learning the sleep mode example code from psoc AN47310 pdf.
However I am having trouble in understanding the purpose of some of the code.

1.Let say my project involve LCD. In which function that I need to edit so that the LCD will turn off during sleep.
Or will the LCD automatically off during sleep.

2.In this example code, if I am not mistaken, the sleep mode will happen when the RESET button is pressed.
And will make the LED on Port 2.0 turn on. Instead of manual press, how can I make the PSOC sleep automatically
after certain time interval.

Hope you guys can help me.

Thanks.


Code: Select all
   
     while(1)   //while GPIO push button is pressed
    {      
        if (gpioFlag)                           /* If flag has been set by the ISR */
        {
       LED_Switch(PORT_2_0);                       /* Turn on LED (drive P2[0] HIGH) */         
         
            for(index = 0; index < 10000; index++)/* Debounce the GPIO */
      
            SleepPrep();                        /* Configure PSOC for sleep */
      
            M8C_Sleep;                          /* Sleep the PSoC */         
      
       asm("nop");                         /* A nop is used for pre-fetch code */
   
            M8C_ClearIntFlag(INT_CLR0, INT_MSK0_GPIO);  /* Clear the GPIO interrupts */
   
            M8C_EnableGInt;                     /* Enable global interrupts again */         
      
            WakeUpRestore();                    /* Reconfigure the PSoC to active conditions */
      
            gpioFlag = 0;                       /* Clear sleep trigger flag. */
        }
   
    #ifndef USE_GPIO_INT
        NoGpioSleep();                          /* Put the PSoC to sleep */
    #endif
   }

ninjabee
Newbie
Newbie
 
Posts: 2
Joined: Sun Aug 26, 2012 11:33 pm

Re: Need help on sleep mode

Postby danadak » Sat Sep 01, 2012 3:34 am

The ap not you refer to has the specific info to set up
and use sleep timer to wake up CPU on its interrupt.

Regards, Dana.
Field Application Engineer
KB1RHB Mostly listen :)
Semi Retired
User avatar
danadak
The Big Cheese
The Big Cheese
 
Posts: 2008
Joined: Thu Dec 27, 2007 8:42 am
Location: New Hampshire

Re: Need help on sleep mode

Postby ninjabee » Mon Sep 24, 2012 11:06 pm

I have refer the doc (AN47310 pdf) and manage to sleep LED that is used in the example project.
Somehow the LCD still showing value, instead of off.
Is there any steps needed to sleep LCD (hardwired to port 2).
ninjabee
Newbie
Newbie
 
Posts: 2
Joined: Sun Aug 26, 2012 11:33 pm

Re: Need help on sleep mode

Postby bobmarlowe » Tue Sep 25, 2012 12:08 am

The LCD is directly powered from the kit-pcb and cannot be switched off. Have a look at the schematics for the LCD-pins.
In your final design you may of course cut off the supply to an LCD as well as the port-2 pin-states which should be powered down as well.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: Need help on sleep mode

Postby johnjcl » Tue Sep 25, 2012 9:48 am

Another option, if You want, You can just disappear messages on the LCD (Reset). With LCD_Init ()
johnjcl
User avatar
johnjcl
Newbie
Newbie
 
Posts: 9
Joined: Fri Nov 11, 2005 11:57 am
WLM: jotapegasus@hotmail.com
Location: Colombia


Return to “%s” USB

Who is online

Users browsing this forum: No registered users and 1 guest