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.

Programming F2812 using Flash memory.

Hello Friends,

I am working on F2812 microcontroller. I am trying to program using flash memory for stand alone operation. I have succeeded in flashing the program. But for some reason none of the interrupts seems to be working. I have three LED's to confirm the operation while the program is running. Two of them are in the main program. One is in the interrupts. 

While running the program in standalone, I am able to observe the two LEDs mentioned in the main program are working. But the LED which is controlled in the Interrupts is not working. Do i have to make any setting changes in the CCS V3.3.

Please help me with the problem.

Thanks and Regards. 

Hari Prasad. A

  • Hi Hari,

    This means that the interrupt initialization is improper. Please check with the sample interrupt codes for F2812 and initialize accordingly. This should solve your issue.

    Go through this link for more info: http://www.codeforge.com/read/61536/Example_281xCpuTimer.c__html

    Regards,

    Gautam

  • Hari,

    Did you copy the interrupt vectors from flash to the PIE RAM?

    See appnote SPRA958 on how to configure code to run from flash.

    http://www.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=spra958l&docCategoryId=1&familyId=1414 

     

    - David

  • Hi David,

     

    Thanks for the information. I have updated the code as you suggested. But still I am not able to observe any change in  the operation of the interrupts. None of the interrupts seems to work.

     

    Do I have to update the F2812 linker command file. If I have to please let me know how to update .cmd file

     

    Thanks and regards

    Hari

  • Hi Hari,

    Did you try running the code form SPRA958?  Interrupts should be working.

    You need to debug the problem.  I cannot tell what is wrong with your code from here.  Connect the debugger and halt the processor.

    Is the peripheral interrupt flag set (for whatever interrupt you are expecting)?

    If so, is the interrupt enabled in the peripheral registers?

    Is the interrupt flagged in the IFR?  Is it enabled in the IER?

    Is the INTM bit cleared?

    Is the interrupt vector properly populated in the PIE RAM?

    If all of the above are yes, then the interrupt HAS to be taken.

    - David

     

  • Hi David

     

    So when we add memcpy for the PIE vector tables in the main program, do we have to update any thing in the linker command file. Or can we use the default F2812 command file issued from the TI...

     

     

    Thanks

    Hari

  • Not sure what the "Default F2812 command file issued from" "TI" is exactly, but the answer should be no.  Look at the f2812_nonBIOS_flash.cmd file in the SPRA958.  Nothing special is done for the interrupt vectors.  They are copied using structure references from the DSP2812 peripheral header files:

    //--- Initialize the PIE_RAM
     PieCtrlRegs.PIECRTL.bit.ENPIE = 0; // Disable the PIE
     asm(" EALLOW");      // Enable EALLOW protected register access
     memcpy(&PieVectTable, &PieVectTableInit, 256);
     asm(" EDIS");      // Disable EALLOW protected register access

     

    Did you check the PIE RAM using the debugger?  Is your code correctly copying the vectors?  You should be able to set a breakpoint at this part of your code and step through and watch the copy occur.

    - David