Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ATtiny104_Datasheet.pdf
Скачиваний:
0
Добавлен:
12.02.2026
Размер:
3.8 Mб
Скачать

17.14.5.Output Comparte Register A 0 Low and High byte

The OCR0AL and OCR0AH register pair represents the 16-bit value, OCR0A.The low byte [7:0] (suffix L) is accessible at the original offset. The high byte [15:8] (suffix H) can be accessed at offset + 0x01. For more details on reading and writing 16-bit registers, refer to Accessing 16-bit Registers.

Name:  OCR0AL and OCR0AH

Offset:  0x26

Reset:  0x00 Property: -

 

Bit

15

14

13

12

11

10

9

8

 

 

 

 

OCR0A[15:8]

 

 

 

Access

 

 

 

 

 

 

 

 

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Reset

0

0

0

0

0

0

0

0

Bit

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

OCR0A[7:0]

 

 

 

Access

 

 

 

 

 

 

 

 

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Reset

0

0

0

0

0

0

0

0

Bits 15:0 – OCR0A[15:0]: Output Compare 0 A

OCR0AH and OCR0AL are combined into OCR0A.

The Output Compare Registers contain a 16-bit value that is continuously compared with the counter value (TCNT0). A match can be used to generate an Output Compare interrupt, or to generate a waveform output on the OC0x pin.

Atmel ATtiny102 / ATtiny104 [DATASHEET] 154

Atmel-42505D-ATtiny102-ATtiny104_Datasheet_Complete-10/2016

17.14.6.Output Comparte Register B 0 Low and High byte

The OCR0BL and OCR0BH register pair represents the 16-bit value, OCR0B.The low byte [7:0] (suffix L) is accessible at the original offset. The high byte [15:8] (suffix H) can be accessed at offset + 0x01. For more details on reading and writing 16-bit registers, refer to Accessing 16-bit Registers.

Name:  OCR0BL and OCR0BH

Offset:  0x24

Reset:  0x00 Property: -

 

Bit

15

14

13

12

11

10

9

8

 

 

 

 

OCR0B[15:8]

 

 

 

Access

 

 

 

 

 

 

 

 

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Reset

0

0

0

0

0

0

0

0

Bit

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

OCR0B[7:0]

 

 

 

Access

 

 

 

 

 

 

 

 

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Reset

0

0

0

0

0

0

0

0

Bits 15:0 – OCR0B[15:0]: Output Compare 0 B

OCR0BH and OCR0BL are combined into OCR0B.

The Output Compare Registers contain a 16-bit value that is continuously compared with the counter value (TCNT0). A match can be used to generate an Output Compare interrupt, or to generate a waveform output on the OC0x pin.

Atmel ATtiny102 / ATtiny104 [DATASHEET] 155

Atmel-42505D-ATtiny102-ATtiny104_Datasheet_Complete-10/2016

17.14.7.Input Capture Register 0 Low and High byte

The ICR0L and ICR0H register pair represents the 16-bit value, ICR0.The low byte [7:0] (suffix L) is accessible at the original offset. The high byte [15:8] (suffix H) can be accessed at offset + 0x01. For more details on reading and writing 16-bit registers, refer to Accessing 16-bit Registers.

Name:  ICR0L and ICR0H

Offset:  0x22

Reset:  0x00 Property: -

 

Bit

15

14

13

12

11

10

9

8

 

 

 

 

 

ICR0[15:8]

 

 

 

Access

 

 

 

 

 

 

 

 

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Reset

0

0

0

0

0

0

0

0

Bit

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ICR0[7:0]

 

 

 

Access

 

 

 

 

 

 

 

 

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Reset

0

0

0

0

0

0

0

0

Bits 15:0 – ICR0[15:0]: Input Capture 0

ICR0H and ICR0L are combined into ICR0.

The Input Capture is updated with the counter (TCNT0) value each time an event occurs on the ICP0 pin (or optionally on the Analog Comparator output for Timer/Counter0). The Input Capture can be used for defining the counter TOP value.

Atmel ATtiny102 / ATtiny104 [DATASHEET] 156

Atmel-42505D-ATtiny102-ATtiny104_Datasheet_Complete-10/2016

17.14.8. Timer/Counter0 Interrupt Mask Register

Name:  TIMSK0 Offset:  0x2B Reset:  0x00 Property: -

 

Bit

7

6

5

4

3

2

1

0

 

 

 

ICIE0

 

 

OCIE0B

OCIE0A

TOIE0

Access

 

 

R/W

 

 

R/W

R/W

R/W

Reset

 

 

0

 

 

0

0

0

Bit 5 – ICIE0: Timer/Counter0, Input Capture Interrupt Enable

When this bit is written to one, and the I-flag in the Status Register is set (interrupts globally enabled), the Timer/Counter0 Input Capture interrupt is enabled. The corresponding Interrupt Vector is executed when the ICF0 Flag, located in TIFR0, is set.

Bit 2 – OCIE0B: Timer/Counter0, Output Compare B Match Interrupt Enable

When this bit is written to one, and the I-flag in the Status Register is set (interrupts globally enabled), the Timer/Counter 0 Output Compare B Match interrupt is enabled. The corresponding Interrupt Vector is executed when the OCF0B Flag, located in TIFR0, is set.

Bit 1 – OCIE0A: Timer/Counter0, Output Compare A Match Interrupt Enable

When this bit is written to one, and the I-flag in the Status Register is set (interrupts globally enabled), the Timer/Counter0 Output Compare A Match interrupt is enabled. The corresponding Interrupt Vector is executed when the OCF0A Flag, located in TIFR0, is set.

Bit 0 – TOIE0: Timer/Counter0, Overflow Interrupt Enable

When this bit is written to one, and the I-flag in the Status Register is set (interrupts globally enabled), the Timer/Counter0 Overflow interrupt is enabled. The corresponding Interrupt Vector is executed when the TOV0 Flag, located in TIFR0, is set.

Atmel ATtiny102 / ATtiny104 [DATASHEET] 157

Atmel-42505D-ATtiny102-ATtiny104_Datasheet_Complete-10/2016