
105
ATmega8515(L)
2512A–AVR–04/02
Compare Match Output
Unit
The
Compare Output mode
(COM1x1:0)bitshave two functions.The Waveform Gener-
ator uses the COM1x1:0 bitsfordefining the Output Compare (OC1x) state at thenext
comparematch. Secondly the COM1x1:0 bitscontrol the OC1xpin output source. Fig-
ure50shows a simplified schematic of the logic affectedbythe COM1x1:0 bit setting.
The I/O Registers, I/Obits, andI/Opins in the figureare showninbold. Only the parts of
the generalI/Oport controlregisters (DDRand PORT) that areaffectedbythe
COM1x1:0 bits are shown. When referringtothe OC1xstate, the referenceisfor the
internalOC1x Register, not the OC1xpin. If a System Reset occur, the OC1x Register is
reset to “0”.
Figure 50. Compare Match Output Unit,Schematic
The generalI/Oport function is overridden by the Output Compare (OC1x) from the
Waveform Generator if either of the COM1x1:0 bits are set. However, the OC1xpin
direction (input or output) isstill controlledbythe
Data Direction Register
(DDR)for the
port pin. The Data Direction Registerbit for the OC1xpin (DDR_OC1x) must be set as
output beforethe OC1x value is visibleonthe pin. The portoverride function is generally
independent of the waveform generation mode,but thereare some exceptions.Refer to
Table50, Table51, and Table52fordetails.
The design of theoutput compare pin logic allows initialization of the OC1xstate before
theoutput is enabled. Note that some COM1x1:0 bit settings are reservedforcertain
modes of operation. See “16-bit Timer/Counter RegisterDescription” on page 116.
The COM1x1:0 bitshavenoeffectontheinput capture unit.
PORT
DDR
DQ
DQ
OCnx
Pin
OCnx
DQ
Waveform
Generator
COMnx1
COMnx0
0
1
DATA BUS
FOCnx
clk
I/O
Komentarze do niniejszej Instrukcji