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.
解決済! 解決策の投稿を見る。
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
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
Thank you very much Tomas. I really appreciate your help.