This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

In which file is IER defined in CCS V4?

I'm playing with 28035, but confused that I cannot find where the CPU related registers are defined, such as IER/INTM... Can anyone tell me where the file is?

From "DSP2803x_Device.h", I found IER/IFR are declared, but where are they defined? please advise, thank you so much.

//---------------------------------------------------------------------------
// Common CPU Definitions:
//

extern cregister volatile unsigned int IFR;
extern cregister volatile unsigned int IER;

#define  EINT   asm(" clrc INTM")
#define  DINT   asm(" setc INTM")
#define  ERTM   asm(" clrc DBGM")
#define  DRTM   asm(" setc DBGM")

  • IER and IFR are special registers and are defined by "cregister".

    The compiler handles cregisters differently because they require special assembly output.

     

    For more information:

    See section 6.4.2 (The cregister Keyword) in TI Document SPRU514C.

    http://www.ti.com/lit/pdf/spru514

     

    For example, the C code:

    unsigned int blah;

    void dummy( void )
    {
        IER = 0x0001;
        blah = 0xBEEF;
    }

    ----------------- Compiles into the following assembly code:

    ;----------------------------------------------------------------------
    ;  55 | IER = 0x0001;                                                         
    ;----------------------------------------------------------------------
            MOVB      AL,#1                 ; |55|
            MOV       IER,AL                ; |55|
    ;----------------------------------------------------------------------
    ;  56 | blah = 0xBEEF;                                                        
    ;----------------------------------------------------------------------
            MOVW      DP,#_blah
            MOV       @_blah,#48879         ; |56|

  • Thank you now I'm clear.