DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

ATTINY15L データシートの表示(PDF) - Atmel Corporation

部品番号
コンポーネント説明
メーカー
ATTINY15L
Atmel
Atmel Corporation Atmel
ATTINY15L Datasheet PDF : 85 Pages
First Prev 21 22 23 24 25 26 27 28 29 30 Next Last
ATtiny15L
The Timer/Counter1 Control
Register – TCCR1
The Timer/Counter1 contains two Output Compare Registers, OCR1A and OCR1B, as
the data source to be compared with the Timer/Counter1 contents. In Normal mode the
Output Compare function is operational with OCR1A only, and the Output Compare
function includes optional clearing of the counter on compare match, and action on the
Output Compare pin (PB1) (OC1A).
In PWM mode OCR1A provides the data value against which the Timer/Counter value is
compared. Upon compare match the PWM output is generated. In PWM mode The
Timer/Counter counts up to the value specified in Output Compare Register OCR1B
and starts again from $00. This feature allows limiting the counter “full” value to a speci-
fied value, lower than $FF. However, if OCR1n is $00, the output will remain constant
and not toggle at all. If OCR1n equals $01, the pulse width will be two ticks, increasing
linearly if OCR1n is larger than $01. Together with the many prescaler options, flexible
PWM frequency selection is provided. Table 14 lists clock selection and OCR1B values
to obtain PWM frequencies from 10 kHz to 150 kHz at 10 kHz steps.
In applications with variable PWM, halving the prescaler setting and doubling the duty
cycle can be used to fine-tune the PWM. Alternatively inverted PWM can be used.
Bit
$30
Read/Write
Initial Value
7
CTC1
R/W
0
6
PWM1
R/W
0
5
COM1A1
R/W
0
4
COM1A0
R/W
0
3
CS13
R/W
0
2
CS12
R/W
0
1
CS11
R/W
0
0
CS10
R/W
0
TCCR1
• Bit 7 – CTC1: Clear Timer/Counter on Compare Match
When the CTC1 control bit is set (one), Timer/Counter1 is reset to $00 in the CPU clock
cycle after a compare match with OCR1A Register value. If the control bit is cleared,
Timer/Counter1 continues counting and is unaffected by a compare match.
• Bit 6 – PWM1: Pulse Width Modulator Enable
When set (one), this bit enables PWM mode for Timer/Counter1. This mode is described
on page 31.
• Bits 5,4 – COM1A1, COM1A0: Compare Output Mode, Bits 1 and 0
The COM1A1 and COM1A0 control bits determine any output pin action following a
compare match A in Timer/Counter1. Output pin actions affect pin PB1(OC1A). Since
this is an alternative function to an I/O port, the corresponding direction control bit must
be set (one) to control an output pin. The control configuration is shown in Table 10.
Table 10. Compare Mode Select(1)
COM1A1
COM1A0 Description
0
0
Timer/Counter disconnected from output pin OC1A
0
1
Toggle the OC1A output line.
1
0
Clear the OC1A output line (to zero).
1
1
Set the OC1A output line (to one).
Note:
1. In PWM mode, these bits have a different function. Refer to Table 12 for a detailed
description.When changing the COM1A1/COM1A0 bits, the Output Compare 1A
Interrupt must be disabled by clearing its Interrupt Enable bit in the TIMSK Register.
Otherwise an interrupt can occur when the bits are changed.
29
1187H–AVR–09/07

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]