- Configure the SCT (see
SCTimer/PWM Configure the SCT).
- Write to the STATE register to define the initial state.
By default the initial state is state 0.
- To start the SCT, write to the CTRL register:
- To stop the counters by software at any time, stop or
halt the counter (write to STOP_L and/or STOP_H bits or HALT_L and/or
HALT_H bits in the CTRL register).
- When the counters are stopped, both an
event configured to clear the STOP bit or software writing a zero
to the STOP bit can start the counter again.
- When the counter are halted, only a software write to
clear the HALT bit can start the counter again. No events can occur.
- When the counters are halted, software can set any SCT
output HIGH or LOW directly by writing to the OUT register.
The current state can be read at any time by reading
the STATE register.
To change the current state by software (that is independently
of any event occurring), set the HALT bit and write to the STATE
register to change the state value. Writing to the STATE register
is only allowed when the counter is halted (the HALT_L and/or HALT_H bits
are set) and no events can occur.