LUT in sleep mode

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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

0 Likes
5 Replies
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

-- 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;

0 Likes
Anonymous
Not applicable

Oh, I see, thanks Kees !

   

That's perfect answer!

   

B. R

   

-- Schurtz

0 Likes