This example assumes interrupt generation capabilities. Perform the following procedure to enable the timer:
- Disable interrupts globally using the CPU INTM mask or some other global interrupt masking in the target subsystem.
- Select which signal drives the counter function by writing the correct index to the SCTM_CTCR_WT_j[23:16] INPSEL bit field.
- Configure the sampling scheme to be used by the counter (edge/level) by writing to the SCTM_CTCR_WT_j[3] DURMODE bit (if required).
- Set the behavior for system state by writing to the SCTM_CTCR_WT_j [5]IDLE and [4] FREE bits (if required).
- If the timer function is continuous, set the SCTM_CTCR_j[10] RESTART bit to 1.
- Set the SCTM_CTCR_WT_j[8] INT bit to 1.
- Set the interval match value in the corresponding SCTM_TINTVLR_i register.
- Enable the corresponding interrupt in the subsystem INTC.
- Enable interrupts globally.
- Start the counter function by setting the SCTM_CTCR_WT_j[0] ENBL bit to 1.