5 Replies Latest reply on Jul 3, 2011 9:05 PM by schurtz.li

    LUT in sleep mode

    schurtz.li

      Hi:

         

       What should I do if I use LUT & sleep mode in application?   No sleep saving API is provided,  any reference for this?

         

       

         

      Thanks

         

       

         

      Schurtz

        • 1. Re: LUT in sleep mode
          udayan.umapathi

          Do you intend to use LUT in sleep mode. Or do you intend to use LUT in Active mode alone and just put PSoC alone to sleep. Could you elaborate what you are trying to with LUT and sleep mode operation.

          • 2. Re: LUT in sleep mode
            schurtz.li

            OK, I use LUT to drive LED in active mode.     Device will be woken up by PICU to change LED display for a while, then turn off LED and go to sleep again until next wakeup.

               

            As I know, UDB configuration will lost  when sleep, and should be restored when wakeup, I try to make clear whether LUT should be in the same way too. If so, there's none reference for LUT configuration saving & recovery.

               

            Thanks

               

            Schurtz

            • 3. Re: LUT in sleep mode
              schurtz.li

              Hi:

                 

              Any feedback for the question above?

                 

              -- Whether LUT configuration will lose when device goes to sleep mode?  If so, how to restore it when wakeup?

                 

              -- And say LUT output connected with GPIO output pin,  device goes to sleep mode, if LUT output state lost,  then GPIO output state will changed either, so I can't expect  GPIO keeps the status as before sleep. Is that correct?

                 

              Thanks.

                 

              B.R

              • 4. Re: LUT in sleep mode
                christopher.keeser

                -- Whether LUT configuration will lose when device goes to sleep mode?  If so, how to restore it when wakeup?

                   

                The configuration of the LUT will not be lost in sleep.

                   

                -- And say LUT output connected with GPIO output pin,  device goes to sleep mode, if LUT output state lost,  then GPIO output state will changed either, so I can't expect  GPIO keeps the status as before sleep. Is that correct?

                   

                              

                   

                 The solution to this is to override the pin with software, force it to a specific state, then enter sleep.  The software state will be retained through sleep.  When the device wakes up, return control of the pin back to the hardware.  This will prevent the glitching on the pin.   

                   

                Here is an example of handing control of the pin over to the data register.

                   

                // In this line of code, we set the pin high by writing a 1 to the data register in the bit position that corresponds to the pin (replace INSTANCE_NAME with your specific pin name):

                   

                 INSTANCE_NAME_DR |= INSTANCE_NAME_MASK;

                   

                //Then you need to hand control of the pin over to the data register, by clearing the bypass bit 

                   

                INSTANCE_NAME_BYP &= ~INSTANCE_NAME_MASK;

                   

                … go to sleep

                   

                … return from sleep

                   

                // Return control of the pin back to the hardware

                    INSTANCE_NAME_BYP |= INSTANCE_NAME_MASK;
                   

                if you want te have the pin low during sleep, replace

                   

                 INSTANCE_NAME_DR |= INSTANCE_NAME_MASK;

                   

                with

                   

                 INSTANCE_NAME_DR &= ~INSTANCE_NAME_MASK;

                • 5. Re: LUT in sleep mode
                  schurtz.li

                  Oh, I see, thanks Kees !

                     

                  That's perfect answer!

                     

                  B. R

                     

                  -- Schurtz