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.

TMS320F28386S: EOC flag

Part Number: TMS320F28386S

Hi team,

I have questions about EOS flag use-case, I am referring TRM now.
On "20.7 EOS and Interrupt Operation" mentions aout EOS pulse and register flag to use for interrupt event.

Q1. Is EOC flag set up on "20.15.2.4 ADCINTFLG Register"?

Q2. Under the settings below, we want to use EOC timing but not use interrupt. Is EOC flag set up on it even EOC interrupt is not used?

AdcaRegs.ADCCTL1.bit.INTPULSEPOS = 1;          // ADC interrupt position. Set at the las of conversion
AdcaRegs.ADCINTSEL1N2.bit.
INT1E=0;               // disable interrupt
AdcaRegs.ADCINTSEL1N2.bit. INT1SEL=5;           // EOC source of ADCINT1 is EOC5

Q3. If Q2 answer is "Yes" which means the flag is set up, When is the flag up? after the SOC0 or after the SOC5?

Sorry for the ambiguous questions but we do not have EVM in my hand and I am not familiar with this kind of questions.
Please tell me if you have any questions.

Best regards,
Yuto

  • Hi Yuto-san,

    Q1. Is EOC flag set up on "20.15.2.4 ADCINTFLG Register"?

    JC: Register ADCINTFLG provides the status of the ADCINTx [1:4] flags.  The ADCINTx flags can be triggered by EOCx [0:15] and set in registers ADCINTSEL1N2 (for ADCINT1 and ADCINT2) and ADCINTSEL3N4 (for ADCINT3 and ADCINT4) with the INT1E, INT2E, INT3E and INT4E bits.

    Q2. Under the settings below, we want to use EOC timing but not use interrupt. Is EOC flag set up on it even EOC interrupt is not used?

    AdcaRegs.ADCCTL1.bit.INTPULSEPOS = 1;          // ADC interrupt position. Set at the las of conversion
    AdcaRegs.ADCINTSEL1N2.bit.
    INT1E=0;               // disable interrupt
    AdcaRegs.ADCINTSEL1N2.bit. INT1SEL=5;           // EOC source of ADCINT1 is EOC5

    JC: INT1E still needs to be set to '1' in order for the EOC to trigger the ADCINT1 flag.  Please refer to fig 20-8 for the ADC interrupt structure.  ADCINT[1:4] signals go to PIE (interrupt module) but will not generate an interrupt (ISR) until enabled in the PIE module.  If not enabled in the PIE module, the ADCINT[1:4] signals can be used as flags to signal an EOC.

    Q3. If Q2 answer is "Yes" which means the flag is set up, When is the flag up? after the SOC0 or after the SOC5?

    JC: For this case ADCINT1 will be set after SOC5 finishes conversion (EOC5).

    Hope above clarifies your questions.

    Best regards,

    Joseph

  • Hi Joseph,

    Thank you for your comment. That makes me clear. But please let me add 1 point for Q3.
    They are using SOC 0 to 5 with no prioritizing which means 0 > 1 > 2 > 3 > 4 > 5.
    With this use case, How will be the Q3? "When is the flag up? after the SOC0 or after the SOC5?"

    Below is the code the are using as reference in case.
    Best regards,
    Yuto

       AdcaRegs.ADCCTL1.bit.INTPULSEPOS = 1;                                                    // 割り込み位置 変換の最後にセット

                  AdcaRegs.ADCINTSEL1N2.bit. INT1E=1;                                                         // 割り込みは無効

                  AdcaRegs.ADCINTSEL1N2.bit. INT1SEL=5;                                                     // ADCINT1のEOCソースはEOC5

    /*A0設定*/

                  AdcaRegs.ADCSOC0CTL.bit.CHSEL = ADC_CHANNEL_0;               /* ADCINA0を入力に設定 */

                  AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = ADC_TRIG_EPWM1;         /* ADC変換開始タイミング EPWM1 */

                  /*A1設定*/

                  AdcaRegs.ADCSOC1CTL.bit.CHSEL = ADC_CHANNEL_1;               /* ADCINA1を入力に設定 */

                  AdcaRegs.ADCSOC1CTL.bit.TRIGSEL = ADC_TRIG_EPWM1;         /* ADC変換開始タイミング EPWM1*/

                  /*A2設定*/

                  AdcaRegs.ADCSOC2CTL.bit.CHSEL = ADC_CHANNEL_2;               /* ADCINA2を入力に設定 */

                  AdcaRegs.ADCSOC2CTL.bit.TRIGSEL = ADC_TRIG_EPWM1;         /* ADC変換開始タイミング EPWM1 */

                  /*A3設定*/

                  AdcaRegs.ADCSOC3CTL.bit.CHSEL = ADC_CHANNEL_3;               /* ADCINA3を入力に設定 */

                  AdcaRegs.ADCSOC3CTL.bit.TRIGSEL = ADC_TRIG_EPWM1;         /* ADC変換開始タイミング EPWM1 */

                  /*A4設定*/

                  AdcaRegs.ADCSOC4CTL.bit.CHSEL = ADC_CHANNEL_4;               /* ADCINA4を入力に設定 */

                  AdcaRegs.ADCSOC4CTL.bit.TRIGSEL = ADC_TRIG_EPWM1;         /* ADC変換開始タイミング EPWM1 */

                  /*A5設定*/

                  AdcaRegs.ADCSOC5CTL.bit.CHSEL = ADC_CHANNEL_5;               /* ADCINA5を入力に設定 */

                  AdcaRegs.ADCSOC5CTL.bit.TRIGSEL = ADC_TRIG_EPWM1;         /* ADC変換開始タイミング EPWM1 */

  • Hi Yuto-san,

    The flag wil be up (set) after EOC5 because of this setting:  

         AdcaRegs.ADCINTSEL1N2.bit. INT1SEL=5;   

    Regards,

    Joseph