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/TMS320F28069M: Triggering ADC same channel from multiple events

Part Number: TMS320F28069M


Tool/software: Code Composer Studio

Hi ,  I have to over-sample the ADC signal . So i will use EPWM in UP-DOWN mode and at  Zero , CMPA, CMPB , TBPRD  events for triggering ADC.

Is following configuration trigger the ADC same channel for 4 different events ? 

AdcRegs.ADCSOC1CTL.bit.TRIGSEL  = ePWM1SOCA | ePWM1SOCB | ePWM2SOCA | ePWM2SOCB ; /*  5 | 6 | 7 | 8 => corresponding trig select values. */

will this instruction trigger the particular  ADC  channel 4 times ??

If not suggest me other method. for triggering same channel multiple times. 

  • Hello,
    I am writing to let you know that a C2000 team member has been assigned to this post and should be answering shortly.

    Regards
    Baskaran
  • Hi Indrajit,

    The statement below:

    AdcRegs.ADCSOC1CTL.bit.TRIGSEL  = ePWM1SOCA | ePWM1SOCB | ePWM2SOCA | ePWM2SOCB ; /*  5 | 6 | 7 | 8 => corresponding trig select values. */

    will assign SOC1 trigger to a final value of 15 (01111b), which will be from a different trigger source, not any of the 4 ePWM events you intended.

    There are 16 SOCs avaialble.  You can assign multiple SOCs for the same channel, say SOC0, SOC1, SOC2 and SOC3 then trigger them from the 4 events that you have defined.  For example, the code below assigns SOC0-3 to channel2 and will be triggered accordingly by the ePWM events:

        AdcRegs.ADCSOC0CTL.bit.CHSEL = 2;

        AdcRegs.ADCSOC1CTL.bit.CHSEL = 2;

        AdcRegs.ADCSOC2CTL.bit.CHSEL = 2;

        AdcRegs.ADCSOC3CTL.bit.CHSEL = 2;

        AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 5;

        AdcRegs.ADCSOC1CTL.bit.TRIGSEL = 6;

        AdcRegs.ADCSOC2CTL.bit.TRIGSEL = 7;

        AdcRegs.ADCSOC3CTL.bit.TRIGSEL = 8;

    Regards,

    Joseph

  • Ok.
    Thanks .
    I got it .

    ..But
    AdcRegs.ADCSOC1CTL.bit.TRIGSEL = ePWM1SOCA | ePWM1SOCB | ePWM2SOCA | ePWM2SOCB ; in this line i am doing "logical -OR" not the "bit-wise OR" , it should run , what is wrong here??
  • Hi Indrajit,

    TRIGSEL is a 5-bit field that will have 2^5 discrete values (0 to 31).  Each of these 32 values correspond to a triggering event.  Regardless of the math operation you do in this field (bitwise OR, logical OR, AND ... add, subtract...etc), you will end up filling those 5 bits and resulting value will have to be a discrete point from 0 to 31.  That said, you cannot combine trigger events in this field.

    Regards,

    Joseph

  • Thank you very much ..