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.

TMDSCNCD28379D: How to choose the right ADC interrupts?

Part Number: TMDSCNCD28379D

Tool/software:

Hi,

Could anyone please help me with questions highlighted blue? Each ADC module has 4 ADC interrupts.  If only ADCD3 is physically used for ADC purpose, can I use ADCA1 interrupt, ADCD1 interrupt or any ADC interrupt or I have to use ADCD3 interrupt?

EALLOW;

    AdcdRegs.ADCSOC0CTL.bit.CHSEL = 3; // SOC0 will convert pin D3

    AdcdRegs.ADCSOC0CTL.bit.ACQPS = SAH_time;

    AdcdRegs.ADCSOC0CTL.bit.TRIGSEL = 0x0D;

EDIS;

//setting 1, which one should I use ADCINTSEL1N2 or ADCINTSEL3N4 or just randomly choose one?

EALLOW;

  AdcdRegs.ADCINTSEL1N2.bit.INT1SEL = 0;

  AdcdRegs.ADCINTSEL1N2.bit.INT1E = 1;

  AdcdRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;

EDIS;

//or setting 2

EALLOW;

  AdcdRegs.ADCINTSEL1N2.bit.INT2SEL = 0;

  AdcdRegs.ADCINTSEL1N2.bit.INT2E = 1;

  AdcdRegs.ADCINTFLGCLR.bit.ADCINT2 = 1;

EDIS;

//or setting 3

EALLOW;

  AdcdRegs.ADCINTSEL3N4.bit.INT3SEL = 0;

  AdcdRegs.ADCINTSEL34.bit.INT3E = 1;

  AdcdRegs.ADCINTFLGCLR.bit.ADCINT3 = 1;

EDIS;

//or setting 4

EALLOW;

  AdcdRegs.ADCINTSEL3N4.bit.INT4SEL = 0;

  AdcdRegs.ADCINTSEL34.bit.INT4E = 1;

  AdcdRegs.ADCINTFLGCLR.bit.ADCINT4 = 1;

EDIS;

// PIE setting, can I use any one from the 16 interrupts or I have to choose PieVectTable.ADCD3_INT = &adcd3_isr since D3 is physically used?

PieVectTable.ADCD1_INT = &adcd1_isr; ..., PieVectTable.ADCD4_INT = &adcd4_isr;

//or

PieVectTable.ADCA1_INT = &adca1_isr; ..., PieVectTable.ADCA4_INT = &adca4_isr;

//or

PieVectTable.ADCB1_INT = &adca1_isr; ..., PieVectTable.ADCB4_INT = &adcb4_isr;

//or

PieVectTable.ADCC1_INT = &adca1_isr; ..., PieVectTable.ADCC4_INT = &adcc4_isr;

Thank you very much!

Hongmei Wan

  • Hello,

    Typically, you should utilize the ADC you're using for conversion to handle the interrupt. This allows you to choose the start and end of the conversion for that particular ADC when managing the interrupt.

    Best Regards,

    Masoud

  • Hi Masoud,

    So it is best for me to use ADCD3 interrupt for my case with only one ADCD3 conversion, right?

    If I have ADCD1, ADCD2, ADCD3, ADCD4 for conversions, what interrupt is the best to use, ADCD4 interrupt?

    Thanks,

    Hongmei Wan

  • Hello,

    Usually, we handle one interrupt for the ISR, where you acknowledge the ADC interrupt and read all the necessary ADCs from the specified channels. Ultimately, though, it's up to you to determine what works best for your application and control setup.

    Best Regards,

    Masoud

  • yes. I only handle one interrupt. They are so many to choose, how to choose it?

    If I have ADCD1, ADCD2, ADCD3, ADCD4 for conversions, what ADC interrupt (only one interrupt to handle) is the best to use? Do you mean anyone of 16 interrupts is good to use?

    Thanks,

    Hongmei

  • Hello Hongmei,

    As we talked about earlier, it's really up to you to figure out what suits your application best, and all interrupts can be useful for you. Let’s go through an example of how to pick the right interrupt. If you need to measure 3 currents and 1 voltage, you’ll usually want to capture all 3 currents at the same time for control purposes. So, it makes sense to use the same Start of Conversion (SoC) from different ADCs, and then assign a different SoC for the voltage measurement. For instance:

    I1 -> ADC A - SoC 0

    I2 -> ADC C - SoC 0

    I3 -> ADC B - SoC 0

    V1 -> ADC A - SoC 1

    Since we’re looking for the end of conversion, you can select one of the interrupts from ADC A with EoC1 as the interrupt source for the SoC.

    Best Regards,
    Masoud