
Code Examples
D-7
C2xLP Migration Guidelines
D.4 Code Examples
D.4.1 Boot Code for C28x operating mode initalization
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
Explanation
SETC OBJMODE
;C28OBJ = 1 enable 28x object mode
CLRC PAGE0
;PAGE0 = 0 not relevant for 28x mode,
;cleared to zero
SETC AMODE
;AMODE = 1 enable C2xLP compatible
;addressing mode
SETC SXM
;SXM = 1 for C2xLP at reset, SXM = 0
;for 28x at reset
SETC C
;Carry bit =1 for C2xLP at reset,
;Carry bit = 0 for 28x at reset
SPM 0
;Set product shift mode zero, that
is PM bits = 001 compatible to
;C2xLP PM reset;mode
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
C28x
INTx:
.
MAR
*,AR1
LDP
#0
LACL
IMR
SACL
*+
AND
#~INT_MASK
SACL
IMR
.
.
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.
Table D
−
2. Code to Disable an Interrupt
C2xLP
C28x
SETC
INTM
LDP
#0
LACL
IMR
AND
#~INTx
SACL
IMR
CLRC
INTM
AND
IER,#~INTx
;operation is atomic and
;will not be interrupted.
Summary of Contents for TMS320C28x
Page 30: ...1 12...
Page 80: ...This page intentionally left blank 2 50 This page intentionally left blank...
Page 269: ...IN loc16 PA 6 112 MOV AL 0 AL 0 UOUT IORegC AL IOspace IORegC AL 10...
Page 308: ...MAXCUL P loc32 6 151 Saturate MOVL Var64 2 ACC Store result into Var64 MOVL Var64 P...
Page 509: ...SUBL ACC P PM 6 352 SUBL ACC P PM ACC S B 11 M X 4 MOVH Y ACC 5 Store Q15 result into Y...
Page 585: ...This page intentionally left blank 7 32 This page intentionally left blank...