Interrupts
CC5X requires that the interrupt function is located at address 4. Writing the interrupt service routine in C
using MPLINK will require some care. The main issue is to set up the linker script file as described later
in this file. Two options are possible:
ALTERNATIVE 1: Use the linking sequence to locate the interrupt service routine. This is done by
listing the module with the interrupt service routine FIRST in the module list used by MPLINK. This is
the important point which makes MPLINK put the interrupt service routine in the beginning of the
PROG/PROG1 logical code section (address 4). When using MPLAB, the C module containing the
interrupt function must be listed first in the project file list. The list file generated by MPLINK should be
inspected to ensure that the interrupt routine starts at address 4. Another important point is to remove the
#pragma origin 4 when using MPLINK. This is the only difference in the C source compared to using the
built in CC5X linker (single C module).
ALTERNATIVE 2: Set up a SEPARATE logical section in the linker script file for the interrupt service
routine. This is a more robust solution. CC5X will generate a partial script file to avoid manual address
calculation. The partial script file must be included in the main script file. The setup is described in
Section The MPLINK script file on page 84.
It is also possible to design an assembly module containing the interrupt service routine. Information on
how to do this should be found in the MPASM/MPLINK documentation.