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;
}