Interrupt disabling in HCS12 microcontroller

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interrupt disabling in HCS12 microcontroller

1,021 Views
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,

Labels (1)
0 Kudos
Reply
1 Reply

449 Views
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 Kudos
Reply