Interrupt disabling in HCS12 microcontroller

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

Interrupt disabling in HCS12 microcontroller

1,325 次查看
Jagadish
Contributor I

Hello,

I am currently using HCS12x microcontroller and third party operating system(OS) for an application. The OS  has two macro's SuspendAllInterrupts() and DisableInterrupts().

I find SuspendAllInterrupts() changes IPL level to 0x07 and does not do anything with I bit.

But DisableInterrupts() changes the I bit value to 1.

 

My question is, I want to enter a critical region in code.

1. Should I use SuspendAllInterrupts() or DisableInterrupt()

2. What is the difference between these two macro's?

 

Regards,

标签 (1)
0 项奖励
回复
1 回复

753 次查看
kef
Specialist I

2. The effects of setting I bit or setting IPL to 7 are almost the same. In first case CPU masks all I-bit maskable interrupts. In the second interrupt controller inhibits all I-bit maskable interrupts.

 

1. I don't know. In both cases your critical section should end with restoring I-bit and/or restoring IPL.

0 项奖励
回复