Tool/software:
Hi TI,
I am trying to understand project implemented by someone else, which has
ADC triggered with PWM1 and PWM5. with settings as below:
TBPRD= 1000 up and 1000 down = 2000
EPWM_setCounterCompareValue(EPWM1_BASE,EPWM_COUNTER_COMPARE_C,20);// for ADC triggering EPWM_setCounterCompareShadowLoadMode(EPWM1_BASE,EPWM_COUNTER_COMPARE_C,EPWM_COMP_LOAD_ON_CNTR_ZERO); EPWM_setCounterCompareValue(EPWM5_BASE,EPWM_COUNTER_COMPARE_C,980);// for ADC triggering EPWM_setCounterCompareShadowLoadMode(EPWM5_BASE,EPWM_COUNTER_COMPARE_C,EPWM_COMP_LOAD_ON_CNTR_ZERO); EPWM_setADCTriggerSource(EPWM1_BASE,EPWM_SOC_A,EPWM_SOC_TBCTR_D_CMPC ); // Generate pulse on 1st event EPWM_setADCTriggerEventPrescale(EPWM1_BASE,EPWM_SOC_A,1); // Enable SOC on A group EPWM_enableADCTrigger(EPWM1_BASE,EPWM_SOC_A); EPWM_setADCTriggerSource(EPWM5_BASE,EPWM_SOC_A,EPWM_SOC_TBCTR_U_CMPC ); // Generate pulse on 1st event EPWM_setADCTriggerEventPrescale(EPWM5_BASE,EPWM_SOC_A,1); // Enable SOC on A group EPWM_enableADCTrigger(EPWM5_BASE,EPWM_SOC_A);
All ADCx modules have been used, with SOC starting from 0 - 13.
ADC is triggered with SCO12 with settings as below .
Interrupt_register(INT_ADCC1, &ADC_ISR); ADC_setInterruptSource(ADCC_BASE ,ADC_INT_NUMBER1,ADC_SOC_NUMBER12); ADC_enableContinuousMode(ADCC_BASE ,ADC_INT_NUMBER1); ADC_enableInterrupt(ADCC_BASE,ADC_INT_NUMBER1); Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1); Interrupt_enable(INT_ADCC1);//GM adc oversampling
1. I understood this settings will acquire samples as shown in above fig., correct ?
2. What flags i can use to toggle GPIO to see this sample acquisition on oscilloscope ?
3. I calculated total time taken by ADC module from SOC0 to SOC13 but how to confirm and measure it on oscilloscope ?
4. when ADC starts its conversion ? because i would like to toggle GPIO when SOC0 starts and trigger for SOC12 is generated using this flag ADCSOCFLG1
I have checked EPwm1Regs.ETFLG.bit.SOCA to see if the SOC generated an event or not, working fine.
I have checked AdccRegs.ADCINTFLG.bit.ADCINT1 to see if interrupt is generated or not, working fine.
I appreciate any help i can get on this.