18.3.2.5 Compare
Each Compare/Capture channel contains a comparator which outputs a compare match if the contents of TIMERn_CCx_CCV matches
the counter value, see
Figure 18.14 TIMER Block Diagram Showing Comparison Functionality on page 589
. In compare mode, each
compare channel can be configured to either set, clear or toggle the output on an event (compare match, overflow or underflow). The
output from each channel is represented as an alternative function on the port it is connected to, which needs to be enabled for the CC
outputs to propagate to the pins.
TnCCR0[15:0
]
TnCCR1[15:0
]
Underflow
Compare Match x
TIMERn_TOP
TIMERn_CNT
TIMERn_CCx
Update
Condition
Note: For simplicity, all
TIMERn_CCx registers are
grouped together in the figure,
but they all have individual
Compare Register and logic
=
= 0
==
TIMn_CC0
Compare and
PWM config
Compare and
PWM config
Compare and
PWM config
=
TIMn_CC1
TIMn_CC2
CNTCLK
Overflow
Figure 18.14. TIMER Block Diagram Showing Comparison Functionality
The compare output is delayed by one cycle to allow for full 0% to 100% PWM generation. Each example contains a high detail dia-
gram whcih specifies the exact timing of events durring Compare or PWM operation. If occurring in the same cycle, match action will
have priority over overflow or underflow action.
The input selected (through PRSSEL, INSEL and FILTSEL in TIMERn_CCx_CTRL) for the CC channel will also be sampled on com-
pare match and the result is found in the CCPOL bits in TIMERn_STATUS. It is also possible to configure the CCPOL to always track
the inputs by setting ATI in TIMERn_CTRL.
The COIST bit in TIMERn_CCx_CTRL is the initial state of the compare/PWM output. The COIST bit can also be used as an initial
value to the compare outputs on a reload-start when RSSCOIST is set in TIMERn_CTRL. Also the resulting output can be inverted by
setting OUTINV in TIMERn_CCx_CTRL. It is recommended to turn off the CC channel before configuring the output state to avoid any
pulses on the output. The CC channel can be turned off by setting MODE to OFF in TIMER_CCx_CTRL.
TIMn_CCx
COIST
OUTINV
Output
Compare/
PWM x
0
1
Figure 18.15. TIMER Output Logic
EFM32JG1 Reference Manual
TIMER - Timer/Counter
silabs.com
| Smart. Connected. Energy-friendly.
Preliminary Rev. 0.6 | 589