D.4 Code Examples
D.4.1 Boot Code for C28x operating mode initalization
D.4.2 IER/IFR Code
Table D−1. Code to Save Contents Of IMR (IER) And Disabling Lower Priority Interrupts At
Beginning Of ISR
C2xLP
INTx: .
MAR
*,AR1
LDP
#0
LACL
IMR
SACL
*+
AND
#~INT_MASK
SACL
IMR
.
.
Table D−2. Code to Disable an Interrupt
C2xLP
SETC
INTM
LDP
#0
LACL
IMR
AND
#~INTx
SACL
IMR
CLRC
INTM
Note: The following code fragment must be placed in your code just after
reset. This code will place the device in the proper operating mode to execute
C2xLP converted code:
Code
SETC OBJMODE
CLRC PAGE0
SETC AMODE
SETC SXM
SETC C
SPM
0
Explanation
;C28OBJ = 1 enable 28x object mode
;PAGE0 = 0 not relevant for 28x mode,
;cleared to zero
;AMODE = 1 enable C2xLP compatible
;addressing mode
;SXM = 1 for C2xLP at reset, SXM = 0
;for 28x at reset
;Carry bit =1 for C2xLP at reset,
;Carry bit = 0 for 28x at reset
;Set product shift mode zero, that
is PM bits = 001 compatible to
;C2xLP PM reset;mode
C28x
INTx: .
AND
IER,#~INT_MASK
.
Note: C28x saves IER as part of auto-
matic context save operation and dis-
ables the current interrupt automati-
cally to prevent recursive interrupts.
C28x
AND
IER,#~INTx
;operation is atomic and
;will not be interrupted.
C2xLP Migration Guidelines
Code Examples
D-7
Need help?
Do you have a question about the TMS320C28x and is the answer not in the manual?