Bit timer/counter register description, Timer/counter 1 control register a – tccr1a, Timer/counter 3 control register a – tccr3a – Rainbow Electronics ATmega128L User Manual

Page 127: Atmega128(l)

Advertising
background image

127

ATmega128(L)

2467B–09/01

Figure 57. Timer/Counter Timing Diagram, with Prescaler (f

clk_I/O

/8)

16-bit Timer/Counter Register Description

Timer/Counter 1 Control
Register A – TCCR1A

Timer/Counter 3 Control
Register A – TCCR3A

Bit 7:6 - COMnA1:0: Compare Output Mode for Channel A

Bit 5:4 - COMnB1:0: Compare Output Mode for Channel B

Bit 3:2 - COMnC1:0: Compare Output Mode for Channel C

The COMnA1:0, COMnB1:0, and COMnC1:0 control the output compare pins (OCnA,
OCnB, and OCnC respectively) behavior. If one or both of the COMnA1:0 bits are writ-
ten to one, the OCnA output overrides the normal port functionality of the I/O pin it is
connected to. If one or both of the COMnB1:0 bits are written to one, the OCnB output
overrides the normal port functionality of the I/O pin it is connected to. If one or both of
the COMnC1:0 bits are written to one, the OCnC output overrides the normal port func-
tionality of the I/O pin it is connected to. However, note that the Data Direction Register
(DDR) bit corresponding to the OCnA, OCnB or OCnC pin must be set in order to
enable the output driver.

When the OCnA, OCnB or OCnC is connected to the pin, the function of the COMnx1:0
bits is dependent of the WGMn3:0 bits setting.

Table 58 shows the COMnx1:0 bit func-

tionality when the WGMn3:0 bits are set to a normal or a CTC mode (non-PWM).

TOVn

(FPWM)

and ICFn

(if used

as TOP)

OCRnx

(Update at TOP)

TCNTn

(CTC and FPWM)

TCNTn

(PC and PFC PWM)

TOP - 1

TOP

TOP - 1

TOP - 2

Old OCRnx Value

New OCRnx Value

TOP - 1

TOP

BOTTOM

BOTTOM + 1

clk

I/O

clk

Tn

(clk

I/O

/8)

Bit

7

6

5

4

3

2

1

0

COM1A1

COM1A0

COM1B1

COM1B0

COM1C1

COM1C0

WGM11

WGM10

TCCR1A

Read/Write

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Initial value

0

0

0

0

0

0

0

0

Bit

7

6

5

4

3

2

1

0

COM3A1

COM3A0

COM3B1

COM3B0

COM3C1

COM3C0

WGM31

WGM30

TCCR3A

Read/Write

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Initial value

0

0

0

0

0

0

0

0

Advertising