- •Features
- •Disclaimer
- •Overview
- •Block Diagram
- •Pin Descriptions
- •Port B (PB7..PB0)
- •Port C (PC7..PC0)
- •Port D (PD7..PD0)
- •D-/SDATA
- •UGND
- •UVCC
- •UCAP
- •RESET/PC1/dW
- •XTAL1
- •XTAL2/PC0
- •AVR CPU Core
- •Introduction
- •Status Register
- •Stack Pointer
- •TABLE 1.
- •TABLE 2.
- •AVR AT90USB82/162 Memories
- •I/O Memory
- •Clock Systems and their Distribution
- •Clock Switch
- •Exemple of use
- •Swith from external clock to RC clock
- •Switch from RC clock to external clock
- •Clock Sources
- •Default Clock Source
- •External Clock
- •Internal PLL for USB interface
- •Idle Mode
- •Power-down Mode
- •Power-save Mode
- •Standby Mode
- •Analog Comparator
- •Brown-out Detector
- •Watchdog Timer
- •Port Pins
- •Resetting the AVR
- •Reset Sources
- •Power-on Reset
- •External Reset
- •Watchdog Reset
- •USB Reset
- •Watchdog Timer
- •TABLE 2.
- •TABLE 2.
- •Interrupts
- •TABLE 2.
- •Introduction
- •Configuring the Pin
- •Toggling the Pin
- •Reading the Pin Value
- •TABLE 3.
- •Unconnected Pins
- •Alternate Port Functions
- •Register Description for I/O-Ports
- •Timer/Counter0 and Timer/Counter1 Prescalers
- •Internal Clock Source
- •Prescaler Reset
- •External Clock Source
- •8-bit Timer/Counter0 with PWM
- •Overview
- •Registers
- •Definitions
- •Counter Unit
- •Normal Mode
- •Fast PWM Mode
- •8-bit Timer/Counter Register Description
- •Overview
- •Registers
- •Definitions
- •Counter Unit
- •Input Capture Unit
- •Noise Canceler
- •Force Output Compare
- •Normal Mode
- •Fast PWM Mode
- •16-bit Timer/Counter Register Description
- •TABLE 2.
- •TABLE 2.
- •Slave Mode
- •Master Mode
- •Data Modes
- •USART
- •Overview
- •Clock Generation
- •External Clock
- •Frame Formats
- •Parity Bit Calculation
- •TABLE 2.
- •TABLE 3.
- •TABLE 4.
- •Parity Generator
- •TABLE 3.
- •TABLE 2.
- •Receiver Error Flags
- •Parity Checker
- •Disabling the Receiver
- •TABLE 2.
- •Using MPCMn
- •Receiver Flow Control
- •Overview
- •Clock Generation
- •Frame Formats
- •TABLE 2.
- •Data Transfer
- •TABLE 3.
- •USB controller
- •Features
- •Block Diagram
- •Typical Application Implementation
- •Device mode
- •Bus Powered device
- •Introduction
- •Interrupts
- •Power modes
- •Idle mode
- •Power down
- •Freeze clock
- •Memory access capability
- •Memory management
- •PAD suspend
- •D+/D- Read/write
- •Registers description
- •USB general registers
- •USB Software Operating modes
- •USB Device Operating modes
- •Introduction
- •Power-on and reset
- •Endpoint reset
- •USB reset
- •Endpoint selection
- •Endpoint activation
- •Address Setup
- •Detach
- •Remote Wake-up
- •STALL request
- •Special consideration for Control Endpoints
- •STALL handshake and Retry mechanism
- •CONTROL endpoint management
- •Control Write
- •Control Read
- •Overview
- •“Manual” mode
- •Detailed description
- •IN endpoint management
- •“Manual” mode
- •Detailed description
- •Abort
- •Isochronous mode
- •Underflow
- •CRC Error
- •Overflow
- •Interrupts
- •Registers
- •USB device general registers
- •USB device endpoint registers
- •Characteristics
- •Analog Comparator
- •Application Section
- •Boot Reset Fuse
- •Simple Assembly Code Example for a Boot Loader
- •debugWIRE On-chip Debug System
- •Features
- •Overview
- •Physical Interface
- •Software Break Points
- •Limitations of debugWIRE
- •debugWIRE Related Register in I/O Memory
- •Fuse Bits
- •Latching of Fuses
- •Signature Bytes
- •Calibration Byte
- •Signal Names
- •Chip Erase
- •Reading the Flash
- •Reading the EEPROM
- •Electrical Characteristics
- •Absolute Maximum Ratings*
- •DC Characteristics
- •External Clock Drive Waveforms
- •External Clock Drive
- •Maximum speed vs. VCC
- •Supply Current of IO modules
- •Example 1
- •Example 2
- •Example 3
- •Instruction Set Summary
- •Packaging Information
- •TQFP32
Registers
USB device general registers
Figure 87. USB Device Controller Endpoint Interrupt System |
|
||
|
|
Endpoint 4 |
|
|
|
Endpoint 3 |
|
|
|
Endpoint 2 |
|
|
|
Endpoint 1 |
|
|
|
Endpoint 0 |
|
OVERFI |
|
|
|
UESTAX.6 |
|
|
|
UNDERFI |
FLERRE |
|
|
UESTAX.5 |
|
|
|
UEIENX.7 |
|
|
|
|
|
|
|
NAKINI |
|
|
|
UEINTX.6 |
NAKINE |
|
|
|
|
|
|
|
UEIENX.6 |
|
|
NAKOUTI |
|
|
|
UEINTX.4 |
TXSTPE |
|
|
|
|
Endpoint Interrupt |
|
|
UEIENX.4 |
|
|
|
|
|
|
RXSTPI |
|
EPINT |
|
UEINTX.3 |
|
|
|
TXOUTE |
UEINT.X |
|
|
|
|
||
|
|
|
|
|
UEIENX.3 |
|
|
RXOUTI |
|
|
|
UEINTX.2 |
RXOUTE |
|
|
|
|
|
|
|
UEIENX.2 |
|
|
STALLEDI |
|
|
|
UEINTX.1 |
STALLEDE |
|
|
|
|
|
|
|
UEIENX.1 |
|
|
TXINI |
|
|
|
UEINTX.0 |
TXINE |
|
|
|
|
|
|
|
UEIENX.0 |
|
|
Processing interrupts are generated when: |
|
|
• Ready to accept IN data |
(EPINTx, TXINI=1) |
|
• |
Received OUT data |
(EPINTx, RXOUTI=1) |
• |
Received SETUP |
(EPINTx, RXSTPI=1) |
Exception Interrupts are generated when: |
|
|
• |
Stalled packet |
(EPINTx, STALLEDI=1) |
• CRC error on OUT in isochronous mode |
(EPINTx, STALLEDI=1) |
|
• |
Overflow |
(EPINTx, OVERFI=1) |
• Underflow in isochronous mode |
(EPINTx, UNDERFI=1) |
|
• |
NAK IN sent |
(EPINTx, NAKINI=1) |
• |
NAK OUT sent |
(EPINTx, NAKOUTI=1) |
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|
- |
- |
- |
- |
- |
RSTCPU |
RMWKUP |
DETACH |
UDCON |
Read/W |
R |
R |
R |
R |
R |
R/W |
R/W |
R/W |
|
rite |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
|
Value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
• Bit 2- RSTCPU - USB Reset CPU Bit
202
7707A–AVR–01/07
Set this bit to one by firmware in order to reset the CPU at the next USB reset (without disabling the USB controller). The value of this bit will not be affected by the reset of the CPU generated by a End Of Reset (remains set). This bit is reset when the USB controller is disabled.
Set this bit to zero by firmware otherwise.
• Bit 1- RMWKUP - Remote Wake-up Bit
Set to send an “upstream-resume” to the host for a remote wake-up. The SUSPI bit must be set to allow the remote wake up to be sent.
Cleared by hardware. Clearing by software has no effect.
See Section , page 195 for more details.
• Bit 0 - DETACH - Detach Bit
Set to physically detach de device.
Clear to reconnect the device. See Section , page 194 for more details.
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|
- |
UPRSMI |
EORSMI |
WAKEUPI |
EORSTI |
SOFI |
- |
SUSPI |
UDINT |
|
|
|
|
|
|
|
|
|
|
Read/W |
R |
R/W |
R/W |
R/W |
R/W |
R/W |
R |
R/W |
|
rite |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
Value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
• 7 - Reserved
The value read from these bits is always 0. Do not set these bits.
• 6 - UPRSMI - Upstream Resume Interrupt Flag
Set by hardware when the USB controller is sending a resume signal called “Upstream Resume”. This triggers an USB interrupt if UPRSME is set.
Shall be cleared by software (USB clocks must be enabled before). Setting by software has no effect.
• 5 - EORSMI - End Of Resume Interrupt Flag
Set by hardware when the USB controller detects a good “End Of Resume” signal initiated by the host. This triggers an USB interrupt if EORSME is set.
Shall be cleared by software. Setting by software has no effect.
• 4 - WAKEUPI - Wake-up CPU Interrupt Flag
Set by hardware when the USB controller is re-activated by a filtered non-idle signal from the lines (not by an upstream resume). This triggers an interrupt if WAKEUPE is set.
Shall be cleared by software (USB clock inputs must be enabled before). Setting by software has no effect.
See Section , page 194 for more details.
• 3 - EORSTI - End Of Reset Interrupt Flag
Set by hardware when an “End Of Reset” has been detected by the USB controller. This triggers an USB interrupt if EORSTE is set.
Shall be cleared by software. Setting by software has no effect.
• 2 - SOFI - Start Of Frame Interrupt Flag
Set by hardware when an USB “Start Of Frame” PID (SOF) has been detected (every 1 ms). This triggers an USB interrupt if SOFE is set..
203
7707A–AVR–01/07
•1 - Reserved
•0 - SUSPI - Suspend Interrupt Flag
Set by hardware when an USB “Suspend” ‘idle bus for 3 frame periods: a J state for 3 ms) is detected. This triggers an USB interrupt if SUSPE is set.
Shall be cleared by software. Setting by software has no effect.
See Section , page 194 for more details.
The interrupt flags bits are set even if their corresponding ‘Enable’ bits is not set.
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|
- |
UPRSME |
EORSME |
WAKE- |
EORSTE |
SOFE |
- |
SUSPE |
UDIEN |
|
|
|
|
UPE |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Read/W |
R |
R/W |
R/W |
R/W |
R/W |
R/W |
R |
R/W |
|
rite |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
Value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
• 7 - Reserved
The value read from these bits is always 0. Do not set these bits.
• 6 - UPRSME - Upstream Resume Interrupt Enable Bit
Set to enable the UPRSMI interrupt.
Clear to disable the UPRSMI interrupt.
• 5 - EORSME - End Of Resume Interrupt Enable Bit
Set to enable the EORSMI interrupt.
Clear to disable the EORSMI interrupt.
• 4 - WAKEUPE - Wake-up CPU Interrupt Enable Bit
Set to enable the WAKEUPI interrupt.
Clear to disable the WAKEUPI interrupt.
• 3 - EORSTE - End Of Reset Interrupt Enable Bit
Set to enable the EORSTI interrupt. This bit is set after a reset.
Clear to disable the EORSTI interrupt.
• 2 - SOFE - Start Of Frame Interrupt Enable Bit
Set to enable the SOFI interrupt.
Clear to disable the SOFI interrupt.
•1 - Reserved
•0 - SUSPE - Suspend Interrupt Enable Bit
Set to enable the SUSPI interrupt.
Clear to disable the SUSPI interrupt.
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|
ADDEN |
UADD6:0 |
|
|
|
|
|
|
UDADDR |
|
|
|
|
|
|
|
|
|
|
Read/W |
R/W |
R/W |
R |
R |
R |
R |
R |
R |
|
rite |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
Value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204
7707A–AVR–01/07
• 7 - ADDEN - Address Enable Bit
Set to activate the UADD (USB address).
Cleared by hardware. Clearing by software has no effect.
See Section , page 194 for more details.
• 6-0 - UADD6:0 - USB Address Bits
Set to configure the device address.
Shall not be cleared.
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|
- |
- |
- |
- |
- |
FNUM10:8 |
|
|
UD- |
|
|
|
|
|
|
|
|
|
FNUMH |
|
|
|
|
|
|
|
|
|
|
Read/W |
R |
R |
R |
R |
R |
R |
R |
R |
|
rite |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
Value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
• 7-3 - Reserved
The value read from these bits is always 0. Do not set these bits.
• 2-0 - FNUM10:8 - Frame Number Upper Flag
Set by hardware. These bits are the 3 MSB of the 11-bits Frame Number information. They are provided in the last received SOF packet. FNUM is updated if a corrupted SOF is received.
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|
FNUM7:0 |
|
|
|
|
|
|
|
UDFNUML |
|
|
|
|
|
|
|
|
|
|
Read/W |
R |
R |
R |
R |
R |
R |
R |
R |
|
rite |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
Value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
• 7-0 Frame Number Lower Flag
Set by hardware. These bits are the 8 LSB of the 11-bits Frame Number information.
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|
- |
- |
- |
FNCERR |
- |
- |
- |
- |
UDMFN |
|
|
|
|
|
|
|
|
|
|
Read/W |
R |
R |
R |
R/W |
R |
R |
R |
R |
|
rite |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
Value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
• 7-5 - Reserved
The value read from these bits is always 0. Do not set these bits.
• 4 - FNCERR -Frame Number CRC Error Flag
Set by hardware when a corrupted Frame Number in start of frame packet is received.
This bit and the SOFI interrupt are updated at the same time.
• 3-0 - Reserved
The value read from these bits is always 0. Do not set these bits.
205
7707A–AVR–01/07
