- •Features
- •Pin Configurations
- •Overview
- •Block Diagram
- •Pin Descriptions
- •Port A (PA2..PA0)
- •Port B (PB7..PB0)
- •Port D (PD6..PD0)
- •RESET
- •XTAL1
- •XTAL2
- •Disclaimer
- •AVR CPU Core
- •Introduction
- •Architectural Overview
- •Status Register
- •Stack Pointer
- •Interrupt Response Time
- •SRAM Data Memory
- •Data Memory Access Times
- •EEPROM Data Memory
- •EEPROM Read/Write Access
- •Atomic Byte Programming
- •Split Byte Programming
- •Erase
- •Write
- •I/O Memory
- •General Purpose I/O Registers
- •Clock Systems and their Distribution
- •Clock Sources
- •Default Clock Source
- •Crystal Oscillator
- •External Clock
- •Idle Mode
- •Power-down Mode
- •Standby Mode
- •Analog Comparator
- •Brown-out Detector
- •Internal Voltage Reference
- •Watchdog Timer
- •Port Pins
- •Resetting the AVR
- •Reset Sources
- •Power-on Reset
- •External Reset
- •Brown-out Detection
- •Watchdog Reset
- •Watchdog Timer
- •Interrupts
- •I/O-Ports
- •Introduction
- •Configuring the Pin
- •Toggling the Pin
- •Reading the Pin Value
- •Alternate Port Functions
- •Alternate Functions of Port A
- •Alternate Functions of Port B
- •Alternate Functions of Port D
- •Register Description for I/O-Ports
- •External Interrupts
- •8-bit Timer/Counter0 with PWM
- •Overview
- •Registers
- •Definitions
- •Counter Unit
- •Output Compare Unit
- •Force Output Compare
- •Modes of Operation
- •Normal Mode
- •Fast PWM Mode
- •Phase Correct PWM Mode
- •Internal Clock Source
- •Prescaler Reset
- •External Clock Source
- •16-bit Timer/Counter1
- •Overview
- •Registers
- •Definitions
- •Compatibility
- •Counter Unit
- •Input Capture Unit
- •Input Capture Trigger Source
- •Noise Canceler
- •Using the Input Capture Unit
- •Output Compare Units
- •Force Output Compare
- •Modes of Operation
- •Normal Mode
- •Fast PWM Mode
- •Phase Correct PWM Mode
- •USART
- •Overview
- •Clock Generation
- •External Clock
- •Synchronous Clock Operation
- •Frame Formats
- •Parity Bit Calculation
- •USART Initialization
- •Sending Frames with 5 to 8 Data Bit
- •Sending Frames with 9 Data Bit
- •Parity Generator
- •Disabling the Transmitter
- •Receiving Frames with 5 to 8 Data Bits
- •Receiving Frames with 9 Data Bits
- •Receiver Error Flags
- •Parity Checker
- •Disabling the Receiver
- •Flushing the Receive Buffer
- •Asynchronous Data Recovery
- •Using MPCM
- •Overview
- •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
- •debugWIRE On-chip Debug System
- •Features
- •Overview
- •Physical Interface
- •Software Break Points
- •Limitations of debugWIRE
- •debugWIRE Related Register in I/O Memory
- •Performing a Page Write
- •Reading the Fuse and Lock Bits from Software
- •Preventing Flash Corruption
- •Fuse Bits
- •Latching of Fuses
- •Signature Bytes
- •Calibration Byte
- •Page Size
- •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
- •Electrical Characteristics
- •Absolute Maximum Ratings*
- •DC Characteristics
- •External Clock Drive Waveforms
- •External Clock Drive
- •Active Supply Current
- •Idle Supply Current
- •Power-down Supply Current
- •Standby Supply Current
- •Pin Pull-up
- •Pin Driver Strength
- •Internal Oscillator Speed
- •Register Summary
- •Instruction Set Summary
- •Ordering Information
- •Packaging Information
- •Errata
- •ATtiny2313 Rev B
- •ATtiny2313 Rev A
- •Changes from Rev. 2514F-08/04 to Rev. 2514G-10/04
- •Changes from Rev. 2514F-08/04 to Rev. 2514G-10/04
- •Changes from Rev. 2514E-04/04 to Rev. 2514F-08/04
- •Changes from Rev. 2514D-03/04 to Rev. 2514E-04/04
- •Changes from Rev. 2514C-12/03 to Rev. 2514D-03/04
- •Changes from Rev. 2514B-09/03 to Rev. 2514C-12/03
- •Changes from Rev. 2514A-09/03 to Rev. 2514B-09/03
- •Table of Contents
ATtiny2313/V
Alternate Functions of Port D The Port D pins with alternate functions are shown in Table 28.
Table 28. Port D Pins Alternate Functions
Port Pin |
Alternate Function |
PD6 ICP
PD5 OC0B/T1
PD4 T0
PD3 INT1
PD2 INT0/XCK/CKOUT
PD1 TXD
PD0 RXD
The alternate pin configuration is as follows:
• ICP – Port D, Bit 6
ICP: Timer/Counter1 Input Capture Pin. The PD6 pin can act as an Input Capture pin for
Timer/Counter1
• OC1B/T1 – Port D, Bit 5
OC0B: Output Compare Match B output: The PD5 pin can serve as an external output for the Timer/Counter0 Output Compare B. The pin has to be configured as an output (DDB5 set (one)) to serve this function. The OC0B pin is also the output pin for the PWM mode timer function.
T1: Timer/Counter1 External Counter Clock input is enabled by setting (one) the bits
CS02 and CS01 in the Timer/Counter1 Control Register (TCCR1).
• T0 – Port D, Bit 4
T0: Timer/Counter0 External Counter Clock input is enabled by setting (one) the bits
CS02 and CS01 in the Timer/Counter0 Control Register (TCCR0).
• INT1 – Port D, Bit 3
INT0: External Interrupt Source 0. The PD3 pin can serve as an external interrupt source to the MCU.
• INT0/XCK/CKOUT – Port D, Bit 2
INT1: External Interrupt Source 1. The PD2 pin can serve as en external interrupt source to the MCU.
XCK: USART Transfer Clock used only by Synchronous Transfer mode.
CKOUT: System Clock Output
• TXD – Port D, Bit 1
TXD: UART Data Transmitter.
• RXD – Port D, Bit 0
RXD: UART Data Receiver.
55
2543H–AVR–02/05
Table 29 and Table 30 relates the alternate functions of Port D to the overriding signals shown in Figure 25 on page 50.
Table 29. Overriding Signals for Alternate Functions PD7..PD4
Signal |
|
|
|
Name |
PD6/ICP |
PD5/OC1B/T1 |
PD4/T0 |
|
|
|
|
PUOE |
0 |
0 |
0 |
|
|
|
|
PUOV |
0 |
0 |
0 |
|
|
|
|
DDOE |
0 |
0 |
0 |
|
|
|
|
DDOV |
0 |
0 |
0 |
|
|
|
|
PVOE |
0 |
OC1B_PVOE |
0 |
|
|
|
|
PVOV |
0 |
OC1B_PVOV |
0 |
|
|
|
|
PTOE |
0 |
0 |
0 |
|
|
|
|
DIEOE |
ICP ENABLE |
T1 ENABLE |
T0 ENABLE |
|
|
|
|
DIEOV |
1 |
1 |
1 |
|
|
|
|
DI |
ICP INPUT |
T1 INPUT |
T0 INPUT |
|
|
|
|
AIO |
– |
– |
AIN1 |
|
|
|
|
Table 30. Overriding Signals for Alternate Functions in PD3..PD0
Signal |
|
PD2/INT0/XCK/ |
|
|
|
|
Name |
PD3/INT1 |
CKOUT |
PD1/TXD |
PD0/RXD |
||
|
|
|
|
|
||
PUOE |
0 |
0 |
TXD_OE |
RXD_OE |
||
|
|
|
|
|
|
|
PUOV |
0 |
0 |
0 |
PORTD0 • |
|
|
PUD |
||||||
|
|
|
|
|
||
DDOE |
0 |
0 |
TXD_OE |
RXD_EN |
||
|
|
|
|
|
|
|
DDOV |
0 |
0 |
1 |
0 |
|
|
|
|
|
|
|
|
|
PVOE |
0 |
XCKO_PVOE |
TXD_OE |
0 |
|
|
|
|
|
|
|
|
|
PVOV |
0 |
XCKO_PVOV |
TXD_PVOV |
0 |
|
|
|
|
|
|
|
|
|
PTOE |
0 |
0 |
0 |
0 |
|
|
|
|
|
|
|
|
|
DIEOE |
INT1 ENABLE |
INT0 ENABLE/ |
0 |
0 |
|
|
|
|
XCK INPUT |
|
|
|
|
|
|
ENABLE |
|
|
|
|
|
|
|
|
|
|
|
DIEOV |
1 |
1 |
0 |
0 |
|
|
|
|
|
|
|
||
DI |
INT1 INPUT |
INT0 INPUT/ |
– |
RXD INPUT |
||
|
|
XCK INPUT |
|
|
|
|
|
|
|
|
|
||
AIO |
– |
– |
– |
– |
||
|
|
|
|
|
|
|
56 ATtiny2313/V
2543H–AVR–02/05