![](http://datasheet.mmic.net.cn/90000/MQ83C154DXXX-12-883R_datasheet_2377128/MQ83C154DXXX-12-883R_99.png)
99
2588F–AVR–06/2013
ATtiny261/461/861
The design of the Output Compare Pin Configuration logic allows initialization of the OC1x state
before the output is enabled. Note that some COM1x1:0 bit settings are reserved for certain
12.7.1
Compare Output Mode and Waveform Generation
The Waveform Generator uses the COM1x1:0 bits differently in Normal mode and PWM modes.
For all modes, setting the COM1x1:0 = 0 tells the Waveform Generator that no action on the
OCW1x Output is to be performed on the next Compare Match. For compare output actions in
A change of the COM1x1:0 bits state will have effect at the first Compare Match after the bits are
written. For non-PWM modes, the action can be forced to have immediate effect by using the
FOC1x strobe bits.
12.8
Modes of Operation
The mode of operation, i.e., the behavior of the Timer/Counter and the Output Compare pins, is
defined by the combination of waveform generation mode bits (PWM1A, PWM1B, and
WGM11:10) and compare output mode bits (COM1x1:0). The Compare Output mode bits do not
affect the counting sequence, while the Waveform Generation mode bits do. The COM1x1:0 bits
control whether the PWM output generated should be inverted, non-inverted or complementary.
For non-PWM modes the COM1x1:0 bits control whether the output should be set, cleared, or
toggled at a Compare Match.
12.8.1
Normal Mode
The simplest mode of operation is Normal mode (PWM1A/PWM1B = 0), where the counter
counts from BOTTOM to TOP (defined as OCR1C) then restarts from BOTTOM. The OCR1C
defines the TOP value for the counter, hence also its resolution, and allows control of the Com-
pare Match output frequency. In toggle Compare Output Mode the Waveform Output (OCW1x)
is toggled at Compare Match between TCNT1 and OCR1x. In non-inverting Compare Output
Mode the Waveform Output is cleared on the Compare Match. In inverting Compare Output
Mode the Waveform Output is set on Compare Match. The timing diagram for Normal mode is
Figure 12-11. Normal Mode, Timing Diagram
TCNTn
OCWnx
(COMnx=1)
OCnx Interrupt Flag Set
1
4
Period
2
3
TOVn Interrupt Flag Set