atmega161-4pi ATMEL Corporation, atmega161-4pi Datasheet - Page 51

no-image

atmega161-4pi

Manufacturer Part Number
atmega161-4pi
Description
8-bit Microcontroller With 16k Bytes Of In-system Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet
1228D–AVR–02/07
• Bits 5, 4
The COM1B1 and COM1B0 control bits determine any output pin action following a
compare match in Timer/Counter1. Any output pin actions affect pin OC1B (Output
CompareB). This is an alternative function to an I/O port, and the corresponding direc-
tion control bit must be set (one) to control an output pin. The following control
configuration is given:
Table 14. Compare 1 Mode Select
Note:
In PWM mode, these bits have a different function. Refer to Table 18 for a detailed
description.
• Bit 3
Writing a logical “1” to this bit forces a change in the compare match output pin PD5
according to the values already set in COM1A1 and COM1A0. If the COM1A1 and
COM1A0 bits are written in the same cycle as FOC1A, the new settings will not take
effect until the next compare match or forced compare match occurs. The Force Output
Compare bit can be used to change the output pin without waiting for a compare match
in the timer. The automatic action programmed in COM1A1 and COM1A0 happens as if
a Compare Match had occurred, but no interrupt is generated and it will not clear the
timer even if CTC1 in TCCR1B is set. The FOC1A bit will always be read as zero. The
setting of the FOC1A bit has no effect in PWM mode.
• Bit 2
Writing a logical “1” to this bit forces a change in the compare match output pin PE2
according to the values already set in COM1B1 and COM1B0. If the COM1B1 and
COM1B0 bits are written in the same cycle as FOC1B, the new settings will not take
effect until the next compare match or forced compare match occurs. The Force Output
Compare bit can be used to change the output pin without waiting for a compare match
in the timer. The automatic action programmed in COM1B1 and COM1B0 happens as if
a Compare Match had occurred, but no interrupt is generated. The FOC1B bit will
always be read as zero. The setting of the FOC1B bit has no effect in PWM mode.
COM1X1
0
0
1
1
1. X = A or B
FOC1A: Force Output Compare1A
FOC1B: Force Output Compare1B
COM1B1, COM1B0: Compare Output Mode1B, Bits 1 and 0
COM1X0
0
1
0
1
Description
Timer/Counter1 disconnected from output pin OC1X
Toggle the OC1X output line.
Clear the OC1X output line (to zero).
Set the OC1X output line (to one).
(1)
ATmega161(L)
51

Related parts for atmega161-4pi