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.

CCS/TMS320F28020: Program address of interrupts in C28x CPU

Part Number: TMS320F28020

Tool/software: Code Composer Studio

Dear TI support,

I am writing a program for TMS320F28020 by assembly. I know C28x have 32 interrupt vector: RESET, INT1, INT2... But i don't know address of it. So can you give me interrupt address of C28x CPU.

Thank you and best regards,

Phu Nguyen

  • Hi Phu,

    Please refer cpu guide chapter 3 for the address related information.

    Thanks

    Vasudha

  • Hi Vasudha,

    I just have a new problem. Can you give a example how to code assembly use a external interrupt INT1. I don't know how to take code for INT1.

    This mean, if i code assembly for 8051, i will use this code:

    ORG 0000H
    LJMP MAIN
    ORG 000BH ISR Timer 0.
    LJMP T0ISR ;Jump ISR Timer 0.
    ORG 0013H ; ISR 1.
    LJMP EX1ISR ;Jump ISR 1.
    ORG 0030H ; Main

    MAIN:
    ………………

    SJMP $

    T0ISR:
    ………………

    ………………

    RETI

    EX1ISR:
    ………………

    ………………

    RETI
    END

    In this code i use ORG to point to address, in C28x CPU, i don't know how to do . Can you help me?

    Thank you,

    Phu Nguyen
  • Phu Nguyen,

    On F2802x, XINT1 is routed through the PIE so you will have to set up the interrupt vector table with your ISR address in address 0x0D46. There is more work to do than simply assigning the address.

    Unfortunately I am not allowed to post CCS projects, but to give you an idea, an assembly code example of initializing the PIE table is below.

    ; copy PIE vector table into RAM
    SETC VMAP ; enable PIE vector table
    MOVW DP, #PIECTRL>>6 ; load data page
    OR @PIECTRL, #01b ; enable PIE vector table [ENPIE = 1]
    MOVW DP, #_vectorTable ; load data page
    MOVL XAR7, #_vectorTable ; XAR7 = source address
    MOVL XAR0, #0x0D00 ; XAR0 = destination address [0x0D00]
    RPT #255 ; repeat 256 times (vector table = 128 x 32-bit words)
    || PREAD *XAR0++, *XAR7 ; copy half-vector into RAM


    ...where PIECTRL is the address of the PIE control register:
    PIECTRL .set 0CE0h

    ...and _vectorTable is the symbol at the start of your vector table, defined as:
    .def _vectorTable ; vector table symbol

    Your vector table would look something like this:

    .label _PIE_vector_table_start
    _vectorTable:
    .long _UTRAP ; [0x0D00] reserved
    .long _UTRAP ; [0x0D02] reserved
    .long _UTRAP ; [0x0D04] reserved
    .long _UTRAP ; [0x0D06] reserved

    ... more .longs ...

    .long _UTRAP ; [0x0D44] reserved
    .long _myIsr ; [0x0D46] XINT1
    .long _UTRAP ; [0x0D48] XINT2

    ... and so on ...


    This is just one thing: there is a lot more to do to configure and use the device from assembly, and you have to know what you're doing. Almost all C28x users are coding in C. Is there a reason you prefer to use assembly?

    Regards,

    Richard