Features • High Performance, Low Power AVR ® 8-Bit Microcontroller • Advanced RISC Architecture– 125 Powerful Instructions – Most Single Clock Cycle Execution– 32 x 8 General Purpose Working Registers– Fully Static Operation– Up to 16 MIPS Throughput at 16 MHz • Non-volatile Program and Data Memories– 8K / 16K Bytes of In-System Self-Programmable Flash• Endurance: 10,000 Write/Erase Cycles8-bit– Optional Boot Code Section with Independent Lock BitsMicrocontroller• USB boot-loader programmed by default in the factory• In-System Programming by on-chip Boot Program hardware-activated afterwithreset• True Read-While-Write Operation8/16K Bytes of– 512 Bytes EEPROM• Endurance: 100,000 Write/Erase CyclesISP Flash– 512 Bytes Internal SRAM– Programming Lock for Software Securityand USB • USB 2.0 Full-speed Device Module with Interrupt on Transfer Completion– Complies fully with Universal Serial Bus Specification REV 2.0Controller– 48 MHz PLL for Full-speed Bus Operation : data transfer rates at 12 Mbit/s– Fully independant 176 bytes USB DPRAM for endpoint memory allocation– Endpoint 0 for Control Transfers: from 8 up to 64-bytesAT90USB82– 4 Programmable Endpoints:• IN or Out DirectionsAT90USB162• Bulk, Interrupt and IsochronousTransfers• Programmable maximum packet size from 8 to 64 bytes• Programmable single or double buffer– Suspend/Resume Interrupts– Microcontroller reset on USB Bus Reset without detach– USB Bus Disconnection on Microcontroller Request– USB pad multiplexed with PS/2 peripheral for single cable capability • Peripheral Features– PS/2 compliant pad– One 8-bit Timer/Counters with Separate Prescaler and Compare Mode (two 8-bitPWM channels)– One 16-bit Timer/Counter with Separate Prescaler, Compare and Capture Mode(three 8-bit PWM channels)– USART with SPI master only mode and hardware flow control (RTS/CTS)– Master/Slave SPI Serial Interface– Programmable Watchdog Timer with Separate On-chip Oscillator– On-chip Analog Comparator– Interrupt and Wake-up on Pin Change • On Chip Debug Interface (debugWIRE) • Special Microcontroller Features– Power-On Reset and Programmable Brown-out Detection– Internal Calibrated Oscillator– External and Internal Interrupt Sources 7707F–AVR–11/10 Document Outline Features 1. Pin Configurations 2. Overview 2.1 Block Diagram 2.2 Pin Descriptions 3. About Code Examples 4. AVR CPU Core 4.1 Introduction 4.2 Architectural Overview 4.3 ALU – Arithmetic Logic Unit 4.4 Status Register 4.5 General Purpose Register File 4.6 Stack Pointer 4.7 Instruction Execution Timing 4.8 Reset and Interrupt Handling 5. AVR AT90USB82/162 Memories 5.1 In-System Reprogrammable Flash Program Memory 5.2 SRAM Data Memory 5.3 EEPROM Data Memory 5.4 I/O Memory 6. System Clock and Clock Options 6.1 Clock Systems and their Distribution 6.2 Clock Switch 6.3 Clock Sources 6.4 Low Power Crystal Oscillator 6.5 Calibrated Internal RC Oscillator 6.6 External Clock 6.7 Clock Output Buffer 6.8 System Clock Prescaler 6.9 PLL 7. Power Distribution 8. Power Management and Sleep Modes 8.1 Idle Mode 8.2 Power-down Mode 8.3 Power-save Mode 8.4 Standby Mode 8.5 Extended Standby Mode 8.6 Power Reduction Register 8.7 Minimizing Power Consumption 9. System Control and Reset 9.1 Resetting the AVR 9.2 Reset Sources 9.3 Power-on Reset 9.4 External Reset 9.5 Brown-out Detection 9.6 Watchdog Reset 9.7 USB Reset 9.8 Internal Voltage Reference 9.9 Watchdog Timer 10. Interrupts 10.1 Interrupt Vectors in AT90USB82/162 11. I/O-Ports 11.1 Introduction 11.2 Ports as General Digital I/O 11.3 Alternate Port Functions 11.4 Register Description for I/O-Ports 12. External Interrupts 13. Timer/Counter0 and Timer/Counter1 Prescalers 14. 8-bit Timer/Counter0 with PWM 14.1 Overview 14.2 Timer/Counter Clock Sources 14.3 Counter Unit 14.4 Output Compare Unit 14.5 Compare Match Output Unit 14.6 Modes of Operation 14.7 Timer/Counter Timing Diagrams 14.8 8-bit Timer/Counter Register Description 15. 16-bit Timer/Counter 1 with PWM 15.1 Overview 15.2 Accessing 16-bit Registers 15.3 Timer/Counter Clock Sources 15.4 Counter Unit 15.5 Input Capture Unit 15.6 Output Compare Units 15.7 Compare Match Output Unit 15.8 Modes of Operation 15.9 Timer/Counter Timing Diagrams 15.10 16-bit Timer/Counter Register Description 16. Serial Peripheral Interface – SPI 16.1 SS Pin Functionality 16.2 Data Modes 17. USART 17.1 Overview 17.2 Clock Generation 17.3 Frame Formats 17.4 USART Initialization 17.5 Data Transmission – The USART Transmitter 17.6 Data Reception – The USART Receiver 17.7 Asynchronous Data Reception 17.8 Multi-processor Communication Mode 17.9 Hardware Flow Control 17.10 USART Register Description 17.11 Examples of Baud Rate Setting 18. USART in SPI Mode 18.1 Overview 18.2 Clock Generation 18.3 SPI Data Modes and Timing 18.4 Frame Formats 18.5 Data Transfer 18.6 USART MSPIM Register Description 18.7 AVR USART MSPIM vs. AVR SPI 19. USB controller 19.1 Features 19.2 Block Diagram 19.3 Typical Application Implementation 19.4 General Operating Modes 19.5 Power modes 19.6 Memory management 19.7 PAD suspend 19.8 D+/D- Read/write 19.9 Registers description 19.10 USB Software Operating modes 20. USB Device Operating modes 20.1 Introduction 20.2 Power-on and reset 20.3 Endpoint reset 20.4 USB reset 20.5 Endpoint selection 20.6 Endpoint activation 20.7 Address Setup 20.8 Suspend, Wake-up and Resume 20.9 Detach 20.10 Remote Wake-up 20.11 STALL request 20.12 CONTROL endpoint management 20.13 OUT endpoint management 20.14 IN endpoint management 20.15 Isochronous mode 20.16 Overflow 20.17 Interrupts 20.18 Registers 21. PS/2 21.1 Characteristics 22. Analog Comparator 23. Boot Loader Support – Read-While-Write Self-Programming 23.1 Boot Loader Features 23.2 Application and Boot Loader Flash Sections 23.3 Read-While-Write and No Read-While-Write Flash Sections 23.4 Boot Loader Lock Bits 23.5 Entering the Boot Loader Program 23.6 Addressing the Flash During Self-Programming 23.7 Self-Programming the Flash 24. debugWIRE On-chip Debug System 24.1 Features 24.2 Overview 24.3 Physical Interface 24.4 Software Break Points 24.5 Limitations of debugWIRE 24.6 debugWIRE Related Register in I/O Memory 25. Memory Programming 25.1 Program And Data Memory Lock Bits 25.2 Fuse Bits 25.3 Signature Bytes 25.4 Calibration Byte 25.5 Parallel Programming Parameters, Pin Mapping, and Commands 25.6 Parallel Programming 25.7 Serial Downloading 25.8 Serial Programming Pin Mapping 26. Electrical Characteristics 26.1 Absolute Maximum Ratings* 26.2 DC Characteristics 26.3 External Clock Drive Waveforms 26.4 External Clock Drive 26.5 Maximum speed vs. VCC 26.6 SPI Timing Characteristics 26.7 Hardware Boot EntranceTiming Characteristics 27. AT90USB82/162 Typical Characteristics – Preliminary Data 27.1 Input Voltage Levels 27.2 Output Voltage Levels 27.3 I/O Pull-up Current 27.4 Power-down Supply Current 27.5 Idle Supply Current 27.6 Active Supply Current 27.7 Reset Supply Current 27.8 Bandgap Voltage 27.9 USB Regulator 27.10 Power-On Reset 27.11 BOD Levels 27.12 Watchdog Timer Frequency 27.13 Internal RC Oscillator Frequency 28. Register Summary 29. Instruction Set Summary 30. Ordering Information 31. Packaging Information 31.1 QFN32 31.2 TQFP32 32. Errata 32.1 AT90USB162 Errata History 32.2 AT90USB82 Errata History 33. Datasheet Revision History for AT90USB82/162 33.1 Rev. 7707F – 11/10 33.2 Rev. 7707E – 11/08 33.3 Rev. 7707D 33.4 Rev. 7707C 33.5 Rev. 7707B 33.6 Rev. 7707A Table of Contents