I am using a TMS320F28377S Launchpad to run some code that is looking at a 75% (or so) duty cycle pulse train. I am using an eCAP to look at this because it really gets rid of a lot of overhead.
That being said, I want to run an algorithm that needs the following:
1) The absolute timestamp of the "most recent" rising edge of the pulse train
2) The relative period between the "two most recent" rising edges of the pulse train
Right now, I have been doing this by enabling the ECap1Regs.CAP1 and ECap1Regs.CAP2 registers and reading the Overflow bit (ECap1Regs.ECFLG.bit.CTROVF). In the nominal case where there is no overflow, I just compare CAP1 and CAP2 and find the "greatest" counter value (which would be the most recent) and store that, then I calculate the difference between CAP1 and CAP2 and store that. If there is an overflow, I basically just do the same thing (accounting for overflow). I think this line of logic is about 100 clock cycles (with inefficient code), which isn't bad considering how much power is in the 28377S, but I would like to know whether I can make things more efficient.
I know that the eCAP can be configured to be in "delta" mode where it gives you the period between the last two capture events, and I know that it can be configured to have absolute timestamp.
Is there a way that I can configure an eCAP so that I can read registers and get the absolute timestamp of the "most recent" rising edge of a pulse train, and also get the period between the last two? I am effectively doing this right now, but it would be nice to do this without have to do any "if-then" logic in software.
Thanks for the help.