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

Ordering
Information
Part Number |
Temp. Range |
Flash Memory Size |
Package |
Product Marking |
|
|
|
|
|
90USB82-16MU |
Industrial Green |
8K |
QFN32 |
90USB82-16MU |
|
|
|
|
|
90USB162-16MU |
Industrial Green |
16K |
QFN32 |
90USB162-16MU |
|
|
|
|
|
90USB162-16AU |
Industrial Green |
16K |
TQFP32 |
90USB162-16AU |
|
|
|
|
|
Packaging Information
Package Type
QFN32 Exposed Pad Dim. 3.6 x 3.6mm
268
7707A–AVR–01/07

QFN32
* *
*
*
*
*
* See package information
269
7707A–AVR–01/07

TQFP32
270
7707A–AVR–01/07

Table of Contents
Features................................................................................................ |
1 |
Pin Configurations............................................................................... |
2 |
Disclaimer ............................................................................................................. |
2 |
Block Diagram ...................................................................................................... |
3 |
Pin Descriptions.................................................................................................... |
5 |
About Code Examples......................................................................... |
6 |
AVR CPU Core ..................................................................................... |
7 |
Introduction ........................................................................................................... |
7 |
Architectural Overview.......................................................................................... |
7 |
ALU – Arithmetic Logic Unit.................................................................................. |
8 |
Status Register ..................................................................................................... |
8 |
General Purpose Register File ............................................................................. |
9 |
Stack Pointer ...................................................................................................... |
11 |
Instruction Execution Timing............................................................................... |
11 |
Reset and Interrupt Handling.............................................................................. |
12 |
AVR AT90USB82/162 Memories....................................................... |
15 |
In-System Reprogrammable Flash Program Memory ........................................ |
15 |
SRAM Data Memory........................................................................................... |
16 |
EEPROM Data Memory...................................................................................... |
18 |
I/O Memory ......................................................................................................... |
23 |
System Clock and Clock Options .................................................... |
25 |
Clock Systems and their Distribution .................................................................. |
25 |
Clock Switch ....................................................................................................... |
26 |
Clock Sources..................................................................................................... |
29 |
Low Power Crystal Oscillator.............................................................................. |
30 |
Calibrated Internal RC Oscillator ........................................................................ |
31 |
External Clock..................................................................................................... |
33 |
Clock Output Buffer ............................................................................................ |
33 |
System Clock Prescaler...................................................................................... |
33 |
PLL ..................................................................................................................... |
36 |
Power Distribution............................................................................. |
38 |
Power Management and Sleep Modes............................................. |
40 |
Idle Mode ............................................................................................................ |
41 |
Power-down Mode.............................................................................................. |
41 |
Power-save Mode............................................................................................... |
41 |
1

Standby Mode..................................................................................................... |
41 |
Extended Standby Mode .................................................................................... |
41 |
Power Reduction Register .................................................................................. |
43 |
Minimizing Power Consumption ......................................................................... |
44 |
System Control and Reset................................................................ |
46 |
Internal Voltage Reference ................................................................................. |
51 |
Watchdog Timer ................................................................................................. |
52 |
Interrupts............................................................................................ |
61 |
Interrupt Vectors in AT90USB82/162 ................................................................. |
61 |
I/O-Ports.............................................................................................. |
64 |
Introduction ......................................................................................................... |
64 |
Ports as General Digital I/O ................................................................................ |
65 |
Alternate Port Functions ..................................................................................... |
69 |
External Interrupts............................................................................. |
81 |
Timer/Counter0 and Timer/Counter1 Prescalers ............................ |
85 |
8-bit Timer/Counter0 with PWM........................................................ |
87 |
Overview............................................................................................................. |
87 |
Timer/Counter Clock Sources............................................................................. |
88 |
Counter Unit........................................................................................................ |
88 |
Output Compare Unit.......................................................................................... |
89 |
Compare Match Output Unit ............................................................................... |
90 |
Modes of Operation ............................................................................................ |
91 |
Timer/Counter Timing Diagrams......................................................................... |
96 |
8-bit Timer/Counter Register Description ........................................................... |
98 |
16-bit Timer/Counter (Timer/Counter1).......................................... |
104 |
Overview........................................................................................................... |
104 |
Accessing 16-bit Registers ............................................................................... |
106 |
Timer/Counter Clock Sources........................................................................... |
110 |
Counter Unit...................................................................................................... |
110 |
Input Capture Unit............................................................................................. |
111 |
Output Compare Units ...................................................................................... |
112 |
Compare Match Output Unit ............................................................................. |
115 |
Modes of Operation .......................................................................................... |
116 |
Timer/Counter Timing Diagrams....................................................................... |
123 |
16-bit Timer/Counter Register Description ....................................................... |
126 |
2

Table of Contents
Serial Peripheral Interface – SPI..................................................... |
135 |
SS Pin Functionality.......................................................................................... |
140 |
Data Modes ...................................................................................................... |
142 |
USART .............................................................................................. |
144 |
Overview........................................................................................................... |
144 |
Clock Generation .............................................................................................. |
146 |
Frame Formats ................................................................................................. |
148 |
USART Initialization.......................................................................................... |
149 |
Data Transmission – The USART Transmitter ................................................. |
150 |
Data Reception – The USART Receiver .......................................................... |
153 |
Asynchronous Data Reception ......................................................................... |
157 |
Multi-processor Communication Mode ............................................................. |
160 |
USART Register Description ............................................................................ |
162 |
Examples of Baud Rate Setting........................................................................ |
167 |
USART in SPI Mode......................................................................... |
171 |
Overview........................................................................................................... |
171 |
Clock Generation .............................................................................................. |
171 |
SPI Data Modes and Timing............................................................................. |
172 |
Frame Formats ................................................................................................. |
172 |
Data Transfer.................................................................................................... |
174 |
USART MSPIM Register Description ............................................................... |
176 |
AVR USART MSPIM vs. |
|
AVR SPI............................................................................................................ |
178 |
Features............................................................................................................ |
179 |
Block Diagram .................................................................................................. |
179 |
Typical Application Implementation .................................................................. |
180 |
General Operating Modes ................................................................................ |
182 |
Power modes.................................................................................................... |
185 |
Memory access capability................................................................................. |
185 |
Memory management....................................................................................... |
186 |
PAD suspend.................................................................................................... |
187 |
D+/D- Read/write .............................................................................................. |
188 |
Registers description ........................................................................................ |
188 |
USB Software Operating modes....................................................................... |
191 |
Introduction ....................................................................................................... |
192 |
Power-on and reset .......................................................................................... |
192 |
Endpoint reset................................................................................................... |
192 |
USB reset ......................................................................................................... |
193 |
Endpoint selection ............................................................................................ |
193 |
Endpoint activation ........................................................................................... |
193 |
3

Table of Contents
Address Setup .................................................................................................. |
194 |
Suspend, Wake-up and Resume...................................................................... |
194 |
Detach .............................................................................................................. |
194 |
Remote Wake-up.............................................................................................. |
195 |
STALL request.................................................................................................. |
195 |
CONTROL endpoint management ................................................................... |
196 |
OUT endpoint management ............................................................................. |
197 |
IN endpoint management ................................................................................. |
198 |
Isochronous mode ............................................................................................ |
200 |
Overflow............................................................................................................ |
200 |
Interrupts........................................................................................................... |
201 |
Registers........................................................................................................... |
202 |
PS/2................................................................................................... |
213 |
Characteristics .................................................................................................. |
213 |
Analog Comparator ......................................................................... |
215 |
Boot Loader Support – Read-While-Write Self-Programming..... |
217 |
Boot Loader Features ....................................................................................... |
217 |
Application and Boot Loader Flash Sections .................................................... |
217 |
Read-While-Write and No Read-While-Write Flash Sections........................... |
217 |
Boot Loader Lock Bits....................................................................................... |
219 |
Entering the Boot Loader Program ................................................................... |
220 |
Addressing the Flash During Self-Programming .............................................. |
223 |
Self-Programming the Flash ............................................................................. |
224 |
Features............................................................................................................ |
231 |
Overview........................................................................................................... |
231 |
Physical Interface ............................................................................................. |
231 |
Software Break Points ...................................................................................... |
232 |
Limitations of debugWIRE ................................................................................ |
232 |
debugWIRE Related Register in I/O Memory ................................................... |
232 |
Memory Programming..................................................................... |
233 |
Program And Data Memory Lock Bits .............................................................. |
233 |
Fuse Bits........................................................................................................... |
234 |
Signature Bytes ................................................................................................ |
236 |
Calibration Byte ................................................................................................ |
236 |
Parallel Programming Parameters, Pin Mapping, and Commands .................. |
236 |
Parallel Programming ....................................................................................... |
240 |
Serial Downloading........................................................................................... |
248 |
Serial Programming Pin Mapping ..................................................................... |
248 |
4

Absolute Maximum Ratings*............................................................................. |
253 |
DC Characteristics............................................................................................ |
253 |
External Clock Drive Waveforms ...................................................................... |
255 |
External Clock Drive ......................................................................................... |
255 |
Maximum speed vs. VCC ......................................................................................................................... |
256 |
SPI Timing Characteristics ............................................................................... |
257 |
Hardware Boot EntranceTiming Characteristics............................................... |
258 |
AT90USB82/162 Typical Characteristics – Preliminary Data....... |
259 |
Supply Current of IO modules .......................................................................... |
259 |
Register Summary ........................................................................... |
261 |
Ordering Information....................................................................... |
268 |
Packaging Information.................................................................... |
268 |
QFN32 .............................................................................................................. |
269 |
TQFP32 ............................................................................................................ |
270 |
5

Atmel Corporation |
Atmel Operations |
2325 Orchard Parkway
San Jose, CA 95131, USA
Tel: 1(408) 441-0311
Fax: 1(408) 487-2600
Regional Headquarters
Europe
Atmel Sarl
Route des Arsenaux 41 Case Postale 80 CH-1705 Fribourg Switzerland
Tel: (41) 26-426-5555 Fax: (41) 26-426-5500
Asia
Room 1219
Chinachem Golden Plaza
77 Mody Road Tsimshatsui
East Kowloon
Hong Kong
Tel: (852) 2721-9778
Fax: (852) 2722-1369
Japan
9F, Tonetsu Shinkawa Bldg.
1-24-8 Shinkawa
Chuo-ku, Tokyo 104-0033
Japan
Tel: (81) 3-3523-3551
Fax: (81) 3-3523-7581
Memory
2325 Orchard Parkway
San Jose, CA 95131, USA
Tel: 1(408) 441-0311
Fax: 1(408) 436-4314
Microcontrollers
2325 Orchard Parkway
San Jose, CA 95131, USA
Tel: 1(408) 441-0311
Fax: 1(408) 436-4314
La Chantrerie
BP 70602
44306 Nantes Cedex 3, France
Tel: (33) 2-40-18-18-18
Fax: (33) 2-40-18-19-60
ASIC/ASSP/Smart Cards
Zone Industrielle
13106 Rousset Cedex, France
Tel: (33) 4-42-53-60-00
Fax: (33) 4-42-53-60-01
1150 East Cheyenne Mtn. Blvd.
Colorado Springs, CO 80906, USA
Tel: 1(719) 576-3300
Fax: 1(719) 540-1759
Scottish Enterprise Technology Park
Maxwell Building
East Kilbride G75 0QR, Scotland
Tel: (44) 1355-803-000
Fax: (44) 1355-242-743
RF/Automotive
Theresienstrasse 2
Postfach 3535
74025 Heilbronn, Germany
Tel: (49) 71-31-67-0
Fax: (49) 71-31-67-2340
1150 East Cheyenne Mtn. Blvd.
Colorado Springs, CO 80906, USA
Tel: 1(719) 576-3300
Fax: 1(719) 540-1759
Biometrics/Imaging/Hi-Rel MPU/
High Speed Converters/RF Datacom
Avenue de Rochepleine
BP 123
38521 Saint-Egreve Cedex, France
Tel: (33) 4-76-58-30-00
Fax: (33) 4-76-58-34-80
Literature Requests
www.atmel.com/literature
Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise,to anyintellectualproperty right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL’S TERMS AND CONDI-TIONS OF
SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORYWARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULARPURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDEN-TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUTOF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes norepresentationsor warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specificationsand product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel’s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.
© 2007 Atmel Corporation. All rights reserved. Atmel®, logo and combinations thereof, Everywhere You Are® and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others.
Printed on recycled paper.
7707A–AVR–01/07