#pragma CODE_SECTION(dcdc_isr, "IsrRamfuncs");
interrupt void dcdc_isr()
{
………
………
………
IsrVars.u16_FSBB_CurrASampSum += adValueBranchACurr;
IsrVars.u16_FSBB_CurrASampSum -= IsrVars.u16_FSBB_CurrASampAD[IsrVars.u16_FSBB_IsrTimer];
IsrVars.u16_FSBB_CurrASampAD[IsrVars.u16_FSBB_IsrTimer] = adValueBranchACurr;
………
………
………
}
#pragma CODE_SECTION(Ocp_tzint_isr, "IsrRamfuncs");
interrupt void Ocp_tzint_isr(void)
{
………
………
………
}
Add information
#define adValueBranchACurr AdcMirror.ADCRESULT2
PieVectTable.EPWM5_INT = &dcdc_isr; //Loop Calculate
PieVectTable.EPWM6_TZINT = &Ocp_tzint_isr;
EPwm5Regs.TBPRD = EPWM5_TIMER_TBPRD;//299
EPwm5Regs.ETSEL.bit.SOCASEL = ET_CTR_PRDZERO;
Phenomena
Only EPWM5 trigger interrupt void dcdc_isr(), the value of adValueBranchACurr stay the same when the code execute. when tirgger interrupt void Ocp_tzint_isr(void), the value of adValueBranchACurr different occasional when the code execute. We thought the AdcMirror.ADCRESULT2 refresh, we check the time as below:
the sampling is in the third channel. In theory, the max conversion time is 3*333ns=999us. The earliest time this code to be executed is 3.2us under normal conditions, and the latest time to be executed is 4.6us.
In the figure above, point A is the time when the A-way current conversion is completed, point B is the earliest time code executed, point C is the latest time code executed. Accounting, there should be no possibility of refreshing conversion value in the code execute , but this phenomenon does exist when tirgger interrupt void Ocp_tzint_isr(void).
So we want to know why conversion value refreshing between point B and point C? thanks.