SPRUJ28E November 2021 – September 2024 AM68 , AM68A , TDA4AL-Q1 , TDA4VE-Q1 , TDA4VL-Q1
// Code snippet for CAP mode Delta Time, Rising and Falling edge triggers
// Run Time ( e.g. CEVT1 triggered ISR call)
//==========================================
// Note: here Time-stamp directly represents the Duty cycle values.
DutyOnTime1 = ECAPxRegs.CAP2; // Fetch Time-Stamp captured at T2
DutyOffTime1 = ECAPxRegs.CAP3; // Fetch Time-Stamp captured at T3
DutyOnTime2 = ECAPxRegs.CAP4; // Fetch Time-Stamp captured at T4
DutyOffTime2 = ECAPxRegs.CAP1; // Fetch Time-Stamp captured at T1
Period1 = DutyOnTime1 + DutyOffTime1;
Period2 = DutyOnTime2 + DutyOffTime2;