-当设备进入休眠模式时,LUT配置是否会丢失?如果是这样,唤醒时如何恢复呢?
睡眠的结构不会在睡眠中消失。
并且说,LUT输出与GPIO输出引脚相连,设备进入休眠模式,如果Lut输出状态丢失,则ToPioOut输出状态也会发生变化,SOI不能期望GPIO将状态保持在睡眠之前。对吗?
解决这个问题的方法是用软件重写PIN,强迫它进入特定状态,然后进入睡眠状态。软件状态将通过睡眠保持。当设备唤醒时,将PIN返回控制到硬件。这将防止针上的闪光。
这里是一个将引脚控制到数据寄存器上的例子。
//在这行代码中,我们通过在对应于PIN的位位置写入数据寄存器1来设置PIN高(用您的特定PIN名称替换StaseSnName):
StaseNAMEnEnEdR.Dr=
然后,您需要通过清除旁路位来将PIN控制到数据寄存器。
StasyNAMENEYBYP&
…去睡觉
从睡梦中归来
//返回控制引脚返回到硬件
IsAsNyNAMEYBYP=IsStasyNAME.A掩码;如果您希望在睡眠期间将PIN设为低,则替换
StaseNAMEnEnEdR.Dr=
具有
StaseNAMENAMEDR&AMP:= ~
以上来自于百度翻译
以下为原文
-- 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;
-当设备进入休眠模式时,LUT配置是否会丢失?如果是这样,唤醒时如何恢复呢?
睡眠的结构不会在睡眠中消失。
并且说,LUT输出与GPIO输出引脚相连,设备进入休眠模式,如果Lut输出状态丢失,则ToPioOut输出状态也会发生变化,SOI不能期望GPIO将状态保持在睡眠之前。对吗?
解决这个问题的方法是用软件重写PIN,强迫它进入特定状态,然后进入睡眠状态。软件状态将通过睡眠保持。当设备唤醒时,将PIN返回控制到硬件。这将防止针上的闪光。
这里是一个将引脚控制到数据寄存器上的例子。
//在这行代码中,我们通过在对应于PIN的位位置写入数据寄存器1来设置PIN高(用您的特定PIN名称替换StaseSnName):
StaseNAMEnEnEdR.Dr=
然后,您需要通过清除旁路位来将PIN控制到数据寄存器。
StasyNAMENEYBYP&
…去睡觉
从睡梦中归来
//返回控制引脚返回到硬件
IsAsNyNAMEYBYP=IsStasyNAME.A掩码;如果您希望在睡眠期间将PIN设为低,则替换
StaseNAMEnEnEdR.Dr=
具有
StaseNAMENAMEDR&AMP:= ~
以上来自于百度翻译
以下为原文
-- 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;
举报