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.

Interrupt priority

Other Parts Discussed in Thread: TMS320F28335

Dear all,

 I'm using the ADC of my TMS320F28335 in DMA mode. Thus I have an ISR (local_DINTCH1_ISR) associated to the DMA channel1 (PieVectTable.DINTCH1 = &local_DINTCH1_ISR;). Then I have created another ISR with lower priority: low_priority_ISR, that I have associated to PieVectTable.rsvd12_6 = &low_priority_ISR;

For test purpose, the low_priority_ISR simply enter into a infinite while loop:

while(1){}

 Into the dma ISR (local_DINTCH1_ISR), I send the interrupt associated to the low_priority_ISR:

 while(PieCtrlRegs.PIEIFR12.all != 0x0000 ){}
 PieCtrlRegs.PIEIFR12.bit.INTx6 = 1;

Thus, the cpu ends the high priority ISR (local_DINTCH1_ISR) and then goes into the low_priority_ISR. Once into the low_priority_ISR, the cpu goes into an infinite loop (while(1){}) and even if it receives the DMA higher priority interrupts, it never goes into the higher priority ISR (local_DINTCH1_ISR) becouse it never ends the current ISR.

 I woild like to have the DMA interrupts served immediatly, without waiting the end of the lower priority interrupts. 

There is a way to serve the higher priority interrupts before ending the lower priority ones?

 

Thank you.

 Best regards,

 Alessandro Polpetta 

 

  • Allessandro,

    by default all other interrupts, including higher prioritzed interrupts, are disabled when the 28x enters an ISR. This is done in hardware and based on INTM. With the return from the ISR the INTM switch is closed again. This principle is called "non nested".

    Now, if you like to have it the other way, it is your reponsiblity to close INTM earlier in yor running ISR ( asm("   CLRC INTM"); ). From that point on, ALL new incoming Interrupt requests will be dealed with immediately. All means, that also interrupts, which you qualified to be at lower priority, will interrupt the running ISR. If you would like to have only those ISR's to be able to interrupt at that time, you have to modify the IER register temporarily. The original value in IER has already been stored by the hardware ISR sequence into the stack and it will be restored with the ISR return.

    Regards

     

  • dear all and in particular alessandro....

    I'm using the ADC of my TMS320F28335 in DMA mode. I try to use the example: Example_2833xAdcToDMA.c but it doesn't work well...in particular the adc works in a good way but the DMA doesn't work. when I see the DMA registers I find all 0. The program doesn't write the ADC value in the DMA.I think that the problem is when I initialize the DMA registers becouse I realize also a code, an easy code:

     EALLOW;

     // Set up MODE Register:
     DmaRegs.CH1.MODE.bit.PERINTSEL = 1 ;

    EDIS

    I expect to find 1 in this register but I find 0 also here....it's like all the register are protected......in particolar for alessandro....your project work well???have you done some changes to the program  also becouse my program never call the interrupt....what have you done to the code? becouse my code is the original and doesn't work....

    Please help me......

    Bye

    Giovanni

    (alessandro you can answer me also in italian......)

  • If peripheral registers read back all 0 and cannot be written to in the memory window then I suggest checking that the clock to the peripheral is turned on.  For the DMA it is the PCLKCR3 register.

    EALLOW;

    ....

       SysCtrlRegs.PCLKCR3.bit.DMAENCLK = 1;       // DMA Clock

    ...

    EDIS;

    In the header file peripheral examples this is typically done in the InitSysCtrl() function call.

    -Lori

     

  • It was the problem......I hadn't found this information in the document.....

     

    thanks a lot

     

    now i can use my DMA

     

    thanks

     

    bye

     

    Giovanni