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/TMS320F28027: F28027. Processing two interrupts simultaneously.

Part Number: TMS320F28027


Tool/software: Code Composer Studio

Good day!
I have the following problem:
I want to process the values of two ADCs through interrupts. When going through 0 in the PWM block, an SOS signal is generated. After the ADC converts, it generates a pre-broadcast signal, more precisely two signals, from the first and second ADCs. In this case, my code processes only the interrupt by ADCINT1, it simply ignores the interrupt by ADCINT2. The description of the PIEACK register says that when one interrupt is executed, the others are ignored. In this case, the values in the registers ADCRESULT0 and ADCRESULT1 are constantly changing, i.e. ADC give results.

I would like ADCINT2 to be processed after an ADCINT1 interrupt, and not just ignored.
Can you help me with this problem?
Below is my code:

#include "main.h"
#include <string.h>

uint16_t DataADC0 = 0;
uint16_t DataADC1 = 0;
float Voltage0 = 0;
float Voltage1 = 0;

__interrupt void ADCINT1_ready_isr(void);
__interrupt void ADCINT2_ready_isr(void);

void main(void) {

InitStartMCU();
// Interrupt that is used in this example is re-mapped to
// ISR function found within this file.
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.ADCINT1 = &ADCINT1_ready_isr;
PieVectTable.ADCINT2 = &ADCINT2_ready_isr;
EDIS; // This is needed to disable write to EALLOW protected registers

InitADC();
InitPWM();

PieCtrlRegs.PIEIER1.bit.INTx1 = 1; // Enable INT 1.1 in the PIE
PieCtrlRegs.PIEIER1.bit.INTx2 = 1; // Enable INT 1.2 in the PIE
IER |= M_INT1;
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM

while(1) {

}
}
__interrupt void ADCINT1_ready_isr(void)
{
AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
DataADC0 = AdcResult.ADCRESULT0;
Voltage0 = DataADC0 * 3.3 / 4096;

PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}

__interrupt void ADCINT2_ready_isr(void)
{
AdcRegs.ADCINTFLGCLR.bit.ADCINT2 = 1;
DataADC1 = AdcResult.ADCRESULT1;
Voltage1 = DataADC1 * 3.3 / 4096;

PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}

  • Hello,

    Concerned experts have been notified of this query.

    Note that it is Thanksgiving week in US and most of the TI engineers are away.

    Please expect a delayed response, surely by early next week.

     

    Regards,

    Sudhakar

    ---------------------------------------------------------------------------------------------------

    If a post answers your question, please mark it with the "verify answer" button.

    Other useful links:

    C2000 Getting Started      C2000 Flash Common Issues/FAQs      Emulation FAQ

  • As long as you've cleared the ACK in the first interrupt (and your code shows you have), the second one should be able to run immediately after the first if its flag is set and it's enabled.

    How did you determine that INT2 wasn't running? With a breakpoint? If you check the interrupt flag in the registers window can you confirm that it gets set?

    Whitney
  • Whitney Dewey, thanks!
    I have already solved this problem. I just ran the program from flash and the code ran too long. Running the program from RAM or copying the program from flash to RAM when I started the program solved my problems.


    memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
    InitFlash();