Timer 2 compare mode register (t2cm), Timer 2 compare register 1 (t2co1), Timer 2 compare register 2 (t2co2) byte write – Rainbow Electronics ATAR862-3 User Manual

Page 53: Atar862-3

Advertising
background image

53

ATAR862-3

4556B–4BMCU–02/03

Timer 2 Compare Mode
Register (T2CM)

Address: "7"hex - Subaddress: "3"hex

Timer 2 COmpare Register 1
(T2CO1)

Address: "7"hex - Subaddress: "4"hex

In prescaler mode the clock is bypassed if the compare register T2CO1 contains 0.

Timer 2 COmpare Register 2
(T2CO2) Byte Write

Address: "7"hex - Subaddress: "5"hex

Bit 3

Bit 2

Bit 1

Bit 0

T2OTM

T2CTM

T2RM

T2IM

Reset value: 0000b

T2OTM

T

imer

2

O

verflow

T

oggle

M

ask bit

T2OTM = 0, disable overflow toggle
T2OTM = 1, enable overflow toggle, a counter overflow (OVF2) toggles output

flip-flop (TOG2). If the T2OTM-bit is set, only a counter overflow can
generate an interrupt except on the Timer 2 output mode 7.

T2CTM

T

imer

2

C

ompare

T

oggle

M

ask bit

T2CTM = 0, disable compare toggle
T2CTM = 1, enable compare toggle, a match of the counter with the compare

register toggles output flip-flop (TOG2). In Timer 2 output mode 7 and
when the T2CTM-bit is set, only a match of the counter with the
compare register can generate an interrupt.

T2RM

T

imer

2

R

eset

M

ask bit

T2RM = 0, disable counter reset
T2RM = 1, enable counter reset, a match of the counter with the compare register

resets the counter

T2IM

T

imer

2

I

nterrupt

M

ask bit

T2IM = 0, disable Timer 2 interrupt
T2IM = 1, enable Timer 2 interrupt

Timer 2 Output Mode

T2OTM

T2CTM

Timer 2 Interrupt Source

1, 2, 3, 4, 5 and 6

0

x

Compare match (CM2)

1, 2, 3, 4, 5 and 6

1

x

Overflow (OVF2)

7

x

1

Compare match (CM2)

Write cycle

Bit 3

Bit 2

Bit 1

Bit 0

Reset value: 1111b

First write cycle

Bit 3

Bit 2

Bit 1

Bit 0

Reset value: 1111b

Second write cycle

Bit 7

Bit 6

Bit 5

Bit 4

Reset value: 1111b

Advertising