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.

CC430 4KB - 2Byte RAM version and Interrupt vector allocated in RAM

Other Parts Discussed in Thread: CC430F5137

Hi all!

I read http://e2e.ti.com/support/microcontrollers/msp430/f/166/p/34237/120458 and I have a question.

If you  want to use the Interrupts vector from RAM using SYSCTL |= SYSRIVECT, theoretically the vectors are allocated in TOP of RAM (TOP_RAM + 1 - sizeof(INT_Vect_Struct)). The problem is that the CC430F5137 has the last two bytes reserved for a bug, being the total size of usable RAM 0x0FFE, so my question is:

Would be a problem the two bytes reserved for the bug  for use the vector from RAM?

I am trying to allocate the interrupt vector in RAM as the TI given example (ram_int_vect_ex.c) but my firmware crashes and I suspect that this would be the problem.

Thanks in advance!

BR,

Luis

  • Until anyone gives a better solution, I have fixed this problem as follow:

    In linker file:

    * I reserved in RAM the space required for the interrupt vector, for cc430f5137 is 0x80, before the last two bytes.

    * I define each interrupt position in the RAM, because the code will be load from FLASH, but it will executed from RAM.

    * For each interrupt position defined in flash, I defined the method to run it from RAM: In my code, for example,

    ".int60 : load=INT60, run=RAM_INT_VECTORS_60, type = VECT_INIT"

    In main:

    * After modifying the linker, the first function in main is the load of the interrupts vector in RAM, copying the flash code to RAM.

    * After the function, I activate the bit that indicates the running of the interrupts vector from RAM: SYSCTL |= SYSRIVECT;


    The code of the interrupts now is called using its position in the vector, adding one position. For example:

    #pragma vector=_USCI_B0
    __interrupt void USCI_B0_INTERRUPT(void)


    _USCI_B0 is the position of the interrupt in the vector, adding one position: #define _USCI_B0 58


    After all, your interrupt vector will be placed and used from RAM.

    If anyone has doubts, I will clear them.

    BR,

    Luis

  • My understanding is, when you set the SYSRIVECT bit in the SYSCTL register the Interrupt Vectors are remapped to 0x2BDA-0x2BFD instead of 0xFFDA-0xFFFD and the Reset Vector is remapped to 0x2BFE-0x2BFF instead of 0xFFEF-0xFFFF. Not all the remapped Interrupt Vectors will be used. Only the Interrupts that are enabled and requested need the remapped Interrupt Vectors. The remapped Reset Vector (at 0x2BFE-0x2BFF) is not necessary at all. Because a Reset will clear the SYSRIVECT bit in the SYSCTL register and the original Reset Vector (at 0xFFFE-0xFFFF) will be used.

**Attention** This is a public forum