- •Introduction
- •Feature
- •Table of Contents
- •1. Description
- •2. Configuration Summary
- •3. Ordering Information
- •4. Block Diagram
- •5. Pin Configurations
- •5.1. Pin Descriptions
- •5.1.3. Port A (PA[7:0])
- •5.1.4. Port B (PB[3:0])
- •5.1.5. RESET
- •6. I/O Multiplexing
- •7. General Information
- •7.1. Resources
- •7.2. Data Retention
- •7.3. About Code Examples
- •8. AVR CPU Core
- •8.1. Overview
- •8.2. Features
- •8.3. Block Diagram
- •8.4. ALU – Arithmetic Logic Unit
- •8.5. Status Register
- •8.6. General Purpose Register File
- •8.8. Stack Pointer
- •8.10. Instruction Execution Timing
- •8.11. Reset and Interrupt Handling
- •8.11.1. Interrupt Response Time
- •8.12. Register Description
- •8.12.1. Configuration Change Protection Register
- •8.12.2. Stack Pointer Register Low and High byte
- •8.12.3. Status Register
- •9. AVR Memories
- •9.1. Overview
- •9.2. Features
- •9.4. SRAM Data Memory
- •9.4.1. Data Memory Access Times
- •9.5. I/O Memory
- •10. Clock System
- •10.1. Overview
- •10.2. Clock Distribution
- •10.3. Clock Subsystems
- •10.4. Clock Sources
- •10.4.1. Calibrated Internal 8MHz Oscillator
- •10.4.2. External Clock
- •10.4.3. Internal 128kHz Oscillator
- •10.4.4. Switching Clock Source
- •10.4.5. Default Clock Source
- •10.5. System Clock Prescaler
- •10.5.1. Switching Prescaler Setting
- •10.6. Starting
- •10.6.1. Starting from Reset
- •10.6.2. Starting from Power-Down Mode
- •10.6.3. Starting from Idle / ADC Noise Reduction / Standby Mode
- •10.7. Register Description
- •10.7.1. Clock Main Settings Register
- •10.7.2. Oscillator Calibration Register
- •10.7.3. Clock Prescaler Register
- •11. Power Management and Sleep Modes
- •11.1. Overview
- •11.2. Features
- •11.3. Sleep Modes
- •11.3.1. Idle Mode
- •11.3.2. ADC Noise Reduction Mode
- •11.3.4. Standby Mode
- •11.4. Power Reduction Register
- •11.5. Minimizing Power Consumption
- •11.5.1. Analog Comparator
- •11.5.2. Analog to Digital Converter
- •11.5.3. Internal Voltage Reference
- •11.5.4. Watchdog Timer
- •11.5.5. Port Pins
- •11.6. Register Description
- •11.6.1. Sleep Mode Control Register
- •11.6.2. Power Reduction Register
- •12. SCRST - System Control and Reset
- •12.1. Overview
- •12.2. Features
- •12.3. Resetting the AVR
- •12.4. Reset Sources
- •12.4.3. External Reset
- •12.4.4. Watchdog System Reset
- •12.5. Watchdog Timer
- •12.5.1. Overview
- •12.5.2. Procedure for Changing the Watchdog Timer Configuration
- •12.5.2.1. Safety Level 1
- •12.5.2.2. Safety Level 2
- •12.5.3. Code Examples
- •12.6. Register Description
- •12.6.1. Watchdog Timer Control Register
- •12.6.2. VCC Level Monitoring Control and Status register
- •12.6.3. Reset Flag Register
- •13. Interrupts
- •13.1. Overview
- •13.2. Interrupt Vectors
- •13.3. External Interrupts
- •13.3.1. Low Level Interrupt
- •13.3.2. Pin Change Interrupt Timing
- •13.4. Register Description
- •13.4.1. External Interrupt Control Register A
- •13.4.2. External Interrupt Mask Register
- •13.4.3. External Interrupt Flag Register
- •13.4.4. Pin Change Interrupt Control Register
- •13.4.5. Pin Change Interrupt Flag Register
- •13.4.6. Pin Change Mask Register 0
- •13.4.7. Pin Change Mask Register 1
- •14. I/O-Ports
- •14.1. Overview
- •14.2. Features
- •14.3. I/O Pin Equivalent Schematic
- •14.4. Ports as General Digital I/O
- •14.4.1. Configuring the Pin
- •14.4.2. Toggling the Pin
- •14.4.4. Reading the Pin Value
- •14.4.5. Digital Input Enable and Sleep Modes
- •14.4.6. Unconnected Pins
- •14.4.7. Program Example
- •14.4.8. Alternate Port Functions
- •14.4.8.1. Alternate Functions of Port A
- •14.4.8.2. Alternate Functions of Port B
- •14.5. Register Description
- •14.5.1. Port A Input Pins Address
- •14.5.2. Port A Data Direction Register
- •14.5.3. Port A Data Register
- •14.5.5. Port B Input Pins Address
- •14.5.6. Port B Data Direction Register
- •14.5.7. Port B Data Register
- •14.5.9. Port Control Register
- •15. USART - Universal Synchronous Asynchronous Receiver Transceiver
- •15.1. Overview
- •15.2. Features
- •15.3. Block Diagram
- •15.4. Clock Generation
- •15.4.1. Internal Clock Generation – The Baud Rate Generator
- •15.4.2. Double Speed Operation (U2X0)
- •15.4.3. External Clock
- •15.4.4. Synchronous Clock Operation
- •15.5. Frame Formats
- •15.5.1. Parity Bit Calculation
- •15.6. USART Initialization
- •15.7. Data Transmission – The USART Transmitter
- •15.7.1. Sending Frames with 5 to 8 Data Bits
- •15.7.2. Sending Frames with 9 Data Bit
- •15.7.3. Transmitter Flags and Interrupts
- •15.7.4. Parity Generator
- •15.7.5. Disabling the Transmitter
- •15.8. Data Reception – The USART Receiver
- •15.8.1. Receiving Frames with 5 to 8 Data Bits
- •15.8.2. Receiving Frames with 9 Data Bits
- •15.8.3. Receive Compete Flag and Interrupt
- •15.8.4. Receiver Error Flags
- •15.8.5. Parity Checker
- •15.8.6. Disabling the Receiver
- •15.8.7. Flushing the Receive Buffer
- •15.9. Asynchronous Data Reception
- •15.9.1. Asynchronous Clock Recovery
- •15.9.2. Asynchronous Data Recovery
- •15.9.3. Asynchronous Operational Range
- •15.9.4. Start Frame Detection
- •15.10. Multi-Processor Communication Mode
- •15.10.1. Using MPCMn
- •15.11. Examples of Baud Rate Setting
- •15.12. Register Description
- •15.12.1. USART I/O Data Register 0
- •15.12.2. USART Control and Status Register 0 A
- •15.12.3. USART Control and Status Register 0 B
- •15.12.4. USART Control and Status Register 0 C
- •15.12.5. USART Control and Status Register 0 D
- •15.12.6. USART Baud Rate 0 Register Low and High byte
- •16. USARTSPI - USART in SPI Mode
- •16.1. Overview
- •16.2. Features
- •16.3. Clock Generation
- •16.4. SPI Data Modes and Timing
- •16.5. Frame Formats
- •16.5.1. USART MSPIM Initialization
- •16.6. Data Transfer
- •16.6.1. Transmitter and Receiver Flags and Interrupts
- •16.6.2. Disabling the Transmitter or Receiver
- •16.7. AVR USART MSPIM vs. AVR SPI
- •16.8. Register Description
- •17.1. Overview
- •17.2. Features
- •17.3. Block Diagram
- •17.4. Definitions
- •17.5. Registers
- •17.6.1. Reusing the Temporary High Byte Register
- •17.7. Timer/Counter Clock Sources
- •17.7.1. Internal Clock Source - Prescaler
- •17.7.2. Prescaler Reset
- •17.7.3. External Clock Source
- •17.8. Counter Unit
- •17.9. Input Capture Unit
- •17.9.1. Input Capture Trigger Source
- •17.9.2. Noise Canceler
- •17.9.3. Using the Input Capture Unit
- •17.10. Output Compare Units
- •17.10.1. Force Output Compare
- •17.10.2. Compare Match Blocking by TCNT0 Write
- •17.10.3. Using the Output Compare Unit
- •17.11. Compare Match Output Unit
- •17.11.1. Compare Output Mode and Waveform Generation
- •17.12. Modes of Operation
- •17.12.1. Normal Mode
- •17.12.2. Clear Timer on Compare Match (CTC) Mode
- •17.12.3. Fast PWM Mode
- •17.12.4. Phase Correct PWM Mode
- •17.12.5. Phase and Frequency Correct PWM Mode
- •17.13. Timer/Counter Timing Diagrams
- •17.14. Register Description
- •17.14.1. Timer/Counter0 Control Register A
- •17.14.2. Timer/Counter0 Control Register B
- •17.14.3. Timer/Counter0 Control Register C
- •17.14.4. Timer/Counter 0 Low and High byte
- •17.14.5. Output Comparte Register A 0 Low and High byte
- •17.14.6. Output Comparte Register B 0 Low and High byte
- •17.14.7. Input Capture Register 0 Low and High byte
- •17.14.8. Timer/Counter0 Interrupt Mask Register
- •17.14.9. Timer/Counter0 Interrupt Flag Register
- •17.14.10. General Timer/Counter Control Register
- •18. AC - Analog Comparator
- •18.1. Overview
- •18.2. Features
- •18.3. Block Diagram
- •18.4. Register Description
- •18.4.1. Analog Comparator Control and Status Register
- •18.4.2. Analog Comparator Control and Status Register 0
- •18.4.3. Digital Input Disable Register 0
- •19. ADC - Analog to Digital Converter
- •19.1. Overview
- •19.2. Features
- •19.3. Block Diagram
- •19.4. Operation
- •19.5. Starting a Conversion
- •19.6. Prescaling and Conversion Timing
- •19.7. Changing Channel or Reference Selection
- •19.8. ADC Input Channels
- •19.9. ADC Voltage Reference
- •19.10. ADC Noise Canceler
- •19.11. Analog Input Circuitry
- •19.12. Analog Noise Canceling Techniques
- •19.13. ADC Accuracy Definitions
- •19.14. ADC Conversion Result
- •19.15. Register Description
- •19.15.1. ADC Multiplexer Selection Register
- •19.15.2. ADC Control and Status Register A
- •19.15.3. ADC Control and Status Register B
- •19.15.4. ADC Data Register Low and High Byte (ADLAR=0)
- •19.15.5. ADC Data Register Low and High Byte (ADLAR=1)
- •19.15.6. Digital Input Disable Register 0
- •20.1. Overview
- •20.2. Features
- •20.3.2. Flash Memory
- •20.3.3. Configuration Section
- •20.3.3.1. Latching of Configuration Bits
- •20.3.4. Signature Section
- •20.3.4.1. Signature Row Summary
- •20.3.4.1.1. Device ID n
- •20.3.4.1.2. Serial Number Byte n
- •20.3.5. Calibration Section
- •20.4. Accessing the NVM
- •20.4.1. Addressing the Flash
- •20.4.2. Reading the Flash
- •20.4.3. Programming the Flash
- •20.4.3.1. Chip Erase
- •20.4.3.2. Erasing the Code Section
- •20.4.3.3. Writing a Code Word
- •20.4.3.4. Erasing the Configuration Section
- •20.4.3.5. Writing a Configuration Word
- •20.4.4. Reading NVM Lock Bits
- •20.4.5. Writing NVM Lock Bits
- •20.5. Self programming
- •20.6. External Programming
- •20.6.1. Entering External Programming Mode
- •20.6.2. Exiting External Programming Mode
- •20.7. Register Description
- •21.1. Overview
- •21.2. Features
- •21.3. Block Diagram
- •21.4. Physical Layer of Tiny Programming Interface
- •21.4.1. Enabling
- •21.4.2. Disabling
- •21.4.3. Frame Format
- •21.4.4. Parity Bit Calculation
- •21.4.5. Supported Characters
- •21.4.6. Operation
- •21.4.7. Serial Data Reception
- •21.4.8. Serial Data Transmission
- •21.4.9. Collision Detection Exception
- •21.4.10. Direction Change
- •21.4.11. Access Layer of Tiny Programming Interface
- •21.4.11.1. Message format
- •21.4.11.2. Exception Handling and Synchronisation
- •21.5. Instruction Set
- •21.5.1. SLD - Serial LoaD from data space using indirect addressing
- •21.5.2. SST - Serial STore to data space using indirect addressing
- •21.5.3. SSTPR - Serial STore to Pointer Register
- •21.5.4. SIN - Serial IN from i/o space using direct addressing
- •21.5.5. SOUT - Serial OUT to i/o space using direct addressing
- •21.5.6. SLDCS - Serial LoaD data from Control and Status space using direct addressing
- •21.5.7. SSTCS - Serial STore data to Control and Status space using direct addressing
- •21.5.8. SKEY - Serial KEY signaling
- •21.7. Control and Status Space Register Descriptions
- •21.7.1. Tiny Programming Interface Identification Register
- •21.7.2. Tiny Programming Interface Physical Layer Control Register
- •21.7.3. Tiny Programming Interface Status Register
- •22. Electrical Characteristics
- •22.1. Absolute Maximum Ratings*
- •22.2. DC Characteristics
- •22.3. Speed
- •22.4. Clock Characteristics
- •22.4.1. Accuracy of Calibrated Internal Oscillator
- •22.4.2. External Clock Drive
- •22.5. System and Reset Characteristics
- •22.6. Analog Comparator Characteristics
- •22.7. ADC Characteristics
- •22.8. Serial Programming Characteristics
- •23. Typical Characteristics
- •23.1. Active Supply Current
- •23.2. Idle Supply Current
- •23.3. Supply Current of I/O Modules
- •23.5. Pin Driver Strength
- •23.6. Pin Threshold and Hysteresis
- •23.7. Analog Comparator Offset
- •23.9. Internal Oscillator Speed
- •23.10. VLM Thresholds
- •23.11. Current Consumption of Peripheral Units
- •23.12. Current Consumption in Reset and Reset Pulsewidth
- •24. Register Summary
- •24.1. Note
- •25. Instruction Set Summary
- •26. Packaging Information
- •27. Errata
- •27.1. ATtiny102
- •27.2. ATtiny104
- •28. Datasheet Revision History
Assembly Code Example
...
;Define pull-ups and set outputs high
;Define directions for port pins
ldi r16,(1<<PUEB2) ldi r17,(1<<PB0)
ldi r18,(1<<DDB1)|(1<<DDB0) out PUEB,r16
out PORTB,r17 out DDRB,r18
;Insert nop for synchronization nop
;Read port pins
in r16,PINB
...
14.4.8.Alternate Port Functions
Most port pins have alternate functions in addition to being general digital I/Os. The following figure shows how the port pin control signals from the simplified in the figure of Ports as General Digital I/O can be overridden by alternate functions. The overriding signals may not be present in all port pins, but the figure serves as a generic description applicable to all port pins in the AVR microcontroller family.
Atmel ATtiny102 / ATtiny104 [DATASHEET] |
70 |
Atmel-42505D-ATtiny102-ATtiny104_Datasheet_Complete-10/2016
Figure 14-6. Alternate Port Functions
|
|
PUOExn |
|
|
|
REx |
|
|
1 |
PUOVxn |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 |
|
|
|
Q |
D |
|
|
|
|
|
|
PUExn |
|
|
|
|
DDOExn |
|
|
Q CLR |
|
|
|
|
|
|
RESET |
WEx |
||
|
|
DDOVxn |
|
|
|||
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 |
|
|
|
Q |
D |
|
|
|
|
|
|
DDxn |
|
|
|
|
|
|
|
Q CLR |
|
|
|
|
PVOExn |
|
|
RESET |
WDx |
|
|
|
|
|
|
|||
|
|
PVOVxn |
|
|
|
|
RDx |
|
|
|
|
|
|
|
|
Pxn |
1 |
|
|
|
|
1 |
|
0 |
|
|
|
Q D |
0 |
|
|
|
|
|
|
|
|||
|
|
|
|
|
PORTxn |
|
PTOExn |
|
|
DIEOExn |
|
|
Q CLR |
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
DIEOVxn |
|
|
RESET |
|
WPx |
|
1 |
|
|
|
WRx |
||
|
|
|
|
|
RRx |
||
|
0 |
SLEEP |
|
|
|
|
|
|
|
|
|
|
|
||
|
|
SYNCHRONIZER |
|
|
|
RPx |
|
|
|
|
|
|
|
|
|
|
|
D SET Q |
D |
|
Q |
|
|
|
|
|
PINxn |
|
|
||
|
|
L CLR Q |
CLR |
Q |
|
|
|
|
|
|
|
|
|
|
clk I/O |
|
|
|
|
|
|
|
DIxn |
|
|
|
|
|
|
|
AIOxn |
PUOExn: |
Pxn PULL-UPOVERRIDE ENABLE |
|
WEx: |
WRITE PUEx |
|
||
|
REx: |
|
READ PUEx |
|
|||
PUOVxn: |
Pxn PULL-UPOVERRIDE VALUE |
|
WDx: |
WRITE DDRx |
|
||
DDOExn: |
Pxn DATA DIRECTION OVERRIDE ENABLE |
|
RDx: |
|
READ DDRx |
|
|
DDOVxn: |
Pxn DATA DIRECTION OVERRIDE VALUE |
|
RRx: |
|
READ PORTx REGISTER |
||
PVOExn: |
Pxn PORTVALUE OVERRIDE ENABLE |
|
WRx: |
WRITE PORTx |
|
||
PVOVxn: |
Pxn PORTVALUE OVERRIDE VALUE |
|
RPx: |
|
READ PORTx PIN |
||
DIEOExn: |
Pxn DIGITAL INPUT-ENABLE OVERRIDE ENABLE |
WPx: |
WRITE PINx |
|
|||
DIEOVxn: |
Pxn DIGITAL INPUT-ENABLE OVERRIDE VALUE |
clk |
|
: |
I/O CLOCK |
|
|
SLEEP: |
SLEEPCONTROL |
|
|
I/O |
DIGITAL INPUTPIN n ON PORTx |
||
|
DIxn: |
||||||
PTOExn: |
Pxn, PORTTOGGLE OVERRIDE ENABLE |
|
AIOxn: |
ANALOGINPUT/OUTPUTPIN n ON PORTx |
|||
DATA BUS
Note: 1. WEx, WRx, WPx, WDx, REx, RRx, RPx, and RDx are common to all pins within the same port. clkI/O and SLEEP are common to all ports. All other signals are unique for each pin.
The following table summarizes the function of the overriding signals. The pin and port indexes from previous figure are not shown in the succeeding tables. The overriding signals are generated internally in the modules having the alternate function.
Atmel ATtiny102 / ATtiny104 [DATASHEET] |
71 |
Atmel-42505D-ATtiny102-ATtiny104_Datasheet_Complete-10/2016
Table 14-2. Generic Description of Overriding Signals for Alternate Functions
Signal Name |
Full Name |
Description |
|
PUOE |
Pull-up Override |
If this signal is set, the pull-up enable is controlled by the PUOV signal. |
|
|
Enable |
If this signal is cleared, the pull-up is enabled when PUExn = 0b1. |
|
|
|
|
|
PUOV |
Pull-up Override Value |
If PUOE is set, the pull-up is enabled/disabled when PUOV is set/ |
|
|
|
cleared, regardless of the setting of the PUExn Register bit. |
|
|
|
|
|
DDOE |
Data Direction |
If this signal is set, the Output Driver Enable is controlled by the DDOV |
|
|
Override Enable |
signal. If this signal is cleared, the Output driver is enabled by the DDxn |
|
|
|
Register bit. |
|
|
|
|
|
DDOV |
Data Direction |
If DDOE is set, the Output Driver is enabled/disabled when DDOV is |
|
|
Override Value |
set/cleared, regardless of the setting of the DDxn Register bit. |
|
|
|
|
|
PVOE |
Port Value Override |
If this signal is set and the Output Driver is enabled, the port value is |
|
|
Enable |
controlled by the PVOV signal. If PVOE is cleared, and the Output |
|
|
|
Driver is enabled, the port Value is controlled by the PORTxn Register |
|
|
|
bit. |
|
|
|
|
|
PVOV |
Port Value Override |
If PVOE is set, the port value is set to PVOV, regardless of the setting of |
|
|
Value |
the PORTxn Register bit. |
|
|
|
|
|
PTOE |
Port Toggle Override |
If PTOE is set, the PORTxn Register bit is inverted. |
|
|
Enable |
|
|
|
|
|
|
DIEOE |
Digital Input Enable |
If this bit is set, the Digital Input Enable is controlled by the DIEOV |
|
|
Override Enable |
signal. If this signal is cleared, the Digital Input Enable is determined by |
|
|
|
MCU state (Normal mode, sleep mode). |
|
|
|
|
|
DIEOV |
Digital Input Enable |
If DIEOE is set, the Digital Input is enabled/disabled when DIEOV is set/ |
|
|
Override Value |
cleared, regardless of the MCU state (Normal mode, sleep mode). |
|
|
|
|
|
DI |
Digital Input |
This is the Digital Input to alternate functions. In the figure, the signal is |
|
|
|
connected to the output of the Schmitt Trigger but before the |
|
|
|
synchronizer. Unless the Digital Input is used as a clock source, the |
|
|
|
module with the alternate function will use its own synchronizer. |
|
|
|
|
|
AIO |
Analog Input/Output |
This is the Analog Input/output to/from alternate functions. The signal is |
|
|
|
connected directly to the pad, and can be used bi-directionally. |
|
|
|
|
The following subsections shortly describe the alternate functions for each port, and relate the overriding signals to the alternate function. Refer to the alternate function description for further details.
14.4.8.1.Alternate Functions of Port A
The Port A pins with alternate functions are shown in the table below:
Atmel ATtiny102 / ATtiny104 [DATASHEET] |
72 |
Atmel-42505D-ATtiny102-ATtiny104_Datasheet_Complete-10/2016
Table 14-3. Port A Pins Alternate Functions
Port Pin |
|
Alternate Functions |
|
|
|||
PA[0] |
|
ADC0: ADC Input Channel 0 |
|
|
|
||
|
|
AIN0: Analog Comparator, Positive Input |
|
|
|
T0: Timer/Counter0 Clock Source (default location) |
|
|
|
PCINT0: Pin Change Interrupt source 0 |
|
|
|
CLKI: External Clock |
|
|
|
TPICLK: Serial Programming Clock |
|
|
|
|
|
PA[1] |
|
ADC1: ADC Input Channel 1 |
|
|
|
||
|
|
AIN1: Analog Comparator, Negative Input |
|
|
|
OC0B: Timer/Counter0 Compare Match B Output (default |
|
|
|
location) |
|
|
|
PCINT1: Pin Change Interrupt source 1 |
|
|
|
TPIDATA: Serial Programming Data |
|
|
|
|
|
PA[2] |
|
PCINT2: Pin Change Interrupt source 2 |
|
|
|
||
|
|
|
Reset Pin |
|
|
RESET: |
|
|
|
|
|
PA[3] |
|
OC0A: Timer/Counter0 Compare Match A Output (alternative |
|
|
|
||
|
|
location) |
|
|
|
PCINT3: Pin Change Interrupt source 3 |
|
|
|
|
|
PA[4] |
|
ICP0: Timer/Counter0 Input Capture Input (alternative |
|
|
|
||
|
|
location) |
|
|
|
PCINT4: Pin Change Interrupt source 4 |
|
|
|
|
|
PA[5] |
|
ADC2: ADC Input Channel 2 |
|
|
|
||
|
|
OC0B: Timer/Counter0 Compare Match B Output (alternative |
|
|
|
location) |
|
|
|
PCINT5: Pin Change Interrupt source 5 |
|
|
|
|
|
PA[6] |
|
ADC3: ADC Input Channel 3 |
|
|
|
||
|
|
PCINT6: Pin Change Interrupt source 6 |
|
|
|
|
|
PA[7] |
|
PCINT7: Pin Change Interrupt source 7 |
|
|
|
||
|
|
|
|
The alternate pin configuration is as follows:
Atmel ATtiny102 / ATtiny104 [DATASHEET] |
73 |
Atmel-42505D-ATtiny102-ATtiny104_Datasheet_Complete-10/2016
•PA[0] – ADC0/AIN0/T0/PCINT0/CLKI/TPICLK
–ADC0: Analog to Digital Converter, Channel 0.
–AIN0: Analog Comparator Positive Input. Configure the port pin as input with the internal pullup switched off to avoid the digital port function from interfering with the function of the Analog Comparator.
–T0: Timer/Counter0 counter source.
–PCINT0: Pin Change Interrupt source 0. The PA[0] pin can serve as an external interrupt source for pin change interrupt 0.
–CLKI: External Clock.
–TPICLK: Serial Programming Clock.
•PA[1] – ADC1/AIN1/OC0B/PCINT1/TPIDATA
–ADC1: Analog to Digital Converter, Channel 1.
–AIN1: Analog Comparator Negative Input. Configure the port pin as input with the internal pull-up switched off to avoid the digital port function from interfering with the function of the Analog Comparator.
–OC0B: Output Compare Match B Output. The PA[1] pin can serve as an external output for the Timer/Counter0 Compare Match B. The PA[1] pin has to be configured as an output (DDB1 set (one)) to serve this function. The OC0B pin is also the output pin for the PWM mode timer function.
–PCINT1: Pin Change Interrupt source 1. The PA[1] pin can serve as an external interrupt source for pin change interrupt 0.
–TPIDATA: Serial Programming Data.
•PA[2] – PCINT2/RESET
–PCINT2: Pin Change Interrupt source 2. The PA[2] pin can serve as an external interrupt source for pin change interrupt 0.
–RESET: Reset Pin.
•PA[3] – OC0A/PCINT3
–OC0A: Output Compare Match A Output. The PA[3] pin can serve as an external output for the Timer/Counter0 Compare Match A. The pin has to be configured as an output (DDB0 set (one)) to serve this function. This is also the output pin for the PWM mode timer function.
–PCINT3: Pin Change Interrupt source 3. The PA[3] pin can serve as an external interrupt source for pin change interrupt 0.
•PA[4] - ICP0/PCINT4
–ICP0: Input Capture Pin. The PA[4] pin can act as an Input Capture pin for Timer/Counter0.
–PCINT4: Pin Change Interrupt source 4. The PA4 pin can serve as an external interrupt source for pin change interrupt 0.
•PA[5] - ADC2/OC0B/PCINT5
–ADC2: Analog to Digital Converter, Channel 2.
–OC0B: Output Compare Match B Output: The PA1 pin can serve as an external output for the Timer/Counter0 Compare Match B. The PA[5] pin has to be configured as an output (DDB1 set (one)) to serve this function. The OC0B pin is also the output pin for the PWM mode timer function.
–PCINT5: Pin Change Interrupt source 5. The PA5 pin can serve as an external interrupt source for pin change interrupt 0.
•PA[6] - ADC3/PCINT6
–ADC3: Analog to Digital Converter, Channel 3.
Atmel ATtiny102 / ATtiny104 [DATASHEET] |
74 |
Atmel-42505D-ATtiny102-ATtiny104_Datasheet_Complete-10/2016
–PCINT6: Pin Change Interrupt source 6. The PA6 pin can serve as an external interrupt source for pin change interrupt 0.
•PA[7] - PCINT7
–PCINT7: Pin Change Interrupt source 7. The PA7 pin can serve as an external interrupt source for pin change interrupt 0.
The following tables relate the alternate functions of Port B to the overriding signals shown in the figure of Alternate Port Functions.
Table 14-4. Overriding Signals for Alternate Functions in PA[7:6]
Signal |
PA7/PCINT7 |
PA6/ADC3/PCINT6 |
||
Name |
|
|
|
|
PUOE |
0 |
0 |
|
|
|
|
|
|
|
PUOV |
0 |
0 |
|
|
|
|
|
|
|
DDOE |
0 |
0 |
|
|
|
|
|
|
|
DDOV |
0 |
0 |
|
|
|
|
|
|
|
PVOE |
0 |
0 |
|
|
|
|
|
|
|
PVOV |
0 |
0 |
|
|
|
|
|
|
|
PTOE |
0 |
0 |
|
|
|
|
|
|
|
DIEOE |
(PCINT7 • PCIE0) |
(PCINT6 • PCIE0) + ADC3D |
||
|
|
|
|
|
DIEOV |
PCINT7 • PCIE0 |
PCINT6 • PCIE0 |
||
|
|
|
|
|
DI |
PCINT7 Input |
PCINT6 input |
||
|
|
|
|
|
AIO |
- |
ADC3 |
||
|
|
|
|
|
Table 14-5. Overriding Signals for Alternate Functions in PA[5:4] |
||||
|
|
|
|
|
Signal |
PA5/ADC2/OC0B/PCINT5 |
|
PA4/ICP0/PCINT4 |
|
Name |
|
|
|
|
PUOE |
0 |
|
0 |
|
|
|
|
|
|
PUOV |
0 |
|
0 |
|
|
|
|
|
|
DDOE |
0 |
|
0 |
|
|
|
|
|
|
DDOV |
0 |
|
0 |
|
|
|
|
|
|
PVOE |
(OC0B Enable • REMAP) |
|
0 |
|
|
|
|
|
|
PVOV |
(OC0B • REMAP) |
|
0 |
|
|
|
|
|
|
PTOE |
0 |
|
0 |
|
|
|
|
|
|
DIEOE |
(PCINT5 • PCIE0) + ADC2D |
|
(PCINT4 • PCIE0) |
|
|
|
|
|
|
DIEOV |
PCINT5 • PCIE0 |
|
(PCINT4 • PCIE0) |
|
|
|
|
|
|
DI |
PCINT5 Input |
|
ICP0/PCINT4 Input |
|
|
|
|
|
|
AIO |
ADC2 |
|
- |
|
|
|
|
|
|
Atmel ATtiny102 / ATtiny104 [DATASHEET] |
75 |
Atmel-42505D-ATtiny102-ATtiny104_Datasheet_Complete-10/2016
