Hey all,
I'm experiencing a somewhat unexplicable issue when adding additional ADC SOC signals. I've tried modifying the DRV_setupAdcs() function with the following changes;
(removed) ADC_setIntSrc(obj->adcHandle,ADC_IntNumber_1,ADC_IntSrc_EOC7);
(added) ADC_setIntSrc(obj->adcHandle,ADC_IntNumber_1,ADC_IntSrc_EOC10);
And also added;
// High-side MOSFET temp sensor
ADC_setSocChanNumber(obj->adcHandle,ADC_SocNumber_8,ADC_SocChanNumber_B5);
ADC_setSocTrigSrc(obj->adcHandle,ADC_SocNumber_8,ADC_SocTrigSrc_EPWM1_ADCSOCA);
ADC_setSocSampleDelay(obj->adcHandle,ADC_SocNumber_8,ADC_SocSampleDelay_9_cycles);
// Low-side MOSFET temp sensor
ADC_setSocChanNumber(obj->adcHandle,ADC_SocNumber_9,ADC_SocChanNumber_B6);
ADC_setSocTrigSrc(obj->adcHandle,ADC_SocNumber_9,ADC_SocTrigSrc_EPWM1_ADCSOCA);
ADC_setSocSampleDelay(obj->adcHandle,ADC_SocNumber_9,ADC_SocSampleDelay_9_cycles);
// Internal core temp sensor
ADC_setSocChanNumber(obj->adcHandle,ADC_SocNumber_10,ADC_SocChanNumber_A5);
ADC_setSocTrigSrc(obj->adcHandle,ADC_SocNumber_10,ADC_SocTrigSrc_EPWM1_ADCSOCA);
ADC_setSocSampleDelay(obj->adcHandle,ADC_SocNumber_10,ADC_SocSampleDelay_9_cycles);
After the section started with
// TODO: AAA When switching to HW-REV 0.2, update ADC mux!
// sample the first sample twice due to errata sprz342f
ADC_setSocChanNumber(...);
As far as I've understood, this should be fine, however, running this results in two calls to mainISR and the ADCINTOVF flag for ADC Int 1 being set. The total period for these calls is correct FWIW.
Though I'm not sure if it's relevant, I did notice that ADCINTSOCSEL1 is configured to trigger SOC0-SOC7 on ADCINT2 and ADCINTSOCSEL2 is configured to trigger SOC8-SOC15 on ADCINT1. Is this just a remnant from DRV_AdcCalConversion? Based on the initialization in DRV_setupAdc's it seems like ADCINT2 isn't used other than during the startup calibration, but if I disable ADC Int #2 in DRV_enableAdcInts mainISR isn't called at all...
What I would like to do in the end is just trigger SOC 8-m periodically. I don't have any real timing requirements in this case, so I'm more than open to any suggestions.