
- •Features
- •Pin Configuration
- •Disclaimer
- •Description
- •Pin Descriptions
- •AVCC
- •Port A (PA7..PA0)
- •Port B (PB7..PB0)
- •XTAL1
- •XTAL2
- •SRAM Data Memory
- •I/O Direct
- •Data Direct
- •Data Indirect with Displacement
- •Data Indirect
- •EEPROM Data Memory
- •I/O Memory
- •Status Register – SREG
- •Stack Pointer – SP
- •Reset Sources
- •Power-on Reset
- •External Reset
- •Brown-out Detection
- •Watchdog Reset
- •Clock Systems and their Distribution
- •CPU Clock – clkCPU
- •I/O Clock – clkI/O
- •Flash Clock – clkFLASH
- •ADC Clock – clkADC
- •Internal PLL for Fast Peripheral Clock Generation – clkPCK
- •Clock Sources
- •Crystal Oscillator
- •External RC Oscillator
- •External Clock
- •Interrupt Handling
- •Interrupt Response Time
- •External Interrupt
- •Pin Change Interrupt
- •Idle Mode
- •ADC Noise Reduction Mode
- •Power-down Mode
- •Standby Mode
- •Analog to Digital Converter
- •Analog Comparator
- •Brown-out Detector
- •Internal Voltage Reference
- •Watchdog Timer
- •Port Pins
- •Timer/Counters
- •Timer/Counter0 Prescaler
- •Timer/Counter1 Prescaler
- •8-bit Timer/Counter0
- •Timer/Counter0 – TCNT0
- •8-bit Timer/Counter1
- •Timer/Counter1 – TCNT1
- •Timer/Counter1 in PWM Mode
- •Watchdog Timer
- •Overview
- •Register Descriptions
- •USI Data Register – USIDR
- •USI Status Register – USISR
- •USI Control Register – USICR
- •Functional Descriptions
- •Three-wire Mode
- •SPI Slave Operation Example
- •Two-wire Mode
- •Start Condition Detector
- •Alternative USI Usage
- •4-bit Counter
- •12-bit Timer/Counter
- •Software Interrupt
- •Analog Comparator
- •Analog to Digital Converter
- •Features
- •Operation
- •ADC Conversion Result
- •ADLAR = 0
- •ADLAR = 1
- •I/O Ports
- •Introduction
- •Configuring the Pin
- •Reading the Pin Value
- •Alternate Port Functions
- •Alternate Functions of Port A
- •Alternate Functions Of Port B
- •Register Description for I/O Ports
- •Port A Data Register – PORTA
- •Port B Data Register – PORTB
- •Fuse Bits
- •Latching of Fuses
- •Signature Bytes
- •Calibration Byte
- •Signal Names
- •Parallel Programming
- •Enter Programming Mode
- •Chip Erase
- •Programming the Flash
- •Programming the EEPROM
- •Reading the Flash
- •Reading the EEPROM
- •Programming the Lock Bits
- •Reading the Signature Bytes
- •Reading the Calibration Byte
- •Serial Downloading
- •Data Polling Flash
- •Data Polling EEPROM
- •Electrical Characteristics
- •Absolute Maximum Ratings*
- •External Clock Drive Waveforms
- •External Clock Drive
- •ADC Characteristics – Preliminary Data
- •ATtiny26/L Register Summary
- •Ordering Information(1)
- •Packaging Information
- •Data Sheet Change Log for ATtiny26
- •Changes from Rev. 1477A-03/02 to Rev. 1477B-04/02
- •Table of Contents

Analog Comparator The Analog Comparator compares the input values on the positive pin PA6 (AIN0) and negative pin PA7 (AIN1). When the voltage on the positive pin PA6 (AIN0) is higher than the voltage on the negative pin PA7 (AIN1), the Analog Comparator Output, ACO is set (one). The comparator’s output can trigger a separate interrupt, exclusive to the Analog Comparator. The user can select Interrupt triggering on comparator output rise, fall or toggle. A block diagram of the comparator and its surrounding logic is shown in the Figure 45.
Figure 45. Analog Comparator Block Diagram
ACBG
PA6
(AIN0)
MUX
PA7 |
|
(AIN1) |
MUX |
|
ACME
ADC
MULTIPLEXER OUTPUT
Analog Comparator Control
and Status Register – ACSR
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
$08 ($28) |
ACD |
ACBG |
ACO |
ACI |
ACIE |
ACME |
ACIS1 |
ACIS0 |
ACSR |
|
|
|
|
|
|
|
|
|
|
Read/Write |
R/W |
R/W |
R |
R/W |
R/W |
R/W |
R/W |
R/W |
|
Initial Value |
0 |
0 |
X |
0 |
0 |
0 |
0 |
0 |
|
• Bit 7 – ACD: Analog Comparator Disable
When this bit is set(one), the power to the Analog Comparator is switched off. This bit can be set at any time to turn off the Analog Comparator. When changing the ACD bit, the Analog Comparator Interrupt must be disabled by clearing the ACIE bit in ACSR. Otherwise an interrupt can occur when the bit is changed.
• Bit 6 – ACBG: Analog Comparator Bandgap Select
When this bit is set (one), it selects internal bandgap reference voltage (1.18V) as the positive comparator input.
• Bit 5 – ACO: Analog Comparator Output
ACO is directly connected to the comparator output.
74 ATtiny26(L)
1477B–AVR–04/02

ATtiny26(L)
• Bit 4 – ACI: Analog Comparator Interrupt Flag
This bit is set (one) when a comparator output event triggers the interrupt mode defined by ACI1 and ACI0. The Analog Comparator Interrupt routine is executed if the ACIE bit is set (one) and the I-bit in SREG is set (one). ACI is cleared by hardware when executing the corresponding interrupt handling vector. Alternatively, ACI is cleared by writing a logic one to the flag.
• Bit 3 – ACIE: Analog Comparator Interrupt Enable
When the ACIE bit is set (one) and the I-bit in the Status Register is set (one), the Analog Comparator interrupt is activated. When cleared (zero), the interrupt is disabled.
• Bit 2 – ACME: Analog Comparator Multiplexer Enable
When the ACME bit is set (one) and the ADC is switched off (ADEN in ADCSR is zero), MUX3...0 in ADMUX select the input pin to replace the negative input to the Analog Comparator, as shown in Table 33 on page 76. If ACME is cleared (zero) or ADEN is set (one), PA7(AIN1) is applied to the negative input to the Analog Comparator.
• Bits 1, 0 – ACIS1, ACIS0: Analog Comparator Interrupt Mode Select
These bits determine which comparator events that trigger the Analog Comparator interrupt. The different settings are shown in Table 32.
Table 32. |
ACIS1/ACIS0 Settings(1) |
||
ACIS1 |
|
ACIS0 |
Interrupt Mode |
|
|
|
|
0 |
|
0 |
Comparator Interrupt on Output Toggle |
|
|
|
|
0 |
|
1 |
Reserved |
|
|
|
|
1 |
|
0 |
Comparator Interrupt on Falling Output Edge |
|
|
|
|
1 |
|
1 |
Comparator Interrupt on Rising Output Edge |
|
|
|
|
Note: 1. When changing the ACIS1/ACIS0 bits, the Analog Comparator Interrupt must be disabled by clearing its Interrupt Enable bit in the ACSR Register. Otherwise an interrupt can occur when the bits are changed.
75
1477B–AVR–04/02

Table 33. Analog Comparator Input Selection(1)
ACME |
ADEN |
MUX3...0(3) |
Analog Comparator Negative Input |
0 |
X |
XXXX |
AIN1 |
|
|
|
|
1 |
1 |
XXXX |
AIN1 |
|
|
|
|
1 |
0 |
0000 |
ADC0 |
|
|
|
|
1 |
0 |
0001 |
ADC1 |
|
|
|
|
1 |
0 |
0010 |
ADC2 |
|
|
|
|
1 |
0 |
0011 |
ADC3 |
|
|
|
|
1 |
0 |
0100 |
ADC4 |
|
|
|
|
1 |
0 |
0101 |
ADC5 |
|
|
|
|
1 |
0 |
0110 |
ADC6(2) |
1 |
0 |
0111 |
ADC7(2) |
1 |
0 |
1000 |
ADC8 |
|
|
|
|
1 |
0 |
1001 |
ADC9 |
|
|
|
|
1 |
0 |
1010 |
ADC10 |
|
|
|
|
1 |
0 |
1011 |
Undefined |
|
|
|
|
1 |
0 |
1100 |
Undefined |
|
|
|
|
1 |
0 |
1101 |
Undefined |
|
|
|
|
1 |
0 |
1110 |
Undefined |
|
|
|
|
1 |
0 |
1111 |
Undefined |
|
|
|
|
Notes: 1. MUX4 does not affect Analog Comparator input selection.
2.Pin change interrupt on PA6 and PA7 is disabled if the Analog Comparator is enabled. This happens regardless of whether AIN1 or AIN0 has been replaced as inputs to the Analog Comparator.
3.The MUX3...0 selections go into effect after one clock cycle delay.
76 ATtiny26(L)
1477B–AVR–04/02