Tool/software:
I want to do the following :
1. at pwm count = 0 sample my signal using ADC
2. Once ADC conversion has been done, generate a End Of Conversion pulse. Trigger the interrupt based on this EOC
This is my code for this :
PWM settings :
 EPwm1Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; // Select INT on Zero event
 EPwm1Regs.ETSEL.bit.INTEN = 1; // Enable INT   I dont think this is the correct setting
 EPwm1Regs.ETPS.bit.INTPRD = ET_1ST; // Generate INT on 1st event
// EPWM ADC settings
 EPwm1Regs.ETSEL.bit.SOCAEN = 1; // Enable ADC A start of conversion
 EPwm1Regs.ETSEL.bit.SOCBEN = 0; // Disable ADC B start of conversion
 EPwm1Regs.ETSEL.bit.SOCASEL = 1; // Enable event time-base counter equal to zero
ADC settings :
AdcaRegs.ADCCTL2.bit.RESOLUTION = 0;
AdcaRegs.ADCCTL2.bit.PRESCALE = 0;
AdcaRegs.ADCSOC0CTL.bit.CHSEL = 0; //SOC0 convert ADCINA0 which is mapped to my signal at the board 
AdcaRegs.ADCSOC0CTL.bit.ACQPS = 19; //SOC0 uses sample duration of 20 SYSCLK cycles
AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = 5; //SOC0 begins conversion on ePWM1 SOCA
AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1; // ADCINT1 is enabled ... I think this is needed 
AdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 0; // EOC0 is trigger for ADCINT1
how is the EOC 0 triggering the interrupt ?
Any idea if this looks okay ?
 
				 
		 
					 
                          