I got a bit further with the implementation of my application, but I still have a couple of questions about the SCT functionalities that I feel are not quite answered in the user manual. The manual seems to focus more on output (PWM signal generation) than on input (signal capturing). The fact that input and output functionality are not treated separately in the manual creates IMO some ambiguity regarding what is possible with the SCT peripherals and what is not.
In my case, I want to have the counter running continuously (increasing on every M4_CLK edge). Then I have two events, the first event occurs when my input signal (CTIN_7) becomes high (rising edge) and one event when it becomes low (falling edge). On every falling edge (event two) I want to capture the counter register in capture register 0 (CAP0), on every rising edge (event one) I want to capture the counter register in capture register 1 (CAP1). Then I want the software to poll the CAP0/1 registers every few seconds or so.
This seems possible if I read the manual, but a few questions remain:
Does the counter reset itself whenever it is captured? If not, I suppose I need to set the LIMIT registers?
If I set the LIMIT registers, will it reset the counter before capturing is possible (therefore rendering the counter result zero)?
Do I need to actively enable the SCT peripheral?
Do I need to actively enable the counter?
I would really like to know whether or not what I'm doing makes sense with respect to the manual.
Thank you in advance.