1.6.3.2 Procedures for Enabling And Disabling Multiplexed Peripheral Interrupts
The proper procedure for enabling or disabling an interrupt is by using the peripheral interrupt enable/disable
flags. The primary purpose of the PIEIER and CPU IER registers is for software prioritization of interrupts within
the same PIE interrupt group. Refer to the method shown in the C2000Ware example for software prioritization
of interrupts.
Should bits within the PIEIER registers need to be cleared outside of this context, one of the following two
procedures should be followed. The first method preserves the associated PIE flag register so that interrupts are
not lost. The second method clears the associated PIE flag register.
Method 1: Use the PIEIERx register to disable the interrupt and preserve the associated PIEIFRx flags.
To clear bits within a PIEIERx register while preserving the associated flags in the PIEIFRx register, the following
procedure should be followed:
1. Disable global interrupts (INTM = 1).
2. Clear the PIEIERx.y bit to disable the interrupt for a given peripheral. This can be done for one or more
peripherals within the same group.
3. Wait 5 cycles. This delay is required to be sure that any interrupt that was incoming to the CPU has been
flagged within the CPU IFR register.
4. Clear the CPU IFRx bit for the peripheral group. This is a safe operation on the CPU IFR register.
5. Clear the PIEACKx bit for the peripheral group.
6. Enable global interrupts (INTM = 0).
Method 2: Use the PIEIERx register to disable the interrupt and clear the associated PIEIFRx flags.
To perform a software reset of a peripheral interrupt and clear the associated flag in the PIEIFRx register and
CPU IFR register, the following procedure should be followed:
1. Disable global interrupts (INTM = 1).
2. Set the EALLOW bit.
3. Modify the PIE vector table to temporarily map the vector of the specific peripheral interrupt to a empty
interrupt service routine (ISR). This empty ISR will only perform a return from interrupt (IRET) instruction.
This is the safe way to clear a single PIEIFRx.y bit without losing any interrupts from other peripherals within
the group.
4. Disable the peripheral interrupt at the peripheral register.
5. Enable global interrupts (INTM = 0).
6. Wait for any pending interrupt from the peripheral to be serviced by the empty ISR routine.
7. Disable global interrupts (INTM = 1).
8. Modify the PIE vector table to map the peripheral vector back to its original ISR.
9. Clear the EALLOW bit.
10. Disable the PIEIER bit for given peripheral.
11. Clear the IFR bit for given peripheral group (this is safe operation on CPU IFR register).
12. Clear the PIEACK bit for the PIE group.
13. Enable global interrupts.
System Control and Interrupts
174
TMS320x2806x Microcontrollers
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
Copyright © 2022 Texas Instruments Incorporated
Содержание TMS320 2806 Series
Страница 2: ......