Datasheet
22. OCM - Output Compare Modulator
22.1 Overview
The Output Compare Modulator (OCM) allows generation of waveforms modulated with a carrier
frequency. The modulator uses the outputs from the Output Compare Unit B of the 16-bit Timer/Counter3
and the Output Compare Unit of the 16-bit Timer/Counter4. For more details about these Timer/Counters
see 16-bit Timer/Counter. When the modulator is enabled, the two output compare channels are
modulated together as shown in the block diagram (as the following figure).
Figure 22-1. Output Compare Modulator, Block Diagram
OC3B
Pin
OC3B /
OC4B / PD2
Timer/Counter 3
Timer/Counter 4
OC4B
Related Links
TC1, 3, 4 - 16-bit Timer/Counter1, 3, 4 with PWM
22.2 Description
The Output Compare unit 3B and Output Compare unit 4B shares the PD2 port pin for output. The
outputs of the Output Compare units (OC3B and OC4B) overrides the normal PORTD2 Register when
one of them is enabled (that is, when COMnx[1:0] is not equal to zero). When both OC3B and OC4B are
enabled at the same time, it will also enable this modulator.
The functional equivalent schematic of the modulator is shown in the figure below. The schematic
includes part of the Timer/Counter units and the port D pin 2 output driver circuit. When the modulator is
enabled the type of modulation (logical AND or OR) can be selected by setting the PORTD2 Register as
‘1’.
Note: The DDRD2 controls the direction of the port independent of the COMnx[1:0] bit setting.
ATmega328PB
OCM - Output Compare Modulator
© 2018 Microchip Technology Inc.
Datasheet Complete
DS40001906C-page 246