1. The pulse capture module is used to capture the rising and falling edges of the pulse quantity, and then the pulse width and duty cycle are calculated.
2.6 groups of ecap modules can also be used as apwm output.
3. Features
1) Under 150MHZ system clock, the resolution of 32-bit time base is 6.67ns
2) 4 levels of depth
3) Can be configured as single channel Apwm mode
4. Single mode and continuous mode
1) Single mode: The ecap module waits for N (1 to 4) capture times to occur, where N is the value of the stop register. Once N is reached, the values of the Mod4 counter and the CAP register are frozen. If 1 is written to RE-ARM of ECCTL2, Mod4 will recover and resume function from the frozen state. At the same time, if CAPLDEN bit of ECCTL1 is written to 1, the CAP1-CAP4 registers will be loaded with new values again.
2) Continuous mode: The Mod4 counter counts in a loop (0->1->2->3->0) until it stops working, and the captured values are continuously written to CAP1-CAP4 in sequence in a circular buffer.
Note: The capture register value can be prevented from loading by controlling the ECCTL1[CAPLDEN] bit in the register. In single-shot mode, this bit is automatically cleared (CAP1-CAP4 are not loaded) when a stop signal is generated (Stopvalue = Mod4).
5. APWM mode: CAP1 and CAP2 are period registers and comparison registers, CAP3 and CAP4 are response shadow registers
6. In the interrupt service function, the global interrupt and the responded interrupt time must be cleared through the interrupt clear register (ECCLR).
7. In APWM mode, the period value and comparison value must be written to the valid registers CAP1 and CAP2, and the module will automatically copy them to its shadow registers (CAP3 and CAP4). When changing the data later, you only need to use the shadow registers.
|