Part Number: LAUNCHXL-F28379D Hello, I'm using the F28379D for a project, and I notice that when I increase the sampling frequency, the ADC interruption stops. To see the interrupt on the osciloscope, I set a GPIO port in the beginning of the interruption and reset it at the end, and I use one of the probes of the oscilocope to see the frequency and the time the interruption takes to do all the calculations. I'm using ePWM4a to set the frequency and trigger of the interruption. A few days ago, I was testing to see how fast the interruption could go, and when I achieve 1MHz, it just stops. Does anyone knows why this is happening? Any tips to increase the sampling and interruption frequency? It is a 60Hz signal and two 80kHz signals. The clock system is already at 200MHz. I'm trying to detect the zero crossing of two 80kHz senusoidal signals, and for that, i need the maximum sampling frequency as possible. Below, is the ADC configuration that I'm using. Also, is there any way the program could know when the interruption stops? so I could reset all my ports if that happens. Otherwise, I could short circuit my project and that is not good. Thanks! void configADC(void) { T_ADC = 200000000/F_ADC; // F_ADC is the desired Frequency // Configure ADC EALLOW; AdcaRegs.ADCINTSEL1N2.bit.INT1CONT = 0; // ADCINT1 Continuous mode AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; AdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 0; // setup EOC0 to trigger ADCINT1 to fire AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1; // Enable ADCINT1 AdcbRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; AdcbRegs.ADCINTSEL1N2.bit.INT1SEL = 0; // setup EOC0 to trigger ADCINT1 to fire AdcbRegs.ADCINTSEL1N2.bit.INT1E = 1; // Enable ADCINT1 AdccRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; AdccRegs.ADCINTSEL1N2.bit.INT1SEL = 0; // setup EOC0 to trigger ADCINT1 to fire AdccRegs.ADCINTSEL1N2.bit.INT1E = 1; // Enable ADCINT1 // Configuração do módulo A do ADC AdcaRegs.ADCCTL1.bit.INTPULSEPOS = 1; // ADCINT1 trips after AdcResults latch AdcaRegs.ADCCTL2.bit.SIGNALMODE = 0; // Single Ended AdcaRegs.ADCCTL1.bit.ADCPWDNZ = 1; // Enabled ADC AdcaRegs.ADCCTL2.bit.RESOLUTION = 0; // 12 Bits AdcaRegs.ADCCTL2.bit.PRESCALE = 0; // ADC Clock = Input Clock/1 AdcSetMode(ADC_ADCA, ADC_RESOLUTION_12BIT, ADC_SIGNALMODE_SINGLE); // Configuração do módulo B do ADC AdcbRegs.ADCCTL1.bit.INTPULSEPOS = 1; // ADCINT1 trips after AdcResults latch AdcbRegs.ADCCTL2.bit.SIGNALMODE = 0; // Single Ended AdcbRegs.ADCCTL1.bit.ADCPWDNZ = 1; // Enabled ADC AdcbRegs.ADCCTL2.bit.RESOLUTION = 0; // 12 Bits AdcbRegs.ADCCTL2.bit.PRESCALE = 0; // ADC Clock = Input Clock/1 AdcSetMode(ADC_ADCB, ADC_RESOLUTION_12BIT, ADC_SIGNALMODE_SINGLE); // Configuração do módulo C do ADC AdccRegs.ADCCTL1.bit.INTPULSEPOS = 1; // ADCINT1 trips after AdcResults latch AdccRegs.ADCCTL2.bit.SIGNALMODE = 0; // Single Ended AdccRegs.ADCCTL1.bit.ADCPWDNZ = 1; // Enabled ADC AdccRegs.ADCCTL2.bit.RESOLUTION = 0; // 12 Bits AdccRegs.ADCCTL2.bit.PRESCALE = 2; // ADC Clock = Input Clock/2 AdcSetMode(ADC_ADCC, ADC_RESOLUTION_12BIT, ADC_SIGNALMODE_SINGLE); // Definição de ADCC - SOC0 alocado para saída ADC - pino AdccRegs.ADCSOC0CTL.bit.CHSEL = 3; // set SOC0 channel select to ADC C3 - pino 24 AdccRegs.ADCSOC0CTL.bit.TRIGSEL = 11; // set SOC0 start trigger on EPWM4A, due to round-robin SOC0 converts first then SOC1 AdccRegs.ADCSOC0CTL.bit.ACQPS = 11; // set SOC0 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1) // Definição de ADCB - SOC0 alocado para saída ADC - pino AdcbRegs.ADCSOC0CTL.bit.CHSEL = 2; // set SOC1 channel select to ADC AdcbRegs.ADCSOC0CTL.bit.TRIGSEL = 11; // set SOC1 start trigger on EPWM4A, due to round-robin SOC0 converts first then SOC1 AdcbRegs.ADCSOC0CTL.bit.ACQPS = 11; // set SOC1 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1) // Definição de ADCA - SOC0 alocado para saída ADC - pino AdcaRegs.ADCSOC0CTL.bit.CHSEL = 2; // set SOC2 channel select to ADC AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = 11; // set SOC2 start trigger on EPWM4A, due to round-robin SOC0 converts first then SOC1 AdcaRegs.ADCSOC0CTL.bit.ACQPS = 11; // set SOC2 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1) EDIS; InitEPwm4Gpio(); // Inicia configurações básicas do módulo 4 do ePWM EPwm4Regs.ETSEL.bit.SOCAEN = 1; // Enable SOC on A group EPwm4Regs.ETSEL.bit.SOCASEL = 4; // Select SOC from CMPA on upcount EPwm4Regs.ETPS.bit.SOCAPRD = 1; // Generate pulse on 1st event EPwm4Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE; EPwm4Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // TBCLK = SYSCLK = 200MHz EPwm4Regs.CMPA.bit.CMPA = T_ADC/2; // Set compare A value EPwm4Regs.TBPRD = T_ADC; // Set period for ePWM6 EPwm4Regs.TBCTL.bit.CTRMODE = 0; // count up and start EPwm4Regs.AQCTLA.bit.ZRO = AQ_SET; // Set at Zero EPwm4Regs.AQCTLA.bit.CAU = AQ_CLEAR; // Clear at CompA }
↧