SCTimer/PWM Use the SCTimer/PWM as a simple timer

To configure the SCT as a simple timer with match or capture functionality, follow these steps:

  1. Set up the SCT as one 32-bit timer or one or two 16-bit timers. See SCTimer/PWM registerName = CONFIG addressOffset = 0x000.
  2. Preload the 32-bit timer or the 16-bit timers with a count value. See SCTimer/PWM registerName = COUNT addressOffset = 0x040.
  3. If you need to create a match event when the timer reaches a match value:
    1. Configure the register map for match registers. See SCTimer/PWM registerName = REGMODE addressOffset = 0x04C.
    2. Configure one or more match registers with a match value. See SCTimer/PWM registerName = MATCH[0:4] addressOffset = 0x100.
    3. For each match value, create a match event. See SCTimer/PWM registerName = EV[0:5]_CTRL addressOffset = 0x304.
    4. If you want to create an interrupt on a match event, enable the event for interrupt. See SCTimer/PWM registerName = EVFLAG addressOffset = 0x0F4.
    5. If you want to create a match output on a pin, connect the CTOUTn function to a pin (see SCTimer/PWM Pin description) and select an output for the match event in the EVn_CTRL register. See SCTimer/PWM registerName = EV[0:5]_CTRL addressOffset = 0x304. The EVn_CTRL registers also control what type of output signal is created.
  4. If you need to capture a timer value on a capture signal:
    1. Configure the register map for capture registers. See SCTimer/PWM registerName = REGMODE addressOffset = 0x04C.
    2. Create one or more capture events. See SCTimer/PWM registerName = EV[0:5]_CTRL addressOffset = 0x304.
    3. Connect the CTIN functions to pins (see SCTimer/PWM Pin description) and configure the signal to create an event. See SCTimer/PWM registerName = EV[0:5]_CTRL addressOffset = 0x304.
  5. Start the timer by writing to the CRTL register. See SCTimer/PWM registerName = CTRL addressOffset = 0x004.
  6. Read the capture registers to read the timer value at the time of the capture events.

-->