FXTH871 Interrupt Enable/Disable Question

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

FXTH871 Interrupt Enable/Disable Question

跳至解决方案
984 次查看
csaunders9526
Contributor I

Hello Community, 

I was looking through the code for the FXTH871, and I noticed that the code has this defined:

#define EnableInterrupts __asm CLI /*!< Macro to enable all interrupts. */
#define DisableInterrupts __asm SEI /*!< Macro to disable all interrupts. */

CLI means Clear Interrupts in Assembly
SEI means Set Interrupts in Assembly.

Shouldn't these be reversed?  Am I missing something?

Also, I was wondering:

If I disable all interrupts, and then call STOP1, can I keep the device disabled until I clock the Reset Pin?  I want to keep it in STOP1 indefinitely, until I trigger the Reset Pin.

Thanks Community.

标签 (1)
标记 (1)
1 解答
803 次查看
TomasVaverka
NXP TechSupport
NXP TechSupport

Hello Carl,

In the S08 microcontroller, clearing the interrupt mask bit (CLI) enables the interrupts and setting the interrupt mask bit (SEI) disables the interrupts.

 

Disabling the interrupts will not prevent a wake up from STOP1 but will prevent the execution of the interrupt vector: the FXTH will wake up from STOP1 even if the interrupts are disabled, but the interrupt vector will be not be accessed after the device wakes up.

 

It is not possible to keep the FXTH in STOP1 indefinitely, the FXTH will always wake up on a PWU interrupt. The PWU cannot be disabled, but can be configured to the maximum period in order to wake up with the longest period possible.

Best regards,

Tomas

在原帖中查看解决方案

2 回复数
804 次查看
TomasVaverka
NXP TechSupport
NXP TechSupport

Hello Carl,

In the S08 microcontroller, clearing the interrupt mask bit (CLI) enables the interrupts and setting the interrupt mask bit (SEI) disables the interrupts.

 

Disabling the interrupts will not prevent a wake up from STOP1 but will prevent the execution of the interrupt vector: the FXTH will wake up from STOP1 even if the interrupts are disabled, but the interrupt vector will be not be accessed after the device wakes up.

 

It is not possible to keep the FXTH in STOP1 indefinitely, the FXTH will always wake up on a PWU interrupt. The PWU cannot be disabled, but can be configured to the maximum period in order to wake up with the longest period possible.

Best regards,

Tomas

803 次查看
csaunders9526
Contributor I

Thank you very much Tomas.  I really appreciate your help.

0 项奖励
回复