beautypg.com

33 tccr4c - timer/counter4 control register c, Atmega128rfa1 – Rainbow Electronics ATmega128RFA1 User Manual

Page 288

background image

288



8266A-MCU Wireless-12/09

ATmega128RFA1

Register Bits

Value

Description

0x4

CTC, TOP = OCRnA

0x5

Fast PWM, 8-bit

0x6

Fast PWM, 9-bit

0x7

Fast PWM, 10-bit

0x8

PWM, Phase and frequency correct, TOP =
ICRn

0x9

PWM, Phase and frequency correct, TOP =
OCRnA

0xA

PWM, Phase correct, TOP = ICRn

0xB

PWM, Phase correct, TOP = OCRnA

0xC

CTC, TOP = OCRnA

0xD

Reserved

0xE

Fast PWM, TOP = ICRn

0xF

Fast PWM, TOP = OCRnA

Bit 2:0 – CS42:40 - Clock Select

The three clock select bits select the clock source to be used by the Timer/Counter4
according to the following table. External pin modes cannot be used for the
Timer/Counter4.

Table 18-23 CS4 Register Bits

Register Bits

Value

Description

0x00

No clock source (Timer/Counter stopped)

0x01

clk_IO/1 (no prescaling)

0x02

clk_IO/8 (from prescaler)

0x03

clk_IO/64 (from prescaler)

0x04

clk_IO/256 (from prescaler)

0x05

clk_IO/1024 (from prescaler)

0x06

Reserved

CS42:40

0x07

Reserved

18.11.33 TCCR4C – Timer/Counter4 Control Register C

Bit

7

6

5

4

3

2

1

0

NA ($A2)

FOC4A

FOC4B

FOC4C

Res4

Res3

Res2

Res1

Res0

TCCR4C

Read/Write

RW

RW

RW

R

R

R

R

R

Initial Value

0

0

0

0

0

0

0

0

Bit 7 – FOC4A - Force Output Compare for Channel A

The FOC4A bit is only active when the WGM43:0 bits specify a non-PWM mode. When
writing a logical one to the FOC4A bit, an immediate compare match is forced. Due to
the limited functionality of the Timer/Counter4 the match has no direct impact on any
output pin. Note that the FOC4A bits are implemented as strobes. Therefore it is the
value present in the COM4A1:0 bits that determine the effect of the forced compare. A
FOC4A strobe will not generate any interrupt nor will it clear the timer in Clear Timer on