ATmega88PA Automotive Atmel Corporation, ATmega88PA Automotive Datasheet - Page 148

no-image

ATmega88PA Automotive

Manufacturer Part Number
ATmega88PA Automotive
Description
Manufacturer
Atmel Corporation
18.6.1
148
Atmel ATmega48PA/88PA/168PA [Preliminary]
Compare Output Mode and Waveform Generation
Figure 18-4. Compare Match Output Unit, Schematic
The general I/O port function is overridden by the Output Compare (OC2x) from the Waveform
Generator if either of the COM2x1:0 bits are set. However, the OC2x pin direction (input or
output) is still controlled by the Data Direction Register (DDR) for the port pin. The Data Direc-
tion Register bit for the OC2x pin (DDR_OC2x) must be set as output before the OC2x value is
visible on the pin. The port override function is independent of the Waveform Generation
mode.
The design of the Output Compare pin logic allows initialization of the OC2x state before the
output is enabled. Note that some COM2x1:0 bit settings are reserved for certain modes of
operation.
The Waveform Generator uses the COM2x1:0 bits differently in normal, CTC, and PWM
modes. For all modes, setting the COM2x1:0 = 0 tells the Waveform Generator that no action
on the OC2x Register is to be performed on the next compare match. For compare output
actions in the non-PWM modes refer to
Table 18-6 on page
A change of the COM2x1: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 FOC2x strobe bits.
COMnx1
COMnx0
FOCnx
clk
See “Register Description” on page 158.
I/O
159, and for phase correct PWM refer to
Waveform
Generator
Table 18-5 on page
D
D
PORT
D
DDR
OCnx
Q
Q
Q
159. For fast PWM mode, refer to
Table 18-7 on page
1
0
9223B–AVR–09/11
OCnx
Pin
160.

Related parts for ATmega88PA Automotive