
- •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

Figure 82. Pad behaviour
|
|
USBE=1 |
|
|
& DETACH=0 |
||
Idle mode |
& |
suspend |
|
|
|
|
USBE=0 |
Active mode |
|
| DETACH=1 |
||
|
||
| suspend |
|
The SUSPI flag indicated that a suspend state has been detected on the USB bus. This flag automatically put the USB pad in Idle. The detection of a non-idle event sets the WAKEUPI flag and wakes-up the USB pad.
SUSPI
Suspend detected = USB pad power down |
Clear Suspend by software |
|
WAKEUPI
Clear Resume by software
Resume = USB pad wake-up
PAD status
Active |
Power Down |
|
Active |
|
|
|
|
Moreover, the pad can also be put in the “idle” mode if the DETACH bit is set. It come back in the active mode when the DETACH bit is cleared.
D+/D- Read/write The level of D+ and D- can be read and written using the UPOE register. The USB controller has to be enabled to write a value. For read operation, the USB controller can be enabled or disabled.
Registers description
USB general registers
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|
USBE |
- |
FRZLK |
- |
- |
- |
- |
- |
USBCON |
|
|
|
|
|
|
|
|
|
|
Read/Writ |
R/W |
R |
R/W |
R |
R |
R |
R |
R |
|
e |
|
|
|
|
|
|
|
|
|
188
7707A–AVR–01/07

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|||||||||
|
Initial Val- |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
|
ue |
|
|
|
|
|
|
|
|
• 7 – USBE: USB macro Enable Bit
Set to enable the USB controller. Clear to disable and reset the USB controller, to disable the
USB transceiver and to disable the USB controller clock inputs.
• 6 – Reserved
The value read from this bit is always 0. Do not set this bit.
• 5 – FRZCLK: Freeze USB Clock Bit
Set to disable the clock inputs (the ”Resume Detection” is still active). This reduces the power consumption. Clear to enable the clock inputs.
• 4-0 – Reserved
The value read from these bits is always 0. Do not set these bits.
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|
DPACC |
- |
- |
- |
- |
- |
- |
- |
UDPAD- |
|
|
|
|
|
|
|
|
|
DH |
|
|
|
|
|
|
|
|
|
|
Read/Wr |
R/W |
R |
R |
R |
R |
R |
R |
R |
|
ite |
|
|
|
|
|
|
|
|
|
Initial |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
Value |
|
|
|
|
|
|
|
|
|
• 7 – DPACC: DPRAM Direct Access Bit
Set this bit to directly read the content the Dual-Port RAM (DPR) data through the UEDATX or
UPDATX registers. See Section , page 185 for more details.
Clear this bit for normal operation and access the DPR through the endpoint FIFO.
• 6-0 – Reserved
The value read from these bits is always 0. Do not set these bits.
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|
DPADD7:0 |
|
|
|
|
|
|
|
UDPAD- |
|
|
|
|
|
|
|
|
|
DL |
Read/Wr |
R/W |
R/W |
R/W |
R/W |
R/W |
R/W |
R/W |
R/W |
|
ite |
|
|
|
|
|
|
|
|
|
Initial |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
Value |
|
|
|
|
|
|
|
|
|
• 7-0 – DPADD7:0: DPRAM Address Low Bit
DAPDD7:0 is the least significant part of DPADD.
189
7707A–AVR–01/07

USB/PS2 Software Output Enable register
– UPOE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bit |
7 |
6 |
5 |
|
4 |
|
3 |
2 |
1 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
UPWE1 |
UPWE0 |
UPDRV |
|
UPDRV |
SCKI |
DATAI |
DPI |
DMI |
UPOE |
||
|
|
|
1 |
|
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
Read/Write |
R/W |
R/W |
R/W |
R/W |
R |
R |
R |
R |
|
|||
Initial Value |
0 |
0 |
0 |
|
0 |
|
0 |
0 |
0 |
0 |
|
• Bit 7:6 – UPOE[1:0]: USB/PS2 Output enable
Set these bits with the following configuration to enable or disable the USB/PS2 software drive. UPOE1 - UPOE0
0 - 0 : Direct drive is disabled.
0 - 1 : Reserved
1 - 0 : Direct drive of DP/DM with USB levels (UPDRV[1:0] values) 1 - 1 : Direct drive of DP/DM with PS/2 levels (UPDRV[1:0] values)
• Bit 5:4 – UPDRV[1:0] : USB/PS2 direct drive values
Write in UPDRV1 the value to write on D+/SCK following the UPOE[1:0] configuration.
Write in UPDRV0 the value to write on D-/DATA following the UPOE[1:0] configuration.
• Bit 3 – SCKI : SCK Input value
This bit is set to one by hardware if a ‘1’ is read on SCK (PS/2 pad).
This bit is set to zero by hardware if a ‘0’ is read on SCK (PS/2 pad).
• Bit 2 – DATAI : DATA Input value
This bit is set to one by hardware if a ‘1’ is read on DATA (PS/2 pad).
This bit is set to zero by hardware if a ‘0’ is read on DATA (PS/2 pad).
• Bit 1 – DPI : D+ Input value
This bit is set to one by hardware if a ‘1’ is read on D+ (USB pad).
This bit is set to zero by hardware if a ‘0’ is read on D+ (USB pad).
• Bit 0 – DMI : D- Input value
This bit is set to one by hardware if a ‘1’ is read on D- (USB pad).
This bit is set to zero by hardware if a ‘0’ is read on D- (USB pad).
190
7707A–AVR–01/07